From ecaa07a72a177dd6487a0b20d2ae090510d669a1 Mon Sep 17 00:00:00 2001 From: Krzysztof Bieganski Date: Mon, 16 May 2022 21:44:41 +0200 Subject: [PATCH] Rename AstTimingControl to AstEventControl (#3425) Signed-off-by: Krzysztof Bieganski --- src/V3AstNodes.h | 8 ++++---- src/V3LinkParse.cpp | 4 ++-- src/V3Width.cpp | 6 +++--- src/verilog.y | 2 +- test_regress/t/t_event_control_unsup.out | 8 ++++---- test_regress/t/t_lint_comb_bad.out | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 5082ae08d..80ae000cc 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -5243,15 +5243,15 @@ public: } }; -class AstTimingControl final : public AstNodeStmt { +class AstEventControl final : public AstNodeStmt { // Parents: stmtlist public: - AstTimingControl(FileLine* fl, AstSenTree* sensesp, AstNode* stmtsp) - : ASTGEN_SUPER_TimingControl(fl) { + AstEventControl(FileLine* fl, AstSenTree* sensesp, AstNode* stmtsp) + : ASTGEN_SUPER_EventControl(fl) { setNOp1p(sensesp); setNOp2p(stmtsp); } - ASTNODE_NODE_FUNCS(TimingControl) + ASTNODE_NODE_FUNCS(EventControl) virtual string verilogKwd() const override { return "@(%l) %r"; } virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index df1e36436..79be8fd05 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -582,12 +582,12 @@ private: iterateChildren(nodep); nodep->timeunit(m_modp->timeunit()); } - virtual void visit(AstTimingControl* nodep) override { + virtual void visit(AstEventControl* nodep) override { cleanFileline(nodep); iterateChildren(nodep); AstAlways* const alwaysp = VN_CAST(nodep->backp(), Always); if (alwaysp && alwaysp->keyword() == VAlwaysKwd::ALWAYS_COMB) { - alwaysp->v3error("Timing control statements not legal under always_comb " + alwaysp->v3error("Event 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); diff --git a/src/V3Width.cpp b/src/V3Width.cpp index f5e16ec21..6118bcff4 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -1323,10 +1323,10 @@ 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" + virtual void visit(AstEventControl* nodep) override { + nodep->v3warn(E_UNSUPPORTED, "Unsupported: event control statement in this location\n" << nodep->warnMore() - << "... Suggest have one timing control statement " + << "... Suggest have one event control statement " << "per procedure, at the top of the procedure"); VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); } diff --git a/src/verilog.y b/src/verilog.y index 84c778b45..3175ee9d0 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -3252,7 +3252,7 @@ statement_item: // IEEE: statement_item | par_block { $$ = $1; } // // IEEE: procedural_timing_control_statement + procedural_timing_control | delay_control stmtBlock { $$ = new AstDelay($1->fileline(), $1); $$->addNextNull($2); } - | event_control stmtBlock { $$ = new AstTimingControl(FILELINE_OR_CRE($1), $1, $2); } + | event_control stmtBlock { $$ = new AstEventControl(FILELINE_OR_CRE($1), $1, $2); } //UNSUP cycle_delay stmtBlock { UNSUP } // | seq_block { $$ = $1; } diff --git a/test_regress/t/t_event_control_unsup.out b/test_regress/t/t_event_control_unsup.out index 1b0a26e28..7c40c182e 100644 --- a/test_regress/t/t_event_control_unsup.out +++ b/test_regress/t/t_event_control_unsup.out @@ -1,12 +1,12 @@ -%Error-UNSUPPORTED: t/t_event_control_unsup.v:14:7: Unsupported: timing control statement in this location +%Error-UNSUPPORTED: t/t_event_control_unsup.v:14:7: Unsupported: event control statement in this location : ... In instance t - : ... Suggest have one timing control statement per procedure, at the top of the procedure + : ... Suggest have one event control statement per procedure, at the top of the procedure 14 | @(clk); | ^ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error-UNSUPPORTED: t/t_event_control_unsup.v:16:7: Unsupported: timing control statement in this location +%Error-UNSUPPORTED: t/t_event_control_unsup.v:16:7: Unsupported: event control statement in this location : ... In instance t - : ... Suggest have one timing control statement per procedure, at the top of the procedure + : ... Suggest have one event control statement per procedure, at the top of the procedure 16 | @(clk); | ^ %Error: Exiting due to diff --git a/test_regress/t/t_lint_comb_bad.out b/test_regress/t/t_lint_comb_bad.out index 176774ef6..ffdca1f17 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 (IEEE 1800-2017 9.2.2.2.2) +%Error: t/t_lint_comb_bad.v:14:4: Event control statements not legal under always_comb (IEEE 1800-2017 9.2.2.2.2) : ... Suggest use a normal 'always' 14 | always_comb @(*) begin | ^~~~~~~~~~~