-
Notifications
You must be signed in to change notification settings - Fork 92
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
Multi-Dimensional array template magic [][] substitution fails when original port name matches parent port name, and verilog-auto-inst-vector is off #1848
Comments
I think the logic you indicate is there to omit suffixes from the 1D packed arrays. Perhaps try making it behave as if Can you make this into a pull request, after adding an appropriate test file to test/ (with autos not expanded) and test_ok/ (having what you want as output)? |
I don't have a fix for the issue, so nothing to create a pull-request of, however the full test files are above so the issue can be recreated by someone more familiar with the code. Yes, the logic there is intended to omit suffixes from 1D packed arrays, however the vl-bits value is also used later when outputting the hint for multi-dimensional nets, so if it's not set it produces the incorrect behavior. Possible solution could be just using (verilog-sig-bits port-st) in the hint comment without qualification, though it looks like there is a lot of other substitution logic below that updates vl-bits that I don't understand, and am not sure if it's needed for some other supported syntax. |
I added a pull request here: #1850 |
I've noticed the following unexpected behavior when
verilog-auto-inst-vector
is nil. When using a template to connect to a renamed net for a multi-dimensional port (packed), if the module port name is the same as one of the ports on the parent, and has the same dimensions, then the generated comment excludes the last dimension, and as a result anyAUTOWIRE
,AUTOINPUT
,AUTOOUTPUT
generated items will have the wrong dimension.Example to reproduce:
When
verilog-auto-inst-vector
is nil, this generates the incorrect following result:Notice how each connection hint comment only includes one of the dimensions, and as a result, the autowire for the net between the two child blocks is missing a dimension.
The current workaround is to set
verilog-auto-inst-vector
to'unsigned
ort
, which produces the correct result:In this case, the comments include both dimensions, and the
AUTOWIRE
statement produces the correct dimensions for the interconnecting net.I tracked down the bug a little bit further and it is related to the current logic of
verilog-auto-inst-port
.vl-bits
is set up near the top, however, ifverilog-auto-inst-vector
is nil, and the port name matched one of the ports in the current module (moddecls
), and the last dimension matches (as best as I can tell, based on the return value ofverilog-sig-bits
), thenvl-bits
ends up as an empty string, and thus any of the later logic that usesvl-bits
, including the hint comment, are missing that dimension range string.The text was updated successfully, but these errors were encountered: