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
Black Boxes for toEnum
/ fromEnum
#2066
Conversation
When running GHC with -Werror, that option is now propagated to the ClashOpts. This means that warnings on primitive instantiation will be promoted to errors. This is necessary to test #2046.
0a9a4da
to
12217de
Compare
12217de
to
3667ed9
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.
LGTM, but I'd to see some HDL simulation tests using the blackboxes.
@@ -0,0 +1 @@ | |||
CHANGED: Clash now respects the -Werror option from GHC |
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.
🎉
06d032a
to
f0ef6cc
Compare
@martijnbastiaan I added a |
f0ef6cc
to
db50776
Compare
, (BitVector 1, BitVector 2) | ||
) |
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.
Can you test Bit
too, one of the functions changed for that
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.
It broke CI, good luck.
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.
iverilog (make testBench): FAIL (0.04s)
Program /usr/bin/iverilog failed with error-code 2.
Full invocation:
/usr/bin/iverilog -I T2046BType.o -I T2046B.dyn_hi -I T2046B.hi -I T2046B.testBench -I T2046BType.dyn_o -I T2046BType.dyn_hi -I T2046B.topEntity -I T2046B.dyn_o -I T2046BType.hi -I T2046B.o -g2 -s testBench -o testBench.exe /tmp/clash-test-b57a279493374e3d/T2046B.testBench/testBench.v /tmp/clash-test-b57a279493374e3d/T2046B.topEntity/topEntity.v
Stderr was:
/tmp/clash-test-b57a279493374e3d/T2046B.topEntity/topEntity.v:98: syntax error
/tmp/clash-test-b57a279493374e3d/T2046B.topEntity/topEntity.v:98: error: syntax error in continuous assignment
Stdout was:
db50776
to
22df733
Compare
22df733
to
f65e779
Compare
To prevent Clash from warning about integer primitives in HDL that originate from uses of fromEnum / toEnum in user code, the functions are now primitives for the sized types in Clash.
f65e779
to
0613f21
Compare
This PR introduces black boxes for
toEnum
/fromEnum
on the numeric types inClash.Sized.Internal
, suppressing the seemingly spurious integer black box warnings previously seen in #1918. As an added bonus, a commit is included which propagates the-Werror
flag from GHC to Clash, allowing primitive warnings to be thrown asClashException
when desired.Fixes #2046
Still TODO:
toEnum
, the current test usesfromEnum
only