diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index aeb1419d7..1f0003e96 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -569,8 +569,10 @@ private: iterateChildren(nodep); AstAlways* alwaysp = VN_CAST(nodep->backp(), Always); if (alwaysp && alwaysp->keyword() == VAlwaysKwd::ALWAYS_COMB) { - alwaysp->v3error("Timing control statements not legal under always_comb\n" + alwaysp->v3error("Timing control statements not legal under always_comb " + "(IEEE 1800-2017 9.2.2.2.2)\n" << nodep->warnMore() << "... Suggest use a normal 'always'"); + VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); } else if (alwaysp && !alwaysp->sensesp()) { // Verilator is still ony supporting SenTrees under an always, // so allow the parser to handle everything and shim to @@ -580,13 +582,8 @@ private: alwaysp->sensesp(sensesp); } if (nodep->stmtsp()) alwaysp->addStmtp(nodep->stmtsp()->unlinkFrBackWithNext()); - } else { - nodep->v3warn(E_UNSUPPORTED, "Unsupported: timing control statement in this location\n" - << nodep->warnMore() - << "... Suggest have one timing control statement " - << "per procedure, at the top of the procedure"); + VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); } - VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); } virtual void visit(AstNode* nodep) override { diff --git a/src/V3Width.cpp b/src/V3Width.cpp index c289ecc1d..8d8c0b6fa 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -1251,6 +1251,13 @@ private: nodep->replaceWith(newp); VL_DO_DANGLING(nodep->deleteTree(), nodep); } + virtual void visit(AstTimingControl* nodep) override { + nodep->v3warn(E_UNSUPPORTED, "Unsupported: timing control statement in this location\n" + << nodep->warnMore() + << "... Suggest have one timing control statement " + << "per procedure, at the top of the procedure"); + VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); + } virtual void visit(AstAttrOf* nodep) override { AstAttrOf* oldAttr = m_attrp; m_attrp = nodep; diff --git a/test_regress/t/t_event_control_unsup.out b/test_regress/t/t_event_control_unsup.out index 7e0f28123..03d17ac22 100644 --- a/test_regress/t/t_event_control_unsup.out +++ b/test_regress/t/t_event_control_unsup.out @@ -1,8 +1,10 @@ %Error-UNSUPPORTED: t/t_event_control_unsup.v:14:7: Unsupported: timing control statement in this location + : ... In instance t : ... Suggest have one timing control statement per procedure, at the top of the procedure 14 | @(clk); | ^ %Error-UNSUPPORTED: t/t_event_control_unsup.v:16:7: Unsupported: timing control statement in this location + : ... In instance t : ... Suggest have one timing control statement per procedure, at the top of the procedure 16 | @(clk); | ^ diff --git a/test_regress/t/t_lint_comb_bad.out b/test_regress/t/t_lint_comb_bad.out index 391b09a97..176774ef6 100644 --- a/test_regress/t/t_lint_comb_bad.out +++ b/test_regress/t/t_lint_comb_bad.out @@ -1,4 +1,4 @@ -%Error: t/t_lint_comb_bad.v:14:4: Timing control statements not legal under always_comb +%Error: t/t_lint_comb_bad.v:14:4: Timing control statements not legal under always_comb (IEEE 1800-2017 9.2.2.2.2) : ... Suggest use a normal 'always' 14 | always_comb @(*) begin | ^~~~~~~~~~~