diff options
author | clairexen <claire@symbioticeda.com> | 2020-09-01 17:28:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 17:28:35 +0200 |
commit | 452442ac2fcdec92a98a5a0896b2b3866db9e5e9 (patch) | |
tree | 5b7a08e9e8c1476e986806a851550577434d1148 /tests | |
parent | 244af8b8b715642a54af22018fb03ad965ca7be1 (diff) | |
parent | ecc5c23b4d3ec42599b80f5f4dc8699f024124be (diff) | |
download | yosys-452442ac2fcdec92a98a5a0896b2b3866db9e5e9.tar.gz yosys-452442ac2fcdec92a98a5a0896b2b3866db9e5e9.tar.bz2 yosys-452442ac2fcdec92a98a5a0896b2b3866db9e5e9.zip |
Merge pull request #2365 from zachjs/const-arg-loop-split-type
Fix constant args used with function ports split across declarations
Diffstat (limited to 'tests')
-rw-r--r-- | tests/various/const_arg_loop.v | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/various/const_arg_loop.v b/tests/various/const_arg_loop.v index 85318562f..3bfff4acd 100644 --- a/tests/various/const_arg_loop.v +++ b/tests/various/const_arg_loop.v @@ -23,6 +23,22 @@ module top; end endfunction + function automatic [31:0] operation3; + input [4:0] rounds; + input integer num; + reg [4:0] rounds; + integer i; + begin + begin : shadow + integer rounds; + rounds = 0; + end + for (i = 0; i < rounds; i = i + 1) + num = num * 2; + operation3 = num; + end + endfunction + wire [31:0] a; assign a = 2; @@ -34,11 +50,15 @@ module top; wire [31:0] x2; assign x2 = operation2(A, a); + wire [31:0] x3; + assign x3 = operation3(A, a); + // `define VERIFY `ifdef VERIFY assert property (a == 2); assert property (A == 3); assert property (x1 == 16); assert property (x2 == 4); + assert property (x3 == 16); `endif endmodule |