mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
Merge pull request #2594 from zachjs/func-arg-width
verilog: fix sizing of constant args for tasks/functions
This commit is contained in:
commit
ad2960adb7
10 changed files with 124 additions and 47 deletions
12
tests/verilog/func_arg_mismatch_1.ys
Normal file
12
tests/verilog/func_arg_mismatch_1.ys
Normal file
|
@ -0,0 +1,12 @@
|
|||
logger -expect error "Incompatible re-declaration of wire" 1
|
||||
read_verilog -sv <<EOT
|
||||
module top;
|
||||
function automatic integer f;
|
||||
input [0:0] inp;
|
||||
integer inp;
|
||||
f = inp;
|
||||
endfunction
|
||||
integer x, y;
|
||||
initial x = f(y);
|
||||
endmodule
|
||||
EOT
|
12
tests/verilog/func_arg_mismatch_2.ys
Normal file
12
tests/verilog/func_arg_mismatch_2.ys
Normal file
|
@ -0,0 +1,12 @@
|
|||
logger -expect error "Incompatible re-declaration of constant function wire" 1
|
||||
read_verilog -sv <<EOT
|
||||
module top;
|
||||
function automatic integer f;
|
||||
input [0:0] inp;
|
||||
integer inp;
|
||||
f = inp;
|
||||
endfunction
|
||||
integer x;
|
||||
initial x = f(0);
|
||||
endmodule
|
||||
EOT
|
12
tests/verilog/func_arg_mismatch_3.ys
Normal file
12
tests/verilog/func_arg_mismatch_3.ys
Normal file
|
@ -0,0 +1,12 @@
|
|||
logger -expect error "Incompatible re-declaration of wire" 1
|
||||
read_verilog -sv <<EOT
|
||||
module top;
|
||||
function automatic integer f;
|
||||
input [1:0] inp;
|
||||
integer inp;
|
||||
f = inp;
|
||||
endfunction
|
||||
integer x, y;
|
||||
initial x = f(y);
|
||||
endmodule
|
||||
EOT
|
12
tests/verilog/func_arg_mismatch_4.ys
Normal file
12
tests/verilog/func_arg_mismatch_4.ys
Normal file
|
@ -0,0 +1,12 @@
|
|||
logger -expect error "Incompatible re-declaration of constant function wire" 1
|
||||
read_verilog -sv <<EOT
|
||||
module top;
|
||||
function automatic integer f;
|
||||
input [1:0] inp;
|
||||
integer inp;
|
||||
f = inp;
|
||||
endfunction
|
||||
integer x;
|
||||
initial x = f(0);
|
||||
endmodule
|
||||
EOT
|
Loading…
Add table
Add a link
Reference in a new issue