Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7 seconds delay after reset on the icestick. #221

Closed
at91rm9200 opened this issue Jun 11, 2022 · 2 comments
Closed

0.7 seconds delay after reset on the icestick. #221

at91rm9200 opened this issue Jun 11, 2022 · 2 comments

Comments

@at91rm9200
Copy link

Hello Sylvain,

I have tested the draft branch and find that it now takes about 0.7 seconds for a design to start up on the icestick. With the stable branch, it is in the microsecond range. Perhaps it has something to do with the changes in frameworks/boards/icestick.v?

algorithm main(output uint5 leds, inout uint8 pmod)
{
  uint26 cnt = 0;

  pmod.oenable := 8b11111111;
  
  while (1) {
    leds = cnt[21,5];   // first led output takes 0,7 seconds after reset.
    pmod.o = cnt[21,5];
    cnt  = cnt + 1;
  }
}

Regards, Bernd.

@sylefeb
Copy link
Owner

sylefeb commented Jun 11, 2022

Hello Bernd,

Indeed, this is due to this part of the framework (the RST counter):

reg ready = 0;
reg [23:0] RST_d;
reg [23:0] RST_q;
always @* begin
RST_d = RST_q[23] ? RST_q : RST_q + 1;
end
always @(posedge CLK) begin
if (ready) begin
RST_q <= RST_d;
end else begin
ready <= 1;
RST_q <= 0;
end
end
wire run_main;
assign run_main = 1'b1;
M_main __main(
.clock(CLK),
.reset(~RST_q[23]),

One issue on the ice40 is that BRAMs take time to initialize and as I encountered some problems I increased the delay very significantly, likely way too much! I'll refine this to make it as short as possible.

(If you need a quick workaround you can simply replace icestick.v by the one from the master branch, but I'll to look into this soon).

@at91rm9200
Copy link
Author

Hello Sylvain,

thank you for the explanation. I replaced icestick.v and everything is fine now.

Regards, Bernd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants