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

Fix constants bound to single bit arguments (fixes #2383)

This commit is contained in:
Zachary Snow 2020-12-05 18:56:18 -07:00
parent 95c6086681
commit 8206546c45
2 changed files with 18 additions and 0 deletions

View file

@ -39,6 +39,12 @@ module top;
end
endfunction
function automatic [16:0] operation4;
input [15:0] a;
input b;
operation4 = {a, b};
endfunction
wire [31:0] a;
assign a = 2;
@ -53,6 +59,9 @@ module top;
wire [31:0] x3;
assign x3 = operation3(A, a);
wire [16:0] x4;
assign x4 = operation4(a[15:0], 0);
// `define VERIFY
`ifdef VERIFY
assert property (a == 2);
@ -60,5 +69,6 @@ module top;
assert property (x1 == 16);
assert property (x2 == 4);
assert property (x3 == 16);
assert property (x4 == a << 1);
`endif
endmodule