diff --git a/ivtest/ivltests/sv_class_queue_prop_methods.v b/ivtest/ivltests/sv_class_queue_prop_methods.v new file mode 100644 index 000000000..47d879bd7 --- /dev/null +++ b/ivtest/ivltests/sv_class_queue_prop_methods.v @@ -0,0 +1,39 @@ +// Regression: queue-typed class properties — push_front/push_back and +// pop_front/pop_back. (VVP asm must recognize %store/prop/qf/* and +// %qpop/prop/*; opcode_table must stay lexicographically sorted.) + +module test; + + bit failed = 1'b0; + + `define check(val, exp) do \ + if (val !== exp) begin \ + $display("FAILED(%0d). expected %0d, got %0d", `__LINE__, exp, val); \ + failed = 1'b1; \ + end \ + while(0) + + class C; + int q[$]; + endclass + + C c; + int t; + + initial begin + c = new; + c.q.push_back(1); + c.q.push_front(0); + c.q.push_back(2); + t = c.q.pop_back(); + `check(t, 32'd2); + `check(c.q.size(), 32'd2); + t = c.q.pop_front(); + `check(t, 32'd0); + `check(c.q[0], 32'd1); + + if (!failed) begin + $display("PASSED"); + end + end +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 13a548189..a85141024 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -235,6 +235,7 @@ sv_class_prop_nest_obj1 vvp_tests/sv_class_prop_nest_obj1.json sv_class_prop_nest_real1 vvp_tests/sv_class_prop_nest_str1.json sv_class_prop_nest_str1 vvp_tests/sv_class_prop_nest_real1.json sv_class_prop_nest_vec1 vvp_tests/sv_class_prop_nest_vec1.json +sv_class_queue_prop_methods vvp_tests/sv_class_queue_prop_methods.json sv_const1 vvp_tests/sv_const1.json sv_const2 vvp_tests/sv_const2.json sv_const3 vvp_tests/sv_const3.json diff --git a/ivtest/vvp_tests/sv_class_queue_prop_methods.json b/ivtest/vvp_tests/sv_class_queue_prop_methods.json new file mode 100644 index 000000000..735de2f79 --- /dev/null +++ b/ivtest/vvp_tests/sv_class_queue_prop_methods.json @@ -0,0 +1,9 @@ +{ + "type" : "normal", + "source" : "sv_class_queue_prop_methods.v", + "iverilog-args" : [ "-g2005-sv" ], + "vlog95" : { + "__comment" : "Classes are not supported", + "type" : "CE" + } +}