-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support genvar inside generate blocks #15
Comments
Similarly, regular for-loops have the same issues. Example: always_comb
for (int i = 0; i < 32; i++) Generated Verilog (note the always @(*)
for (int i = 0; (i < 32); i = (i + 1)) Instead, it should be: integer i;
always @(*)
for (i = 0; (i < 32); i = (i + 1)) |
Thanks for the report! I wasn't aware of the restrictions on Verilog for loops. This should now be resolved. |
Thank you for the prompt implementation! |
This implementation works fine, but there is a problem when there are multiple generate blocks in a file using the same Could the sv2v tool uniquify all genvars, e.g. by using the name of the generate block, as shown in the above example where |
One more corner case: Original SystemVerilog snippet:
Output of
sv2v
:However, Yosys has problems with the genvar inside the generate block, saying
ERROR: syntax error, unexpected TOK_GENVAR, expecting TOK_ID or '{'
. Yosys works fine if I manually change the generated Verilog as follows:An even safer way is shown below, which uses a unique genvar name to avoid possible name collisions with other generate blocks that use the same genvar name:
The text was updated successfully, but these errors were encountered: