mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
Allow constant function calls in constant function arguments
This commit is contained in:
parent
95c6086681
commit
186d6df4c3
2 changed files with 14 additions and 0 deletions
|
@ -14,6 +14,11 @@ module top;
|
|||
end
|
||||
endfunction
|
||||
|
||||
function automatic [31:0] pass_through;
|
||||
input [31:0] inp;
|
||||
pass_through = inp;
|
||||
endfunction
|
||||
|
||||
function automatic [31:0] operation2;
|
||||
input [4:0] var;
|
||||
input integer num;
|
||||
|
@ -47,6 +52,9 @@ module top;
|
|||
wire [31:0] x1;
|
||||
assign x1 = operation1(A, a);
|
||||
|
||||
wire [31:0] x1b;
|
||||
assign x1b = operation1(pass_through(A), a);
|
||||
|
||||
wire [31:0] x2;
|
||||
assign x2 = operation2(A, a);
|
||||
|
||||
|
@ -58,6 +66,7 @@ module top;
|
|||
assert property (a == 2);
|
||||
assert property (A == 3);
|
||||
assert property (x1 == 16);
|
||||
assert property (x1b == 16);
|
||||
assert property (x2 == 4);
|
||||
assert property (x3 == 16);
|
||||
`endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue