Skip to content

Commit b6241f0

Browse files
author
Sebastien Bourdeauducq
committedNov 28, 2011
standby: work around intermittent reconfiguration problem
1 parent be2f599 commit b6241f0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

‎boards/milkymist-one/standby/standby.v

+14-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ always @(posedge clk, negedge locked)
193193
rescue <= next_rescue;
194194
`endif
195195

196+
`ifdef AUTO_ON
197+
/* HACK: for some reason, reconfiguring right away fails intermittently.
198+
* Work around this with a timer.
199+
*/
200+
reg [19:0] timer;
201+
always @(posedge clk, negedge locked)
202+
if(~locked)
203+
timer <= 20'd0;
204+
else
205+
timer <= timer + 20'd1;
206+
`endif
207+
196208
always @(*) begin
197209
d = 16'hxxxx;
198210
icap_en_n = 1'b1;
@@ -206,7 +218,8 @@ always @(*) begin
206218
case(state)
207219
IDLE: begin
208220
`ifdef AUTO_ON
209-
next_state = DUMMY;
221+
if(timer[19])
222+
next_state = DUMMY;
210223
`else
211224
next_rescue = btn1_r;
212225
if(btn2_r & ~btn2_r2)

0 commit comments

Comments
 (0)
Please sign in to comment.