-
Notifications
You must be signed in to change notification settings - Fork 893
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
write_verilog: don't emit code with dangling else related to wrong condition #4150
Conversation
I can't reproduce the test failure locally for some reason. That's odd. |
Oh no |
In any case I feel like we need some tests here. |
@whitequark OK with you if I push to your branch? I would rebase (to fix CI), and maybe add some test. |
Go ahead please. |
Rebased |
@@ -1996,36 +1982,52 @@ bool dump_proc_switch_ifelse(std::ostream &f, std::string indent, RTLIL::SwitchR | |||
} | |||
} | |||
|
|||
dump_attributes(f, indent, sw->attributes); |
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.
So this is something we were missing before, unrelated to the fix
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.
We were dumping slightly different attributes (for case rules and not switch itself), the switch is probably better.
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.
Looks fine
Thanks @povik! |
It is embarrassing to have written it, but also, three independent reviewers missed it too :D
See amaranth-lang/amaranth#1049.
Issue introduced in #4090