-
Notifications
You must be signed in to change notification settings - Fork 154
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
Netlist generation fails on Unsigned 1
#2289
Comments
EDIT: Removed uniques and qualifiers, since they just add clutter. It goes wrong here:
|
Ugh... DEC, the bane of my existence... as a clash developer. Anyhow, it seems to mess up selection of the evidence for the coercion. The short term "fix" would be to disable DEC for GADTs. The better fix is thinking of how to deal with GADTs inside DEC. |
How can I detect whether it's GADT? I rather not disable the entire DEC, since I then also have to use a custom Clash version. I'd be willing to implement this check and make a PR. |
Whether we have `Refl : True ~ True` or `SomeAxiom : (1 <=? 2) ~ True` it doesn't matter, since when we normalize both sides we always end up with a proof of `True ~ True`. Since DEC only fires for applications where all the type arguments are equal, we can deduce that all equality arguments witness the same equality, hence we don't have to care about the shape of the proof. Fixes #2289
Whether we have `Refl : True ~ True` or `SomeAxiom : (1 <=? 2) ~ True` it doesn't matter, since when we normalize both sides we always end up with a proof of `True ~ True`. Since DEC only fires for applications where all the type arguments are equal, we can deduce that all equality arguments witness the same equality, hence we don't have to care about the shape of the proof. Fixes #2289 (cherry picked from commit d585d3c)
Whether we have `Refl : True ~ True` or `SomeAxiom : (1 <=? 2) ~ True` it doesn't matter, since when we normalize both sides we always end up with a proof of `True ~ True`. Since DEC only fires for applications where all the type arguments are equal, we can deduce that all equality arguments witness the same equality, hence we don't have to care about the shape of the proof. Fixes #2289 (cherry picked from commit d585d3c) Co-authored-by: Christiaan Baaij <christiaan.baaij@gmail.com>
We've released v1.6.4, which includes a fix for this issue. |
After some refactoring I hit a bug where Clash failed during Normalization. When trying reducing to reduce it to a smaller case I no-longer hit a Normalization but hit a netlist generation issue. So I probably will create another issue once this one is fixed.
Anyway I can reproduce the issue with GHC 8.10.7 and with GHC 9.0.2 with both Clash 1.6.3 and the current master.
When I run synthesis I get this error:
And the complete compilation output with DebugApplied enabled available here(GHC 9.0.2 + Clash master): https://gist.github.com/rowanG077/3c330bd65a2c7f66907189eef96443c4
I have created a reproducer which contains 3 modules so to make it easy to debug it I have created a repo for it: https://github.com/rowanG077/clash-netlist-gen-bug
It's based on clash-starter so to run it just clone it and run
cabal run clash -- Example.TopEntity --verilog
It assumes clash sources are available one directory up.The text was updated successfully, but these errors were encountered: