3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

Fix constant args used with function ports split across declarations

This commit is contained in:
Zachary Snow 2020-08-29 13:31:02 -04:00
parent 082cbcb4c7
commit ecc5c23b4d
2 changed files with 24 additions and 3 deletions

View file

@ -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