Tests: Update t_disable_task_unsup (#6853 partial)

This commit is contained in:
Wilson Snyder 2025-12-21 21:26:16 -05:00
parent f6b966ed16
commit 742c0b134c
2 changed files with 56 additions and 15 deletions

View File

@ -1,5 +1,8 @@
%Error-UNSUPPORTED: t/t_disable_task_unsup.v:20:13: Unsupported: disabling task by name %Error-UNSUPPORTED: t/t_disable_task_unsup.v:37:10: Unsupported: disabling task by name
20 | #1 disable increment_x; 37 | #1 disable increment_x;
| ^~~~~~~ | ^~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error-UNSUPPORTED: t/t_disable_task_unsup.v:26:5: Unsupported: disabling task by name
26 | disable get_and_send;
| ^~~~~~~
%Error: Exiting due to %Error: Exiting due to

View File

@ -7,21 +7,59 @@
int x = 0; int x = 0;
task increment_x; task increment_x;
x++; x++;
#2; #2;
x++; x++;
endtask endtask
class driver;
int m_time = 0;
task get_and_send();
forever begin
#10;
m_time += 10;
end
endtask
task post_shutdown_phase();
disable get_and_send;
endtask
endclass
module t; module t;
initial begin driver c;
fork
increment_x(); initial begin
#1 disable increment_x; fork
join increment_x();
if (x != 1) $stop; #1 disable increment_x;
$write("*-* All Finished *-*\n"); join
$finish;
end if (x != 1) $stop;
c = new;
fork
c.get_and_send;
join_none
if (c.m_time != 0) $stop;
#11;
if ($time != 12) $stop;
if (c.m_time != 10) $stop;
#20;
if ($time != 32) $stop;
if (c.m_time != 30) $stop;
c.post_shutdown_phase;
#20;
if ($time != 52) $stop;
if (c.m_time != 30) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule endmodule