-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add Xilinx dual clock FIFO primitive #2182
Conversation
81126e5
to
f37a98d
Compare
5598a1a
to
9074def
Compare
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.
Here's some inspiration for a dual clock test bench:
https://github.com/clash-lang/clash-compiler/blob/master/tests/shouldwork/Signal/DualBlockRam0.hs
Given that we don't have a cycle accurate Haskell model, you'd probably want to build a circuit similar to the one you've got in the unittests, and test your assumptions in HDL.
f9deb1d
to
e04eb51
Compare
Looking at the revision history in the product guide, 13.2 has been the version since 2017-10-04. I doubt you can reasonably deal with changes to the FIFO core; that seems to quickly lead to separate Clash functions or modules for separate Vivado versions. How would you deal with a new configuration option, new signals in Clash? One Vivado version can generally generate only a single version of bundled IP; it seems simplest to just pin a version of In general, I suggest tracking the latest version of Vivado available for all platforms. If people really need an old version of Vivado, it might be more of a hassle for them. Vivado can upgrade an older version of IP to a (reasonably-identically configured?) new version, though. So if Vivado switches to 13.3, people can still synthesise by introducing another step in their workflow: using Vivado to upgrade the IP. It seems they just need to add this to their Tcl:
https://www.xilinx.com/products/intellectual-property/vivado-ip-versioning.html |
95c10ba
to
7821d91
Compare
Cool @DigitalBrains1, I've seen that before, it should just work. Another option would be to add the version to the data Version
= v13_3
| v13_4
| CustomVersion String |
67fbf7e
to
6d50a4a
Compare
These signals are generated as
Edit: done |
4370a42
to
1b0efcc
Compare
0db6633
to
1606c63
Compare
@vmchale Could you split this up into three PRs:
I've already started with (2) as I wanted to get Vivado running on CI: That branch has CI setup with Vivado running on it. It's probably best to comment out some GHC versions in so it probably takes some debugging.. |
The PR for component declarations in blocks is here: #2255 I can rebase on that once it is merged. |
b1ae233
to
b99667e
Compare
8afc560
to
5304f29
Compare
This is based on #2257 but CI is passing now. |
I think this is also going to need to be squashed :( |
Co-authored-by: Peter Lebbing <[email protected]>
Co-authored-by: Martijn Bastiaan <[email protected]>
Martijn suggested above that you create a new PR for this. Anyway, I think this can be a single commit indeed, but we'll see in review. |
Oh you're right @DigitalBrains1! I'll close this; wait til the Vivado support is merged so it can be sensibly reviewed. |
This PR adds a Xilinx dual clock FIFO implementation to
clash-cores
.Comments for implementers:
How to test
The easiest way to create a quick test bench (IMO) is to instantiate a new Clash project with
stack new fifotest clash-lang/simple
, addto
cabal.project
and runcabal run clash -- Test.hs --vhdl -fclash-clear -fclash-no-cache && cat vhdl/Test.topEntity/dcfifo*
whereTest.hs
is something like:Questions for reviewers:
dc
though. Remove?fifo_generator
here (13.2
) - pretty much linked to Vivado 2021.2. How can we deal with versioning?Resources:
Still TODO:
Writenot relevant anymorecheckDcConfig :: DcConfig -> Maybe Error
that returns a (human-readable) error message for misconfigurations.boolFromBit
analogous toboolToBit
, right now it can only be used in VHDL) (@vmchale)Made primitive a multi result primitive for prettier HDL (@vmchale / @martijnbastiaan)Attempting this triggers a bug, I'll post an issue.Makenot for this PRClash.Cores.Xilinx.Floating
use functions inClash.Cores.Xilinx.Common
?Write a changelog entry (see changelog/README.md)clash-cores
isn't released on Hackage