-
Notifications
You must be signed in to change notification settings - Fork 894
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
Prepend Verilog globals to module AST #4656
base: main
Are you sure you want to change the base?
Conversation
Fixes YosysHQ#4653. Further AST and RTLIL stages seem to be order-sensitive, and appending globals to the module children list did not work.
b70dbf0
to
5c62838
Compare
This seems to have caused (or uncovered an issue with
I will try to shed more light into this issue. |
It seems like there's a mismatch in the resulting dimensions after simplification between declaring a 2D packed array of wires directly vs. using a Example Verilog code used to test this behavior: typedef logic [3:0][1:0] Matrix;
module Top;
`ifdef INLINE
logic [3:0][1:0] matrix;
`else
Matrix matrix;
`endif
assign matrix = "a";
endmodule Simplified AST when
Simplified AST when
Notice how the My guess is that the code below line 1944 of Honestly, I think I'm going to need some help here, so if somebody knows the internals better than me (so, knows them at all) I would appreciate some guidance. |
What are the reasons/motivation for this change?
Fixes #4653. Further AST and RTLIL stages seem to be order-sensitive, and appending globals to the module children list did not work.
Explain how this is achieved.
Early during
AST::process()
, Verilog globals are prepended to the children list instead.If applicable, please suggest to reviewers how they can test the change.
#4653 contains a test case that triggers an assertion, but works fine after applying this change.