diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-11-11 10:54:35 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-11-11 10:54:35 +0100 |
commit | 34f2b84fb60445210ff9ffdf33b90ef6f50b91ed (patch) | |
tree | d9df1a940c0c2e72e0514939e691e09f0147c710 /tests/simple | |
parent | d98d99aec6049d981abb2480cf942947f3f23989 (diff) | |
download | yosys-34f2b84fb60445210ff9ffdf33b90ef6f50b91ed.tar.gz yosys-34f2b84fb60445210ff9ffdf33b90ef6f50b91ed.tar.bz2 yosys-34f2b84fb60445210ff9ffdf33b90ef6f50b91ed.zip |
Fixed handling of parameters and localparams in functions
Diffstat (limited to 'tests/simple')
-rw-r--r-- | tests/simple/task_func.v | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/simple/task_func.v b/tests/simple/task_func.v index 9b8e26e51..36ac768ea 100644 --- a/tests/simple/task_func.v +++ b/tests/simple/task_func.v @@ -68,7 +68,7 @@ endmodule // ------------------------------------------------------------------- -module task_func_test03( input [7:0] din_a, input [7:0] din_b, output [7:0] dout_a); +module task_func_test03(input [7:0] din_a, input [7:0] din_b, output [7:0] dout_a); assign dout_a = test(din_a,din_b); function [7:0] test; input [7:0] a; @@ -80,3 +80,32 @@ module task_func_test03( input [7:0] din_a, input [7:0] din_b, output [7:0] dout end endfunction endmodule + +// ------------------------------------------------------------------- + +module task_func_test04(input [7:0] in, output [7:0] out1, out2, out3); + parameter p = 23; + function [7:0] test1; + input [7:0] i; + parameter p = 42; + begin + test1 = i + p; + end + endfunction + function [7:0] test2; + input [7:0] i; + parameter p2 = p+42; + begin + test2 = i + p2; + end + endfunction + function [7:0] test3; + input [7:0] i; + begin + test3 = i + p; + end + endfunction + assign out1 = test1(in); + assign out2 = test2(in); + assign out3 = test3(in); +endmodule |