diff --git a/ivtest/ivltests/sv_queue_ap_method.v b/ivtest/ivltests/sv_queue_ap_method.v new file mode 100644 index 000000000..41f174422 --- /dev/null +++ b/ivtest/ivltests/sv_queue_ap_method.v @@ -0,0 +1,33 @@ +// Check that assignment patterns are supported for queue method arguments. + +module test; + + bit failed; + bit [1:0][3:0] q[$]; + + `define check(val, exp) do begin \ + if (val !== exp) begin \ + $display("FAILED(%0d). '%s' expected %0h, got %0h", `__LINE__, \ + `"val`", exp, val); \ + failed = 1'b1; \ + end \ + end while (0) + + initial begin + failed = 1'b0; + + q.push_back('{4'h1, 4'h2}); + q.push_front('{4'h3, 4'h4}); + q.insert(1, '{4'h5, 4'h6}); + + `check(q.size(), 3); + `check(q[0], 8'h34); + `check(q[1], 8'h56); + `check(q[2], 8'h12); + + if (!failed) begin + $display("PASSED"); + end + end + +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 09f0498cf..2475c4d3a 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -349,6 +349,7 @@ sv_net_decl_assign vvp_tests/sv_net_decl_assign.json sv_package_lifetime vvp_tests/sv_package_lifetime.json sv_package_lifetime_fail vvp_tests/sv_package_lifetime_fail.json sv_parameter_type vvp_tests/sv_parameter_type.json +sv_queue_ap_method vvp_tests/sv_queue_ap_method.json sv_queue_assign_op vvp_tests/sv_queue_assign_op.json sv_soft_packed_union vvp_tests/sv_soft_packed_union.json sv_soft_packed_union_fail1 vvp_tests/sv_soft_packed_union_fail1.json diff --git a/ivtest/vvp_tests/sv_queue_ap_method.json b/ivtest/vvp_tests/sv_queue_ap_method.json new file mode 100644 index 000000000..1080087e9 --- /dev/null +++ b/ivtest/vvp_tests/sv_queue_ap_method.json @@ -0,0 +1,9 @@ +{ + "type" : "normal", + "source" : "sv_queue_ap_method.v", + "iverilog-args" : [ "-g2005-sv" ], + "vlog95" : { + "__comment" : "Queues are not supported", + "type" : "CE" + } +}