From 742c0b134cfcb0fd26746c26470a2748654c7e6d Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 21 Dec 2025 21:26:16 -0500 Subject: [PATCH] Tests: Update t_disable_task_unsup (#6853 partial) --- test_regress/t/t_disable_task_unsup.out | 9 ++-- test_regress/t/t_disable_task_unsup.v | 62 ++++++++++++++++++++----- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/test_regress/t/t_disable_task_unsup.out b/test_regress/t/t_disable_task_unsup.out index e5628d22a..024eadd80 100644 --- a/test_regress/t/t_disable_task_unsup.out +++ b/test_regress/t/t_disable_task_unsup.out @@ -1,5 +1,8 @@ -%Error-UNSUPPORTED: t/t_disable_task_unsup.v:20:13: Unsupported: disabling task by name - 20 | #1 disable increment_x; - | ^~~~~~~ +%Error-UNSUPPORTED: t/t_disable_task_unsup.v:37:10: Unsupported: disabling task by name + 37 | #1 disable increment_x; + | ^~~~~~~ ... 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 diff --git a/test_regress/t/t_disable_task_unsup.v b/test_regress/t/t_disable_task_unsup.v index 8cda396f0..346dd3c3c 100644 --- a/test_regress/t/t_disable_task_unsup.v +++ b/test_regress/t/t_disable_task_unsup.v @@ -7,21 +7,59 @@ int x = 0; task increment_x; - x++; - #2; - x++; + x++; + #2; + x++; 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; - initial begin - fork - increment_x(); - #1 disable increment_x; - join - if (x != 1) $stop; - $write("*-* All Finished *-*\n"); - $finish; - end + driver c; + + initial begin + fork + increment_x(); + #1 disable increment_x; + join + + 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