mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-24 21:27:00 +00:00
More bugfixes in handling of parameters in tasks and functions
This commit is contained in:
parent
34f2b84fb6
commit
7ae3d1b5a9
2 changed files with 23 additions and 2 deletions
|
@ -83,8 +83,9 @@ endmodule
|
|||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
module task_func_test04(input [7:0] in, output [7:0] out1, out2, out3);
|
||||
module task_func_test04(input [7:0] in, output [7:0] out1, out2, out3, out4);
|
||||
parameter p = 23;
|
||||
parameter px = 42;
|
||||
function [7:0] test1;
|
||||
input [7:0] i;
|
||||
parameter p = 42;
|
||||
|
@ -105,7 +106,17 @@ module task_func_test04(input [7:0] in, output [7:0] out1, out2, out3);
|
|||
test3 = i + p;
|
||||
end
|
||||
endfunction
|
||||
function [7:0] test4;
|
||||
input [7:0] i;
|
||||
parameter px = p + 13;
|
||||
parameter p3 = px - 37;
|
||||
parameter p4 = p3 ^ px;
|
||||
begin
|
||||
test4 = i + p4;
|
||||
end
|
||||
endfunction
|
||||
assign out1 = test1(in);
|
||||
assign out2 = test2(in);
|
||||
assign out3 = test3(in);
|
||||
assign out4 = test4(in);
|
||||
endmodule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue