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:
parent
1dbf91a8ef
commit
f0a52e3dd2
5 changed files with 104 additions and 1 deletions
9
tests/verilog/for_decl_no_init.ys
Normal file
9
tests/verilog/for_decl_no_init.ys
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue