-
Notifications
You must be signed in to change notification settings - Fork 597
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
"Default Block" / more than one match per line for switch statement #526
Comments
What is the benefit of switch over when/elsewhen/otherwise ? I feel like switch is never used... |
On 2, you can actually already (most of) this. The is function takes a varargs. It will run both blocks if you repeat a value in two blocks (although unclear whether this is guaranteed behavior or just a side effect of the implementation). @mwachs5 switch is currently immediately (at frontend) transcribed into "when, when, when" so the only benefit is in potential Chisel readability. |
I think there's more to this that we should consider that is an API modification. Because switch emits when, when, when, instead of when, elsewhen, otherwise it leaves coverage holes in the Verilog. This makes it a terrible thing to use for state machines which is what it's really intended for. We probably should change it (but should also check what Verilog case statements do). This would be an API backwards incompatible change though. |
Resolution: do both by 3.1 |
+1 |
#1198 is related. Conclusion: is a Challenge Issue. |
Just a ping that this would be useful 👍 I notice it didn't make it into the latest Chisel release as per: Thanks! |
Two separate feature requests
e.g.
e.g. (the first two cases are more useful, the subsequent examples have potential usages, but I haven't encountered it yet)
The text was updated successfully, but these errors were encountered: