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
The order of "case" in verilog #91
Comments
When GHC goes from Haskell to its internal Core language, it puts the default pattern, Also note that, in Haskell, all patterns are unique, so the order in which they are put (with the exception of the default pattern) doesn't matter. |
Ah, I didn't realize the problem yesterday as I had a long day of travel behind me. I'm on holiday right now, and will be back on the 11th of November. I won't be able to fix it until then. Perhaps you want to try and supply a patch? Here are some instructions on how to: https://github.com/clash-lang/clash-compiler/wiki/Getting-started The code that needs patching is probably: https://github.com/clash-lang/clash-compiler/blob/master/clash-lib/src/CLaSH/Netlist.hs#L216 |
I am trying to display numbers on segment LED, so I write such a encoder:
but when I tried to encode
Unsigned 3
numbers, for number 0, the displayed number is 8. I thought it was because8==(0::Unsigned 3)
, so I looked at the compiled verilog code:Why is the order in "case" from 9 to 0, instead of from 0 to 9, which matches the semantic of haskell more?
The text was updated successfully, but these errors were encountered: