-
Notifications
You must be signed in to change notification settings - Fork 177
Add support for iCE40 internal oscillators. #338
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
Conversation
…node IRC, who basically wrote this for me.
Codecov Report
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 82.54% 82.72% +0.18%
==========================================
Files 35 35
Lines 5924 5911 -13
Branches 1199 1199
==========================================
Hits 4890 4890
+ Misses 875 862 -13
Partials 159 159
Continue to review full report at Codecov.
|
if self.default_rst is not None: | ||
rst_i = self.request(self.default_rst).i | ||
else: | ||
rst_i = Const(0) | ||
|
||
m = Module() | ||
|
||
# Power-on-reset domain | ||
m.domains += ClockDomain("por", reset_less=True, local=True) | ||
delay = int(15e-6 * self.default_clk_frequency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both SB_HFOSC and SB_LFOSC output is unstable for 100 µs after enabling them. So if one of these oscillators are selected, this power-on reset delay should be increased to 100 µs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, you learn something new every day. Should it have a 5x margin like the BRAM delay and be 500us, or is 100us okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, 100 us is OK. The reason BRAM delay has a 5x margin is that the 3 us figure is experimental (i.e. typical case) rather than provided by the vendor (i.e. worst case). Since we have no idea where that delay comes from it seems wise to play it safe, but that's not needed here.
…e default clock source.
Okay, I think that should add a longer delay if an internal oscillator is selected. |
Thanks for the PR! I've merged it with minor changes. |
Thanks to #nmigen on Freenode IRC; they basically wrote this for me.