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

lib.fifo: add custom domain to sync FIFOs #607

Closed
wants to merge 1 commit into from

Conversation

slan
Copy link

@slan slan commented Apr 9, 2021

Allow SyncFIFO and SyncFIFOBuffered to use a user-specified clock domain

@codecov
Copy link

codecov bot commented Apr 9, 2021

Codecov Report

Merging #607 (62b4d67) into master (c84d4af) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #607   +/-   ##
=======================================
  Coverage   81.50%   81.51%           
=======================================
  Files          49       49           
  Lines        6461     6463    +2     
  Branches     1287     1287           
=======================================
+ Hits         5266     5268    +2     
- Misses       1007     1008    +1     
+ Partials      188      187    -1     
Impacted Files Coverage Δ
nmigen/lib/fifo.py 94.14% <100.00%> (+0.05%) ⬆️
nmigen/build/run.py 22.05% <0.00%> (ø)

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 c84d4af...62b4d67. Read the comment docs.

@anuejn
Copy link
Contributor

anuejn commented Apr 9, 2021

Why would one want that? Couldn't you use DomainsRenamer ?

@slan
Copy link
Author

slan commented Apr 9, 2021

I wasn't aware of this option... it felt natural and consistent with e.g. AsyncFIFO to set the clock domain explicitly. As a beginner, I developed the habit of having an explicit domain for most of my modules. I found it easier to reason about, but that might be a bad habit for larger-scale projects or libraries (I guess domain name collision).

I'll start to use DomainRenamer, feel free to close this PR.

@anuejn
Copy link
Contributor

anuejn commented Apr 9, 2021

Generally the nMigen convention is that modules that work only in one clock domain use the sync domain and are then used in combination with DomainRenamer. The AsyncFIFO spans multiple clock domains and is therefore different.

@whitequark
Copy link
Member

What @anuejn said is accurate.

@whitequark whitequark closed this Apr 10, 2021
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.

None yet

3 participants