Fix continuing on wait(0) (#7372) (#8231)

This commit is contained in:
Szymon Gizler
2026-08-31 13:06:23 -04:00
committed by GitHub
parent 9474a01d54
commit be83d1393d
18 changed files with 674 additions and 59 deletions
+7 -2
View File
@@ -1393,8 +1393,13 @@ class TimingControlVisitor final : public VNVisitor {
if (constp->isZero()) {
// We have to await forever instead of simply returning in case we're deep in a
// callstack
AstCExpr* const foreverp = new AstCExpr{flp, "VlForever{}"};
AstCAwait* const awaitp = new AstCAwait{flp, foreverp};
AstCMethodHard* const foreverMethodp = new AstCMethodHard{
flp, new AstVarRef{flp, getCreateDelayScheduler(), VAccess::WRITE},
VCMethod::SCHED_WAIT_FOREVER};
foreverMethodp->dtypeSetVoid();
addProcessInfo(foreverMethodp);
addDebugInfo(foreverMethodp);
AstCAwait* const awaitp = new AstCAwait{flp, foreverMethodp};
nodep->replaceWith(awaitp);
if (stmtsp) VL_DO_DANGLING(stmtsp->deleteTree(), stmtsp);
VL_DO_DANGLING(condp->deleteTree(), condp);