Files
iverilog/ivtest/ivltests/sv_class_queue_prop_methods.v
T
mjoekhan 9880fb8d5e SV: class queue/darray property foundation
Fold in Windows VPI routing for vpip_format_pretty, fix queue method
argument elaboration via elaborate_rval_expr, reject class tasks used as
expressions cleanly, and update br1005 now that class queues compile.

Review follow-up: move vpip_format_pretty to vpip_format.cc with
diagnostic return strings, restore NetNet-based queue method elaboration
with a separate property path, drop spurious /devel/ from .gitignore,
and bump copyright years on touched files.

Formatting pass per inline review: brace style for multi-line if bodies,
||/&& at end-of-line continuations, switch/case indentation, single-line
if returns, NetNet-based sys_task_method_ again, and aligned extern decls.
2026-07-07 00:46:45 +05:00

40 lines
802 B
Verilog

// 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