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

Fix {r,w}_level in AsyncFIFOBuffered #512

Merged
merged 1 commit into from Nov 3, 2020

Conversation

anuejn
Copy link
Contributor

@anuejn anuejn commented Oct 22, 2020

@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #512 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
nmigen/lib/fifo.py 94.08% <100.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7014f8...5d85ad4. Read the comment docs.

nmigen/lib/fifo.py Outdated Show resolved Hide resolved
@anuejn
Copy link
Contributor Author

anuejn commented Oct 24, 2020

This should be rebased onto master now (which includes the other PR)

Copy link
Member

@whitequark whitequark left a 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 Show resolved Hide resolved
]

m.d[self._r_domain] += self.r_level.eq(fifo.r_level + self.r_rdy - self.r_en)
buffer_used = Signal()
Copy link
Member

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.

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)
Copy link
Member

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.

@anuejn anuejn force-pushed the fifo_bugfix branch 2 times, most recently from 54051b8 to 8332cc5 Compare November 3, 2020 09:25
@whitequark whitequark merged commit b15f056 into amaranth-lang:master Nov 3, 2020
@whitequark
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

{r,w}_level is broken on AsyncFIFO{Buffered,}
2 participants