3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-03 09:50:24 +00:00

sv: support declaration in procedural for initialization

In line with other tools, this adds an extra wrapping block around such
for loops to appropriately scope the variable.
This commit is contained in:
Zachary Snow 2021-08-30 11:35:36 -06:00 committed by Zachary Snow
parent 1dbf91a8ef
commit f0a52e3dd2
5 changed files with 104 additions and 1 deletions

View file

@ -0,0 +1,9 @@
logger -expect error "For loop variable declaration is missing initialization!" 1
read_verilog -sv <<EOT
module top;
integer z;
initial
for (integer i; i < 10; i = i + 1)
z = i;
endmodule
EOT