parent
96857c5f95
commit
2fbd41e13b
|
|
@ -12,6 +12,7 @@ module t();
|
|||
// verilator no_inline_task
|
||||
`endif
|
||||
q.push_back(42);
|
||||
if (q.size() != 1) $stop;
|
||||
endfunction
|
||||
|
||||
function void queue_check_nref(q_t q);
|
||||
|
|
@ -39,6 +40,7 @@ module t();
|
|||
initial begin
|
||||
q_t iq;
|
||||
queue_set(iq);
|
||||
if (iq.size() != 1) $stop;
|
||||
queue_check_ref(iq);
|
||||
|
||||
iq[0] = 44;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env perl
|
||||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
scenarios(simulator => 1);
|
||||
|
||||
top_filename("t/t_queue_persistence.v");
|
||||
|
||||
if (!$Self->have_coroutines) {
|
||||
skip("No coroutine support");
|
||||
}
|
||||
else {
|
||||
compile(
|
||||
timing_loop => 1,
|
||||
verilator_flags2 => ["--timing"],
|
||||
);
|
||||
|
||||
execute(
|
||||
fails => $Self->{vlt_all}, # bug3385 need to fix "ref"
|
||||
check_finished => !$Self->{vlt_all},
|
||||
);
|
||||
}
|
||||
|
||||
ok(1);
|
||||
1;
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2023 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
`define checkd(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got=%0d exp=%0d\n", `__FILE__,`__LINE__, (gotv), (expv)); $stop; end while(0);
|
||||
|
||||
module t(/*AUTOARG*/);
|
||||
|
||||
int q[$];
|
||||
|
||||
task automatic func(ref int vrefed);
|
||||
`ifdef TEST_NOINLINE
|
||||
// verilator no_inline_task
|
||||
`endif
|
||||
`checkd(vrefed, 2);
|
||||
#100;
|
||||
vrefed = 10;
|
||||
`checkd(vrefed, 10);
|
||||
endtask
|
||||
|
||||
initial begin
|
||||
q.push_back(1);
|
||||
q.push_back(2);
|
||||
q.push_back(3);
|
||||
`checkd(q[0], 1);
|
||||
`checkd(q[1], 2);
|
||||
`checkd(q[2], 3);
|
||||
func(q[1]);
|
||||
end
|
||||
|
||||
initial begin
|
||||
#50;
|
||||
`checkd(q[1], 2);
|
||||
q.delete();
|
||||
#100;
|
||||
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env perl
|
||||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2023 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
scenarios(simulator => 1);
|
||||
|
||||
top_filename("t/t_queue_persistence.v");
|
||||
|
||||
if (!$Self->have_coroutines) {
|
||||
skip("No coroutine support");
|
||||
}
|
||||
else {
|
||||
compile(
|
||||
timing_loop => 1,
|
||||
verilator_flags2 => ["--timing --fno-inline +define+TEST_NOINLINE"],
|
||||
);
|
||||
|
||||
execute(
|
||||
fails => $Self->{vlt_all}, # bug3385 need to fix "ref"
|
||||
check_finished => !$Self->{vlt_all},
|
||||
);
|
||||
}
|
||||
|
||||
ok(1);
|
||||
1;
|
||||
Loading…
Reference in New Issue