-
Notifications
You must be signed in to change notification settings - Fork 177
Don't use declaration-assigns for wires representing mem ports #2189
Conversation
Here is a minimal example of a circuit that would cause this Verilog declaration-use issue before this PR. This PR fixes it. I will add this as some kind of test as part of this PR.
|
I wonder if we could add some more strict |
I cannot get Verilator to complain about this problem. Not with |
Default nettype only comes into play when an undeclared identifier appears on the lhs of an assign. |
The change that caused the use-before-declaration was basically just a silly attempt at improving style that I tacked on to the actual substantive changes to the emitter in #2111. Most consumers of Verilog don't require declaration-before-rhs-reference for non-default nets since they try to be "declarative," but it's definitely better to emit universally acceptable code from a compiler. @ekiwi @jackkoenig, since there is basically no way to write a test for this that will run in CI, can we just merge this? |
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.
since there is basically no way to write a test for this that will run in CI, can we just merge this?
🚢
Just FYI, the tool that was complaining about this is VCS. |
This should have been backported right? Needed for #2172? |
Type of improvement: bug-fix
API impact: none
Backend code-generation impact: Avoids using declaration-assignments for "intermediate" wires created to represent the various fields of memory ports. Since these wires are create when the memory is declared, they may appear before the definition of whatever happens to drive them.
Desired merge strategy: squash
Contributor Checklist
Reviewer Checklist (only modified by reviewer)
Please Merge
?