From 44badf50de6e76253c2575581fb0daff0416f032 Mon Sep 17 00:00:00 2001 From: Ethan Sifferman Date: Fri, 28 Jul 2023 23:51:02 -0700 Subject: [PATCH] added test --- ivtest/ivltests/sv_argumentless_func.v | 29 ++++++++++++++++++++++ ivtest/regress-vvp.list | 1 + ivtest/vvp_tests/sv_argumentless_func.json | 5 ++++ 3 files changed, 35 insertions(+) create mode 100644 ivtest/ivltests/sv_argumentless_func.v create mode 100644 ivtest/vvp_tests/sv_argumentless_func.json diff --git a/ivtest/ivltests/sv_argumentless_func.v b/ivtest/ivltests/sv_argumentless_func.v new file mode 100644 index 000000000..858da97f0 --- /dev/null +++ b/ivtest/ivltests/sv_argumentless_func.v @@ -0,0 +1,29 @@ + +module test; + +function automatic [7:0] test_func; + input _unused; + test_func = _unused; +endfunction + +logic [7:0] test_assign; +assign test_assign = test_func(0); + +wire [7:0] test_wire = test_func(0); + +initial begin + if (test_assign !== test_func(0)) begin + $display("FAILED -- test_assign=%h, expect %h", test_assign, test_func(0)); + $finish; + end + + if (test_wire !== test_func(0)) begin + $display("FAILED -- test_wire=%h, expect %h", test_wire, test_func(0)); + $finish; + end + + $display("PASSED"); + $finish; +end + +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 11f9dc682..a3a38b0ed 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -56,6 +56,7 @@ sv_ap_uarray5 vvp_tests/sv_ap_uarray5.json sv_ap_uarray6 vvp_tests/sv_ap_uarray6.json sv_ap_uarray_fail1 vvp_tests/sv_ap_uarray_fail1.json sv_ap_uarray_fail2 vvp_tests/sv_ap_uarray_fail2.json +sv_argumentless_func vvp_tests/sv_argumentless_func.json sv_array_assign_fail1 vvp_tests/sv_array_assign_fail1.json sv_array_assign_fail2 vvp_tests/sv_array_assign_fail2.json sv_array_cassign6 vvp_tests/sv_array_cassign6.json diff --git a/ivtest/vvp_tests/sv_argumentless_func.json b/ivtest/vvp_tests/sv_argumentless_func.json new file mode 100644 index 000000000..6cf5de5aa --- /dev/null +++ b/ivtest/vvp_tests/sv_argumentless_func.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "sv_argumentless_func.v", + "iverilog-args" : [ "-g2012" ] +}