For-loop in always block and generate-for-loop with same index causing issues
Summary
When having two separate for loops, one in an always-block, and one in a generate, using the same name for the index variable, the generate loop replicates the indexes with A, B, C suffix.
Steps to reproduce
In commit e124a2cc see file forloop_generate03.sv
.
cd test/systemverilog
../../bin/tmrg forloop_generate03.sv
iverilog -g2012 forloop_generate03TMR.sv
What is the current bug behavior
The assignment in the generate-for-loop uses <genvar index>A
, <genvar index>B
, <genvar index>C
.
What is the correct behavior
The assignment in the generate-for-loop uses <genvar index>
.
Additional information
- verible passes for this block (due to https://github.com/chipsalliance/verible/issues/1161)
- iverilog recognizes the incorrect syntax, but the CI passes either iverilog or verible pass.
- Using a different index name solves the issue.
Edited by Matteo Lupi