Skip to content

Commit

Permalink
bscan_common.v: Fix bscan 59a6 bug. Thanks to joosteto <joosteto@gmai…
Browse files Browse the repository at this point in the history
…l.com>!

git-svn-id: http://svn.code.sf.net/p/xc3sprog/code/trunk@746 5e3be8be-922f-45f9-ad52-57b51d30232e
  • Loading branch information
u_bonnes committed Jun 25, 2013
1 parent c5eebd9 commit f898090
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bscan_spi/bscan_common.v
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
end // if (!have_header)
end // else: !if(CAPTRE || RESET || UPDATE || !SEL1)

reg reset_header = 0;
always @(posedge DRCK1 or posedge rst)
if (rst)
begin
Expand All @@ -42,14 +43,22 @@
RAM_WADDR <= 0;
RAM_RADDR <=0;
RAM_WE <= 0;
reset_header <= 1;
end
else
begin
RAM_RADDR <= RAM_RADDR + 1;
RAM_WE <= !CSB;
if(RAM_WE)
RAM_WADDR <= RAM_WADDR + 1;
header <= {header[46:0], TDI};

reset_header <=0;
//For the next if, the value of reset_header is probed at rising
//clock, before "reset_header<=0" is executed:
if(reset_header)
header <={47'h000000000000, TDI};
else
header <= {header[46:0], TDI};
CS_GO <= CS_GO_PREP;
if (CS_GO && (len == 0))
CS_STOP_PREP <= 1;
Expand Down

0 comments on commit f898090

Please sign in to comment.