Conversation
martijnbastiaan
requested changes
Apr 14, 2026
Contributor
martijnbastiaan
left a comment
There was a problem hiding this comment.
Overall this LGTM, the GHC bug is too bad.
I do have three comments:
- Instead of making it a big God class, could you make it into singular classes? This would help us if vendor can't supply all the primitives.
- I get the appeal of adopting Xilinx's naming scheme, but at the same time I think that scheme doesn't really fit Clash. What do you think of:
Single:BitArraySingle:IndependentBits
- Could you please remove the
cdcprefix from the names and design forqualifieduse? I.e., call sites would look likeCdc.gray.
I'm fairly certain (1) is the way to go, less so of (2), and unswayable on (3) :-)
Collaborator
Author
|
Made changes (1) and (3), plus introduced a couple other convenience typeclasses so that it's easier to get the right constraints into scope so that you can call the CDC primitives' functions. I'm a little less enthusiastic about change (2), but I do see the reasoning for it so I did make that change. |
martijnbastiaan
requested changes
Apr 17, 2026
Contributor
martijnbastiaan
left a comment
There was a problem hiding this comment.
Almost there.. :)
| import Data.Maybe (fromMaybe, isJust, isNothing) | ||
| import GHC.Stack (HasCallStack) | ||
|
|
||
| class IndependentBits (vendor :: Symbol) where |
Contributor
3 tasks
fc7af3f to
3afd9b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What (what did you do)
This should implement (most of?) the desired changes as per #1222.
Why (context, issues, etc.)
See issue for context.
Dear reviewer (anything you'd like the reviewer to pay close attention to?)
I think there's a GHC bug to be found in here. If in
Clash.Cores.XilinxI writeand then replace all
withVendorI @XilinxwithwithXilinxIcalls, I suddenly get a bunch of compilation errors. If it's somehow possible to get this to work though, I'd appreciate a review comment (:AI disclaimer (heads-up for more than inline autocomplete)
None.
TODO
Cross-outany that do not applyWrite (regression) testdocs/