-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fix {r,w}_level in AsyncFIFOBuffered #512
Conversation
Codecov Report
@@ Coverage Diff @@
## master #512 +/- ##
==========================================
+ Coverage 81.32% 81.33% +0.01%
==========================================
Files 49 49
Lines 6414 6419 +5
Branches 1282 1282
==========================================
+ Hits 5216 5221 +5
Misses 1009 1009
Partials 189 189
Continue to review full report at Codecov.
|
This should be rebased onto master now (which includes the other PR) |
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.
Looks good overall, just a few minor issues.
nmigen/lib/fifo.py
Outdated
] | ||
|
||
m.d[self._r_domain] += self.r_level.eq(fifo.r_level + self.r_rdy - self.r_en) | ||
buffer_used = Signal() |
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.
I think this code would be easier to understand if the signals subject to CDC used the same naming conventions as the ones in AsyncFIFO
; something like r_consume_buffered
and w_consume_buffered
.
nmigen/lib/fifo.py
Outdated
m.d[self._r_domain] += self.r_level.eq(fifo.r_level + buffer_used) | ||
|
||
buffer_used_in_wr_domain = Signal() | ||
m.submodules.rst_cdc = AsyncFFSynchronizer(buffer_used, buffer_used_in_wr_domain, o_domain=self._w_domain) |
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.
The rst_cdc
name is a copy/paste leftover. I'd use consume_buffered_cdc
.
54051b8
to
8332cc5
Compare
Thanks! |
This Fixes #485 as per discussion in https://freenode.irclog.whitequark.org/glasgow/2020-10-22#1603367304-1603369561