From 5f52c066e5a1f8b78c81193d37607a01d0947f19 Mon Sep 17 00:00:00 2001 From: Szymon Gizler <151655464+sgizler@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:35:13 +0100 Subject: [PATCH] Internals: Add serializeOnly() and dumpTreeEitherLevel() (#4815) (#4715). No functional change intended. --- docs/CONTRIBUTORS | 1 + src/V3Active.cpp | 2 +- src/V3ActiveTop.cpp | 2 +- src/V3Assert.cpp | 2 +- src/V3AssertPre.cpp | 2 +- src/V3Begin.cpp | 2 +- src/V3CCtors.cpp | 2 +- src/V3CUse.cpp | 2 +- src/V3Case.cpp | 2 +- src/V3Cast.cpp | 2 +- src/V3Class.cpp | 2 +- src/V3Clean.cpp | 2 +- src/V3Clock.cpp | 2 +- src/V3Combine.cpp | 2 +- src/V3Common.cpp | 2 +- src/V3Const.cpp | 8 +++--- src/V3Coverage.cpp | 2 +- src/V3CoverageJoin.cpp | 2 +- src/V3Dead.cpp | 10 +++---- src/V3Delayed.cpp | 2 +- src/V3Depth.cpp | 2 +- src/V3DepthBlock.cpp | 2 +- src/V3Descope.cpp | 2 +- src/V3DfgOptimizer.cpp | 4 +-- src/V3Error.h | 1 + src/V3Expand.cpp | 2 +- src/V3Force.cpp | 2 +- src/V3Fork.cpp | 4 +-- src/V3Gate.cpp | 2 +- src/V3Inline.cpp | 2 +- src/V3Inst.cpp | 4 +-- src/V3Interface.cpp | 2 +- src/V3Life.cpp | 2 +- src/V3LifePost.cpp | 2 +- src/V3LinkDot.cpp | 24 +++++++++++------ src/V3LinkInc.cpp | 2 +- src/V3LinkJump.cpp | 2 +- src/V3LinkLValue.cpp | 2 +- src/V3LinkLevel.cpp | 4 +-- src/V3LinkParse.cpp | 2 +- src/V3LinkResolve.cpp | 2 +- src/V3Localize.cpp | 2 +- src/V3MergeCond.cpp | 2 +- src/V3Name.cpp | 2 +- src/V3Options.cpp | 6 ++--- src/V3Options.h | 1 + src/V3Param.cpp | 2 +- src/V3Premit.cpp | 2 +- src/V3Randomize.cpp | 2 +- src/V3Reloop.cpp | 2 +- src/V3Sched.cpp | 2 +- src/V3SchedTiming.cpp | 2 +- src/V3SchedVirtIface.cpp | 2 +- src/V3Scope.cpp | 2 +- src/V3Slice.cpp | 2 +- src/V3Split.cpp | 4 +-- src/V3SplitAs.cpp | 2 +- src/V3SplitVar.cpp | 4 +-- src/V3Subst.cpp | 2 +- src/V3Table.cpp | 2 +- src/V3Task.cpp | 2 +- src/V3Timing.cpp | 2 +- src/V3Trace.cpp | 2 +- src/V3TraceDecl.cpp | 2 +- src/V3Tristate.cpp | 2 +- src/V3Unknown.cpp | 2 +- src/V3Unroll.cpp | 2 +- src/V3VariableOrder.cpp | 2 +- src/V3Width.cpp | 2 +- src/V3WidthCommit.cpp | 2 +- src/Verilator.cpp | 56 +++++++++++++++++++++------------------- 71 files changed, 130 insertions(+), 115 deletions(-) diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index b5efe1199..f68ce43d5 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -161,6 +161,7 @@ Srinivasan Venkataramanan Stefan Wallentowitz Stephen Henry Steven Hugg +Szymon Gizler Sören Tempel Teng Huang Tim Hutt diff --git a/src/V3Active.cpp b/src/V3Active.cpp index 800205664..18c9fea8c 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -648,5 +648,5 @@ public: void V3Active::activeAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ActiveVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("active", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("active", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3ActiveTop.cpp b/src/V3ActiveTop.cpp index fb59ecc0b..2f4e63bd6 100644 --- a/src/V3ActiveTop.cpp +++ b/src/V3ActiveTop.cpp @@ -142,5 +142,5 @@ public: void V3ActiveTop::activeTopAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ActiveTopVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("activetop", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("activetop", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index 508e33e5f..897fe5906 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -540,5 +540,5 @@ public: void V3Assert::assertAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { AssertVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("assert", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("assert", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp index 34104eab2..83f8b9e5f 100644 --- a/src/V3AssertPre.cpp +++ b/src/V3AssertPre.cpp @@ -495,5 +495,5 @@ public: void V3AssertPre::assertPreAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { AssertPreVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("assertpre", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("assertpre", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index 370c3b794..088d3f7ed 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -366,5 +366,5 @@ void V3Begin::debeginAll(AstNetlist* nodep) { { BeginVisitor{nodep, &state}; } if (state.anyFuncInBegin()) { BeginRelinkVisitor{nodep, &state}; } } // Destruct before checking - V3Global::dumpCheckGlobalTree("begin", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("begin", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3CCtors.cpp b/src/V3CCtors.cpp index 5f50f4128..7aa3130dc 100644 --- a/src/V3CCtors.cpp +++ b/src/V3CCtors.cpp @@ -252,5 +252,5 @@ void V3CCtors::cctorsAll() { UINFO(2, __FUNCTION__ << ": " << endl); evalAsserts(); { CCtorsVisitor{v3Global.rootp()}; } - V3Global::dumpCheckGlobalTree("cctors", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("cctors", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3CUse.cpp b/src/V3CUse.cpp index 5ad565677..d40abd5b5 100644 --- a/src/V3CUse.cpp +++ b/src/V3CUse.cpp @@ -117,5 +117,5 @@ void V3CUse::cUseAll() { // for each output file and put under that CUseVisitor{modp}; } - V3Global::dumpCheckGlobalTree("cuse", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("cuse", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Case.cpp b/src/V3Case.cpp index fcaa828a5..403f0ac00 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -602,7 +602,7 @@ public: void V3Case::caseAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { CaseVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("case", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("case", 0, dumpTreeEitherLevel() >= 3); } void V3Case::caseLint(AstNodeCase* nodep) { UINFO(4, __FUNCTION__ << ": " << endl); diff --git a/src/V3Cast.cpp b/src/V3Cast.cpp index c6720efd3..be6a0839f 100644 --- a/src/V3Cast.cpp +++ b/src/V3Cast.cpp @@ -236,5 +236,5 @@ public: void V3Cast::castAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { CastVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("cast", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("cast", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Class.cpp b/src/V3Class.cpp index 545e76419..54ac0677b 100644 --- a/src/V3Class.cpp +++ b/src/V3Class.cpp @@ -240,5 +240,5 @@ public: void V3Class::classAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ClassVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("class", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("class", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp index 50dd4c576..fa118f4da 100644 --- a/src/V3Clean.cpp +++ b/src/V3Clean.cpp @@ -320,5 +320,5 @@ public: void V3Clean::cleanAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { CleanVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("clean", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("clean", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index d58d8c138..e3315b35b 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -217,5 +217,5 @@ public: void V3Clock::clockAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ClockVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("clock", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("clock", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index 0fc717789..40dbbe7f6 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -235,5 +235,5 @@ public: void V3Combine::combineAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); CombineVisitor::apply(nodep); - V3Global::dumpCheckGlobalTree("combine", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("combine", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Common.cpp b/src/V3Common.cpp index 891ca15cf..47a5451ec 100644 --- a/src/V3Common.cpp +++ b/src/V3Common.cpp @@ -172,5 +172,5 @@ void V3Common::commonAll() { if (!dtypep->packed()) makeVlToString(dtypep); } } - V3Global::dumpCheckGlobalTree("common", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("common", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 8353833e2..397324ed1 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -3881,7 +3881,7 @@ void V3Const::constifyAllLint(AstNetlist* nodep) { ConstVisitor visitor{ConstVisitor::PROC_V_WARN, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); } // Destruct before checking - V3Global::dumpCheckGlobalTree("const", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("const", 0, dumpTreeEitherLevel() >= 3); } void V3Const::constifyCpp(AstNetlist* nodep) { @@ -3890,7 +3890,7 @@ void V3Const::constifyCpp(AstNetlist* nodep) { ConstVisitor visitor{ConstVisitor::PROC_CPP, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); } // Destruct before checking - V3Global::dumpCheckGlobalTree("const_cpp", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("const_cpp", 0, dumpTreeEitherLevel() >= 3); } AstNode* V3Const::constifyEdit(AstNode* nodep) { @@ -3914,7 +3914,7 @@ void V3Const::constifyAllLive(AstNetlist* nodep) { ConstVisitor visitor{ConstVisitor::PROC_LIVE, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); } // Destruct before checking - V3Global::dumpCheckGlobalTree("const", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("const", 0, dumpTreeEitherLevel() >= 3); } void V3Const::constifyAll(AstNetlist* nodep) { @@ -3924,7 +3924,7 @@ void V3Const::constifyAll(AstNetlist* nodep) { ConstVisitor visitor{ConstVisitor::PROC_V_EXPENSIVE, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); } // Destruct before checking - V3Global::dumpCheckGlobalTree("const", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("const", 0, dumpTreeEitherLevel() >= 3); } AstNode* V3Const::constifyExpensiveEdit(AstNode* nodep) { diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index e1d188621..dcddd0c99 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -556,5 +556,5 @@ public: void V3Coverage::coverage(AstNetlist* rootp) { UINFO(2, __FUNCTION__ << ": " << endl); { CoverageVisitor{rootp}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("coverage", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("coverage", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3CoverageJoin.cpp b/src/V3CoverageJoin.cpp index 7f6603f7d..b7cc10392 100644 --- a/src/V3CoverageJoin.cpp +++ b/src/V3CoverageJoin.cpp @@ -114,5 +114,5 @@ public: void V3CoverageJoin::coverageJoin(AstNetlist* rootp) { UINFO(2, __FUNCTION__ << ": " << endl); { CoverageJoinVisitor{rootp}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("coveragejoin", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("coveragejoin", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp index 66a3ced92..db5e6ae5c 100644 --- a/src/V3Dead.cpp +++ b/src/V3Dead.cpp @@ -543,29 +543,29 @@ void V3Dead::deadifyModules(AstNetlist* nodep) { { DeadVisitor{nodep, false, false, false, false, !v3Global.opt.topIfacesSupported()}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("deadModules", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("deadModules", 0, dumpTreeEitherLevel() >= 6); } void V3Dead::deadifyDTypes(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DeadVisitor{nodep, false, true, false, false, false}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("deadDtypes", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("deadDtypes", 0, dumpTreeEitherLevel() >= 3); } void V3Dead::deadifyDTypesScoped(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DeadVisitor{nodep, false, true, true, false, false}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("deadDtypesScoped", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("deadDtypesScoped", 0, dumpTreeEitherLevel() >= 3); } void V3Dead::deadifyAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DeadVisitor{nodep, true, true, false, true, false}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("deadAll", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("deadAll", 0, dumpTreeEitherLevel() >= 3); } void V3Dead::deadifyAllScoped(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DeadVisitor{nodep, true, true, true, true, false}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("deadAllScoped", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("deadAllScoped", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index 79205f615..cb31f131e 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -649,5 +649,5 @@ public: void V3Delayed::delayedAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DelayedVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("delayed", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("delayed", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Depth.cpp b/src/V3Depth.cpp index 51785fc8a..25a294268 100644 --- a/src/V3Depth.cpp +++ b/src/V3Depth.cpp @@ -160,5 +160,5 @@ public: void V3Depth::depthAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DepthVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("depth", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("depth", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp index d9fe7dd79..54fa3f2b6 100644 --- a/src/V3DepthBlock.cpp +++ b/src/V3DepthBlock.cpp @@ -121,5 +121,5 @@ public: void V3DepthBlock::depthBlockAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DepthBlockVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("deepblock", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("deepblock", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index 6f224ab85..56078471f 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -300,5 +300,5 @@ public: void V3Descope::descopeAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DescopeVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("descope", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("descope", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3DfgOptimizer.cpp b/src/V3DfgOptimizer.cpp index 98a4fc5e0..f209351a9 100644 --- a/src/V3DfgOptimizer.cpp +++ b/src/V3DfgOptimizer.cpp @@ -233,7 +233,7 @@ void V3DfgOptimizer::extract(AstNetlist* netlistp) { UINFO(2, __FUNCTION__ << ": " << endl); // Extract more optimization candidates DataflowExtractVisitor::apply(netlistp); - V3Global::dumpCheckGlobalTree("dfg-extract", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("dfg-extract", 0, dumpTreeEitherLevel() >= 3); } void V3DfgOptimizer::optimize(AstNetlist* netlistp, const string& label) { @@ -300,5 +300,5 @@ void V3DfgOptimizer::optimize(AstNetlist* netlistp, const string& label) { AstModule* const resultModp = V3DfgPasses::dfgToAst(*dfg, ctx); UASSERT_OBJ(resultModp == modp, modp, "Should be the same module"); } - V3Global::dumpCheckGlobalTree("dfg-optimize", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("dfg-optimize", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Error.h b/src/V3Error.h index e1032a0dd..4873bd193 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -680,6 +680,7 @@ void v3errorEndFatal(std::ostringstream& sstr) VL_DEFINE_DUMP(DfgLevel, "dfg"); /* Define 'int dumpDfgLevel()' for --dumpi-level */ \ VL_DEFINE_DUMP(GraphLevel, "graph"); /* Define 'int dumpGraphLevel()' for dumpi-graph */ \ VL_DEFINE_DUMP(TreeLevel, "tree"); /* Define 'int dumpTreeLevel()' for dumpi-tree */ \ + VL_ATTR_UNUSED static int dumpTreeEitherLevel() { return dumpTreeLevel(); } \ static_assert(true, "") //---------------------------------------------------------------------- diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index db2b53208..21447053f 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -963,5 +963,5 @@ void V3Expand::expandAll(AstNetlist* nodep) { ExpandOkVisitor okVisitor{nodep}; ExpandVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("expand", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("expand", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Force.cpp b/src/V3Force.cpp index a7217f811..0141efcbf 100644 --- a/src/V3Force.cpp +++ b/src/V3Force.cpp @@ -328,5 +328,5 @@ void V3Force::forceAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); if (!v3Global.hasForceableSignals()) return; ForceConvertVisitor::apply(nodep); - V3Global::dumpCheckGlobalTree("force", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("force", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 2d024ea59..7d0900061 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -659,11 +659,11 @@ public: void V3Fork::makeDynamicScopes(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { DynScopeVisitor{nodep}; } - V3Global::dumpCheckGlobalTree("fork_dynscope", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("fork_dynscope", 0, dumpTreeEitherLevel() >= 3); } void V3Fork::makeTasks(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ForkVisitor{nodep}; } - V3Global::dumpCheckGlobalTree("fork", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("fork", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index 61ba85be7..2e2976ff9 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -1381,5 +1381,5 @@ void V3Gate::gateAll(AstNetlist* netlistp) { if (dumpGraphLevel() >= 3) graphp->dumpDotFilePrefixed("gate_final"); } - V3Global::dumpCheckGlobalTree("gate", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("gate", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index 90d6bd304..638393cd7 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -640,5 +640,5 @@ void V3Inline::inlineAll(AstNetlist* nodep) { } } - V3Global::dumpCheckGlobalTree("inline", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("inline", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 16a6461df..748a11158 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -610,11 +610,11 @@ void V3Inst::checkOutputShort(AstPin* nodep) { void V3Inst::instAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { InstVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("inst", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("inst", 0, dumpTreeEitherLevel() >= 3); } void V3Inst::dearrayAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { InstDeVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("dearray", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("dearray", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Interface.cpp b/src/V3Interface.cpp index 4f5cfcc9c..146739525 100644 --- a/src/V3Interface.cpp +++ b/src/V3Interface.cpp @@ -113,5 +113,5 @@ void V3Interface::interfaceAll(AstNetlist* nodep) { { InlineIntfRefVisitor{nodep}; } - V3Global::dumpCheckGlobalTree("interface", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("interface", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 0d057d373..d5292bdb8 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -503,5 +503,5 @@ void V3Life::lifeAll(AstNetlist* nodep) { LifeTopVisitor{nodep, &state}; } // Destruct before checking VIsCached::clearCacheTree(); // Removing assignments may affect isPure - V3Global::dumpCheckGlobalTree("life", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("life", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LifePost.cpp b/src/V3LifePost.cpp index 07f6d0eeb..4855f800d 100644 --- a/src/V3LifePost.cpp +++ b/src/V3LifePost.cpp @@ -362,5 +362,5 @@ void V3LifePost::lifepostAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); // Mark redundant AssignPost { LifePostDlyVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("life_post", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("life_post", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index ce262adc9..06bd30b9c 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -3791,18 +3791,24 @@ public: void V3LinkDot::linkDotGuts(AstNetlist* rootp, VLinkDotStep step) { VIsCached::clearCacheTree(); // Avoid using any stale isPure - if (debug() >= 5 || dumpTreeLevel() >= 9) { + if (dumpTreeEitherLevel() >= 9) { + V3Global::dumpCheckGlobalTree("prelinkdot"); + } else if (debug() >= 5) { // on high dbg level, dump even if not explicitly told to v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot.tree")); } LinkDotState state{rootp, step}; const LinkDotFindVisitor visitor{rootp, &state}; - if (debug() >= 5 || dumpTreeLevel() >= 9) { + if (dumpTreeEitherLevel() >= 9) { + V3Global::dumpCheckGlobalTree("prelinkdot-find"); + } else if (debug() >= 5) { v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot-find.tree")); } if (step == LDS_PRIMARY || step == LDS_PARAMED) { // Initial link stage, resolve parameters const LinkDotParamVisitor visitors{rootp, &state}; - if (debug() >= 5 || dumpTreeLevel() >= 9) { + if (dumpTreeEitherLevel() >= 9) { + V3Global::dumpCheckGlobalTree("prelinkdot-param"); + } else if (debug() >= 5) { v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot-param.tree")); } } else if (step == LDS_ARRAYED) { @@ -3811,7 +3817,9 @@ void V3LinkDot::linkDotGuts(AstNetlist* rootp, VLinkDotStep step) { // process AstScope's. This needs to be separate pass after whole hierarchy graph created. const LinkDotScopeVisitor visitors{rootp, &state}; v3Global.assertScoped(true); - if (debug() >= 5 || dumpTreeLevel() >= 9) { + if (dumpTreeEitherLevel() >= 9) { + V3Global::dumpCheckGlobalTree("prelinkdot-scoped"); + } else if (debug() >= 5) { v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("prelinkdot-scoped.tree")); } } else { @@ -3829,23 +3837,23 @@ void V3LinkDot::linkDotGuts(AstNetlist* rootp, VLinkDotStep step) { void V3LinkDot::linkDotPrimary(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); linkDotGuts(nodep, LDS_PRIMARY); - V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeEitherLevel() >= 6); } void V3LinkDot::linkDotParamed(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); linkDotGuts(nodep, LDS_PARAMED); - V3Global::dumpCheckGlobalTree("linkdotparam", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("linkdotparam", 0, dumpTreeEitherLevel() >= 3); } void V3LinkDot::linkDotArrayed(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); linkDotGuts(nodep, LDS_ARRAYED); - V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeEitherLevel() >= 6); } void V3LinkDot::linkDotScope(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); linkDotGuts(nodep, LDS_SCOPED); - V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index 6f87710ca..92ee6d4ed 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -305,5 +305,5 @@ public: void V3LinkInc::linkIncrements(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { LinkIncVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("linkinc", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("linkinc", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkJump.cpp b/src/V3LinkJump.cpp index 267439768..2adf3f1e2 100644 --- a/src/V3LinkJump.cpp +++ b/src/V3LinkJump.cpp @@ -348,5 +348,5 @@ public: void V3LinkJump::linkJump(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { LinkJumpVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("linkjump", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("linkjump", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkLValue.cpp b/src/V3LinkLValue.cpp index 88b34da37..c92aa9956 100644 --- a/src/V3LinkLValue.cpp +++ b/src/V3LinkLValue.cpp @@ -317,7 +317,7 @@ public: void V3LinkLValue::linkLValue(AstNetlist* nodep) { UINFO(4, __FUNCTION__ << ": " << endl); { LinkLValueVisitor{nodep, VAccess::NOCHANGE}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("linklvalue", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("linklvalue", 0, dumpTreeEitherLevel() >= 6); } void V3LinkLValue::linkLValueSet(AstNode* nodep) { // Called by later link functions when it is known a node needs diff --git a/src/V3LinkLevel.cpp b/src/V3LinkLevel.cpp index f6d19543a..4fbdc657f 100644 --- a/src/V3LinkLevel.cpp +++ b/src/V3LinkLevel.cpp @@ -82,7 +82,7 @@ void V3LinkLevel::modSortByLevel() { UASSERT_OBJ(!v3Global.rootp()->modulesp(), v3Global.rootp(), "Unlink didn't work"); for (AstNodeModule* nodep : mods) v3Global.rootp()->addModulesp(nodep); UINFO(9, "modSortByLevel() done\n"); // Comment required for gcc4.6.3 / bug666 - V3Global::dumpCheckGlobalTree("cells", false, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("cells", false, dumpTreeEitherLevel() >= 3); } void V3LinkLevel::timescaling(const ModVec& mods) { @@ -178,7 +178,7 @@ void V3LinkLevel::wrapTop(AstNetlist* rootp) { } } - V3Global::dumpCheckGlobalTree("wraptop", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("wraptop", 0, dumpTreeEitherLevel() >= 6); } void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index 7980a7336..275608f98 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -919,5 +919,5 @@ public: void V3LinkParse::linkParse(AstNetlist* rootp) { UINFO(4, __FUNCTION__ << ": " << endl); { LinkParseVisitor{rootp}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("linkparse", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("linkparse", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index 0507decdf..03a655aa3 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -515,5 +515,5 @@ void V3LinkResolve::linkResolve(AstNetlist* rootp) { const LinkResolveVisitor visitor{rootp}; LinkBotupVisitor{rootp}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("linkresolve", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("linkresolve", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index b92751c89..7a16c5352 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -219,5 +219,5 @@ public: void V3Localize::localizeAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { LocalizeVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("localize", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("localize", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3MergeCond.cpp b/src/V3MergeCond.cpp index 55e674808..82add8465 100644 --- a/src/V3MergeCond.cpp +++ b/src/V3MergeCond.cpp @@ -884,5 +884,5 @@ public: void V3MergeCond::mergeAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { MergeCondVisitor{nodep}; } - V3Global::dumpCheckGlobalTree("merge_cond", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("merge_cond", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Name.cpp b/src/V3Name.cpp index 481539e64..4631c145e 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -141,5 +141,5 @@ public: void V3Name::nameAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { NameVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("name", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("name", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 340f4c48f..9afd8452e 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -777,7 +777,7 @@ void V3Options::notify() VL_MT_DISABLED { FileLine* const cmdfl = new FileLine{FileLine::commandLineFilename()}; if (!outFormatOk() && v3Global.opt.main()) ccSet(); // --main implies --cc if not provided - if (!outFormatOk() && !dpiHdrOnly() && !lintOnly() && !preprocOnly() && !xmlOnly()) { + if (!outFormatOk() && !dpiHdrOnly() && !lintOnly() && !preprocOnly() && !serializeOnly()) { v3fatal("verilator: Need --binary, --cc, --sc, --dpi-hdr-only, --lint-only, " "--xml-only or --E option"); } @@ -847,14 +847,14 @@ void V3Options::notify() VL_MT_DISABLED { !v3Global.opt.dpiHdrOnly() // && !v3Global.opt.lintOnly() // && !v3Global.opt.preprocOnly() // - && !v3Global.opt.xmlOnly()); + && !v3Global.opt.serializeOnly()); } if (v3Global.opt.makeDepend().isDefault()) { v3Global.opt.m_makeDepend.setTrueOrFalse( // !v3Global.opt.dpiHdrOnly() // && !v3Global.opt.lintOnly() // && !v3Global.opt.preprocOnly() // - && !v3Global.opt.xmlOnly()); + && !v3Global.opt.serializeOnly()); } if (trace()) { diff --git a/src/V3Options.h b/src/V3Options.h index 5db70ffe6..c80e92875 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -516,6 +516,7 @@ public: bool vpi() const { return m_vpi; } bool xInitialEdge() const { return m_xInitialEdge; } bool xmlOnly() const { return m_xmlOnly; } + bool serializeOnly() const { return m_xmlOnly; } bool topIfacesSupported() const { return lintOnly() && !hierarchical(); } int buildJobs() const VL_MT_SAFE { return m_buildJobs; } diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 028be731b..806dedf9a 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -1479,5 +1479,5 @@ public: void V3Param::param(AstNetlist* rootp) { UINFO(2, __FUNCTION__ << ": " << endl); { ParamVisitor{rootp}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("param", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("param", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 08ab03e69..b313df5c9 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -345,5 +345,5 @@ public: void V3Premit::premitAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { PremitVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("premit", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("premit", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index ecdd7824e..492f42129 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -435,7 +435,7 @@ void V3Randomize::randomizeNetlist(AstNetlist* nodep) { const RandomizeMarkVisitor markVisitor{nodep}; RandomizeVisitor{nodep}; } - V3Global::dumpCheckGlobalTree("randomize", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("randomize", 0, dumpTreeEitherLevel() >= 3); } AstFunc* V3Randomize::newRandomizeFunc(AstClass* nodep) { diff --git a/src/V3Reloop.cpp b/src/V3Reloop.cpp index 3149ac55d..c7329c8ad 100644 --- a/src/V3Reloop.cpp +++ b/src/V3Reloop.cpp @@ -268,5 +268,5 @@ public: void V3Reloop::reloopAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ReloopVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("reloop", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("reloop", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Sched.cpp b/src/V3Sched.cpp index 59014e149..331301a88 100644 --- a/src/V3Sched.cpp +++ b/src/V3Sched.cpp @@ -1383,7 +1383,7 @@ void schedule(AstNetlist* netlistp) { netlistp->dpiExportTriggerp(nullptr); - V3Global::dumpCheckGlobalTree("sched", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("sched", 0, dumpTreeEitherLevel() >= 3); } } // namespace V3Sched diff --git a/src/V3SchedTiming.cpp b/src/V3SchedTiming.cpp index d83d82e61..eda28aa16 100644 --- a/src/V3SchedTiming.cpp +++ b/src/V3SchedTiming.cpp @@ -429,7 +429,7 @@ void transformForks(AstNetlist* const netlistp) { ~ForkVisitor() override = default; }; ForkVisitor{netlistp}; - V3Global::dumpCheckGlobalTree("sched_forks", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("sched_forks", 0, dumpTreeEitherLevel() >= 6); } } // namespace V3Sched diff --git a/src/V3SchedVirtIface.cpp b/src/V3SchedVirtIface.cpp index 270c62aae..5093991c7 100644 --- a/src/V3SchedVirtIface.cpp +++ b/src/V3SchedVirtIface.cpp @@ -225,7 +225,7 @@ VirtIfaceTriggers makeVirtIfaceTriggers(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); if (v3Global.hasVirtIfaces()) { VirtIfaceVisitor visitor{nodep}; - V3Global::dumpCheckGlobalTree("sched_vif", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("sched_vif", 0, dumpTreeEitherLevel() >= 6); return visitor.take_triggers(); } return {}; diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index c8eb247d2..6436b9932 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -416,5 +416,5 @@ void V3Scope::scopeAll(AstNetlist* nodep) { const ScopeVisitor visitor{nodep}; ScopeCleanupVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("scope", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("scope", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp index 69ecca56f..f2fe8cb7e 100644 --- a/src/V3Slice.cpp +++ b/src/V3Slice.cpp @@ -335,5 +335,5 @@ public: void V3Slice::sliceAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { SliceVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("slice", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("slice", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Split.cpp b/src/V3Split.cpp index b2e7e8d22..e2eb6c757 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -1005,10 +1005,10 @@ private: void V3Split::splitReorderAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { ReorderVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("reorder", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("reorder", 0, dumpTreeEitherLevel() >= 3); } void V3Split::splitAlwaysAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { SplitVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("split", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("split", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3SplitAs.cpp b/src/V3SplitAs.cpp index e63f0d8e8..029144d52 100644 --- a/src/V3SplitAs.cpp +++ b/src/V3SplitAs.cpp @@ -192,5 +192,5 @@ public: void V3SplitAs::splitAsAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { SplitAsVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("splitas", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("splitas", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 9bb0b1ea5..1247581db 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -1242,9 +1242,9 @@ void V3SplitVar::splitVariable(AstNetlist* nodep) { const SplitUnpackedVarVisitor visitor{nodep}; refs = visitor.getPackedVarRefs(); } - V3Global::dumpCheckGlobalTree("split_var", 0, dumpTreeLevel() >= 9); + V3Global::dumpCheckGlobalTree("split_var", 0, dumpTreeEitherLevel() >= 9); { SplitPackedVarVisitor{nodep, refs}; } - V3Global::dumpCheckGlobalTree("split_var", 0, dumpTreeLevel() >= 9); + V3Global::dumpCheckGlobalTree("split_var", 0, dumpTreeEitherLevel() >= 9); } bool V3SplitVar::canSplitVar(const AstVar* varp) { diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index 643a051f1..5b68583a9 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -384,5 +384,5 @@ public: void V3Subst::substituteAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { SubstVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("subst", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("subst", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Table.cpp b/src/V3Table.cpp index 06ffe06b8..c958c87e8 100644 --- a/src/V3Table.cpp +++ b/src/V3Table.cpp @@ -427,5 +427,5 @@ void TableSimulateVisitor::varRefCb(AstVarRef* nodep) { void V3Table::tableAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { TableVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("table", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("table", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 021da7f20..62d0f8c05 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -1981,5 +1981,5 @@ void V3Task::taskAll(AstNetlist* nodep) { TaskStateVisitor visitors{nodep}; const TaskVisitor visitor{nodep, &visitors}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("task", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("task", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Timing.cpp b/src/V3Timing.cpp index b9993687a..48aa5c017 100644 --- a/src/V3Timing.cpp +++ b/src/V3Timing.cpp @@ -1237,5 +1237,5 @@ void V3Timing::timingAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); TimingSuspendableVisitor susVisitor{nodep}; if (v3Global.usesTiming()) TimingControlVisitor{nodep}; - V3Global::dumpCheckGlobalTree("timing", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("timing", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 6be90173a..ef3795b7c 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -918,5 +918,5 @@ public: void V3Trace::traceAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { TraceVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("trace", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("trace", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp index 47986dbd6..cceee8a5c 100644 --- a/src/V3TraceDecl.cpp +++ b/src/V3TraceDecl.cpp @@ -691,5 +691,5 @@ public: void V3TraceDecl::traceDeclAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { TraceDeclVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("tracedecl", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("tracedecl", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index 48f1e8d46..56cf939f8 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -1814,5 +1814,5 @@ public: void V3Tristate::tristateAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { TristateVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("tristate", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("tristate", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp index cb34c7ed3..69fca0873 100644 --- a/src/V3Unknown.cpp +++ b/src/V3Unknown.cpp @@ -525,5 +525,5 @@ public: void V3Unknown::unknownAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { UnknownVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("unknown", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("unknown", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index ae92a5230..076b0518a 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -512,5 +512,5 @@ void V3Unroll::unrollAll(AstNetlist* nodep) { UnrollStateful unroller; unroller.unrollAll(nodep); } // Destruct before checking - V3Global::dumpCheckGlobalTree("unroll", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("unroll", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3VariableOrder.cpp b/src/V3VariableOrder.cpp index 7bddc69a6..cc02a8a6c 100644 --- a/src/V3VariableOrder.cpp +++ b/src/V3VariableOrder.cpp @@ -202,5 +202,5 @@ void V3VariableOrder::orderAll() { modp = VN_AS(modp->nextp(), NodeModule)) { VariableOrder::processModule(modp); } - V3Global::dumpCheckGlobalTree("variableorder", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("variableorder", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 13afe74f3..d6cfaae8f 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -7620,7 +7620,7 @@ void V3Width::width(AstNetlist* nodep) { WidthRemoveVisitor rvisitor; (void)rvisitor.mainAcceptEdit(nodep); } // Destruct before checking - V3Global::dumpCheckGlobalTree("width", 0, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("width", 0, dumpTreeEitherLevel() >= 3); } //! Single node parameter propagation //! Smaller step... Only do a single node for parameter propagation diff --git a/src/V3WidthCommit.cpp b/src/V3WidthCommit.cpp index c3ac9bc95..174d25605 100644 --- a/src/V3WidthCommit.cpp +++ b/src/V3WidthCommit.cpp @@ -232,5 +232,5 @@ public: void V3WidthCommit::widthCommit(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { WidthCommitVisitor{nodep}; } // Destruct before checking - V3Global::dumpCheckGlobalTree("widthcommit", 0, dumpTreeLevel() >= 6); + V3Global::dumpCheckGlobalTree("widthcommit", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/Verilator.cpp b/src/Verilator.cpp index cee743a50..3c4cea294 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -151,7 +151,7 @@ static void process() { if (v3Global.opt.stats()) V3Stats::statsStageAll(v3Global.rootp(), "Link"); if (v3Global.opt.debugExitUvm23()) { V3Error::abortIfErrors(); - if (v3Global.opt.xmlOnly()) V3EmitXml::emitxml(); + if (v3Global.opt.serializeOnly()) V3EmitXml::emitxml(); cout << "--debug-exit-uvm23: Exiting after UVM-supported pass\n"; std::exit(0); } @@ -168,7 +168,8 @@ static void process() { v3Global.checkTree(); // Create a hierarchical Verilation plan - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly() && v3Global.opt.hierarchical()) { + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly() + && v3Global.opt.hierarchical()) { V3HierBlockPlan::createPlan(v3Global.rootp()); // If a plan is created, further analysis is not necessary. // The actual Verilation will be done based on this plan. @@ -179,7 +180,7 @@ static void process() { } if (v3Global.opt.debugExitUvm()) { V3Error::abortIfErrors(); - if (v3Global.opt.xmlOnly()) V3EmitXml::emitxml(); + if (v3Global.opt.serializeOnly()) V3EmitXml::emitxml(); cout << "--debug-exit-uvm: Exiting after UVM-supported pass\n"; std::exit(0); } @@ -215,7 +216,7 @@ static void process() { // V3Assert::assertAll(v3Global.rootp()); - if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) { + if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) { // Add top level wrapper with instance pointing to old top // Move packages to under new top // Must do this after we know parameters and dtypes (as don't clone dtype decls) @@ -225,7 +226,7 @@ static void process() { // Propagate constants into expressions if (v3Global.opt.fConstBeforeDfg()) V3Const::constifyAllLint(v3Global.rootp()); - if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) { + if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) { // Split packed variables into multiple pieces to resolve UNOPTFLAT. // should be after constifyAllLint() which flattens to 1D bit vector V3SplitVar::splitVariable(v3Global.rootp()); @@ -250,7 +251,7 @@ static void process() { V3Tristate::tristateAll(v3Global.rootp()); } - if (!v3Global.opt.xmlOnly()) { + if (!v3Global.opt.serializeOnly()) { // Move assignments from X into MODULE temps. // (Before flattening, so each new X variable is shared between all scopes of that // module.) @@ -268,7 +269,7 @@ static void process() { V3DfgOptimizer::optimize(v3Global.rootp(), " pre inline"); } - if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) { + if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) { // Module inlining // Cannot remove dead variables after this, as alias information for final // V3Scope's V3LinkDot is in the AstVar. @@ -298,7 +299,7 @@ static void process() { // --FLATTENING--------------- - if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) { + if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) { // We're going to flatten the hierarchy, so as many optimizations that // can be done as possible should be before this.... @@ -318,25 +319,25 @@ static void process() { // --SCOPE BASED OPTIMIZATIONS-------------- - if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) { + if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) { // Cleanup V3Const::constifyAll(v3Global.rootp()); V3Dead::deadifyDTypesScoped(v3Global.rootp()); v3Global.checkTree(); } - if (!v3Global.opt.xmlOnly()) { + if (!v3Global.opt.serializeOnly()) { // Convert case statements to if() blocks. Must be after V3Unknown // Must be before V3Task so don't need to deal with task in case value compares V3Case::caseAll(v3Global.rootp()); } - if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) { + if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) { // Inline all tasks V3Task::taskAll(v3Global.rootp()); } - if (!v3Global.opt.xmlOnly()) { + if (!v3Global.opt.serializeOnly()) { // Add __PVT's // After V3Task so task internal variables will get renamed V3Name::nameAll(v3Global.rootp()); @@ -449,7 +450,7 @@ static void process() { // --MODULE OPTIMIZATIONS-------------- - if (!v3Global.opt.xmlOnly()) { + if (!v3Global.opt.serializeOnly()) { // Split deep blocks to appease MSVC++. Must be before Localize. if (!v3Global.opt.lintOnly() && v3Global.opt.compLimitBlocks()) { V3DepthBlock::depthBlockAll(v3Global.rootp()); @@ -472,7 +473,7 @@ static void process() { // --GENERATION------------------ - if (!v3Global.opt.xmlOnly()) { + if (!v3Global.opt.serializeOnly()) { // Remove unused vars V3Const::constifyAll(v3Global.rootp()); V3Dead::deadifyAll(v3Global.rootp()); @@ -489,24 +490,24 @@ static void process() { } // Expand macros and wide operators into C++ primitives - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly() && v3Global.opt.fExpand()) { + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly() && v3Global.opt.fExpand()) { V3Expand::expandAll(v3Global.rootp()); } // Propagate constants across WORDSEL arrayed temporaries - if (!v3Global.opt.xmlOnly() && v3Global.opt.fSubst()) { + if (!v3Global.opt.serializeOnly() && v3Global.opt.fSubst()) { // Constant folding of expanded stuff V3Const::constifyCpp(v3Global.rootp()); V3Subst::substituteAll(v3Global.rootp()); } - if (!v3Global.opt.xmlOnly() && v3Global.opt.fSubstConst()) { + if (!v3Global.opt.serializeOnly() && v3Global.opt.fSubstConst()) { // Constant folding of substitutions V3Const::constifyCpp(v3Global.rootp()); V3Dead::deadifyAll(v3Global.rootp()); } - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly()) { + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly()) { if (v3Global.opt.fMergeCond()) { // Merge conditionals V3MergeCond::mergeAll(v3Global.rootp()); @@ -531,11 +532,11 @@ static void process() { } V3Error::abortIfErrors(); - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly()) { // + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly()) { // V3CCtors::cctorsAll(); } - if (!v3Global.opt.xmlOnly() && v3Global.opt.mtasks()) { + if (!v3Global.opt.serializeOnly() && v3Global.opt.mtasks()) { // Finalize our MTask cost estimates and pack the mtasks into // threads. Must happen pre-EmitC which relies on the packing // order. Must happen post-V3LifePost which changes the relative @@ -543,7 +544,8 @@ static void process() { V3Partition::finalize(v3Global.rootp()); } - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly() && !v3Global.opt.dpiHdrOnly()) { + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly() + && !v3Global.opt.dpiHdrOnly()) { // Add common methods/etc to modules V3Common::commonAll(); @@ -555,7 +557,8 @@ static void process() { } // Output the text - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly() && !v3Global.opt.dpiHdrOnly()) { + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly() + && !v3Global.opt.dpiHdrOnly()) { // emitcInlines is first, as it may set needHInlines which other emitters read V3EmitC::emitcInlines(); V3EmitC::emitcSyms(); @@ -567,13 +570,13 @@ static void process() { V3EmitC::emitcSyms(true); } } - if (!v3Global.opt.xmlOnly() + if (!v3Global.opt.serializeOnly() && !v3Global.opt.dpiHdrOnly()) { // Unfortunately we have some lint checks in emitcImp. V3EmitC::emitcImp(); } { const V3MtDisabledLockGuard mtDisabler{v3MtDisabledLock()}; - if (v3Global.opt.xmlOnly() + if (v3Global.opt.serializeOnly() // Check XML when debugging to make sure no missing node types || (v3Global.opt.debugCheck() && !v3Global.opt.lintOnly() && !v3Global.opt.dpiHdrOnly())) { @@ -590,7 +593,8 @@ static void process() { V3EmitC::emitcFiles(); } - if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly() && !v3Global.opt.dpiHdrOnly()) { + if (!v3Global.opt.lintOnly() && !v3Global.opt.serializeOnly() + && !v3Global.opt.dpiHdrOnly()) { if (v3Global.opt.main()) V3EmitCMain::emit(); // V3EmitMk/V3EmitCMake must be after all other emitters, @@ -679,7 +683,7 @@ static void verilate(const string& argString) { } // Final steps - V3Global::dumpCheckGlobalTree("final", 990, dumpTreeLevel() >= 3); + V3Global::dumpCheckGlobalTree("final", 990, dumpTreeEitherLevel() >= 3); V3Error::abortIfErrors();