From 46c7b69c6413aa3fab45ba420e16978f62f332f3 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 22 May 2025 20:29:32 -0400 Subject: [PATCH] Internals: UINFO now includes newline itself. No functional change. --- src/V3Active.cpp | 2 +- src/V3ActiveTop.cpp | 10 +- src/V3Assert.cpp | 6 +- src/V3AssertPre.cpp | 14 +- src/V3Ast.cpp | 16 +- src/V3Begin.cpp | 28 +-- src/V3Branch.cpp | 6 +- src/V3Broken.cpp | 4 +- src/V3CCtors.cpp | 2 +- src/V3CUse.cpp | 4 +- src/V3Case.cpp | 8 +- src/V3Cast.cpp | 4 +- src/V3Class.cpp | 6 +- src/V3Clean.cpp | 4 +- src/V3Clock.cpp | 2 +- src/V3Combine.cpp | 6 +- src/V3Common.cpp | 2 +- src/V3Config.cpp | 12 +- src/V3Const.cpp | 117 ++++++----- src/V3Coverage.cpp | 42 ++-- src/V3CoverageJoin.cpp | 10 +- src/V3Dead.cpp | 22 +-- src/V3Delayed.cpp | 2 +- src/V3Depth.cpp | 6 +- src/V3DepthBlock.cpp | 8 +- src/V3Descope.cpp | 23 ++- src/V3DfgOptimizer.cpp | 6 +- src/V3DfgPeephole.cpp | 2 +- src/V3DiagSarif.cpp | 4 +- src/V3DupFinder.cpp | 2 +- src/V3EmitCConstPool.cpp | 2 +- src/V3EmitCFunc.cpp | 2 +- src/V3EmitCHeaders.cpp | 4 +- src/V3EmitCImp.cpp | 6 +- src/V3EmitCInlines.cpp | 2 +- src/V3EmitCMain.cpp | 2 +- src/V3EmitCMake.cpp | 2 +- src/V3EmitCModel.cpp | 2 +- src/V3EmitCPch.cpp | 2 +- src/V3EmitCSyms.cpp | 16 +- src/V3EmitMk.cpp | 20 +- src/V3EmitMkJson.cpp | 2 +- src/V3EmitV.cpp | 4 +- src/V3EmitXml.cpp | 2 +- src/V3Error.h | 14 +- src/V3ExecGraph.cpp | 39 ++-- src/V3Expand.cpp | 66 +++---- src/V3File.cpp | 28 +-- src/V3Force.cpp | 2 +- src/V3Fork.cpp | 18 +- src/V3FuncOpt.cpp | 10 +- src/V3Gate.cpp | 46 ++--- src/V3GraphAcyc.cpp | 34 ++-- src/V3GraphAlg.cpp | 2 +- src/V3GraphTest.cpp | 2 +- src/V3Hasher.cpp | 2 +- src/V3HierBlock.cpp | 9 +- src/V3Inline.cpp | 28 +-- src/V3Inst.cpp | 33 ++-- src/V3InstrCount.cpp | 10 +- src/V3Interface.cpp | 2 +- src/V3Life.cpp | 44 ++--- src/V3LifePost.cpp | 6 +- src/V3LinkCells.cpp | 22 +-- src/V3LinkDot.cpp | 359 ++++++++++++++++------------------ src/V3LinkInc.cpp | 4 +- src/V3LinkJump.cpp | 12 +- src/V3LinkLValue.cpp | 8 +- src/V3LinkLevel.cpp | 21 +- src/V3LinkParse.cpp | 18 +- src/V3LinkResolve.cpp | 10 +- src/V3Localize.cpp | 10 +- src/V3MergeCond.cpp | 4 +- src/V3Name.cpp | 2 +- src/V3Number.cpp | 22 +-- src/V3Options.cpp | 6 +- src/V3OrderParallel.cpp | 48 ++--- src/V3OrderProcessDomains.cpp | 12 +- src/V3OrderSerial.cpp | 2 +- src/V3Os.cpp | 14 +- src/V3Param.cpp | 65 +++--- src/V3ParseGrammar.cpp | 4 +- src/V3ParseImp.cpp | 18 +- src/V3PreExpr.h | 16 +- src/V3PreProc.cpp | 77 ++++---- src/V3PreShell.cpp | 4 +- src/V3Premit.cpp | 10 +- src/V3ProtectLib.cpp | 2 +- src/V3Randomize.cpp | 10 +- src/V3Reloop.cpp | 16 +- src/V3Sampled.cpp | 4 +- src/V3Sched.cpp | 2 +- src/V3SchedPartition.cpp | 2 +- src/V3SchedVirtIface.cpp | 2 +- src/V3Scope.cpp | 32 +-- src/V3Simulate.h | 39 ++-- src/V3Slice.cpp | 16 +- src/V3Split.cpp | 50 ++--- src/V3SplitAs.cpp | 16 +- src/V3SplitVar.cpp | 50 +++-- src/V3StackCount.cpp | 10 +- src/V3Stats.cpp | 2 +- src/V3StatsReport.cpp | 2 +- src/V3String.cpp | 2 +- src/V3Subst.cpp | 30 ++- src/V3SymTable.h | 15 +- src/V3TSP.cpp | 16 +- src/V3Table.cpp | 20 +- src/V3Task.cpp | 40 ++-- src/V3Timing.cpp | 4 +- src/V3Trace.cpp | 22 +-- src/V3TraceDecl.cpp | 8 +- src/V3Tristate.cpp | 130 ++++++------ src/V3Udp.cpp | 2 +- src/V3Undriven.cpp | 20 +- src/V3Unknown.cpp | 24 +-- src/V3Unroll.cpp | 30 +-- src/V3VariableOrder.cpp | 2 +- src/V3Width.cpp | 219 +++++++++++---------- src/V3WidthCommit.cpp | 10 +- src/V3WidthRemove.h | 2 +- src/V3WidthSel.cpp | 30 +-- src/Verilator.cpp | 12 +- src/VlcBucket.h | 4 +- src/VlcMain.cpp | 4 +- src/VlcPoint.h | 2 +- src/VlcTest.h | 2 +- src/VlcTop.cpp | 28 +-- src/astgen | 2 +- 129 files changed, 1259 insertions(+), 1287 deletions(-) diff --git a/src/V3Active.cpp b/src/V3Active.cpp index ca1c12d51..34b87d2fc 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -647,7 +647,7 @@ public: // Active class functions void V3Active::activeAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ActiveVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("active", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3ActiveTop.cpp b/src/V3ActiveTop.cpp index 91248a918..b432f0506 100644 --- a/src/V3ActiveTop.cpp +++ b/src/V3ActiveTop.cpp @@ -61,11 +61,11 @@ class ActiveTopVisitor final : public VNVisitor { void visit(AstNodeModule* nodep) override { // Create required actives and add to module // We can start ordering at a module, or a scope - UINFO(4, " MOD " << nodep << endl); + UINFO(4, " MOD " << nodep); iterateChildren(nodep); } void visit(AstActive* nodep) override { - UINFO(4, " ACTIVE " << nodep << endl); + UINFO(4, " ACTIVE " << nodep); // Remove duplicate clocks and such; sensesp() may change! V3Const::constifyExpensiveEdit(nodep); AstSenTree* sensesp = nodep->sensesp(); @@ -95,10 +95,10 @@ class ActiveTopVisitor final : public VNVisitor { // Move the SENTREE for each active up to the global level. // This way we'll easily see what clock domains are identical AstSenTree* const wantp = m_finder.getSenTree(sensesp); - UINFO(4, " lookdone\n"); + UINFO(4, " lookdone"); if (wantp != sensesp) { // Move the active's contents to the other active - UINFO(4, " merge active " << sensesp << " into " << wantp << endl); + UINFO(4, " merge active " << sensesp << " into " << wantp); if (nodep->sensesStorep()) { UASSERT_OBJ(sensesp == nodep->sensesStorep(), nodep, "sensesStore should have been deleted earlier if different"); @@ -155,7 +155,7 @@ public: // Active class functions void V3ActiveTop::activeTopAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ActiveTopVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("activetop", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index 0c6b848c7..d62f01066 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -635,7 +635,7 @@ class AssertVisitor final : public VNVisitor { FileLine* const fl = nodep->fileline(); switch (nodep->ctlType()) { case VAssertCtlType::ON: - UINFO(9, "Generating assertctl for a module: " << m_modp << endl); + UINFO(9, "Generating assertctl for a module: " << m_modp); nodep->replaceWith(new AstCExpr{ fl, "vlSymsp->_vm_contextp__->assertOnSet("s + std::to_string(nodep->ctlAssertTypes()) @@ -644,7 +644,7 @@ class AssertVisitor final : public VNVisitor { break; case VAssertCtlType::OFF: case VAssertCtlType::KILL: { - UINFO(9, "Generating assertctl for a module: " << m_modp << endl); + UINFO(9, "Generating assertctl for a module: " << m_modp); nodep->replaceWith(new AstCExpr{fl, "vlSymsp->_vm_contextp__->assertOnClear("s + std::to_string(nodep->ctlAssertTypes()) + " ,"s @@ -725,7 +725,7 @@ public: // Top Assert class void V3Assert::assertAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { AssertVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("assert", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp index 2761344df..8d1bc1e5a 100644 --- a/src/V3AssertPre.cpp +++ b/src/V3AssertPre.cpp @@ -156,7 +156,7 @@ private: void visit(AstClocking* const nodep) override { VL_RESTORER(m_clockingp); m_clockingp = nodep; - UINFO(8, " CLOCKING" << nodep << endl); + UINFO(8, " CLOCKING" << nodep); iterateChildren(nodep); if (nodep->eventp()) nodep->addNextHere(nodep->eventp()->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); @@ -359,9 +359,9 @@ private: } } void visit(AstNodeVarRef* nodep) override { - UINFO(8, " -varref: " << nodep << endl); - UINFO(8, " -varref-var-back: " << nodep->varp()->backp() << endl); - UINFO(8, " -varref-var-user1: " << nodep->varp()->user1p() << endl); + UINFO(8, " -varref: " << nodep); + UINFO(8, " -varref-var-back: " << nodep->varp()->backp()); + UINFO(8, " -varref-var-user1: " << nodep->varp()->user1p()); if (AstClockingItem* const itemp = VN_CAST( nodep->varp()->user1p() ? nodep->varp()->user1p() : nodep->varp()->firstAbovep(), ClockingItem)) { @@ -369,12 +369,12 @@ private: // ensure linking still works, this has to be done only once if (AstVarXRef* xrefp = VN_CAST(nodep, VarXRef)) { - UINFO(8, " -clockvarxref-in: " << xrefp << endl); + UINFO(8, " -clockvarxref-in: " << xrefp); string dotted = xrefp->dotted(); const size_t dotPos = dotted.rfind('.'); dotted.erase(dotPos, string::npos); xrefp->dotted(dotted); - UINFO(8, " -clockvarxref-out: " << xrefp << endl); + UINFO(8, " -clockvarxref-out: " << xrefp); m_xrefsp.emplace_back(xrefp); } @@ -613,7 +613,7 @@ public: // Top Assert class void V3AssertPre::assertPreAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { AssertPreVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("assertpre", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 26cbabc4e..a55d9e45e 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -671,7 +671,7 @@ AstNode* AstNode::unlinkFrBack(VNRelinker* linkerp) { void AstNode::relink(VNRelinker* linkerp) { if (debug() > 8) { - UINFO(0, " EDIT: relink: "); + UINFO_PREFIX(" EDIT: relink: "); dumpPtrs(); } AstNode* const newp = this; @@ -1344,7 +1344,7 @@ void AstNode::dumpTreeFile(const string& filename, bool doDump) { // Not const function as calls checkTree if (doDump) { { // Write log & close - UINFO(2, "Dumping " << filename << endl); + UINFO(2, "Dumping " << filename); const std::unique_ptr logsp{V3File::new_ofstream(filename)}; if (logsp->fail()) v3fatal("Can't write file: " << filename); *logsp << "Verilator Tree Dump (format 0x3900) from treejsonp{V3File::new_ofstream(filename)}; if (treejsonp->fail()) v3fatal("Can't write file: " << filename); dumpTreeJson(*treejsonp); @@ -1398,7 +1398,7 @@ void AstNode::dumpTreeJsonFile(const string& filename, bool doDump) { void AstNode::dumpJsonMetaFileGdb(const char* filename) { dumpJsonMetaFile(filename); } void AstNode::dumpJsonMetaFile(const string& filename) { - UINFO(2, "Dumping " << filename << endl); + UINFO(2, "Dumping " << filename); const std::unique_ptr treejsonp{V3File::new_ofstream(filename)}; if (treejsonp->fail()) v3fatalStatic("Can't write file: " << filename); *treejsonp << '{'; @@ -1412,7 +1412,7 @@ void AstNode::dumpJsonMetaFile(const string& filename) { void AstNode::dumpTreeDotFile(const string& filename, bool doDump) { if (doDump) { - UINFO(2, "Dumping " << filename << endl); + UINFO(2, "Dumping " << filename); const std::unique_ptr treedotp{V3File::new_ofstream(filename)}; if (treedotp->fail()) v3fatal("Can't write file: " << filename); *treedotp << "digraph vTree{\n"; @@ -1608,9 +1608,9 @@ static VCastable computeCastableImp(const AstNodeDType* toDtp, const AstNodeDTyp VCastable AstNode::computeCastable(const AstNodeDType* toDtp, const AstNodeDType* fromDtp, const AstNode* fromConstp) { const auto castable = computeCastableImp(toDtp, fromDtp, fromConstp); - UINFO(9, " castable=" << castable << " for " << toDtp << endl); - UINFO(9, " =?= " << fromDtp << endl); - if (fromConstp) UINFO(9, " const= " << fromConstp << endl); + UINFO(9, " castable=" << castable << " for " << toDtp); + UINFO(9, " =?= " << fromDtp); + if (fromConstp) UINFO(9, " const= " << fromConstp); return castable; } diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index f66ed625c..cc2fd557f 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -74,7 +74,7 @@ class BeginVisitor final : public VNVisitor { string dot(const string& a, const string& b) { return VString::dot(a, "__DOT__", b); } void dotNames(const AstNodeBlock* const nodep, const char* const blockName) { - UINFO(8, "nname " << m_namedScope << endl); + UINFO(8, "nname " << m_namedScope); if (nodep->name() != "") { // Else unneeded unnamed block // Create data for dotted variable resolution string dottedname = nodep->name() + "__DOT__"; // So always found @@ -149,7 +149,7 @@ class BeginVisitor final : public VNVisitor { // Rename it (e.g. class under a generate) if (m_unnamedScope != "") { nodep->name(dot(m_unnamedScope, nodep->name())); - UINFO(8, " rename to " << nodep->name() << endl); + UINFO(8, " rename to " << nodep->name()); m_statep->userMarkChanged(nodep); } VL_RESTORER(m_displayScope); @@ -161,11 +161,11 @@ class BeginVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstNodeFTask* nodep) override { - UINFO(8, " " << nodep << endl); + UINFO(8, " " << nodep); // Rename it if (m_unnamedScope != "") { nodep->name(dot(m_unnamedScope, nodep->name())); - UINFO(8, " rename to " << nodep->name() << endl); + UINFO(8, " rename to " << nodep->name()); m_statep->userMarkChanged(nodep); } // BEGIN wrapping a function rename that function, but don't affect @@ -200,7 +200,7 @@ class BeginVisitor final : public VNVisitor { } void visit(AstBegin* nodep) override { // Begin blocks were only useful in variable creation, change names and delete - UINFO(8, " " << nodep << endl); + UINFO(8, " " << nodep); VL_RESTORER(m_displayScope); VL_RESTORER(m_namedScope); VL_RESTORER(m_unnamedScope); @@ -255,12 +255,12 @@ class BeginVisitor final : public VNVisitor { } } void visit(AstCell* nodep) override { - UINFO(8, " CELL " << nodep << endl); + UINFO(8, " CELL " << nodep); if (m_namedScope != "") { m_statep->userMarkChanged(nodep); // Rename it nodep->name(dot(m_namedScope, nodep->name())); - UINFO(8, " rename to " << nodep->name() << endl); + UINFO(8, " rename to " << nodep->name()); // Move to module nodep->unlinkFrBack(); m_modp->addStmtsp(nodep); @@ -268,10 +268,10 @@ class BeginVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstVarXRef* nodep) override { - UINFO(9, " VARXREF " << nodep << endl); + UINFO(9, " VARXREF " << nodep); if (m_namedScope != "" && nodep->inlinedDots() == "" && !m_ftaskp) { nodep->inlinedDots(m_namedScope); - UINFO(9, " rescope to " << nodep << endl); + UINFO(9, " rescope to " << nodep); } } void visit(AstScopeName* nodep) override { @@ -339,23 +339,23 @@ private: void visit(AstNodeFTaskRef* nodep) override { UASSERT_OBJ(nodep->taskp(), nodep, "unlinked"); if (nodep->taskp()->user1()) { // It was converted - UINFO(9, " relinkFTask " << nodep << endl); + UINFO(9, " relinkFTask " << nodep); nodep->name(nodep->taskp()->name()); } iterateChildrenConst(nodep); } void visit(AstVarRef* nodep) override { if (nodep->varp()->user1()) { // It was converted - UINFO(9, " relinVarRef " << nodep << endl); + UINFO(9, " relinVarRef " << nodep); } iterateChildrenConst(nodep); } void visit(AstIfaceRefDType* nodep) override { // May have changed cell names // TypeTable is always after all modules, so names are stable - UINFO(8, " IFACEREFDTYPE " << nodep << endl); + UINFO(8, " IFACEREFDTYPE " << nodep); if (nodep->cellp()) nodep->cellName(nodep->cellp()->name()); - UINFO(8, " rename to " << nodep << endl); + UINFO(8, " rename to " << nodep); iterateChildrenConst(nodep); } //-------------------- @@ -371,7 +371,7 @@ public: // Task class functions void V3Begin::debeginAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { BeginState state; { BeginVisitor{nodep, &state}; } diff --git a/src/V3Branch.cpp b/src/V3Branch.cpp index 56ee3f0b8..72203bd8e 100644 --- a/src/V3Branch.cpp +++ b/src/V3Branch.cpp @@ -53,14 +53,14 @@ class BranchVisitor final : public VNVisitorConst { } void checkUnlikely(AstNode* nodep) { if (nodep->isUnlikely()) { - UINFO(4, " UNLIKELY: " << nodep << endl); + UINFO(4, " UNLIKELY: " << nodep); m_unlikely++; } } // VISITORS void visit(AstNodeIf* nodep) override { - UINFO(4, " IF: " << nodep << endl); + UINFO(4, " IF: " << nodep); VL_RESTORER(m_likely); VL_RESTORER(m_unlikely); { @@ -119,6 +119,6 @@ public: // Branch class functions void V3Branch::branchAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { BranchVisitor{nodep}; } } diff --git a/src/V3Broken.cpp b/src/V3Broken.cpp index e1b5a73fd..f34c2b7cc 100644 --- a/src/V3Broken.cpp +++ b/src/V3Broken.cpp @@ -332,11 +332,11 @@ public: // Broken check entry point void V3Broken::brokenAll(AstNetlist* nodep) { - // UINFO(9, __FUNCTION__ << ": " << endl); + // UINFO(9, __FUNCTION__ << ": "); static bool inBroken = false; if (VL_UNCOVERABLE(inBroken)) { // A error called by broken can recurse back into broken; avoid this - UINFO(1, "Broken called under broken, skipping recursion.\n"); // LCOV_EXCL_LINE + UINFO(1, "Broken called under broken, skipping recursion."); // LCOV_EXCL_LINE } else { inBroken = true; diff --git a/src/V3CCtors.cpp b/src/V3CCtors.cpp index 92728f867..b90f868c1 100644 --- a/src/V3CCtors.cpp +++ b/src/V3CCtors.cpp @@ -260,7 +260,7 @@ void V3CCtors::evalAsserts() { } void V3CCtors::cctorsAll() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); evalAsserts(); { CCtorsVisitor{v3Global.rootp()}; } V3Global::dumpCheckGlobalTree("cctors", 0, dumpTreeEitherLevel() >= 3); diff --git a/src/V3CUse.cpp b/src/V3CUse.cpp index 1f90291c7..46505673f 100644 --- a/src/V3CUse.cpp +++ b/src/V3CUse.cpp @@ -98,7 +98,7 @@ public: for (auto& used : m_didUse) { AstCUse* const newp = new AstCUse{used.second.first, used.second.second, used.first}; m_modp->addStmtsp(newp); - UINFO(8, "Insert " << newp << endl); + UINFO(8, "Insert " << newp); } } ~CUseVisitor() override = default; @@ -109,7 +109,7 @@ public: // Class class functions void V3CUse::cUseAll() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Call visitor separately for each module, so visitor state is cleared for (AstNodeModule* modp = v3Global.rootp()->modulesp(); modp; modp = VN_AS(modp->nextp(), NodeModule)) { diff --git a/src/V3Case.cpp b/src/V3Case.cpp index 9c934b6a7..c0b3f8648 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -188,7 +188,7 @@ class CaseVisitor final : public VNVisitor { m_caseNoOverlapsAllCovered = false; return false; // Too wide for analysis } - UINFO(8, "Simple case statement: " << nodep << endl); + UINFO(8, "Simple case statement: " << nodep); const uint32_t numCases = 1UL << m_caseWidth; // Zero list of items for each value for (uint32_t i = 0; i < numCases; ++i) m_valueItem[i] = nullptr; @@ -376,7 +376,7 @@ class CaseVisitor final : public VNVisitor { if (debug() >= 9) { // LCOV_EXCL_START for (uint32_t i = 0; i < (1UL << m_caseWidth); ++i) { if (const AstNode* const itemp = m_valueItem[i]) { - UINFO(9, "Value " << std::hex << i << " " << itemp << endl); + UINFO(9, "Value " << std::hex << i << " " << itemp); } } } // LCOV_EXCL_STOP @@ -600,11 +600,11 @@ public: // Case class functions void V3Case::caseAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { CaseVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("case", 0, dumpTreeEitherLevel() >= 3); } void V3Case::caseLint(AstNodeCase* nodep) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); { CaseLintVisitor{nodep}; } } diff --git a/src/V3Cast.cpp b/src/V3Cast.cpp index 3cbd14b09..1cdd43a4d 100644 --- a/src/V3Cast.cpp +++ b/src/V3Cast.cpp @@ -62,7 +62,7 @@ class CastVisitor final : public VNVisitor { // AstCCast* const castp = new AstCCast{nodep->fileline(), nodep, needsize, nodep->widthMin()}; - UINFO(4, " MadeCast " << static_cast(castp) << " for " << nodep << endl); + UINFO(4, " MadeCast " << static_cast(castp) << " for " << nodep); relinkHandle.relink(castp); // if (debug() > 8) castp->dumpTree("- castins: "); // @@ -239,7 +239,7 @@ public: // Cast class functions void V3Cast::castAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { CastVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("cast", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Class.cpp b/src/V3Class.cpp index 3139ded69..af9bfddde 100644 --- a/src/V3Class.cpp +++ b/src/V3Class.cpp @@ -243,7 +243,7 @@ public: for (auto moved : m_toScopeMoves) { AstNode* const nodep = moved.first; AstScope* const scopep = moved.second; - UINFO(9, "moving " << nodep << " to " << scopep << endl); + UINFO(9, "moving " << nodep << " to " << scopep); if (VN_IS(nodep, NodeFTask)) { scopep->addBlocksp(nodep->unlinkFrBack()); } else if (VN_IS(nodep, Var)) { @@ -261,7 +261,7 @@ public: for (auto moved : m_toPackageMoves) { AstNode* const nodep = moved.first; AstNodeModule* const modp = moved.second; - UINFO(9, "moving " << nodep << " to " << modp << endl); + UINFO(9, "moving " << nodep << " to " << modp); nodep->unlinkFrBack(); modp->addStmtsp(nodep); } @@ -294,7 +294,7 @@ public: // Class class functions void V3Class::classAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ClassVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("class", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp index 00590c5c8..c4dc07ff3 100644 --- a/src/V3Clean.cpp +++ b/src/V3Clean.cpp @@ -119,7 +119,7 @@ class CleanVisitor final : public VNVisitor { // Operate on nodes void insertClean(AstNodeExpr* nodep) { // We'll insert ABOVE passed node - UINFO(4, " NeedClean " << nodep << endl); + UINFO(4, " NeedClean " << nodep); VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); // @@ -326,7 +326,7 @@ public: // Clean class functions void V3Clean::cleanAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { CleanVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("clean", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index 0fbdb9a27..72e78ad57 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -191,7 +191,7 @@ public: // Clock class functions void V3Clock::clockAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ClockVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("clock", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index 5eff00462..6fea6c4c9 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -113,8 +113,8 @@ class CombineVisitor final : VNVisitor { if (oldp->user3()) std::swap(oldp, newp); // Something is being replaced - UINFO(9, "Replacing " << oldp << endl); - UINFO(9, " with " << newp << endl); + UINFO(9, "Replacing " << oldp); + UINFO(9, " with " << newp); ++m_cfuncsCombined; replaced = true; @@ -233,7 +233,7 @@ public: // Combine class functions void V3Combine::combineAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); CombineVisitor::apply(nodep); V3Global::dumpCheckGlobalTree("combine", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Common.cpp b/src/V3Common.cpp index 3d0f08885..e41360422 100644 --- a/src/V3Common.cpp +++ b/src/V3Common.cpp @@ -157,7 +157,7 @@ static void makeToStringMiddle(AstClass* nodep) { // V3Common class functions void V3Common::commonAll() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // NODE STATE // Entire netlist: // AstClass::user1() -> bool. True if class needs to_string dumper diff --git a/src/V3Config.cpp b/src/V3Config.cpp index 59d7460cc..91482d6a1 100644 --- a/src/V3Config.cpp +++ b/src/V3Config.cpp @@ -404,17 +404,17 @@ public: void applyIgnores(FileLine* filelinep) { // HOT routine, called each parsed token line of this filename if (m_lastIgnore.lineno != filelinep->lineno()) { - // UINFO(9, " ApplyIgnores for " << filelinep->ascii() << endl); + // UINFO(9, " ApplyIgnores for " << filelinep->ascii()); // Process all on/offs for lines up to and including the current line const int curlineno = filelinep->lastLineno(); for (; m_lastIgnore.it != m_ignLines.end(); ++m_lastIgnore.it) { if (m_lastIgnore.it->m_lineno > curlineno) break; - // UINFO(9, " Hit " << *m_lastIgnore.it << endl); + // UINFO(9, " Hit " << *m_lastIgnore.it); filelinep->warnOn(m_lastIgnore.it->m_code, m_lastIgnore.it->m_on); } if (false && debug() >= 9) { for (IgnLines::const_iterator it = m_lastIgnore.it; it != m_ignLines.end(); ++it) { - UINFO(9, " NXT " << *it << endl); + UINFO(9, " NXT " << *it); } } m_lastIgnore.lineno = filelinep->lastLineno(); @@ -480,7 +480,7 @@ class V3ConfigScopeTraceResolver final { public: void addScopeTraceOn(bool on, const string& scope, int levels) { UINFO(9, "addScopeTraceOn " << on << " '" << scope << "' " - << " levels=" << levels << endl); + << " levels=" << levels); m_entries.emplace_back(V3ConfigScopeTraceEntry{scope, on, levels}); m_matchCache.clear(); } @@ -499,7 +499,7 @@ public: for (const auto& ch : scope) { if (ch == '.') ++maxLevel; } - UINFO(9, "getScopeTraceOn " << scope << " maxLevel=" << maxLevel << endl); + UINFO(9, "getScopeTraceOn " << scope << " maxLevel=" << maxLevel); bool enabled = true; for (const auto& ent : m_entries) { @@ -518,7 +518,7 @@ public: UINFO(9, "getScopeTraceOn-part " << scope << " enabled=" << enabled << " @ lev=" << partLevel << (levelMatch ? "[match]" : "[miss]") - << " from scopepart=" << scopepart << endl); + << " from scopepart=" << scopepart); break; } if (partEnd == scope.length()) break; diff --git a/src/V3Const.cpp b/src/V3Const.cpp index e893c5133..40dbbca62 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -394,7 +394,7 @@ class ConstBitOpTreeVisitor final : public VNVisitorConst { bool setFailed(bool fail, const char* reason, AstNode* nodep, int line) { if (fail && !m_failed) { UINFO(9, "cannot optimize " << m_rootp << " reason:" << reason << " called from line:" - << line << " when checking:" << nodep << std::endl); + << line << " when checking:" << nodep); // if (debug() >= 9) m_rootp->dumpTree("- root: "); m_failed = true; } @@ -402,7 +402,7 @@ class ConstBitOpTreeVisitor final : public VNVisitorConst { } void incrOps(const AstNode* nodep, int line) { ++m_ops; - UINFO(9, "Increment to " << m_ops << " " << nodep << " called from line " << line << "\n"); + UINFO(9, "Increment to " << m_ops << " " << nodep << " called from line " << line); } VarInfo& getVarInfo(const LeafInfo& ref) { UASSERT_OBJ(ref.refp(), m_rootp, "null varref in And/Or/Xor optimization"); @@ -729,11 +729,11 @@ public: if (v->getConstResult()) { UASSERT_OBJ(visitor.isOrTree(), nodep, "Only OR tree can yield known 1 result"); - UINFO(9, "OR tree with const 1 term: " << v->refp() << endl); + UINFO(9, "OR tree with const 1 term: " << v->refp()); // Known 1 bit in OR tree, whole result is 1 resultp = new AstConst{fl, AstConst::BitTrue{}}; } else if (visitor.isAndTree()) { - UINFO(9, "AND tree with const 0 term: " << v->refp() << endl); + UINFO(9, "AND tree with const 0 term: " << v->refp()); // Known 0 bit in AND tree, whole result is 0 resultp = new AstConst{fl, AstConst::BitFalse{}}; } else { @@ -750,10 +750,10 @@ public: resultOps += std::get<1>(result); if (std::get<2>(result)) { hasCleanTerm = true; - UINFO(9, "Clean term: " << termps.back() << endl); + UINFO(9, "Clean term: " << termps.back()); } else { hasDirtyTerm = true; - UINFO(9, "Dirty term: " << termps.back() << endl); + UINFO(9, "Dirty term: " << termps.back()); } } @@ -770,7 +770,7 @@ public: } else { // Otherwise, conservatively assume the frozen term is dirty hasDirtyTerm = true; - UINFO(9, "Dirty frozen term: " << termp << endl); + UINFO(9, "Dirty frozen term: " << termp); } frozenNodes[frozenInfo.second].push_back(termp); } @@ -1103,8 +1103,7 @@ class ConstVisitor final : public VNVisitor { if (!VN_IS(condp->thenp(), Const) && !VN_IS(condp->elsep(), Const)) return false; AstConst* const maskp = VN_CAST(nodep->lhsp(), Const); if (!maskp) return false; - UINFO(4, "AND(CONSTm, CONDcond(c, i, e))->CONDcond(c, AND(m,i), AND(m, e)) " << nodep - << endl); + UINFO(4, "AND(CONSTm, CONDcond(c, i, e))->CONDcond(c, AND(m,i), AND(m, e)) " << nodep); AstNodeCond* const newp = static_cast(condp->cloneType( condp->condp()->unlinkFrBack(), new AstAnd{nodep->fileline(), maskp->cloneTree(false), condp->thenp()->unlinkFrBack()}, @@ -1219,7 +1218,7 @@ class ConstVisitor final : public VNVisitor { if (newp) { nodep->replaceWithKeepDType(newp); - UINFO(4, "Transformed leaf of bit tree to " << newp << std::endl); + UINFO(4, "Transformed leaf of bit tree to " << newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } @@ -1362,7 +1361,7 @@ class ConstVisitor final : public VNVisitor { const int newLsb = lp->toSInt() + bp->toSInt(); if (newLsb + nodep->widthConst() > ap->width()) return false; // - UINFO(9, "SEL(SHIFTR(a,b),l,w) -> SEL(a,l+b,w)\n"); + UINFO(9, "SEL(SHIFTR(a,b),l,w) -> SEL(a,l+b,w)"); if (debug() >= 9) nodep->dumpTree("- SEL(SH)-in: "); AstSel* const newp = new AstSel{nodep->fileline(), ap->unlinkFrBack(), newLsb, nodep->widthConst()}; @@ -1454,7 +1453,7 @@ class ConstVisitor final : public VNVisitor { : (" (adjusted +" + cvtToStr(-nodep->declRange().lo()) + " to account for negative lsb)"))); UINFO(1, " Related Raw index is " << nodep->msbConst() << ":" - << nodep->lsbConst() << endl); + << nodep->lsbConst()); // Don't replace with zero, we'll do it later } } @@ -1638,14 +1637,14 @@ class ConstVisitor final : public VNVisitor { V3Number numv{nodep, nodep->widthMinV()}; nodep->numberOperate(numv, constNumV(nodep->lhsp())); const V3Number& num = toNumC(nodep, numv); - UINFO(4, "UNICONST -> " << num << endl); + UINFO(4, "UNICONST -> " << num); VL_DO_DANGLING(replaceNum(nodep, num), nodep); } void replaceConst(AstNodeBiop* nodep) { V3Number numv{nodep, nodep->widthMinV()}; nodep->numberOperate(numv, constNumV(nodep->lhsp()), constNumV(nodep->rhsp())); const V3Number& num = toNumC(nodep, numv); - UINFO(4, "BICONST -> " << num << endl); + UINFO(4, "BICONST -> " << num); VL_DO_DANGLING(replaceNum(nodep, num), nodep); } void replaceConst(AstNodeTriop* nodep) { @@ -1653,7 +1652,7 @@ class ConstVisitor final : public VNVisitor { nodep->numberOperate(numv, constNumV(nodep->lhsp()), constNumV(nodep->rhsp()), constNumV(nodep->thsp())); const V3Number& num = toNumC(nodep, numv); - UINFO(4, "TRICONST -> " << num << endl); + UINFO(4, "TRICONST -> " << num); VL_DO_DANGLING(replaceNum(nodep, num), nodep); } void replaceConst(AstNodeQuadop* nodep) { @@ -1661,7 +1660,7 @@ class ConstVisitor final : public VNVisitor { nodep->numberOperate(numv, constNumV(nodep->lhsp()), constNumV(nodep->rhsp()), constNumV(nodep->thsp()), constNumV(nodep->fhsp())); const V3Number& num = toNumC(nodep, numv); - UINFO(4, "QUADCONST -> " << num << endl); + UINFO(4, "QUADCONST -> " << num); VL_DO_DANGLING(replaceNum(nodep, num), nodep); } @@ -1835,8 +1834,7 @@ class ConstVisitor final : public VNVisitor { "tried to merge two selects which are not adjacent"); AstSel* const newselp = new AstSel{ lselp->fromp()->fileline(), rselp->fromp()->unlinkFrBack(), rstart, lwidth + rwidth}; - UINFO(5, "merged two adjacent sel " << lselp << " and " << rselp << " to one " << newselp - << endl); + UINFO(5, "merged two adjacent sel " << lselp << " and " << rselp << " to one " << newselp); nodep->replaceWithKeepDType(newselp); VL_DO_DANGLING(pushDeletep(lselp), lselp); @@ -1862,7 +1860,7 @@ class ConstVisitor final : public VNVisitor { lrp->replaceWith(newrp); VL_DO_DANGLING(pushDeletep(lrp), lrp); lp->dtypeChgWidthSigned(newlp->width(), newlp->width(), VSigning::UNSIGNED); - UINFO(5, "merged " << nodep << endl); + UINFO(5, "merged " << nodep); VL_DO_DANGLING(pushDeletep(rp->unlinkFrBack()), rp); nodep->replaceWithKeepDType(lp->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -1884,7 +1882,7 @@ class ConstVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); } void replacePowShift(AstNodeBiop* nodep) { // Pow or PowS - UINFO(5, "POW(2,b)->SHIFTL(1,b) " << nodep << endl); + UINFO(5, "POW(2,b)->SHIFTL(1,b) " << nodep); AstNodeExpr* const rhsp = nodep->rhsp()->unlinkFrBack(); AstShiftL* const newp = new AstShiftL{nodep->fileline(), new AstConst{nodep->fileline(), 1}, rhsp}; @@ -1893,7 +1891,7 @@ class ConstVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); } void replaceMulShift(AstMul* nodep) { // Mul, but not MulS as not simple shift - UINFO(5, "MUL(2^n,b)->SHIFTL(b,n) " << nodep << endl); + UINFO(5, "MUL(2^n,b)->SHIFTL(b,n) " << nodep); const int amount = VN_AS(nodep->lhsp(), Const)->num().mostSetBitP1() - 1; // 2^n->n+1 AstNodeExpr* const opp = nodep->rhsp()->unlinkFrBack(); AstShiftL* const newp @@ -1902,7 +1900,7 @@ class ConstVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); } void replaceDivShift(AstDiv* nodep) { // Mul, but not MulS as not simple shift - UINFO(5, "DIV(b,2^n)->SHIFTR(b,n) " << nodep << endl); + UINFO(5, "DIV(b,2^n)->SHIFTR(b,n) " << nodep); const int amount = VN_AS(nodep->rhsp(), Const)->num().mostSetBitP1() - 1; // 2^n->n+1 AstNodeExpr* const opp = nodep->lhsp()->unlinkFrBack(); AstShiftR* const newp @@ -1911,7 +1909,7 @@ class ConstVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); } void replaceModAnd(AstModDiv* nodep) { // Mod, but not ModS as not simple shift - UINFO(5, "MOD(b,2^n)->AND(b,2^n-1) " << nodep << endl); + UINFO(5, "MOD(b,2^n)->AND(b,2^n-1) " << nodep); const int amount = VN_AS(nodep->rhsp(), Const)->num().mostSetBitP1() - 1; // 2^n->n+1 V3Number mask{nodep, nodep->width()}; mask.setMask(amount); @@ -1922,7 +1920,7 @@ class ConstVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); } void replaceShiftOp(AstNodeBiop* nodep) { - UINFO(5, "SHIFT(AND(a,b),CONST)->AND(SHIFT(a,CONST),SHIFT(b,CONST)) " << nodep << endl); + UINFO(5, "SHIFT(AND(a,b),CONST)->AND(SHIFT(a,CONST),SHIFT(b,CONST)) " << nodep); const int width = nodep->width(); const int widthMin = nodep->widthMin(); VNRelinker handle; @@ -1946,7 +1944,7 @@ class ConstVisitor final : public VNVisitor { iterate(newp); // Further reduce, either node may have more reductions. } void replaceShiftShift(AstNodeBiop* nodep) { - UINFO(4, "SHIFT(SHIFT(a,s1),s2)->SHIFT(a,ADD(s1,s2)) " << nodep << endl); + UINFO(4, "SHIFT(SHIFT(a,s1),s2)->SHIFT(a,ADD(s1,s2)) " << nodep); if (debug() >= 9) nodep->dumpTree("- repShiftShift_old: "); AstNodeBiop* const lhsp = VN_AS(nodep->lhsp(), NodeBiop); lhsp->unlinkFrBack(); @@ -2040,8 +2038,8 @@ class ConstVisitor final : public VNVisitor { return false; } const bool lsbFirstAssign = (con1p->toUInt() < con2p->toUInt()); - UINFO(4, "replaceAssignMultiSel " << nodep << endl); - UINFO(4, " && " << nextp << endl); + UINFO(4, "replaceAssignMultiSel " << nodep); + UINFO(4, " && " << nextp); // if (debug()) nodep->dumpTree("- comb1: "); // if (debug()) nextp->dumpTree("- comb2: "); AstNodeExpr* const rhs1p = nodep->rhsp()->unlinkFrBack(); @@ -2110,7 +2108,7 @@ class ConstVisitor final : public VNVisitor { if (need_temp_pure) { // if the RHS is impure we need to create a temporary variable for it, because // further handling involves copying of the RHS. - UINFO(4, " ASSITEMPPURE " << nodep << endl); + UINFO(4, " ASSITEMPPURE " << nodep); // ASSIGN(CONCAT(lc1,lc2),rhs) -> ASSIGN(temp,rhs), // ASSIGN(lc1,SEL(temp,{size1})), // ASSIGN(lc2,SEL(temp,{size2})) @@ -2126,13 +2124,13 @@ class ConstVisitor final : public VNVisitor { } else if (need_temp) { // The first time we constify, there may be the same variable on the LHS // and RHS. In that case, we must use temporaries, or {a,b}={b,a} will break. - UINFO(4, " ASSITEMP " << nodep << endl); + UINFO(4, " ASSITEMP " << nodep); // ASSIGN(CONCAT(lc1,lc2),rhs) -> ASSIGN(temp1,SEL(rhs,{size})), // ASSIGN(temp2,SEL(newrhs,{size})) // ASSIGN(lc1,temp1), // ASSIGN(lc2,temp2) } else { - UINFO(4, " ASSI " << nodep << endl); + UINFO(4, " ASSI " << nodep); // ASSIGN(CONCAT(lc1,lc2),rhs) -> ASSIGN(lc1,SEL(rhs,{size})), // ASSIGN(lc2,SEL(newrhs,{size})) } @@ -2316,7 +2314,7 @@ class ConstVisitor final : public VNVisitor { if (!aboveBlockp) return false; if (aboveBlockp != nodep->labelp()->blockp()) return false; if (aboveBlockp->endStmtsp() != nodep->labelp()) return false; - UINFO(4, "JUMPGO => last remove " << nodep << endl); + UINFO(4, "JUMPGO => last remove " << nodep); VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); return true; } @@ -2372,7 +2370,7 @@ class ConstVisitor final : public VNVisitor { AstNode* const newp = valuep->cloneTree(false); newp->fileline(nodep->fileline()); nodep->replaceWithKeepDType(newp); - UINFO(4, "Simulate->" << newp << endl); + UINFO(4, "Simulate->" << newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } } @@ -2469,7 +2467,7 @@ class ConstVisitor final : public VNVisitor { AstRand* const bRandp = VN_CAST(nodep->rhsp(), Rand); if (!aRandp || !bRandp) return false; if (!aRandp->combinable(bRandp)) return false; - UINFO(4, "Concat(Rand,Rand) => Rand: " << nodep << endl); + UINFO(4, "Concat(Rand,Rand) => Rand: " << nodep); nodep->replaceWithKeepDType(aRandp->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(nodep), nodep); return true; @@ -2479,7 +2477,7 @@ class ConstVisitor final : public VNVisitor { AstRand* const aRandp = VN_CAST(nodep->fromp(), Rand); if (!aRandp) return false; if (aRandp->seedp()) return false; - UINFO(4, "Sel(Rand) => Rand: " << nodep << endl); + UINFO(4, "Sel(Rand) => Rand: " << nodep); nodep->replaceWithKeepDType(aRandp->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(nodep), nodep); return true; @@ -2508,7 +2506,7 @@ class ConstVisitor final : public VNVisitor { // putting additional CONCATs on the RHS leads to fewer assembler operations. // However, we'll end up with lots of wide moves if we make huge trees // like that, so on 32 bit boundaries, we'll do the opposite form. - UINFO(4, "Move concat: " << nodep << endl); + UINFO(4, "Move concat: " << nodep); if (operandConcatMove(nodep) > 1) { AstNodeExpr* const ap = nodep->lhsp()->unlinkFrBack(); AstConcat* const bcConcp = VN_AS(nodep->rhsp(), Concat); @@ -2572,7 +2570,7 @@ class ConstVisitor final : public VNVisitor { AstNodeExpr* const lsb1p = nodep->lsbp()->unlinkFrBack(); AstNodeExpr* const lsb2p = belowp->lsbp()->unlinkFrBack(); // Eliminate lower range - UINFO(4, "Elim Lower range: " << nodep << endl); + UINFO(4, "Elim Lower range: " << nodep); AstNodeExpr* newlsbp; if (VN_IS(lsb1p, Const) && VN_IS(lsb2p, Const)) { newlsbp = new AstConst{lsb1p->fileline(), @@ -2787,7 +2785,7 @@ class ConstVisitor final : public VNVisitor { || nodep->varp()->isParam())) { if (operandConst(valuep)) { const V3Number& num = VN_AS(valuep, Const)->num(); - // UINFO(2,"constVisit "<getIndexDefaultedValuep(bit); if (VN_IS(itemp, Const)) { const V3Number& num = VN_AS(itemp, Const)->num(); - // UINFO(2,"constVisit "<stmtsp())) { - UINFO(8, "ExprStmt(...) " << nodep << " " << nodep->resultp() << endl); + UINFO(8, "ExprStmt(...) " << nodep << " " << nodep->resultp()); nodep->replaceWith(nodep->resultp()->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(nodep), nodep); // Removing the ExprStmt might have made something impure above now pure @@ -2899,7 +2897,7 @@ class ConstVisitor final : public VNVisitor { lastSensp = VN_AS(lastSensp, Not)->lhsp(); invert = !invert; } - UINFO(8, "senItem(NOT...) " << nodep << " " << invert << endl); + UINFO(8, "senItem(NOT...) " << nodep << " " << invert); if (invert) nodep->edgeType(nodep->edgeType().invert()); sensp->replaceWith(lastSensp->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(sensp), sensp); @@ -3097,7 +3095,7 @@ class ConstVisitor final : public VNVisitor { && !varrefp->varp()->isForced() // Not forced (not really a constant) ) { // ASSIGNW (VARREF, const) -> INITIAL ( ASSIGN (VARREF, const) ) - UINFO(4, "constAssignW " << nodep << endl); + UINFO(4, "constAssignW " << nodep); // Make a initial assignment AstNodeExpr* const exprp = nodep->rhsp()->unlinkFrBack(); varrefp->unlinkFrBack(); @@ -3129,13 +3127,13 @@ class ConstVisitor final : public VNVisitor { if (const AstConst* const constp = VN_CAST(nodep->condp(), Const)) { AstNode* keepp = nullptr; if (constp->isZero()) { - UINFO(4, "IF(0,{any},{x}) => {x}: " << nodep << endl); + UINFO(4, "IF(0,{any},{x}) => {x}: " << nodep); keepp = nodep->elsesp(); } else if (!m_doV || constp->isNeqZero()) { // Might be X in Verilog - UINFO(4, "IF(!0,{x},{any}) => {x}: " << nodep << endl); + UINFO(4, "IF(!0,{x},{any}) => {x}: " << nodep); keepp = nodep->thensp(); } else { - UINFO(4, "IF condition is X, retaining: " << nodep << endl); + UINFO(4, "IF condition is X, retaining: " << nodep); return; } if (keepp) { @@ -3155,7 +3153,7 @@ class ConstVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); } } else if (!AstNode::afterCommentp(nodep->thensp())) { - UINFO(4, "IF({x}) nullptr {...} => IF(NOT{x}}: " << nodep << endl); + UINFO(4, "IF({x}) nullptr {...} => IF(NOT{x}}: " << nodep); AstNodeExpr* const condp = nodep->condp(); AstNode* const elsesp = nodep->elsesp(); condp->unlinkFrBackWithNext(); @@ -3169,7 +3167,7 @@ class ConstVisitor final : public VNVisitor { } else if (((VN_IS(nodep->condp(), Not) && nodep->condp()->width() == 1) || VN_IS(nodep->condp(), LogNot)) && nodep->thensp() && nodep->elsesp()) { - UINFO(4, "IF(NOT {x}) => IF(x) swapped if/else" << nodep << endl); + UINFO(4, "IF(NOT {x}) => IF(x) swapped if/else" << nodep); AstNodeExpr* const condp = VN_AS(nodep->condp(), NodeUniop)->lhsp()->unlinkFrBackWithNext(); AstNode* const thensp = nodep->thensp()->unlinkFrBackWithNext(); @@ -3180,9 +3178,8 @@ class ConstVisitor final : public VNVisitor { nodep->replaceWith(ifp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } else if (ifSameAssign(nodep)) { - UINFO( - 4, - "IF({a}) ASSIGN({b},{c}) else ASSIGN({b},{d}) => ASSIGN({b}, {a}?{c}:{d})\n"); + UINFO(4, + "IF({a}) ASSIGN({b},{c}) else ASSIGN({b},{d}) => ASSIGN({b}, {a}?{c}:{d})"); AstNodeAssign* const thensp = VN_AS(nodep->thensp(), NodeAssign); AstNodeAssign* const elsesp = VN_AS(nodep->elsesp(), NodeAssign); thensp->unlinkFrBack(); @@ -3195,7 +3192,7 @@ class ConstVisitor final : public VNVisitor { } else if (false // Disabled, as vpm assertions are faster // without due to short-circuiting && operandIfIf(nodep)) { - UINFO(9, "IF({a}) IF({b}) => IF({a} && {b})" << endl); + UINFO(9, "IF({a}) IF({b}) => IF({a} && {b})"); AstNodeIf* const lowerIfp = VN_AS(nodep->thensp(), NodeIf); AstNodeExpr* const condp = nodep->condp()->unlinkFrBack(); AstNode* const lowerThensp = lowerIfp->thensp()->unlinkFrBackWithNext(); @@ -3249,7 +3246,7 @@ class ConstVisitor final : public VNVisitor { if (pformatp->text().length() + nformatp->text().length() > DISPLAY_MAX_MERGE_LENGTH) return false; // - UINFO(9, "DISPLAY(SF({a})) DISPLAY(SF({b})) -> DISPLAY(SF({a}+{b}))" << endl); + UINFO(9, "DISPLAY(SF({a})) DISPLAY(SF({b})) -> DISPLAY(SF({a}+{b}))"); // Convert DT_DISPLAY to DT_WRITE as may allow later optimizations if (prevp->displayType() == VDisplayType::DT_DISPLAY) { prevp->displayType(VDisplayType::DT_WRITE); @@ -3281,7 +3278,7 @@ class ConstVisitor final : public VNVisitor { } } if (m_doNConst && anyconst) { - // UINFO(9, " Display in " << nodep->text() << endl); + // UINFO(9, " Display in " << nodep->text()); string newFormat; string fmt; bool inPct = false; @@ -3310,7 +3307,7 @@ class ConstVisitor final : public VNVisitor { if (VN_IS(argp, Const)) { // Convert it const string out = constNumV(argp).displayed(nodep, fmt); UINFO(9, " DispConst: " << fmt << " -> " << out << " for " - << argp << endl); + << argp); // fmt = out w/ replace % with %% as it must be literal. fmt = VString::quotePercent(out); VL_DO_DANGLING(pushDeletep(argp->unlinkFrBack()), argp); @@ -3326,7 +3323,7 @@ class ConstVisitor final : public VNVisitor { } if (newFormat != nodep->text()) { nodep->text(newFormat); - UINFO(9, " Display out " << nodep << endl); + UINFO(9, " Display out " << nodep); } } if (!nodep->exprsp() && nodep->name().find('%') == string::npos && !nodep->hidden()) { @@ -3367,7 +3364,7 @@ class ConstVisitor final : public VNVisitor { m_hasJumpDelay = thisWhileHasJumpDelay || oldHasJumpDelay; if (m_doNConst) { if (nodep->condp()->isZero()) { - UINFO(4, "WHILE(0) => nop " << nodep << endl); + UINFO(4, "WHILE(0) => nop " << nodep); if (nodep->precondsp()) { nodep->replaceWith(nodep->precondsp()); } else { @@ -3459,7 +3456,7 @@ class ConstVisitor final : public VNVisitor { iterateChildren(nodep); // AstJumpGo's below here that point to this node will set user4 if (m_doExpensive && !nodep->user4()) { - UINFO(4, "JUMPLABEL => unused " << nodep << endl); + UINFO(4, "JUMPLABEL => unused " << nodep); AstNode* underp = nullptr; if (nodep->stmtsp()) underp = nodep->stmtsp()->unlinkFrBackWithNext(); if (underp) { @@ -3963,7 +3960,7 @@ AstNode* V3Const::constifyGenerateParamsEdit(AstNode* nodep) { void V3Const::constifyAllLint(AstNetlist* nodep) { // Only call from Verilator.cpp, as it uses user#'s - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ConstVisitor visitor{ConstVisitor::PROC_V_WARN, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); @@ -3972,7 +3969,7 @@ void V3Const::constifyAllLint(AstNetlist* nodep) { } void V3Const::constifyCpp(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ConstVisitor visitor{ConstVisitor::PROC_CPP, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); @@ -3996,7 +3993,7 @@ void V3Const::constifyAllLive(AstNetlist* nodep) { // Only call from Verilator.cpp, as it uses user#'s // This only pushes constants up, doesn't make any other edits // IE doesn't prune dead statements, as we need to do some usability checks after this - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ConstVisitor visitor{ConstVisitor::PROC_LIVE, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); @@ -4006,7 +4003,7 @@ void V3Const::constifyAllLive(AstNetlist* nodep) { void V3Const::constifyAll(AstNetlist* nodep) { // Only call from Verilator.cpp, as it uses user#'s - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ConstVisitor visitor{ConstVisitor::PROC_V_EXPENSIVE, /* globalPass: */ true}; (void)visitor.mainAcceptEdit(nodep); diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index 6e22199b4..0ae403193 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -183,7 +183,7 @@ class CoverageVisitor final : public VNVisitor { AstCoverDecl* const declp = new AstCoverDecl{fl, page, comment, linescov, offset}; declp->hier(hier); m_modp->addStmtsp(declp); - UINFO(9, "new " << declp << endl); + UINFO(9, "new " << declp); AstCoverInc* const incp = new AstCoverInc{fl, declp}; if (!trace_var_name.empty() @@ -197,7 +197,7 @@ class CoverageVisitor final : public VNVisitor { varp->setIgnoreSchedWrite(); // Ignore the increment output, so no UNOPTFLAT varp->trace(true); m_modp->addStmtsp(varp); - UINFO(5, "New coverage trace: " << varp << endl); + UINFO(5, "New coverage trace: " << varp); AstAssign* const assp = new AstAssign{ incp->fileline(), new AstVarRef{incp->fileline(), varp, VAccess::WRITE}, new AstAdd{incp->fileline(), new AstVarRef{incp->fileline(), varp, VAccess::READ}, @@ -223,7 +223,7 @@ class CoverageVisitor final : public VNVisitor { // Ensure line numbers we track are in the same file as this block // so track via nodep m_state.m_nodep = nodep; - UINFO(9, "line create h" << m_state.m_handle << " " << nodep << endl); + UINFO(9, "line create h" << m_state.m_handle << " " << nodep); } void lineTrack(const AstNode* nodep) { if (m_state.lineCoverageOn(nodep) && !m_ifCond @@ -231,7 +231,7 @@ class CoverageVisitor final : public VNVisitor { for (int lineno = nodep->fileline()->firstLineno(); lineno <= nodep->fileline()->lastLineno(); ++lineno) { UINFO(9, "line track " << lineno << " for h" << m_state.m_handle << " " - << m_state.m_nodep << endl); + << m_state.m_nodep); m_handleLines[m_state.m_handle].insert(lineno); } } @@ -266,7 +266,7 @@ class CoverageVisitor final : public VNVisitor { if (!out.empty()) out += ","; out += linesFirstLast(first, last); } - UINFO(9, "lines out " << out << " for h" << state.m_handle << " " << nodep << endl); + UINFO(9, "lines out " << out << " for h" << state.m_handle << " " << nodep); return out; } @@ -358,9 +358,9 @@ class CoverageVisitor final : public VNVisitor { && v3Global.opt.coverageToggle()) { const char* const disablep = varIgnoreToggle(nodep); if (disablep) { - UINFO(4, " Disable Toggle: " << disablep << " " << nodep << endl); + UINFO(4, " Disable Toggle: " << disablep << " " << nodep); } else { - UINFO(4, " Toggle: " << nodep << endl); + UINFO(4, " Toggle: " << nodep); // There's several overall ways to approach this // Treat like tracing, where a end-of-timestamp action sees all changes // Works ok, but would be quite slow as need to reform @@ -519,7 +519,7 @@ class CoverageVisitor final : public VNVisitor { // VISITORS - LINE COVERAGE void visit(AstCond* nodep) override { - UINFO(4, " COND: " << nodep << endl); + UINFO(4, " COND: " << nodep); if (m_seeking == NONE) coverExprs(nodep->condp()); @@ -558,7 +558,7 @@ class CoverageVisitor final : public VNVisitor { void visit(AstIf* nodep) override { if (nodep->user2()) return; - UINFO(4, " IF: " << nodep << endl); + UINFO(4, " IF: " << nodep); if (m_state.m_on) { // An else-if. When we iterate the if, use "elsif" marking const bool elsif @@ -603,7 +603,7 @@ class CoverageVisitor final : public VNVisitor { && elseState.lineCoverageOn(nodep)) { // Normal if. Linecov shows what's inside the if (not condition that is // always executed) - UINFO(4, " COVER-branch: " << nodep << endl); + UINFO(4, " COVER-branch: " << nodep); nodep->addThensp(newCoverInc(nodep->fileline(), "", "v_branch", "if", linesCov(ifState, nodep), 0, traceNameForLine(nodep, "if"))); @@ -616,7 +616,7 @@ class CoverageVisitor final : public VNVisitor { } // If/else attributes to each block as non-branch coverage else if (first_elsif || cont_elsif) { - UINFO(4, " COVER-elsif: " << nodep << endl); + UINFO(4, " COVER-elsif: " << nodep); if (ifState.lineCoverageOn(nodep)) { nodep->addThensp(newCoverInc(nodep->fileline(), "", "v_line", "elsif", linesCov(ifState, nodep), 0, @@ -626,13 +626,13 @@ class CoverageVisitor final : public VNVisitor { } else { // Cover as separate blocks (not a branch as is not two-legged) if (ifState.lineCoverageOn(nodep)) { - UINFO(4, " COVER-half-if: " << nodep << endl); + UINFO(4, " COVER-half-if: " << nodep); nodep->addThensp(newCoverInc(nodep->fileline(), "", "v_line", "if", linesCov(ifState, nodep), 0, traceNameForLine(nodep, "if"))); } if (elseState.lineCoverageOn(nodep)) { - UINFO(4, " COVER-half-el: " << nodep << endl); + UINFO(4, " COVER-half-el: " << nodep); nodep->addElsesp(newCoverInc(nodep->fileline(), "", "v_line", "else", linesCov(elseState, nodep), 1, traceNameForLine(nodep, "else"))); @@ -643,19 +643,19 @@ class CoverageVisitor final : public VNVisitor { VL_RESTORER(m_ifCond); m_ifCond = true; iterateAndNextNull(nodep->condp()); - UINFO(9, " done HANDLE " << m_state.m_handle << " for " << nodep << endl); + UINFO(9, " done HANDLE " << m_state.m_handle << " for " << nodep); } void visit(AstCaseItem* nodep) override { // We don't add an explicit "default" coverage if not provided, // as we already have a warning when there is no default. - UINFO(4, " CASEI: " << nodep << endl); + UINFO(4, " CASEI: " << nodep); if (m_state.lineCoverageOn(nodep)) { VL_RESTORER(m_state); createHandle(nodep); iterateAndNextNull(nodep->stmtsp()); if (m_state.lineCoverageOn(nodep)) { // if the case body didn't disable it lineTrack(nodep); - UINFO(4, " COVER: " << nodep << endl); + UINFO(4, " COVER: " << nodep); nodep->addStmtsp(newCoverInc(nodep->fileline(), "", "v_line", "case", linesCov(m_state, nodep), 0, traceNameForLine(nodep, "case"))); @@ -663,7 +663,7 @@ class CoverageVisitor final : public VNVisitor { } } void visit(AstCover* nodep) override { - UINFO(4, " COVER: " << nodep << endl); + UINFO(4, " COVER: " << nodep); VL_RESTORER(m_state); m_state.m_on = true; // Always do cover blocks, even if there's a $stop createHandle(nodep); @@ -677,13 +677,13 @@ class CoverageVisitor final : public VNVisitor { } } void visit(AstStop* nodep) override { - UINFO(4, " STOP: " << nodep << endl); + UINFO(4, " STOP: " << nodep); m_state.m_on = false; } void visit(AstPragma* nodep) override { if (nodep->pragType() == VPragmaType::COVERAGE_BLOCK_OFF) { // Skip all NEXT nodes under this block, and skip this if/case branch - UINFO(4, " OFF: h" << m_state.m_handle << " " << nodep << endl); + UINFO(4, " OFF: h" << m_state.m_handle << " " << nodep); m_state.m_on = false; VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); } else { @@ -1009,7 +1009,7 @@ class CoverageVisitor final : public VNVisitor { } void exprUnsupported(AstNode* nodep, const string& why) { - UINFO(9, "unsupported: " << why << " " << nodep << endl); + UINFO(9, "unsupported: " << why << " " << nodep); bool wasSeeking = m_seeking == SEEKING; Objective oldSeeking = m_seeking; if (wasSeeking) abortExprCoverage(); @@ -1029,7 +1029,7 @@ public: // Coverage class functions void V3Coverage::coverage(AstNetlist* rootp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { CoverageVisitor{rootp}; } // Destruct before checking V3Global::dumpCheckGlobalTree("coverage", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3CoverageJoin.cpp b/src/V3CoverageJoin.cpp index 86fa0ea6a..bcdf767cb 100644 --- a/src/V3CoverageJoin.cpp +++ b/src/V3CoverageJoin.cpp @@ -44,7 +44,7 @@ class CoverageJoinVisitor final : public VNVisitor { // METHODS void detectDuplicates() { - UINFO(9, "Finding duplicates\n"); + UINFO(9, "Finding duplicates"); // Note uses user4 V3DupFinder dupFinder; // Duplicate code detection // Hash all of the original signals we toggle cover @@ -70,14 +70,14 @@ class CoverageJoinVisitor final : public VNVisitor { // covertoggle which is immediately above, so: AstCoverToggle* const removep = VN_AS(duporigp->backp(), CoverToggle); UASSERT_OBJ(removep, nodep, "CoverageJoin duplicate of wrong type"); - UINFO(8, " Orig " << nodep << " -->> " << nodep->incp()->declp() << endl); - UINFO(8, " dup " << removep << " -->> " << removep->incp()->declp() << endl); + UINFO(8, " Orig " << nodep << " -->> " << nodep->incp()->declp()); + UINFO(8, " dup " << removep << " -->> " << removep->incp()->declp()); // The CoverDecl the duplicate pointed to now needs to point to the // original's data. I.e. the duplicate will get the coverage number // from the non-duplicate AstCoverDecl* const datadeclp = nodep->incp()->declp()->dataDeclThisp(); removep->incp()->declp()->dataDeclp(datadeclp); - UINFO(8, " new " << removep->incp()->declp() << endl); + UINFO(8, " new " << removep->incp()->declp()); // Mark the found node as a duplicate of the first node // (Not vice-versa as we have the iterator for the found node) removep->unlinkFrBack(); @@ -115,7 +115,7 @@ public: // Coverage class functions void V3CoverageJoin::coverageJoin(AstNetlist* rootp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { CoverageJoinVisitor{rootp}; } // Destruct before checking V3Global::dumpCheckGlobalTree("coveragejoin", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp index fedf41048..8cbf22db3 100644 --- a/src/V3Dead.cpp +++ b/src/V3Dead.cpp @@ -81,7 +81,7 @@ class DeadVisitor final : public VNVisitor { // METHODS void deleting(AstNode* nodep) { - UINFO(9, " deleting " << nodep << endl); + UINFO(9, " deleting " << nodep); VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); } @@ -353,7 +353,7 @@ class DeadVisitor final : public VNVisitor { if (modp->dead() || (modp->level() > 2 && modp->user1() == 0 && !modp->internal())) { // > 2 because L1 is the wrapper, L2 is the top user module - UINFO(4, " Dead module " << modp << endl); + UINFO(4, " Dead module " << modp); // And its children may now be killable too; correct counts // Recurse, as cells may not be directly under the module but in a generate if (!modp->dead()) { // If was dead didn't increment user1's @@ -382,7 +382,7 @@ class DeadVisitor final : public VNVisitor { AstScope* const scp = *it; if (!scp) continue; if (scp->user1() == 0) { - UINFO(4, " Dead AstScope " << scp << endl); + UINFO(4, " Dead AstScope " << scp); scp->aboveScopep()->user1Inc(-1); if (scp->dtypep()) scp->dtypep()->user1Inc(-1); deleting(scp); @@ -422,12 +422,12 @@ class DeadVisitor final : public VNVisitor { // Delete any unused varscopes for (AstVarScope* vscp : m_vscsp) { if (vscp->user1() == 0) { - UINFO(4, " Dead " << vscp << endl); + UINFO(4, " Dead " << vscp); const std::pair eqrange = m_assignMap.equal_range(vscp); for (AssignMap::iterator itr = eqrange.first; itr != eqrange.second; ++itr) { AstNodeAssign* const assp = itr->second; - UINFO(4, " Dead assign " << assp << endl); + UINFO(4, " Dead assign " << assp); assp->dtypep()->user1Inc(-1); deleting(assp); } @@ -442,7 +442,7 @@ class DeadVisitor final : public VNVisitor { AstVar* const varp = *it; if (!varp) continue; if (varp->user1() == 0) { - UINFO(4, " Dead " << varp << endl); + UINFO(4, " Dead " << varp); if (varp->dtypep()) varp->dtypep()->user1Inc(-1); deleting(varp); *it = nullptr; @@ -553,7 +553,7 @@ public: // Dead class functions void V3Dead::deadifyModules(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { // node, elimUserVars, elimDTypes, elimScopes, elimCells, elimTopIfaces DeadVisitor{nodep, false, false, false, false, !v3Global.opt.topIfacesSupported()}; } // Destruct before checking @@ -561,25 +561,25 @@ void V3Dead::deadifyModules(AstNetlist* nodep) { } void V3Dead::deadifyDTypes(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DeadVisitor{nodep, false, true, false, false, false}; } // Destruct before checking V3Global::dumpCheckGlobalTree("deadDtypes", 0, dumpTreeEitherLevel() >= 3); } void V3Dead::deadifyDTypesScoped(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DeadVisitor{nodep, false, true, true, false, false}; } // Destruct before checking V3Global::dumpCheckGlobalTree("deadDtypesScoped", 0, dumpTreeEitherLevel() >= 3); } void V3Dead::deadifyAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DeadVisitor{nodep, true, true, false, true, false}; } // Destruct before checking V3Global::dumpCheckGlobalTree("deadAll", 0, dumpTreeEitherLevel() >= 3); } void V3Dead::deadifyAllScoped(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DeadVisitor{nodep, true, true, true, true, false}; } // Destruct before checking V3Global::dumpCheckGlobalTree("deadAllScoped", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index ed57f85fe..56bef3a3d 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -1067,7 +1067,7 @@ public: // Delayed class functions void V3Delayed::delayedAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DelayedVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("delayed", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Depth.cpp b/src/V3Depth.cpp index 4d7803fef..96994fe66 100644 --- a/src/V3Depth.cpp +++ b/src/V3Depth.cpp @@ -47,7 +47,7 @@ class DepthVisitor final : public VNVisitor { // METHODS void createDeepTemp(AstNodeExpr* nodep) { - UINFO(6, " Deep " << nodep << endl); + UINFO(6, " Deep " << nodep); // if (debug() >= 9) nodep->dumpTree("- deep: "); AstVar* const varp = new AstVar{nodep->fileline(), VVarType::STMTTEMP, m_tempNames.get(nodep), nodep->dtypep()}; @@ -127,7 +127,7 @@ class DepthVisitor final : public VNVisitor { void needNonStaticFunc(AstNode* nodep) { UASSERT_OBJ(m_cfuncp, nodep, "Non-static accessor not under a function"); if (m_cfuncp->isStatic()) { - UINFO(5, "Mark non-public due to " << nodep << endl); + UINFO(5, "Mark non-public due to " << nodep); m_cfuncp->isStatic(false); } } @@ -158,7 +158,7 @@ public: // Depth class functions void V3Depth::depthAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DepthVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("depth", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp index 8c31fc7df..f4f54ee8c 100644 --- a/src/V3DepthBlock.cpp +++ b/src/V3DepthBlock.cpp @@ -60,7 +60,7 @@ class DepthBlockVisitor final : public VNVisitor { funcp->argTypes(EmitCBase::symClassVar()); callp->argTypes("vlSymsp"); } - UINFO(6, " New " << callp << endl); + UINFO(6, " New " << callp); relinkHandle.relink(callp->makeStmt()); // Done return funcp; @@ -68,7 +68,7 @@ class DepthBlockVisitor final : public VNVisitor { // VISITORS void visit(AstNodeModule* nodep) override { - UINFO(4, " MOD " << nodep << endl); + UINFO(4, " MOD " << nodep); VL_RESTORER(m_modp); m_modp = nodep; m_deepNum = 0; @@ -87,7 +87,7 @@ class DepthBlockVisitor final : public VNVisitor { void visit(AstNodeStmt* nodep) override { ++m_depth; if (m_depth > v3Global.opt.compLimitBlocks()) { // Already done - UINFO(4, "DeepBlocks " << m_depth << " " << nodep << endl); + UINFO(4, "DeepBlocks " << m_depth << " " << nodep); const AstNode* const backp = nodep->backp(); // Only for debug if (debug() >= 9) backp->dumpTree("- pre : "); AstCFunc* const funcp = createDeepFunc(nodep); @@ -115,7 +115,7 @@ public: // DepthBlock class functions void V3DepthBlock::depthBlockAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DepthBlockVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("deepblock", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index aa861f690..0545551ae 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -97,9 +97,9 @@ class DescopeVisitor final : public VNVisitor { // Static functions can't use relative references via 'this->' const bool relativeRefOk = !m_funcp->isStatic(); - UINFO(8, " Descope ref under " << m_scopep << endl); - UINFO(8, " ref to " << scopep << endl); - UINFO(8, " aboveScope " << scopep->aboveScopep() << endl); + UINFO(8, " Descope ref under " << m_scopep); + UINFO(8, " ref to " << scopep); + UINFO(8, " aboveScope " << scopep->aboveScopep()); if (VN_IS(scopep->modp(), Class)) { // Direct reference to class members are from within the class itself, references from @@ -133,7 +133,7 @@ class DescopeVisitor final : public VNVisitor { const bool moreOfSame1 = (nextIt1 != m_modFuncs.end() && nextIt1->first == name); if (moreOfSame1) { // Multiple functions under this name, need a wrapper function - UINFO(6, " Wrapping " << name << " multifuncs\n"); + UINFO(6, " Wrapping " << name << " multifuncs"); AstCFunc* const newfuncp = topFuncp->cloneTree(false); if (newfuncp->initsp()) newfuncp->initsp()->unlinkFrBackWithNext()->deleteTree(); if (newfuncp->stmtsp()) newfuncp->stmtsp()->unlinkFrBackWithNext()->deleteTree(); @@ -152,9 +152,8 @@ class DescopeVisitor final : public VNVisitor { = (nextIt2 != m_modFuncs.end() && nextIt2->first == name); UASSERT_OBJ(funcp->scopep(), funcp, "Not scoped"); - UINFO(6, " Wrapping " << name << " " << funcp << endl); - UINFO(6, - " at " << newfuncp->argTypes() << " und " << funcp->argTypes() << endl); + UINFO(6, " Wrapping " << name << " " << funcp); + UINFO(6, " at " << newfuncp->argTypes() << " und " << funcp->argTypes()); funcp->declPrivate(true); AstVarRef* argsp = nullptr; for (AstNode* stmtp = newfuncp->argsp(); stmtp; stmtp = stmtp->nextp()) { @@ -199,7 +198,7 @@ class DescopeVisitor final : public VNVisitor { if (debug() >= 9) newfuncp->dumpTree("- newfunc: "); } else { // Only a single function under this name, we can rename it - UINFO(6, " Wrapping " << name << " just one " << topFuncp << endl); + UINFO(6, " Wrapping " << name << " just one " << topFuncp); topFuncp->name(name); } } @@ -231,7 +230,7 @@ class DescopeVisitor final : public VNVisitor { return; } // Convert the hierch name - UINFO(9, " ref-in " << nodep << endl); + UINFO(9, " ref-in " << nodep); UASSERT_OBJ(m_scopep, nodep, "Node not under scope"); const AstVar* const varp = nodep->varScopep()->varp(); const AstScope* const scopep = nodep->varScopep()->scopep(); @@ -245,10 +244,10 @@ class DescopeVisitor final : public VNVisitor { nodep->selfPointer(descopedSelfPointer(scopep)); } nodep->varScopep(nullptr); - UINFO(9, " refout " << nodep << " selfPtr=" << nodep->selfPointer().asString() << endl); + UINFO(9, " refout " << nodep << " selfPtr=" << nodep->selfPointer().asString()); } void visit(AstCCall* nodep) override { - // UINFO(9, " " << nodep << endl); + // UINFO(9, " " << nodep); iterateChildren(nodep); // Convert the hierch name UASSERT_OBJ(m_scopep, nodep, "Node not under scope"); @@ -295,7 +294,7 @@ public: // Descope class functions void V3Descope::descopeAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DescopeVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("descope", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3DfgOptimizer.cpp b/src/V3DfgOptimizer.cpp index 32aba69d2..cf3a2393e 100644 --- a/src/V3DfgOptimizer.cpp +++ b/src/V3DfgOptimizer.cpp @@ -230,14 +230,14 @@ public: }; void V3DfgOptimizer::extract(AstNetlist* netlistp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Extract more optimization candidates DataflowExtractVisitor::apply(netlistp); V3Global::dumpCheckGlobalTree("dfg-extract", 0, dumpTreeEitherLevel() >= 3); } void V3DfgOptimizer::optimize(AstNetlist* netlistp, const string& label) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // NODE STATE // AstVar::user1 -> Used by V3DfgPasses::astToDfg, V3DfgPasses::eliminateVars @@ -258,7 +258,7 @@ void V3DfgOptimizer::optimize(AstNetlist* netlistp, const string& label) { AstModule* const modp = VN_CAST(nodep, Module); if (!modp) continue; - UINFO(4, "Applying DFG optimization to module '" << modp->name() << "'" << endl); + UINFO(4, "Applying DFG optimization to module '" << modp->name() << "'"); ++ctx.m_modules; // Build the DFG of this module diff --git a/src/V3DfgPeephole.cpp b/src/V3DfgPeephole.cpp index b88c726b3..f297d45bd 100644 --- a/src/V3DfgPeephole.cpp +++ b/src/V3DfgPeephole.cpp @@ -152,7 +152,7 @@ class V3DfgPeephole final : public DfgVisitor { // METHODS bool checkApplying(VDfgPeepholePattern id) { if (!m_ctx.m_enabled[id]) return false; - UINFO(9, "Applying DFG pattern " << id.ascii() << endl); + UINFO(9, "Applying DFG pattern " << id.ascii()); ++m_ctx.m_count[id]; return true; } diff --git a/src/V3DiagSarif.cpp b/src/V3DiagSarif.cpp index a7c4b5041..e8008725d 100644 --- a/src/V3DiagSarif.cpp +++ b/src/V3DiagSarif.cpp @@ -85,7 +85,7 @@ class V3DiagSarifImp final { : "warning"); string text = msg.text(); - // UINFO(9, "Result raw text " << text << endl << endl); + // UINFO(9, "Result raw text " << text); // We put the entire message including relatedLocations text // into the primary message text, because viewers such as @@ -190,6 +190,6 @@ void V3DiagSarif::pushMessage(const VErrorMessage& msg) VL_MT_DISABLED { void V3DiagSarif::output(bool success) { if (!v3Global.opt.diagnosticsSarif()) return; - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); V3DiagSarifImp::s().output(success); } diff --git a/src/V3DupFinder.cpp b/src/V3DupFinder.cpp index 409caa96c..33e7edae4 100644 --- a/src/V3DupFinder.cpp +++ b/src/V3DupFinder.cpp @@ -53,7 +53,7 @@ V3DupFinder::iterator V3DupFinder::findDuplicate(AstNode* nodep, V3DupFinderUser } void V3DupFinder::dumpFile(const string& filename, bool tree) { - UINFO(2, "Dumping " << filename << endl); + UINFO(2, "Dumping " << filename); const std::unique_ptr logp{V3File::new_ofstream(filename)}; if (logp->fail()) v3fatal("Can't write file: " << filename); diff --git a/src/V3EmitCConstPool.cpp b/src/V3EmitCConstPool.cpp index b94dbc6aa..e43d511ef 100644 --- a/src/V3EmitCConstPool.cpp +++ b/src/V3EmitCConstPool.cpp @@ -121,6 +121,6 @@ public: // EmitC static functions void V3EmitC::emitcConstPool() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); EmitCConstPool(v3Global.rootp()->constPoolp()); } diff --git a/src/V3EmitCFunc.cpp b/src/V3EmitCFunc.cpp index 4d0885f19..34971f85f 100644 --- a/src/V3EmitCFunc.cpp +++ b/src/V3EmitCFunc.cpp @@ -321,7 +321,7 @@ void EmitCFunc::displayNode(AstNode* nodep, AstScopeName* scopenamep, const stri bool inPct = false; bool ignore = false; for (; pos != vformat.end(); ++pos) { - // UINFO(1, "Parse '" << *pos << "' IP" << inPct << " List " << cvtToHex(elistp) << endl); + // UINFO(1, "Parse '" << *pos << "' IP" << inPct << " List " << cvtToHex(elistp)); if (!inPct && pos[0] == '%') { inPct = true; ignore = false; diff --git a/src/V3EmitCHeaders.cpp b/src/V3EmitCHeaders.cpp index a8ccf7694..16c6f6314 100644 --- a/src/V3EmitCHeaders.cpp +++ b/src/V3EmitCHeaders.cpp @@ -605,7 +605,7 @@ class EmitCHeader final : public EmitCConstInit { } explicit EmitCHeader(const AstNodeModule* modp) { - UINFO(5, " Emitting header for " << prefixNameProtect(modp) << endl); + UINFO(5, " Emitting header for " << prefixNameProtect(modp)); // Open output file const string filename = v3Global.opt.makeDir() + "/" + prefixNameProtect(modp) + ".h"; @@ -665,7 +665,7 @@ public: // EmitC class functions void V3EmitC::emitcHeaders() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Process each module in turn for (const AstNode* nodep = v3Global.rootp()->modulesp(); nodep; nodep = nodep->nextp()) { diff --git a/src/V3EmitCImp.cpp b/src/V3EmitCImp.cpp index ef8ec9241..fd6fbdc6b 100644 --- a/src/V3EmitCImp.cpp +++ b/src/V3EmitCImp.cpp @@ -549,7 +549,7 @@ class EmitCImp final : EmitCFunc { : m_fileModp{modp} , m_slow{slow} , m_cfilesr{cfilesr} { - UINFO(5, " Emitting implementation of " << prefixNameProtect(modp) << endl); + UINFO(5, " Emitting implementation of " << prefixNameProtect(modp)); m_modp = modp; @@ -978,7 +978,7 @@ public: // EmitC class functions void V3EmitC::emitcImp() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Make parent module pointers available. const EmitCParentModule emitCParentModule; std::list> cfiles; @@ -1019,7 +1019,7 @@ void V3EmitC::emitcImp() { } void V3EmitC::emitcFiles() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); for (AstNodeFile* filep = v3Global.rootp()->filesp(); filep; filep = VN_AS(filep->nextp(), NodeFile)) { AstCFile* const cfilep = VN_CAST(filep, CFile); diff --git a/src/V3EmitCInlines.cpp b/src/V3EmitCInlines.cpp index 73cfec669..8ac603114 100644 --- a/src/V3EmitCInlines.cpp +++ b/src/V3EmitCInlines.cpp @@ -61,6 +61,6 @@ public: // EmitC class functions void V3EmitC::emitcInlines() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { EmitCInlines{v3Global.rootp()}; } } diff --git a/src/V3EmitCMain.cpp b/src/V3EmitCMain.cpp index 2abdcd70b..8ee6fe5a2 100644 --- a/src/V3EmitCMain.cpp +++ b/src/V3EmitCMain.cpp @@ -123,6 +123,6 @@ private: // EmitC class functions void V3EmitCMain::emit() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { EmitCMain visitor; } } diff --git a/src/V3EmitCMake.cpp b/src/V3EmitCMake.cpp index a908c7038..c76e33c4d 100644 --- a/src/V3EmitCMake.cpp +++ b/src/V3EmitCMake.cpp @@ -221,6 +221,6 @@ public: }; void V3EmitCMake::emit() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); const CMakeEmitter emitter; } diff --git a/src/V3EmitCModel.cpp b/src/V3EmitCModel.cpp index 60de32beb..5517e0db3 100644 --- a/src/V3EmitCModel.cpp +++ b/src/V3EmitCModel.cpp @@ -697,6 +697,6 @@ public: // EmitC class functions void V3EmitC::emitcModel() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { EmitCModel{v3Global.rootp()}; } } diff --git a/src/V3EmitCPch.cpp b/src/V3EmitCPch.cpp index ca56694de..e1c6df69b 100644 --- a/src/V3EmitCPch.cpp +++ b/src/V3EmitCPch.cpp @@ -73,6 +73,6 @@ public: // EmitC static functions void V3EmitC::emitcPch() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); EmitCPch{}; } diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index 12bca0e86..bde94b017 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -235,12 +235,12 @@ class EmitCSyms final : EmitCBaseVisitorConst { varBase = whole; } // UINFO(9, "For " << scopep->name() << " - " << varp->name() << " Scp " - // << scpName << "Var " << varBase << endl); + // << scpName << "Var " << varBase); const string varBasePretty = AstNode::vpiName(VName::dehash(varBase)); const string scpPretty = AstNode::prettyName(VName::dehash(scpName)); const string scpSym = scopeSymString(VName::dehash(scpName)); // UINFO(9, " scnameins sp " << scpName << " sp " << scpPretty << " ss " - // << scpSym << endl); + // << scpSym); if (v3Global.opt.vpi()) varHierarchyScopes(scpName); if (m_scopeNames.find(scpSym) == m_scopeNames.end()) { // cppcheck-suppress stlFindInsert @@ -348,7 +348,7 @@ class EmitCSyms final : EmitCBaseVisitorConst { void visit(AstScopeName* nodep) override { const string name = nodep->scopeSymName(); // UINFO(9, "scnameins sp " << nodep->name() << " sp " << nodep->scopePrettySymName() - // << " ss" << name << endl); + // << " ss" << name); const int timeunit = m_modp ? m_modp->timeunit().powerOfTen() : 0; m_dpiScopeNames.emplace(name, ScopeData{nodep, name, nodep->scopePrettySymName(), "", timeunit, "SCOPE_OTHER"}); @@ -402,7 +402,7 @@ public: }; void EmitCSyms::emitSymHdr() { - UINFO(6, __FUNCTION__ << ": " << endl); + UINFO(6, __FUNCTION__ << ": "); const string filename = v3Global.opt.makeDir() + "/" + symClassName() + ".h"; AstCFile* const cfilep = newCFile(filename, true /*slow*/, false /*source*/); V3OutCFile* const ofilep = optSystemC() ? new V3OutScFile{filename} : new V3OutCFile{filename}; @@ -686,7 +686,7 @@ void EmitCSyms::emitScopeHier(bool destroy) { } void EmitCSyms::emitSymImp() { - UINFO(6, __FUNCTION__ << ": " << endl); + UINFO(6, __FUNCTION__ << ": "); const string filename = v3Global.opt.makeDir() + "/" + symClassName() + ".cpp"; AstCFile* const cfilep = newCFile(filename, true /*slow*/, true /*source*/); cfilep->support(true); @@ -1025,7 +1025,7 @@ void EmitCSyms::emitSymImp() { //###################################################################### void EmitCSyms::emitDpiHdr() { - UINFO(6, __FUNCTION__ << ": " << endl); + UINFO(6, __FUNCTION__ << ": "); const string filename = v3Global.opt.makeDir() + "/" + topClassName() + "__Dpi.h"; AstCFile* const cfilep = newCFile(filename, false /*slow*/, false /*source*/); cfilep->support(true); @@ -1080,7 +1080,7 @@ void EmitCSyms::emitDpiHdr() { //###################################################################### void EmitCSyms::emitDpiImp() { - UINFO(6, __FUNCTION__ << ": " << endl); + UINFO(6, __FUNCTION__ << ": "); const string filename = v3Global.opt.makeDir() + "/" + topClassName() + "__Dpi.cpp"; AstCFile* const cfilep = newCFile(filename, false /*slow*/, true /*source*/); cfilep->support(true); @@ -1138,6 +1138,6 @@ void EmitCSyms::emitDpiImp() { // EmitC class functions void V3EmitC::emitcSyms(bool dpiHdrOnly) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); EmitCSyms{v3Global.rootp(), dpiHdrOnly}; } diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index 246f0f027..3a71b5300 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -185,13 +185,13 @@ private: if (inputFilesCount < MIN_FILES_COUNT && inputFilesCount <= static_cast(totalBucketsNum)) { UINFO(4, "File concatenation skipped: Too few files (" << m_inputFiles.size() << " < " - << MIN_FILES_COUNT << ")\n"); + << MIN_FILES_COUNT << ")"); groupingRedundant = true; } if (inputFilesCount < (MIN_FILES_PER_BUCKET * totalBucketsNum)) { UINFO(4, "File concatenation skipped: Too few files per bucket (" << m_inputFiles.size() << " < " << MIN_FILES_PER_BUCKET << " - " - << totalBucketsNum << ")\n"); + << totalBucketsNum << ")"); groupingRedundant = true; } if (!groupingRedundant) return false; @@ -394,19 +394,19 @@ private: } void process() { - UINFO(4, __FUNCTION__ << " group file prefix: " << m_groupFilePrefix << '\n'); - UINFO(5, "Number of input files: " << m_inputFiles.size() << '\n'); - UINFO(5, "Total score: " << m_totalScore << '\n'); + UINFO(4, __FUNCTION__ << " group file prefix: " << m_groupFilePrefix); + UINFO(5, "Number of input files: " << m_inputFiles.size()); + UINFO(5, "Total score: " << m_totalScore); const int totalBucketsNum = v3Global.opt.outputGroups(); - UINFO(5, "Number of buckets: " << totalBucketsNum << '\n'); + UINFO(5, "Number of buckets: " << totalBucketsNum); UASSERT(totalBucketsNum > 0, "More than 0 buckets required"); if (fallbackNoGrouping(m_inputFiles.size())) return; if (debug() >= 6 || dumpLevel() >= 6) { const string filename = v3Global.debugFilename("outputgroup") + ".txt"; - UINFO(5, "Dumping " << filename << endl); + UINFO(5, "Dumping " << filename); m_logp = std::unique_ptr{V3File::new_ofstream(filename)}; if (m_logp->fail()) v3fatal("Can't write file: " << filename); } @@ -427,7 +427,7 @@ private: list.m_isConcatenable = false; UINFO(5, "Excluding from concatenation: Work List contains only one file: " "Work List #" - << list.m_dbgId << endl); + << list.m_dbgId); continue; } @@ -926,11 +926,11 @@ public: // Gate class functions void V3EmitMk::emitmk() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); const EmitMk emitter; } void V3EmitMk::emitHierVerilation(const V3HierBlockPlan* planp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); EmitMkHierVerilation{planp}; } diff --git a/src/V3EmitMkJson.cpp b/src/V3EmitMkJson.cpp index d42c57ad3..09bfc6271 100644 --- a/src/V3EmitMkJson.cpp +++ b/src/V3EmitMkJson.cpp @@ -178,6 +178,6 @@ public: }; void V3EmitMkJson::emit() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); const V3EmitMkJsonEmitter emitter; } diff --git a/src/V3EmitV.cpp b/src/V3EmitV.cpp index 5eef0746e..3facbbc5d 100644 --- a/src/V3EmitV.cpp +++ b/src/V3EmitV.cpp @@ -995,7 +995,7 @@ void V3EmitV::verilogForTree(const AstNode* nodep, std::ostream& os) { } void V3EmitV::emitvFiles() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); for (AstNodeFile* filep = v3Global.rootp()->filesp(); filep; filep = VN_AS(filep->nextp(), NodeFile)) { AstVFile* const vfilep = VN_CAST(filep, VFile); @@ -1009,7 +1009,7 @@ void V3EmitV::emitvFiles() { } void V3EmitV::debugEmitV(const string& filename) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); V3OutVFile of{filename}; { EmitVFileVisitor{v3Global.rootp(), &of, true, true}; } } diff --git a/src/V3EmitXml.cpp b/src/V3EmitXml.cpp index 332ca6f06..2fb2d1896 100644 --- a/src/V3EmitXml.cpp +++ b/src/V3EmitXml.cpp @@ -436,7 +436,7 @@ public: // EmitXml class functions void V3EmitXml::emitxml() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // All-in-one file const string filename = (v3Global.opt.xmlOutput().empty() ? v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + ".xml" diff --git a/src/V3Error.h b/src/V3Error.h index e7c52d1e9..f96e1d81a 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -624,13 +624,17 @@ void v3errorEndFatal(std::ostringstream& sstr) #define UINFO(level, stmsg) \ do { \ if (VL_UNCOVERABLE(debug() >= (level))) { \ - std::cout << "- " << V3Error::lineStr(__FILE__, __LINE__) << stmsg; \ + std::ostringstream ss; \ + ss << "- " << V3Error::lineStr(__FILE__, __LINE__) << stmsg; \ + if (ss.str()[ss.str().size() - 1] != '\n') ss << '\n'; \ + std::cout << ss.str(); \ } \ } while (false) -#define UINFONL(level, stmsg) \ - do { \ - if (VL_UNCOVERABLE(debug() >= (level))) { std::cout << stmsg; } \ - } while (false) +/// Print the prefix of UINFO, but no newline. No level argument, as +/// always need an if() at the caller site to determine if rest of the line +/// gets printed or not +#define UINFO_PREFIX(stmsg) \ + do { std::cout << "- " << V3Error::lineStr(__FILE__, __LINE__) << stmsg; } while (false) /// Compile statements only when debug build #ifdef VL_DEBUG diff --git a/src/V3ExecGraph.cpp b/src/V3ExecGraph.cpp index 318009efe..8a011fcfd 100644 --- a/src/V3ExecGraph.cpp +++ b/src/V3ExecGraph.cpp @@ -383,7 +383,7 @@ class PackThreads final { } UINFO(6, "Sandbagged end time for " << mtaskp->name() << " on th " << threadId << " = " - << sandbaggedEndTime << endl); + << sandbaggedEndTime); return sandbaggedEndTime; } @@ -454,7 +454,7 @@ class PackThreads final { if (timeBegin > bestTime) { UINFO(6, "th " << threadId << " busy until " << timeBegin << ", later than bestTime " << bestTime - << ", skipping thread.\n"); + << ", skipping thread."); break; } for (const V3GraphEdge& edge : mtaskp->inEdges()) { @@ -463,7 +463,7 @@ class PackThreads final { if (priorEndTime > timeBegin) timeBegin = priorEndTime; } UINFO(6, "Task " << mtaskp->name() << " start at " << timeBegin - << " on thread " << threadId << endl); + << " on thread " << threadId); if ((timeBegin < bestTime) || ((timeBegin == bestTime) && bestMtaskp // Redundant, but appeases static analysis tools @@ -515,7 +515,7 @@ class PackThreads final { "Tasks after one being assigned should not be ready"); if (isReady(schedule, nextp)) { readyMTasks.insert(nextp); - UINFO(6, "Inserted " << nextp->name() << " into ready\n"); + UINFO(6, "Inserted " << nextp->name() << " into ready"); } } } @@ -754,9 +754,9 @@ void normalizeCosts(Costs& costs) { // profiled data. (Improves results if only a few profiles missing.) const double estToProfile = static_cast(sumCostProfiled) / static_cast(sumCostEstimate); - UINFO(5, "Estimated data needs scaling by " - << estToProfile << ", sumCostProfiled=" << sumCostProfiled - << " sumCostEstimate=" << sumCostEstimate << endl); + UINFO(5, "Estimated data needs scaling by " << estToProfile + << ", sumCostProfiled=" << sumCostProfiled + << " sumCostEstimate=" << sumCostEstimate); for (auto& est : costs) { uint64_t& costEstimate = est.second.first; costEstimate = scaleCost(costEstimate, estToProfile); @@ -770,14 +770,13 @@ void normalizeCosts(Costs& costs) { const uint64_t& costProfiled = est.second.second; if (maxCost < costEstimate) maxCost = costEstimate; if (maxCost < costProfiled) maxCost = costProfiled; - UINFO(9, - "Post uint scale: ce = " << est.second.first << " cp=" << est.second.second << endl); + UINFO(9, "Post uint scale: ce = " << est.second.first << " cp=" << est.second.second); } const uint64_t scaleDownTo = 10000000; // Extra room for future algorithms to add costs if (maxCost > scaleDownTo) { const double scaleup = static_cast(scaleDownTo) / static_cast(maxCost); - UINFO(5, "Scaling data to within 32-bits by multiply by=" << scaleup << ", maxCost=" - << maxCost << endl); + UINFO(5, "Scaling data to within 32-bits by multiply by=" << scaleup + << ", maxCost=" << maxCost); for (auto& est : costs) { est.second.first = scaleCost(est.second.first, scaleup); est.second.second = scaleCost(est.second.second, scaleup); @@ -797,7 +796,7 @@ void fillinCosts(V3Graph* execMTaskGraphp) { = V3Config::getProfileData(v3Global.opt.prefix(), mtp->hashName()); if (costProfiled) { UINFO(5, "Profile data for mtask " << mtp->id() << " " << mtp->hashName() - << " cost override " << costProfiled << endl); + << " cost override " << costProfiled); } costs[mtp->id()] = std::make_pair(costEstimate, costProfiled); } @@ -810,7 +809,7 @@ void fillinCosts(V3Graph* execMTaskGraphp) { ExecMTask* const mtp = vtx.as(); const uint32_t costEstimate = costs[mtp->id()].first; const uint64_t costProfiled = costs[mtp->id()].second; - UINFO(9, "ce = " << costEstimate << " cp=" << costProfiled << endl); + UINFO(9, "ce = " << costEstimate << " cp=" << costProfiled); UASSERT(costEstimate <= (1UL << 31), "cost scaling math would overflow uint32"); UASSERT(costProfiled <= (1UL << 31), "cost scaling math would overflow uint32"); const uint64_t costProfiled32 = static_cast(costProfiled); @@ -863,7 +862,7 @@ void finalizeCosts(V3Graph* execMTaskGraphp) { // the MTaskBody to see if it's empty. That's the source of truth. AstMTaskBody* const bodyp = mtp->bodyp(); if (!bodyp->stmtsp()) { // Kill this empty mtask - UINFO(6, "Removing zero-cost " << mtp->name() << endl); + UINFO(6, "Removing zero-cost " << mtp->name()); for (V3GraphEdge& in : mtp->inEdges()) { for (V3GraphEdge& out : mtp->outEdges()) { new V3GraphEdge{execMTaskGraphp, in.fromp(), out.top(), 1}; @@ -891,12 +890,12 @@ void finalizeCosts(V3Graph* execMTaskGraphp) { V3Stats::addStat("MTask graph, final, parallelism factor", report.parallelismFactor()); if (debug() >= 3) { UINFO(0, "\n"); - UINFO(0, " Final mtask parallelism report:\n"); - UINFO(0, " Critical path cost = " << report.criticalPathCost() << "\n"); - UINFO(0, " Total graph cost = " << report.totalGraphCost() << "\n"); - UINFO(0, " MTask vertex count = " << report.vertexCount() << "\n"); - UINFO(0, " Edge count = " << report.edgeCount() << "\n"); - UINFO(0, " Parallelism factor = " << report.parallelismFactor() << "\n"); + UINFO(0, " Final mtask parallelism report:"); + UINFO(0, " Critical path cost = " << report.criticalPathCost()); + UINFO(0, " Total graph cost = " << report.totalGraphCost()); + UINFO(0, " MTask vertex count = " << report.vertexCount()); + UINFO(0, " Edge count = " << report.edgeCount()); + UINFO(0, " Parallelism factor = " << report.parallelismFactor()); } } diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index 401923ef3..a0109d51e 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -85,7 +85,7 @@ class ExpandVisitor final : public VNVisitor { // Use state that ExpandOkVisitor calculated bool isImpure(AstNode* nodep) { const bool impure = nodep->user2(); - if (impure) UINFO(9, " impure " << nodep << endl); + if (impure) UINFO(9, " impure " << nodep); return impure; } @@ -265,7 +265,7 @@ class ExpandVisitor final : public VNVisitor { //==================== bool expandWide(AstNodeAssign* nodep, AstConst* rhsp) { - UINFO(8, " Wordize ASSIGN(CONST) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(CONST) " << nodep); if (!doExpandWide(nodep)) return false; // -> {for each_word{ ASSIGN(WORDSEL(wide,#),WORDSEL(CONST,#))}} if (rhsp->num().isFourState()) { @@ -281,7 +281,7 @@ class ExpandVisitor final : public VNVisitor { } //-------- Uniops bool expandWide(AstNodeAssign* nodep, AstVarRef* rhsp) { - UINFO(8, " Wordize ASSIGN(VARREF) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(VARREF) " << nodep); if (!doExpandWide(nodep)) return false; for (int w = 0; w < nodep->widthWords(); ++w) { addWordAssign(nodep, w, newAstWordSelClone(rhsp, w)); @@ -289,7 +289,7 @@ class ExpandVisitor final : public VNVisitor { return true; } bool expandWide(AstNodeAssign* nodep, AstArraySel* rhsp) { - UINFO(8, " Wordize ASSIGN(ARRAYSEL) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(ARRAYSEL) " << nodep); UASSERT_OBJ(!VN_IS(nodep->dtypep()->skipRefp(), UnpackArrayDType), nodep, "ArraySel with unpacked arrays should have been removed in V3Slice"); if (!doExpandWide(nodep)) return false; @@ -299,7 +299,7 @@ class ExpandVisitor final : public VNVisitor { return true; } bool expandWide(AstNodeAssign* nodep, AstNot* rhsp) { - UINFO(8, " Wordize ASSIGN(NOT) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(NOT) " << nodep); // -> {for each_word{ ASSIGN(WORDSEL(wide,#),NOT(WORDSEL(lhs,#))) }} if (!doExpandWide(nodep)) return false; FileLine* const fl = rhsp->fileline(); @@ -310,7 +310,7 @@ class ExpandVisitor final : public VNVisitor { } //-------- Biops bool expandWide(AstNodeAssign* nodep, AstAnd* rhsp) { - UINFO(8, " Wordize ASSIGN(AND) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(AND) " << nodep); if (!doExpandWide(nodep)) return false; FileLine* const fl = nodep->fileline(); for (int w = 0; w < nodep->widthWords(); ++w) { @@ -321,7 +321,7 @@ class ExpandVisitor final : public VNVisitor { return true; } bool expandWide(AstNodeAssign* nodep, AstOr* rhsp) { - UINFO(8, " Wordize ASSIGN(OR) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(OR) " << nodep); if (!doExpandWide(nodep)) return false; FileLine* const fl = nodep->fileline(); for (int w = 0; w < nodep->widthWords(); ++w) { @@ -332,7 +332,7 @@ class ExpandVisitor final : public VNVisitor { return true; } bool expandWide(AstNodeAssign* nodep, AstXor* rhsp) { - UINFO(8, " Wordize ASSIGN(XOR) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(XOR) " << nodep); if (!doExpandWide(nodep)) return false; FileLine* const fl = nodep->fileline(); for (int w = 0; w < nodep->widthWords(); ++w) { @@ -344,7 +344,7 @@ class ExpandVisitor final : public VNVisitor { } //-------- Triops bool expandWide(AstNodeAssign* nodep, AstNodeCond* rhsp) { - UINFO(8, " Wordize ASSIGN(COND) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(COND) " << nodep); if (!doExpandWide(nodep)) return false; FileLine* const fl = nodep->fileline(); for (int w = 0; w < nodep->widthWords(); ++w) { @@ -372,7 +372,7 @@ class ExpandVisitor final : public VNVisitor { } else if (lhsp->isWide()) { nodep->v3fatalSrc("extending larger thing into smaller?"); } else { - UINFO(8, " EXTEND(q<-l) " << nodep << endl); + UINFO(8, " EXTEND(q<-l) " << nodep); newp = new AstCCast{nodep->fileline(), lhsp, nodep}; } } else { // Long @@ -384,7 +384,7 @@ class ExpandVisitor final : public VNVisitor { } } bool expandWide(AstNodeAssign* nodep, AstExtend* rhsp) { - UINFO(8, " Wordize ASSIGN(EXTEND) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(EXTEND) " << nodep); if (!doExpandWide(nodep)) return false; AstNodeExpr* const rlhsp = rhsp->lhsp(); for (int w = 0; w < rlhsp->widthWords(); ++w) { @@ -408,7 +408,7 @@ class ExpandVisitor final : public VNVisitor { // See under ASSIGN(WIDE) } else if (nodep->fromp()->isWide()) { if (isImpure(nodep)) return; - UINFO(8, " SEL(wide) " << nodep << endl); + UINFO(8, " SEL(wide) " << nodep); UASSERT_OBJ(nodep->widthConst() <= 64, nodep, "Inconsistent width"); // Selection amounts // Check for constant shifts & save some constification work later. @@ -482,7 +482,7 @@ class ExpandVisitor final : public VNVisitor { VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep); } else { // Long/Quad from Long/Quad // No isImpure() check - can handle side effects in below - UINFO(8, " SEL->SHIFT " << nodep << endl); + UINFO(8, " SEL->SHIFT " << nodep); FileLine* const fl = nodep->fileline(); AstNodeExpr* fromp = nodep->fromp()->unlinkFrBack(); AstNodeExpr* const lsbp = nodep->lsbp()->unlinkFrBack(); @@ -501,13 +501,13 @@ class ExpandVisitor final : public VNVisitor { if (!doExpandWide(nodep)) return false; if (VN_IS(rhsp->lsbp(), Const) && VL_BITBIT_E(rhsp->lsbConst()) == 0) { const int lsb = rhsp->lsbConst(); - UINFO(8, " Wordize ASSIGN(SEL,align) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(SEL,align) " << nodep); for (int w = 0; w < nodep->widthWords(); ++w) { addWordAssign(nodep, w, newAstWordSelClone(rhsp->fromp(), w + VL_BITWORD_E(lsb))); } return true; } else { - UINFO(8, " Wordize ASSIGN(EXTRACT,misalign) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(EXTRACT,misalign) " << nodep); FileLine* const nfl = nodep->fileline(); FileLine* const rfl = rhsp->fileline(); FileLine* const ffl = rhsp->fromp()->fileline(); @@ -559,7 +559,7 @@ class ExpandVisitor final : public VNVisitor { V3Number maskold{nodep, destp->widthMin()}; maskold.opNot(maskset); if (destwide) { - UINFO(8, " ASSIGNSEL(const,wide) " << nodep << endl); + UINFO(8, " ASSIGNSEL(const,wide) " << nodep); for (int w = 0; w < destp->widthWords(); ++w) { if (w >= VL_BITWORD_E(lsb) && w <= VL_BITWORD_E(msb)) { // else we would just be setting it to the same exact value @@ -591,7 +591,7 @@ class ExpandVisitor final : public VNVisitor { VL_DO_DANGLING(rhsp->deleteTree(), rhsp); VL_DO_DANGLING(destp->deleteTree(), destp); } else { - UINFO(8, " ASSIGNSEL(const,narrow) " << nodep << endl); + UINFO(8, " ASSIGNSEL(const,narrow) " << nodep); if (destp->isQuad() && !rhsp->isQuad()) rhsp = new AstCCast{nfl, rhsp, nodep}; AstNodeExpr* oldvalp = destp->cloneTreePure(true); fixCloneLvalue(oldvalp); @@ -613,7 +613,7 @@ class ExpandVisitor final : public VNVisitor { return true; } else { // non-const select offset if (destwide && lhsp->widthConst() == 1) { - UINFO(8, " ASSIGNSEL(varlsb,wide,1bit) " << nodep << endl); + UINFO(8, " ASSIGNSEL(varlsb,wide,1bit) " << nodep); AstNodeExpr* const rhsp = nodep->rhsp()->unlinkFrBack(); AstNodeExpr* const destp = lhsp->fromp()->unlinkFrBack(); AstNodeExpr* oldvalp = newWordSel(lfl, destp->cloneTreePure(true), lhsp->lsbp()); @@ -638,7 +638,7 @@ class ExpandVisitor final : public VNVisitor { insertBefore(nodep, newp); return true; } else if (destwide) { - UINFO(8, " ASSIGNSEL(varlsb,wide) -- NoOp -- " << nodep << endl); + UINFO(8, " ASSIGNSEL(varlsb,wide) -- NoOp -- " << nodep); // For wide destp, we can either form a equation for every destination word, // with the appropriate long equation of if it's being written or not. // Or, we can use a LHS variable arraysel with @@ -650,7 +650,7 @@ class ExpandVisitor final : public VNVisitor { // Reconsider if we get subexpression elimination. return false; } else { - UINFO(8, " ASSIGNSEL(varlsb,narrow) " << nodep << endl); + UINFO(8, " ASSIGNSEL(varlsb,narrow) " << nodep); // nodep->dumpTree("- old: "); AstNodeExpr* rhsp = nodep->rhsp()->unlinkFrBack(); AstNodeExpr* const destp = lhsp->fromp()->unlinkFrBack(); @@ -694,7 +694,7 @@ class ExpandVisitor final : public VNVisitor { // See under ASSIGN(WIDE) } else { // No isImpure() check - can handle side effects in below - UINFO(8, " CONCAT " << nodep << endl); + UINFO(8, " CONCAT " << nodep); FileLine* const fl = nodep->fileline(); AstNodeExpr* lhsp = nodep->lhsp()->unlinkFrBack(); AstNodeExpr* rhsp = nodep->rhsp()->unlinkFrBack(); @@ -708,7 +708,7 @@ class ExpandVisitor final : public VNVisitor { } } bool expandWide(AstNodeAssign* nodep, AstConcat* rhsp) { - UINFO(8, " Wordize ASSIGN(CONCAT) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(CONCAT) " << nodep); if (!doExpandWide(rhsp)) return false; FileLine* const fl = rhsp->fileline(); // Lhs or Rhs may be word, long, or quad. @@ -737,10 +737,10 @@ class ExpandVisitor final : public VNVisitor { AstNodeExpr* newp; const int lhswidth = lhsp->widthMin(); if (lhswidth == 1) { - UINFO(8, " REPLICATE(w1) " << nodep << endl); + UINFO(8, " REPLICATE(w1) " << nodep); newp = new AstNegate{fl, lhsp}; } else { - UINFO(8, " REPLICATE " << nodep << endl); + UINFO(8, " REPLICATE " << nodep); const AstConst* const constp = VN_AS(nodep->countp(), Const); UASSERT_OBJ(constp, nodep, "Replication value isn't a constant. Checked earlier!"); @@ -764,7 +764,7 @@ class ExpandVisitor final : public VNVisitor { } } bool expandWide(AstNodeAssign* nodep, AstReplicate* rhsp) { - UINFO(8, " Wordize ASSIGN(REPLICATE) " << nodep << endl); + UINFO(8, " Wordize ASSIGN(REPLICATE) " << nodep); if (!doExpandWide(rhsp)) return false; FileLine* const fl = nodep->fileline(); AstNodeExpr* const lhsp = rhsp->srcp(); @@ -795,7 +795,7 @@ class ExpandVisitor final : public VNVisitor { iterateChildren(nodep); if (nodep->lhsp()->isWide()) { if (isImpure(nodep)) return; - UINFO(8, " Wordize EQ/NEQ " << nodep << endl); + UINFO(8, " Wordize EQ/NEQ " << nodep); // -> (0=={or{for each_word{WORDSEL(lhs,#)^WORDSEL(rhs,#)}}} FileLine* const fl = nodep->fileline(); AstNodeExpr* newp = nullptr; @@ -821,7 +821,7 @@ class ExpandVisitor final : public VNVisitor { FileLine* const fl = nodep->fileline(); if (nodep->lhsp()->isWide()) { if (isImpure(nodep)) return; - UINFO(8, " Wordize REDOR " << nodep << endl); + UINFO(8, " Wordize REDOR " << nodep); // -> (0!={or{for each_word{WORDSEL(lhs,#)}}} AstNodeExpr* newp = nullptr; for (int w = 0; w < nodep->lhsp()->widthWords(); ++w) { @@ -832,7 +832,7 @@ class ExpandVisitor final : public VNVisitor { VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep); } else { // No isImpure() check - can handle side effects in below - UINFO(8, " REDOR->EQ " << nodep << endl); + UINFO(8, " REDOR->EQ " << nodep); AstNodeExpr* const lhsp = nodep->lhsp()->unlinkFrBack(); AstNodeExpr* const newp = new AstNeq{ fl, new AstConst{fl, AstConst::WidthedValue{}, longOrQuadWidth(nodep), 0}, lhsp}; @@ -845,7 +845,7 @@ class ExpandVisitor final : public VNVisitor { FileLine* const fl = nodep->fileline(); if (nodep->lhsp()->isWide()) { if (isImpure(nodep)) return; - UINFO(8, " Wordize REDAND " << nodep << endl); + UINFO(8, " Wordize REDAND " << nodep); // -> (0!={and{for each_word{WORDSEL(lhs,#)}}} AstNodeExpr* newp = nullptr; for (int w = 0; w < nodep->lhsp()->widthWords(); ++w) { @@ -865,7 +865,7 @@ class ExpandVisitor final : public VNVisitor { VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep); } else { // No isImpure() check - can handle side effects in below - UINFO(8, " REDAND->EQ " << nodep << endl); + UINFO(8, " REDAND->EQ " << nodep); AstNodeExpr* const lhsp = nodep->lhsp()->unlinkFrBack(); AstNodeExpr* const newp = new AstEq{fl, new AstConst{fl, wordMask(lhsp)}, lhsp}; VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep); @@ -876,7 +876,7 @@ class ExpandVisitor final : public VNVisitor { iterateChildren(nodep); if (nodep->lhsp()->isWide()) { if (isImpure(nodep)) return; - UINFO(8, " Wordize REDXOR " << nodep << endl); + UINFO(8, " Wordize REDXOR " << nodep); // -> (0!={redxor{for each_word{XOR(WORDSEL(lhs,#))}}} FileLine* const fl = nodep->fileline(); AstNodeExpr* newp = nullptr; @@ -885,7 +885,7 @@ class ExpandVisitor final : public VNVisitor { newp = newp ? new AstXor{fl, newp, eqp} : eqp; } newp = new AstRedXor{fl, newp}; - UINFO(8, " Wordize REDXORnew " << newp << endl); + UINFO(8, " Wordize REDXORnew " << newp); VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep); } // We don't reduce non-wide XORs, as its more efficient to use a temp register, @@ -962,7 +962,7 @@ public: // Expand class functions void V3Expand::expandAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ExpandOkVisitor okVisitor{nodep}; ExpandVisitor{nodep}; diff --git a/src/V3File.cpp b/src/V3File.cpp index fffd6bf87..5997b29ef 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -97,7 +97,7 @@ class V3FileDependImp final { m_stat.st_mtime = 1; m_exists = false; // Not an error... This can occur due to `line directives in the .vpp files - UINFO(1, "-Info: File not statable: " << filename() << endl); + UINFO(1, "-Info: File not statable: " << filename()); } } } @@ -215,7 +215,7 @@ void V3FileDependImp::writeTimes(const string& filename, const string& cmdlineIn bool V3FileDependImp::checkTimes(const string& filename, const string& cmdlineIn) { const std::unique_ptr ifp{V3File::new_ifstream_nodepend(filename)}; if (ifp->fail()) { - UINFO(2, " --check-times failed: no input " << filename << endl); + UINFO(2, " --check-times failed: no input " << filename); return false; } { @@ -231,7 +231,7 @@ bool V3FileDependImp::checkTimes(const string& filename, const string& cmdlineIn const string chkCmdline = V3Os::getline(*ifp, '"'); const string cmdline = stripQuotes(cmdlineIn); if (cmdline != chkCmdline) { - UINFO(2, " --check-times failed: different command line\n"); + UINFO(2, " --check-times failed: different command line"); return false; } } @@ -261,7 +261,7 @@ bool V3FileDependImp::checkTimes(const string& filename, const string& cmdlineIn struct stat chkStat; const int err = stat(chkFilename.c_str(), &chkStat); if (err != 0) { - UINFO(2, " --check-times failed: missing " << chkFilename << endl); + UINFO(2, " --check-times failed: missing " << chkFilename); return false; } // UINFO(9," got d="< 0 && size < todo) todo = size; errno = 0; const ssize_t got = read(fd, buf, todo); - // UINFO(9,"RD GOT g "<< got<<" e "< 0) { outl.push_back(string(buf, got)); @@ -424,7 +424,7 @@ private: // cppverilator-suppress unusedFunction unusedPrivateFunction string readFilterLine() { // Slow, but we don't need it much - UINFO(9, "readFilterLine\n"); + UINFO(9, "readFilterLine"); string line; while (!m_readEof) { StrList outl; @@ -458,7 +458,7 @@ private: while (!m_readEof && out.length() > offset) { errno = 0; const int got = write(m_writeFd, (out.c_str()) + offset, out.length() - offset); - // UINFO(9,"WR GOT g "<< got<<" e "< 0) { offset += got; @@ -502,12 +502,12 @@ private: v3fatal("--pipe-filter: stdin/stdout closed before pipe opened\n"); } - UINFO(1, "--pipe-filter: /bin/sh -c " << command << endl); + UINFO(1, "--pipe-filter: /bin/sh -c " << command); const pid_t pid = fork(); if (pid < 0) v3fatal("--pipe-filter: fork failed: " << std::strerror(errno)); if (pid == 0) { // Child - UINFO(6, "In child\n"); + UINFO(6, "In child"); close(fd_stdin[P_WR]); dup2(fd_stdin[P_RD], 0); close(fd_stdout[P_RD]); @@ -521,7 +521,7 @@ private: } else { // Parent UINFO(6, "In parent, child pid " << pid << " stdin " << fd_stdin[P_WR] << "->" << fd_stdin[P_RD] << " stdout " << fd_stdout[P_WR] - << "->" << fd_stdout[P_RD] << endl); + << "->" << fd_stdout[P_RD]); m_pid = pid; m_pidExited = false; m_pidStatus = 0; @@ -538,7 +538,7 @@ private: flags = fcntl(m_writeFd, F_GETFL, 0); fcntl(m_writeFd, F_SETFL, flags | O_NONBLOCK); } - UINFO(6, "startFilter complete\n"); + UINFO(6, "startFilter complete"); #else v3fatalSrc("--pipe-filter not implemented on this platform"); #endif @@ -548,7 +548,7 @@ private: if (m_pid) stopFilter(); } void stopFilter() { - UINFO(6, "Stopping filter process\n"); + UINFO(6, "Stopping filter process"); #ifdef INFILTER_PIPE close(m_writeFd); checkFilter(true); @@ -557,7 +557,7 @@ private: } m_pid = 0; close(m_readFd); - UINFO(6, "Closed\n"); + UINFO(6, "Closed"); #else v3fatalSrc("--pipe-filter not implemented on this platform"); #endif diff --git a/src/V3Force.cpp b/src/V3Force.cpp index 7be65fd53..eeb8e9f9c 100644 --- a/src/V3Force.cpp +++ b/src/V3Force.cpp @@ -408,7 +408,7 @@ public: // void V3Force::forceAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); if (!v3Global.hasForceableSignals()) return; { ForceState state; diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 5ac142bb8..10f765ca7 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -82,7 +82,7 @@ public: UASSERT_OBJ(!m_instance.initialized(), m_procp, "Dynamic scope already instantiated."); m_instance.m_classp = new AstClass{m_procp->fileline(), generateDynScopeClassName()}; - UINFO(9, "new dynscope class " << m_instance.m_classp << endl); + UINFO(9, "new dynscope class " << m_instance.m_classp); m_instance.m_refDTypep = new AstClassRefDType{m_procp->fileline(), m_instance.m_classp, nullptr}; v3Global.rootp()->typeTablep()->addTypesp(m_instance.m_refDTypep); @@ -91,7 +91,7 @@ public: generateDynScopeHandleName(m_procp), m_instance.m_refDTypep}; m_instance.m_handlep->funcLocal(true); m_instance.m_handlep->lifetime(VLifetime::AUTOMATIC); - UINFO(9, "new dynscope var " << m_instance.m_handlep << endl); + UINFO(9, "new dynscope var " << m_instance.m_handlep); return m_instance; } @@ -119,7 +119,7 @@ public: varp->varType(VVarType::MEMBER); varp->lifetime(VLifetime::AUTOMATIC); varp->usedLoopIdx(false); // No longer unrollable - UINFO(9, "insert DynScope member " << varp << endl); + UINFO(9, "insert DynScope member " << varp); m_instance.m_classp->addStmtsp(varp); } @@ -462,7 +462,7 @@ class DynScopeVisitor final : public VNVisitor { forkp->joinType(VJoinType::JOIN_NONE); nodep->replaceWith(forkp); forkp->addStmtsp(nodep); - UINFO(9, "assign new fork " << forkp << endl); + UINFO(9, "assign new fork " << forkp); } else { visit(static_cast(nodep)); } @@ -481,7 +481,7 @@ public: // Commit changes to AST bool typesAdded = false; for (auto orderp : m_frameOrder) { - UINFO(9, "Frame commit " << orderp << endl); + UINFO(9, "Frame commit " << orderp); auto frameIt = m_frames.find(orderp); UASSERT_OBJ(frameIt != m_frames.end(), orderp, "m_frames didn't contain m_frameOrder"); ForkDynScopeFrame* framep = frameIt->second; @@ -537,7 +537,7 @@ class ForkVisitor final : public VNVisitor { varp->direction(VDirection::INPUT); varp->funcLocal(true); varp->lifetime(VLifetime::AUTOMATIC); - UINFO(9, "new capture var " << varp << endl); + UINFO(9, "new capture var " << varp); m_capturedVarsp = AstNode::addNext(m_capturedVarsp, varp); // Use the original ref as an argument for call m_capturedVarRefsp @@ -603,7 +603,7 @@ class ForkVisitor final : public VNVisitor { } m_modp->addStmtsp(taskp); - UINFO(9, "new " << taskp << endl); + UINFO(9, "new " << taskp); AstTaskRef* const taskrefp = new AstTaskRef{nodep->fileline(), taskp, m_capturedVarRefsp}; AstStmtExpr* const taskcallp = taskrefp->makeStmt(); @@ -698,13 +698,13 @@ public: // Fork class functions void V3Fork::makeDynamicScopes(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { DynScopeVisitor{nodep}; } V3Global::dumpCheckGlobalTree("fork_dynscope", 0, dumpTreeEitherLevel() >= 3); } void V3Fork::makeTasks(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ForkVisitor{nodep}; } V3Global::dumpCheckGlobalTree("fork", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3FuncOpt.cpp b/src/V3FuncOpt.cpp index 4e869fd6f..6462542fa 100644 --- a/src/V3FuncOpt.cpp +++ b/src/V3FuncOpt.cpp @@ -110,7 +110,7 @@ class BalanceConcatTree final { // Returns replacement node, or nullptr if no change static AstConcat* balance(AstConcat* const rootp) { - UINFO(9, "balanceConcat " << rootp << "\n"); + UINFO(9, "balanceConcat " << rootp); // Gather all input vertices of the tree const std::vector exprps = gatherTerms(rootp); // Don't bother with trivial trees @@ -219,7 +219,7 @@ class FuncOptVisitor final : public VNVisitor { // Split wide assignments with a wide concatenation on the RHS. // Returns true if 'nodep' was deleted bool splitConcat(AstNodeAssign* nodep) { - UINFO(9, "splitConcat " << nodep << "\n"); + UINFO(9, "splitConcat " << nodep); // Only care about concatenations on the right AstConcat* const rhsp = VN_CAST(nodep->rhsp(), Concat); if (!rhsp) return false; @@ -253,7 +253,7 @@ class FuncOptVisitor final : public VNVisitor { if (!nodep->user1() && readsLhs(nodep)) return false; // Ok, actually split it now - UINFO(5, "splitConcat optimizing " << nodep << "\n"); + UINFO(5, "splitConcat optimizing " << nodep); ++m_concatSplits; // The 2 parts and their offsets AstNodeExpr* const rrp = rhsp->rhsp()->unlinkFrBack(); @@ -291,7 +291,7 @@ class FuncOptVisitor final : public VNVisitor { void visit(AstConcat* nodep) override { if (v3Global.opt.fFuncBalanceCat() && !nodep->user1() && !VN_IS(nodep->backp(), Concat)) { if (AstConcat* const newp = BalanceConcatTree::apply(nodep)) { - UINFO(5, "balanceConcat optimizing " << nodep << "\n"); + UINFO(5, "balanceConcat optimizing " << nodep); ++m_balancedConcats; nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -319,7 +319,7 @@ public: //###################################################################### void V3FuncOpt::funcOptAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { const VNUser1InUse user1InUse; V3ThreadScope threadScope; diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index c31800e9c..b19e2516f 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -57,15 +57,15 @@ public: bool dedupable() const { return m_dedupable; } bool consumed() const { return m_consumed; } void setConsumed(const char* /*consumedReason*/) { - // if (!m_consumed) UINFO(0, "\t\tSetConsumed " << consumedReason << " " << this << endl); + // if (!m_consumed) UINFO(0, "\t\tSetConsumed " << consumedReason << " " << this); m_consumed = true; } void clearReducible(const char* /*nonReducibleReason*/) { - // UINFO(0, " NR: " << nonReducibleReason << " " << name() << endl); + // UINFO(0, " NR: " << nonReducibleReason << " " << name()); m_reducible = false; } void clearDedupable(const char* /*nonDedupableReason*/) { - // UINFO(0, " ND: " << nonDedupableReason << " " << name() << endl); + // UINFO(0, " ND: " << nonDedupableReason << " " << name()); m_dedupable = false; } void clearReducibleAndDedupable(const char* nonReducibleReason) { @@ -160,7 +160,7 @@ public: GateVarVertex* makeVarVertex(AstVarScope* vscp) { GateVarVertex* vVtxp = reinterpret_cast(vscp->user1p()); if (!vVtxp) { - UINFO(6, "New vertex " << vscp << endl); + UINFO(6, "New vertex " << vscp); vVtxp = new GateVarVertex{this, vscp}; vscp->user1p(vVtxp); if (vscp->varp()->sensIfacep()) { @@ -381,7 +381,7 @@ class GateConcatVisitor final : public VNVisitorConst { nodep->user2(true); m_found_offset = m_offset; m_found = true; - UINFO(9, "CLK DECOMP Concat found var (off = " << m_offset << ") - " << nodep << endl); + UINFO(9, "CLK DECOMP Concat found var (off = " << m_offset << ") - " << nodep); } m_offset += nodep->dtypep()->width(); } @@ -431,7 +431,7 @@ class GateClkDecomp final { // Check that we haven't been here before if (vscp->user2SetOnce()) return; - UINFO(9, "CLK DECOMP Var - " << vVtxp << " : " << vscp << endl); + UINFO(9, "CLK DECOMP Var - " << vVtxp << " : " << vscp); VL_RESTORER(m_clkVectors); if (vscp->varp()->width() > 1) { m_clkVectors = true; @@ -499,7 +499,7 @@ class GateClkDecomp final { explicit GateClkDecomp(GateGraph& graph) : m_graph{graph} { - UINFO(9, "Starting clock decomposition" << endl); + UINFO(9, "Starting clock decomposition"); for (V3GraphVertex& vtx : graph.vertices()) { GateVarVertex* const vVtxp = vtx.cast(); if (!vVtxp) continue; @@ -508,7 +508,7 @@ class GateClkDecomp final { if (vscp->varp()->attrClocker() != VVarAttrClocker::CLOCKER_YES) continue; if (vscp->varp()->width() == 1) { - UINFO(9, "CLK DECOMP - " << vVtxp << " : " << vscp << endl); + UINFO(9, "CLK DECOMP - " << vVtxp << " : " << vscp); m_clkVtxp = vVtxp; visit(vVtxp, 0); } @@ -544,7 +544,7 @@ class GateOkVisitor final : public VNVisitorConst { // METHODS void clearSimple(const char* because) { - if (m_isSimple) UINFO(9, "Clear simple " << because << endl); + if (m_isSimple) UINFO(9, "Clear simple " << because); m_isSimple = false; } @@ -619,7 +619,7 @@ class GateOkVisitor final : public VNVisitorConst { if (!(m_dedupe ? nodep->isGateDedupable() : nodep->isGateOptimizable()) // || !nodep->isPure() || nodep->isBrancher()) { - UINFO(5, "Non optimizable type: " << nodep << endl); + UINFO(5, "Non optimizable type: " << nodep); clearSimple("Non optimizable type"); return; } @@ -815,7 +815,7 @@ class GateInline final { if (!okVisitor.varAssigned(vVtxp->varScp())) continue; if (excludedWide(vVtxp, okVisitor.substitutionp())) { ++m_statExcluded; - UINFO(9, "Gate inline exclude '" << vVtxp->name() << "'" << endl); + UINFO(9, "Gate inline exclude '" << vVtxp->name() << "'"); vVtxp->clearReducible("Excluded wide"); // Check once. continue; } @@ -1153,18 +1153,18 @@ class GateDedupe final { ++m_statDedupLogic; GateVarVertex* const dupVVtxp = dupRefp->varScopep()->user1u().to(); - UINFO(4, "replacing " << vVtxp << " with " << dupVVtxp << endl); + UINFO(4, "replacing " << vVtxp << " with " << dupVVtxp); // Replace all of this varvertex's consumers with dupRefp for (V3GraphEdge* const edgep : vVtxp->outEdges().unlinkable()) { const GateLogicVertex* const consumerVtxp = edgep->top()->as(); AstNode* const consumerp = consumerVtxp->nodep(); - UINFO(9, "elim src vtx" << lVtxp << " node " << lVtxp->nodep() << endl); - UINFO(9, "elim cons vtx" << consumerVtxp << " node " << consumerp << endl); - UINFO(9, "elim var vtx " << vVtxp << " node " << vVtxp->varScp() << endl); - UINFO(9, "replace with " << dupRefp << endl); + UINFO(9, "elim src vtx" << lVtxp << " node " << lVtxp->nodep()); + UINFO(9, "elim cons vtx" << consumerVtxp << " node " << consumerp); + UINFO(9, "elim var vtx " << vVtxp << " node " << vVtxp->varScp()); + UINFO(9, "replace with " << dupRefp); if (lVtxp == consumerVtxp) { - UINFO(9, "skipping as self-recirculates\n"); + UINFO(9, "skipping as self-recirculates"); } else { // Substitute consumer logic consumerp->foreach([&](AstNodeVarRef* refp) { @@ -1213,14 +1213,14 @@ class GateDedupe final { explicit GateDedupe(GateGraph& graph) { // Traverse starting from each of the clocks - UINFO(9, "Gate dedupe() clocks:\n"); + UINFO(9, "Gate dedupe() clocks:"); for (V3GraphVertex& vtx : graph.vertices()) { if (GateVarVertex* const vVtxp = vtx.cast()) { if (vVtxp->isClock()) visit(vVtxp); } } // Traverse starting from each of the outputs - UINFO(9, "Gate dedupe() outputs:\n"); + UINFO(9, "Gate dedupe() outputs:"); for (V3GraphVertex& vtx : graph.vertices()) { if (GateVarVertex* const vVtxp = vtx.cast()) { if (vVtxp->isTop() && vVtxp->varScp()->varp()->isWritable()) visit(vVtxp); @@ -1287,7 +1287,7 @@ class GateMergeAssignments final { AstSel* const currSelp = VN_AS(assignp->lhsp(), Sel); if (AstSel* const newSelp = merge(prevSelp, currSelp)) { - UINFO(5, "assemble to new sel: " << newSelp << endl); + UINFO(5, "assemble to new sel: " << newSelp); // replace preSel with newSel prevSelp->replaceWith(newSelp); VL_DO_DANGLING(prevSelp->deleteTree(), prevSelp); @@ -1323,7 +1323,7 @@ class GateMergeAssignments final { explicit GateMergeAssignments(GateGraph& graph) : m_graph{graph} { - UINFO(6, "mergeAssigns\n"); + UINFO(6, "mergeAssigns"); for (V3GraphVertex& vtx : graph.vertices()) { if (GateVarVertex* const vVtxp = vtx.cast()) process(vVtxp); } @@ -1386,7 +1386,7 @@ class GateUnused final { AstNode* const nodep = lVtxp->nodep(); warnUnused(nodep); - UINFO(8, " Remove unconsumed " << nodep << endl); + UINFO(8, " Remove unconsumed " << nodep); nodep->unlinkFrBack(); VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(lVtxp->unlinkDelete(&m_graph), lVtxp); @@ -1409,7 +1409,7 @@ public: // Pass entry point void V3Gate::gateAll(AstNetlist* netlistp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { // Build the graph diff --git a/src/V3GraphAcyc.cpp b/src/V3GraphAcyc.cpp index 5e615e1e0..91387c49e 100644 --- a/src/V3GraphAcyc.cpp +++ b/src/V3GraphAcyc.cpp @@ -159,7 +159,7 @@ class GraphAcyc final { } void cutOrigEdge(V3GraphEdge* breakEdgep, const char* why) { // From the break edge, cut edges in original graph it represents - UINFO(8, why << " CUT " << breakEdgep->fromp() << endl); + UINFO(8, why << " CUT " << breakEdgep->fromp()); breakEdgep->cut(); const OrigEdgeList* const oEListp = static_cast(breakEdgep->userp()); if (!oEListp) { @@ -168,8 +168,7 @@ class GraphAcyc final { // The breakGraph edge may represent multiple real edges; cut them all for (const auto& origEdgep : *oEListp) { origEdgep->cut(); - UINFO(8, - " " << why << " " << origEdgep->fromp() << " ->" << origEdgep->top() << endl); + UINFO(8, " " << why << " " << origEdgep->fromp() << " ->" << origEdgep->top()); } } // Work Queue @@ -280,7 +279,7 @@ void GraphAcyc::simplifyNone(GraphAcycVertex* avertexp) { // Likewise, vertices with no outputs if (avertexp->isDelete()) return; if (avertexp->inEmpty() || avertexp->outEmpty()) { - UINFO(9, " SimplifyNoneRemove " << avertexp << endl); + UINFO(9, " SimplifyNoneRemove " << avertexp); avertexp->setDelete(); // Mark so we won't delete it twice // Remove edges while (V3GraphEdge* const edgep = avertexp->outEdges().frontp()) { @@ -305,7 +304,7 @@ void GraphAcyc::simplifyOne(GraphAcycVertex* avertexp) { // The in and out may be the same node; we'll make a loop // The in OR out may be THIS node; we can't delete it then. if (inVertexp != avertexp && outVertexp != avertexp) { - UINFO(9, " SimplifyOneRemove " << avertexp << endl); + UINFO(9, " SimplifyOneRemove " << avertexp); avertexp->setDelete(); // Mark so we won't delete it twice // Make a new edge connecting the two vertices directly // If both are breakable, we pick the one with less weight, else it's arbitrary @@ -337,7 +336,7 @@ void GraphAcyc::simplifyOut(GraphAcycVertex* avertexp) { V3GraphEdge* const outEdgep = avertexp->outEdges().frontp(); if (!outEdgep->cutable()) { V3GraphVertex* outVertexp = outEdgep->top(); - UINFO(9, " SimplifyOutRemove " << avertexp << endl); + UINFO(9, " SimplifyOutRemove " << avertexp); avertexp->setDelete(); // Mark so we won't delete it twice for (V3GraphEdge* const inEdgep : avertexp->inEdges().unlinkable()) { V3GraphVertex* inVertexp = inEdgep->fromp(); @@ -377,16 +376,16 @@ void GraphAcyc::simplifyDup(GraphAcycVertex* avertexp) { if (!prevEdgep->cutable()) { // !cutable duplicates prev !cutable: we can ignore it, redundant // cutable duplicates prev !cutable: know it's not a relevant loop, ignore it - UINFO(8, " DelDupEdge " << avertexp << " -> " << edgep->top() << endl); + UINFO(8, " DelDupEdge " << avertexp << " -> " << edgep->top()); VL_DO_DANGLING(edgep->unlinkDelete(), edgep); } else if (!edgep->cutable()) { // !cutable duplicates prev cutable: delete the earlier cutable - UINFO(8, " DelDupPrev " << avertexp << " -> " << prevEdgep->top() << endl); + UINFO(8, " DelDupPrev " << avertexp << " -> " << prevEdgep->top()); VL_DO_DANGLING(prevEdgep->unlinkDelete(), prevEdgep); outVertexp->userp(edgep); } else { // cutable duplicates prev cutable: combine weights - UINFO(8, " DelDupComb " << avertexp << " -> " << edgep->top() << endl); + UINFO(8, " DelDupComb " << avertexp << " -> " << edgep->top()); prevEdgep->weight(prevEdgep->weight() + edgep->weight()); addOrigEdgep(prevEdgep, edgep); VL_DO_DANGLING(edgep->unlinkDelete(), edgep); @@ -440,7 +439,7 @@ void GraphAcyc::place() { if (edge.weight() && edge.cutable()) ++numEdges; } } - UINFO(4, " Cutable edges = " << numEdges << endl); + UINFO(4, " Cutable edges = " << numEdges); std::vector edges; // List of all edges to be processed // Make the vector properly sized right off the bat -- faster than reallocating @@ -463,8 +462,7 @@ void GraphAcyc::place() { void GraphAcyc::placeTryEdge(V3GraphEdge* edgep) { // Try to make this edge uncutable m_placeStep++; - UINFO(8, " PlaceEdge s" << m_placeStep << " w" << edgep->weight() << " " << edgep->fromp() - << endl); + UINFO(8, " PlaceEdge s" << m_placeStep << " w" << edgep->weight() << " " << edgep->fromp()); // Make the edge uncutable so we detect it in placement edgep->cutable(false); // Vertex::m_user begin: number indicates this edge was completed @@ -537,27 +535,27 @@ void GraphAcyc::main() { simplify(false); if (dumpGraphLevel() >= 5) m_breakGraph.dumpDotFilePrefixed("acyc_simp"); - UINFO(4, " Cutting trivial loops\n"); + UINFO(4, " Cutting trivial loops"); simplify(true); if (dumpGraphLevel() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_mid"); - UINFO(4, " Ranking\n"); + UINFO(4, " Ranking"); m_breakGraph.rank(&V3GraphEdge::followNotCutable); if (dumpGraphLevel() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_rank"); - UINFO(4, " Placement\n"); + UINFO(4, " Placement"); place(); if (dumpGraphLevel() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_place"); - UINFO(4, " Final Ranking\n"); + UINFO(4, " Final Ranking"); // Only needed to assert there are no loops in completed graph m_breakGraph.rank(&V3GraphEdge::followAlwaysTrue); if (dumpGraphLevel() >= 6) m_breakGraph.dumpDotFilePrefixed("acyc_done"); } void V3Graph::acyclic(V3EdgeFuncP edgeFuncp) { - UINFO(4, "Acyclic\n"); + UINFO(4, "Acyclic"); GraphAcyc acyc{this, edgeFuncp}; acyc.main(); - UINFO(4, "Acyclic done\n"); + UINFO(4, "Acyclic done"); } diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp index 56b6e7e1a..fc307f141 100644 --- a/src/V3GraphAlg.cpp +++ b/src/V3GraphAlg.cpp @@ -462,7 +462,7 @@ void V3Graph::sortEdges() { // (Results in better dcache packing.) void V3Graph::order() { - UINFO(2, "Order:\n"); + UINFO(2, "Order:"); // Compute rankings again rank(&V3GraphEdge::followAlwaysTrue); diff --git a/src/V3GraphTest.cpp b/src/V3GraphTest.cpp index 4bc98f035..6cf2498e7 100644 --- a/src/V3GraphTest.cpp +++ b/src/V3GraphTest.cpp @@ -298,7 +298,7 @@ public: void V3Graph::selfTest() { // Execute all of the tests - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { V3GraphTestStrong{}.run(); } { V3GraphTestAcyc{}.run(); } { V3GraphTestVars{}.run(); } diff --git a/src/V3Hasher.cpp b/src/V3Hasher.cpp index d1fde1ff2..b6fee854b 100644 --- a/src/V3Hasher.cpp +++ b/src/V3Hasher.cpp @@ -97,7 +97,7 @@ class HasherVisitor final : public VNVisitorConst { void visit(AstNode* nodep) override { #if VL_DEBUG - UINFO(0, "%Warning: Hashing node as AstNode: " << nodep << endl); + UINFO(0, "%Warning: Hashing node as AstNode: " << nodep); #endif m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {}); } diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index f4a689ff9..c0e2d8955 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -322,8 +322,7 @@ class HierBlockUsageCollectVisitor final : public VNVisitorConst { // Don't visit twice if (nodep->user1SetOnce()) return; UINFO(5, "Checking " << nodep->prettyNameQ() << " from " - << (m_hierBlockp ? m_hierBlockp->prettyNameQ() : "null"s) - << std::endl); + << (m_hierBlockp ? m_hierBlockp->prettyNameQ() : "null"s)); VL_RESTORER(m_modp); AstModule* const prevHierBlockp = m_hierBlockp; ModuleSet prevReferred; @@ -382,8 +381,8 @@ void V3HierBlockPlan::add(const AstNodeModule* modp, const V3HierBlockParams& pa if (pair.second) { V3HierBlock* hblockp = new V3HierBlock{modp, params}; UINFO(3, "Add " << modp->prettyNameQ() << " with " << params.gparams().size() - << " parameters and " << params.gTypeParams().size() << " type parameters" - << std::endl); + << " parameters and " << params.gTypeParams().size() + << " type parameters"); pair.first->second = hblockp; } } @@ -394,7 +393,7 @@ void V3HierBlockPlan::registerUsage(const AstNodeModule* parentp, const AstNodeM const iterator child = m_blocks.find(childp); if (child != m_blocks.end()) { UINFO(3, "Found usage relation " << parentp->prettyNameQ() << " uses " - << childp->prettyNameQ() << std::endl); + << childp->prettyNameQ()); parent->second->addChild(child->second); child->second->addParent(parent->second); } diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index 53081e2a7..37c6f73d1 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -94,13 +94,13 @@ class InlineMarkVisitor final : public VNVisitor { void cantInline(const char* reason, bool hard) { if (hard) { if (m_modp->user2() != CIL_NOTHARD) { - UINFO(4, " No inline hard: " << reason << " " << m_modp << endl); + UINFO(4, " No inline hard: " << reason << " " << m_modp); m_modp->user2(CIL_NOTHARD); ++m_statUnsup; } } else { if (m_modp->user2() == CIL_MAYBE) { - UINFO(4, " No inline soft: " << reason << " " << m_modp << endl); + UINFO(4, " No inline soft: " << reason << " " << m_modp); m_modp->user2(CIL_NOTSOFT); } } @@ -220,7 +220,7 @@ class InlineMarkVisitor final : public VNVisitor { || refs * statements < v3Global.opt.inlineMult()); m_moduleState(modp).m_inlined = doit; UINFO(4, " Inline=" << doit << " Possible=" << allowed << " Refs=" << refs - << " Stmts=" << statements << " " << modp << endl); + << " Stmts=" << statements << " " << modp); } } //-------------------- @@ -261,7 +261,7 @@ class InlineRelinkVisitor final : public VNVisitor { m_modp->addInlinesp(nodep); // Rename nodep->name(m_cellp->name() + "__DOT__" + nodep->name()); - UINFO(6, " Inline " << nodep << endl); + UINFO(6, " Inline " << nodep); // Do CellInlines under this, but don't move them iterateChildren(nodep); } @@ -285,7 +285,7 @@ class InlineRelinkVisitor final : public VNVisitor { FileLine* const flp = nodep->fileline(); AstConst* const exprconstp = VN_CAST(nodep->user2p(), Const); AstVarRef* exprvarrefp = VN_CAST(nodep->user2p(), VarRef); - UINFO(8, "connectto: " << nodep->user2p() << endl); + UINFO(8, "connectto: " << nodep->user2p()); UASSERT_OBJ(exprconstp || exprvarrefp, nodep, "Unknown interconnect type; pinReconnectSimple should have cleared up"); if (exprconstp) { @@ -296,7 +296,7 @@ class InlineRelinkVisitor final : public VNVisitor { // Public variable at the lower module end - we need to make sure we propagate // the logic changes up and down; if we aliased, we might // remove the change detection on the output variable. - UINFO(9, "public pin assign: " << exprvarrefp << endl); + UINFO(9, "public pin assign: " << exprvarrefp); UASSERT_OBJ(!nodep->isNonOutput(), nodep, "Outputs only - inputs use AssignAlias"); m_modp->addStmtsp(new AstAssignW{flp, exprvarrefp->cloneTree(false), new AstVarRef{flp, nodep, VAccess::READ}}); @@ -304,7 +304,7 @@ class InlineRelinkVisitor final : public VNVisitor { // Public variable at this end and it is an unpacked array. We need to assign // instead of aliased, because otherwise it will pass V3Slice and invalid // code will be emitted. - UINFO(9, "assign to public and unpacked: " << nodep << endl); + UINFO(9, "assign to public and unpacked: " << nodep); exprvarrefp = exprvarrefp->cloneTree(false); exprvarrefp->access(VAccess::READ); nodep->user4(true); // Making assignment to it @@ -387,7 +387,7 @@ class InlineRelinkVisitor final : public VNVisitor { if (AstVarRef* const varrefp = VN_CAST(nodep->lhsp(), VarRef)) { if (m_initialStatic && varrefp->varp()->user2() && varrefp->varp()->user4()) { // Initial assignment to i/o we are overriding, can remove - UINFO(9, "Remove InitialStatic " << nodep << endl); + UINFO(9, "Remove InitialStatic " << nodep); VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); return; } @@ -438,7 +438,7 @@ class InlineRelinkVisitor final : public VNVisitor { if (m_renamedInterfaces.count(nodep->dotted())) { nodep->dotted(m_cellp->name() + "__DOT__" + nodep->dotted()); } - UINFO(8, " " << nodep << endl); + UINFO(8, " " << nodep); iterateChildren(nodep); } @@ -502,7 +502,7 @@ class InlineVisitor final : public VNVisitor { // METHODS void inlineCell(AstCell* nodep) { - UINFO(5, " Inline CELL " << nodep << endl); + UINFO(5, " Inline CELL " << nodep); const VNUser2InUse user2InUse; const VNUser3InUse user3InUse; @@ -550,7 +550,7 @@ class InlineVisitor final : public VNVisitor { // Create assignments to the pins for (AstPin* pinp = nodep->pinsp(); pinp; pinp = VN_AS(pinp->nextp(), Pin)) { if (!pinp->exprp()) continue; - UINFO(6, " Pin change from " << pinp->modVarp() << endl); + UINFO(6, " Pin change from " << pinp->modVarp()); AstNode* const connectRefp = pinp->exprp(); UASSERT_OBJ(VN_IS(connectRefp, Const) || VN_IS(connectRefp, VarRef), pinp, @@ -572,8 +572,8 @@ class InlineVisitor final : public VNVisitor { // One to one interconnect won't make a temporary variable. // This prevents creating a lot of extra wires for clock signals. // It will become a tracing alias. - UINFO(6, "One-to-one " << connectRefp << endl); - UINFO(6, " -to " << pinNewVarp << endl); + UINFO(6, "One-to-one " << connectRefp); + UINFO(6, " -to " << pinNewVarp); pinNewVarp->user2p(connectRefp); // Public output inside the cell must go via an assign rather // than alias. Else the public logic will set the alias, losing @@ -648,7 +648,7 @@ public: // Inline class functions void V3Inline::inlineAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { const VNUser1InUse m_inuser1; // output of InlineMarkVisitor, input to InlineVisitor. diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 78551062c..a59bf55fc 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -43,7 +43,7 @@ class InstVisitor final : public VNVisitor { // VISITORS void visit(AstCell* nodep) override { - UINFO(4, " CELL " << nodep << endl); + UINFO(4, " CELL " << nodep); VL_RESTORER(m_cellp); m_cellp = nodep; // VV***** We reset user1p() on each cell!!! @@ -53,7 +53,7 @@ class InstVisitor final : public VNVisitor { void visit(AstPin* nodep) override { // PIN(p,expr) -> ASSIGNW(VARXREF(p),expr) (if sub's input) // or ASSIGNW(expr,VARXREF(p)) (if sub's output) - UINFO(4, " PIN " << nodep << endl); + UINFO(4, " PIN " << nodep); if (!nodep->user1()) { // Simplify it V3Inst::pinReconnectSimple(nodep, m_cellp, false); @@ -134,7 +134,7 @@ private: // VISITORS void visit(AstVar* nodep) override { if (VN_IS(nodep->dtypep(), IfaceRefDType)) { - UINFO(8, " dm-1-VAR " << nodep << endl); + UINFO(8, " dm-1-VAR " << nodep); insert(nodep); } iterateChildrenConst(nodep); @@ -145,7 +145,7 @@ private: public: // METHODS void insert(AstVar* nodep) { - UINFO(8, " dmINSERT " << nodep << endl); + UINFO(8, " dmINSERT " << nodep); m_modVarNameMap.emplace(nodep->name(), nodep); } AstVar* find(const string& name) { @@ -166,7 +166,7 @@ public: InstDeModVarVisitor() = default; ~InstDeModVarVisitor() override = default; void main(AstNodeModule* nodep) { - UINFO(8, " dmMODULE " << nodep << endl); + UINFO(8, " dmMODULE " << nodep); m_modVarNameMap.clear(); iterateConst(nodep); } @@ -190,12 +190,12 @@ private: if (VN_AS(VN_AS(nodep->dtypep(), UnpackArrayDType)->subDTypep(), IfaceRefDType) ->isVirtual()) return; - UINFO(8, " dv-vec-VAR " << nodep << endl); + UINFO(8, " dv-vec-VAR " << nodep); AstUnpackArrayDType* const arrdtype = VN_AS(nodep->dtypep(), UnpackArrayDType); AstNode* prevp = nullptr; for (int i = arrdtype->lo(); i <= arrdtype->hi(); ++i) { const string varNewName = nodep->name() + "__BRA__" + cvtToStr(i) + "__KET__"; - UINFO(8, "VAR name insert " << varNewName << " " << nodep << endl); + UINFO(8, "VAR name insert " << varNewName << " " << nodep); if (!m_deModVars.find(varNewName)) { AstIfaceRefDType* const ifaceRefp = VN_AS(arrdtype->subDTypep(), IfaceRefDType)->cloneTree(false); @@ -224,7 +224,7 @@ private: } void visit(AstCell* nodep) override { - UINFO(4, " CELL " << nodep << endl); + UINFO(4, " CELL " << nodep); // Find submodule vars UASSERT_OBJ(nodep->modp(), nodep, "Unlinked"); m_deModVars.main(nodep->modp()); @@ -256,7 +256,7 @@ private: // The spec says we add [x], but that won't work in C... newp->name(newp->name() + "__BRA__" + cvtToStr(instNum) + "__KET__"); newp->origName(newp->origName() + "__BRA__" + cvtToStr(instNum) + "__KET__"); - UINFO(8, " CELL loop " << newp << endl); + UINFO(8, " CELL loop " << newp); // If this AstCell is actually an interface instantiation, also clone the IfaceRef // within the same parent module as the cell @@ -307,19 +307,18 @@ private: // Any non-direct pins need reconnection with a part-select if (!nodep->exprp()) return; // No-connect if (m_cellRangep) { - UINFO(4, " PIN " << nodep << endl); + UINFO(4, " PIN " << nodep); const int modwidth = nodep->modVarp()->width(); const int expwidth = nodep->exprp()->width(); const std::pair pinDim = nodep->modVarp()->dtypep()->dimensions(false); const std::pair expDim = nodep->exprp()->dtypep()->dimensions(false); - UINFO(4, " PINVAR " << nodep->modVarp() << endl); - UINFO(4, " EXP " << nodep->exprp() << endl); + UINFO(4, " PINVAR " << nodep->modVarp()); + UINFO(4, " EXP " << nodep->exprp()); UINFO(4, " expwidth=" << expwidth << " modwidth=" << modwidth << " expDim(p,u)=" << expDim.first << "," << expDim.second - << " pinDim(p,u)=" << pinDim.first << "," << pinDim.second - << endl); + << " pinDim(p,u)=" << pinDim.first << "," << pinDim.second); if (expDim.second == pinDim.second + 1) { // Connection to array, where array dimensions match the instant dimension const AstRange* const rangep @@ -662,7 +661,7 @@ public: // See also V3Inst AstNodeExpr* rhsp = new AstVarRef{pinp->fileline(), newvarp, VAccess::READ}; UINFO(5, "pinRecon width " << pinVarp->width() << " >? " << rhsp->width() << " >? " - << pinexprp->width() << endl); + << pinexprp->width()); rhsp = extendOrSel(pinp->fileline(), rhsp, pinVarp); pinp->exprp(new AstVarRef{newvarp->fileline(), newvarp, VAccess::WRITE}); AstNodeExpr* const rhsSelp = extendOrSel(pinp->fileline(), rhsp, pinexprp); @@ -706,13 +705,13 @@ void V3Inst::checkOutputShort(AstPin* nodep) { // Inst class visitor void V3Inst::instAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { InstVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("inst", 0, dumpTreeEitherLevel() >= 3); } void V3Inst::dearrayAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { InstDeVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("dearray", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3InstrCount.cpp b/src/V3InstrCount.cpp index 365a67e41..404f61166 100644 --- a/src/V3InstrCount.cpp +++ b/src/V3InstrCount.cpp @@ -111,7 +111,7 @@ private: return savedCount; } void endVisitBase(uint32_t savedCount, AstNode* nodep) { - UINFO(8, "cost " << std::setw(6) << std::left << m_instrCount << " " << nodep << endl); + UINFO(8, "cost " << std::setw(6) << std::left << m_instrCount << " " << nodep); markCost(nodep); if (!m_ignoreRemaining) m_instrCount += savedCount; } @@ -168,13 +168,13 @@ private: iterateAndNextConstNull(nodep->condp()); const uint32_t savedCount = m_instrCount; - UINFO(8, "thensp:\n"); + UINFO(8, "thensp:"); reset(); iterateAndNextConstNull(nodep->thensp()); uint32_t ifCount = m_instrCount; if (nodep->branchPred().unlikely()) ifCount = 0; - UINFO(8, "elsesp:\n"); + UINFO(8, "elsesp:"); reset(); iterateAndNextConstNull(nodep->elsesp()); uint32_t elseCount = m_instrCount; @@ -197,12 +197,12 @@ private: iterateAndNextConstNull(nodep->condp()); const uint32_t savedCount = m_instrCount; - UINFO(8, "?\n"); + UINFO(8, "?"); reset(); iterateAndNextConstNull(nodep->thenp()); const uint32_t ifCount = m_instrCount; - UINFO(8, ":\n"); + UINFO(8, ":"); reset(); iterateAndNextConstNull(nodep->elsep()); const uint32_t elseCount = m_instrCount; diff --git a/src/V3Interface.cpp b/src/V3Interface.cpp index 6364ef847..4537fab18 100644 --- a/src/V3Interface.cpp +++ b/src/V3Interface.cpp @@ -109,7 +109,7 @@ public: // Interface class functions void V3Interface::interfaceAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { InlineIntfRefVisitor{nodep}; } diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 22e6c7272..d58525ca8 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -148,7 +148,7 @@ public: // we just don't optimize any public sigs // Check the var entry, and remove if appropriate if (AstNodeStmt* const oldassp = entp->assignp()) { - UINFO(7, " PREV: " << oldassp << endl); + UINFO(7, " PREV: " << oldassp); // Redundant assignment, in same level block // Don't delete it now as it will confuse iteration since it maybe WAY // above our current iteration point. @@ -166,8 +166,8 @@ public: } void resetStatement(AstVarScope* nodep, AstCReset* rstp) { // Do we have a old assignment we can nuke? - UINFO(4, " CRESETof: " << nodep << endl); - UINFO(7, " new: " << rstp << endl); + UINFO(4, " CRESETof: " << nodep); + UINFO(7, " new: " << rstp); const auto pair = m_map.emplace(std::piecewise_construct, // std::forward_as_tuple(nodep), std::forward_as_tuple(LifeVarEntry::CRESET{}, rstp)); @@ -179,8 +179,8 @@ public: } void simpleAssign(AstVarScope* nodep, AstNodeAssign* assp) { // Do we have a old assignment we can nuke? - UINFO(4, " ASSIGNof: " << nodep << endl); - UINFO(7, " new: " << assp << endl); + UINFO(4, " ASSIGNof: " << nodep); + UINFO(7, " new: " << assp); const auto pair = m_map.emplace(std::piecewise_construct, // std::forward_as_tuple(nodep), std::forward_as_tuple(LifeVarEntry::SIMPLEASSIGN{}, assp)); @@ -191,7 +191,7 @@ public: // lifeDump(); } void complexAssign(AstVarScope* nodep) { - UINFO(4, " clearof: " << nodep << endl); + UINFO(4, " clearof: " << nodep); const auto pair = m_map.emplace(nodep, LifeVarEntry::COMPLEXASSIGN{}); if (!pair.second) pair.first->second.complexAssign(); } @@ -205,7 +205,7 @@ public: if (!varrefp->varp()->isSigPublic() && !varrefp->varp()->sensIfacep()) { // Aha, variable is constant; substitute in. // We'll later constant propagate - UINFO(4, " replaceconst: " << varrefp << endl); + UINFO(4, " replaceconst: " << varrefp); varrefp->replaceWith(constp->cloneTree(false)); m_replacedVref = true; VL_DO_DANGLING(varrefp->deleteTree(), varrefp); @@ -213,14 +213,14 @@ public: return; // **DONE, no longer a var reference** } } - UINFO(4, " usage: " << nodep << endl); + UINFO(4, " usage: " << nodep); pair.first->second.consumed(); } } void complexAssignFind(AstVarScope* nodep) { const auto pair = m_map.emplace(nodep, LifeVarEntry::COMPLEXASSIGN{}); if (!pair.second) { - UINFO(4, " casfind: " << pair.first->first << endl); + UINFO(4, " casfind: " << pair.first->first); pair.first->second.complexAssign(); } } @@ -257,7 +257,7 @@ public: AstVarScope* const nodep = itr.first; if (itr.second.setBeforeUse() && nodep->user1()) { // Both branches set the var, we can remove the assignment before the IF. - UINFO(4, "DUALBRANCH " << nodep << endl); + UINFO(4, "DUALBRANCH " << nodep); const auto itab = m_map.find(nodep); if (itab != m_map.end()) checkRemoveAssign(itab); } @@ -267,12 +267,12 @@ public: void clear() { m_map.clear(); } // DEBUG void lifeDump() { - UINFO(5, " LifeMap:" << endl); + UINFO(5, " LifeMap:"); for (const auto& itr : m_map) { - UINFO(5, " Ent: " << (itr.second.setBeforeUse() ? "[F] " : " ") << itr.first - << endl); + UINFO(5, + " Ent: " << (itr.second.setBeforeUse() ? "[F] " : " ") << itr.first); if (itr.second.assignp()) { // - UINFO(5, " Ass: " << itr.second.assignp() << endl); + UINFO(5, " Ass: " << itr.second.assignp()); } } } @@ -363,7 +363,7 @@ class LifeVisitor final : public VNVisitor { //---- Track control flow changes void visit(AstNodeIf* nodep) override { - UINFO(4, " IF " << nodep << endl); + UINFO(4, " IF " << nodep); // Condition is part of PREVIOUS block iterateAndNextNull(nodep->condp()); LifeBlock* const prevLifep = m_lifep; @@ -378,7 +378,7 @@ class LifeVisitor final : public VNVisitor { iterateAndNextNull(nodep->elsesp()); } m_lifep = prevLifep; - UINFO(4, " join " << endl); + UINFO(4, " join "); // Find sets on both flows m_lifep->dualBranch(ifLifep, elseLifep); // For the next assignments, clear any variables that were read or written in the block @@ -410,7 +410,7 @@ class LifeVisitor final : public VNVisitor { iterateAndNextNull(nodep->incsp()); } m_lifep = prevLifep; - UINFO(4, " joinfor" << endl); + UINFO(4, " joinfor"); // For the next assignments, clear any variables that were read or written in the block condLifep->lifeToAbove(); bodyLifep->lifeToAbove(); @@ -430,13 +430,13 @@ class LifeVisitor final : public VNVisitor { iterateAndNextNull(nodep->stmtsp()); m_lifep = prevLifep; } - UINFO(4, " joinjump" << endl); + UINFO(4, " joinjump"); // For the next assignments, clear any variables that were read or written in the block bodyLifep->lifeToAbove(); VL_DO_DANGLING(delete bodyLifep, bodyLifep); } void visit(AstNodeCCall* nodep) override { - // UINFO(4, " CCALL " << nodep << endl); + // UINFO(4, " CCALL " << nodep); iterateChildren(nodep); // Enter the function and trace it // else is non-inline or public function we optimize separately @@ -448,7 +448,7 @@ class LifeVisitor final : public VNVisitor { } } void visit(AstCFunc* nodep) override { - // UINFO(4, " CFUNC " << nodep << endl); + // UINFO(4, " CFUNC " << nodep); if (!m_tracingCall && !nodep->entryPoint()) return; m_tracingCall = false; if (nodep->recursive()) setNoopt(); @@ -479,7 +479,7 @@ public: // CONSTRUCTORS LifeVisitor(AstNode* nodep, LifeState* statep) : m_statep{statep} { - UINFO(4, " LifeVisitor on " << nodep << endl); + UINFO(4, " LifeVisitor on " << nodep); { m_lifep = new LifeBlock{nullptr, m_statep}; iterate(nodep); @@ -530,7 +530,7 @@ public: // Life class functions void V3Life::lifeAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { LifeState state; LifeTopVisitor{nodep, &state}; diff --git a/src/V3LifePost.cpp b/src/V3LifePost.cpp index 2a8f8792d..7a6e5b889 100644 --- a/src/V3LifePost.cpp +++ b/src/V3LifePost.cpp @@ -55,7 +55,7 @@ class LifePostElimVisitor final : public VNVisitor { const AstVarScope* const vscp = nodep->varScopep(); UASSERT_OBJ(vscp, nodep, "Scope not assigned"); if (AstVarScope* const newvscp = reinterpret_cast(vscp->user4p())) { - UINFO(9, " Replace " << nodep << " to " << newvscp << endl); + UINFO(9, " Replace " << nodep << " to " << newvscp); AstVarRef* const newrefp = new AstVarRef{nodep->fileline(), newvscp, nodep->access()}; nodep->replaceWith(newrefp); VL_DO_DANGLING(nodep->deleteTree(), nodep); @@ -243,7 +243,7 @@ class LifePostDlyVisitor final : public VNVisitor { if (!canScrunch) continue; // Delete and mark so LifePostElimVisitor will get it - UINFO(4, " DELETE " << app->nodep << endl); + UINFO(4, " DELETE " << app->nodep); dlyVarp->user4p(origVarp); VL_DO_DANGLING(app->nodep->unlinkFrBack()->deleteTree(), app->nodep); ++m_statAssnDel; @@ -360,7 +360,7 @@ public: // LifePost class functions void V3LifePost::lifepostAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Mark redundant AssignPost { LifePostDlyVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("life_post", 0, dumpTreeEitherLevel() >= 3); diff --git a/src/V3LinkCells.cpp b/src/V3LinkCells.cpp index b1f18ca6f..30c87c470 100644 --- a/src/V3LinkCells.cpp +++ b/src/V3LinkCells.cpp @@ -125,7 +125,7 @@ class LinkCellsVisitor final : public VNVisitor { } void newEdge(V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cuttable) { const V3GraphEdge* const edgep = new V3GraphEdge{&m_graph, fromp, top, weight, cuttable}; - UINFO(9, " newEdge " << edgep << " " << fromp->name() << " -> " << top->name() << endl); + UINFO(9, " newEdge " << edgep << " " << fromp->name() << " -> " << top->name()); } AstNodeModule* findModuleSym(const string& modName) { @@ -186,7 +186,7 @@ class LinkCellsVisitor final : public VNVisitor { if (m_modp) newEdge(vertex(m_modp), vertex(nodep), 1, false); // m_modp = nodep; - UINFO(4, "Link Module: " << nodep << endl); + UINFO(4, "Link Module: " << nodep); if (nodep->fileline()->filebasenameNoExt() != nodep->prettyName() && !v3Global.opt.isLibraryFile(nodep->fileline()->filename()) && !VN_IS(nodep, NotFoundModule) && !nodep->recursiveClone() @@ -207,7 +207,7 @@ class LinkCellsVisitor final : public VNVisitor { const bool topMatch = (v3Global.opt.topModule() == nodep->prettyName()); if (topMatch) { m_topVertexp = vertex(nodep); - UINFO(2, "Link --top-module: " << nodep << endl); + UINFO(2, "Link --top-module: " << nodep); nodep->inLibrary(false); // Safer to make sure it doesn't disappear } if (v3Global.opt.topModule() == "" ? nodep->inLibrary() // Library cells are lower @@ -225,7 +225,7 @@ class LinkCellsVisitor final : public VNVisitor { void visit(AstIfaceRefDType* nodep) override { // Cell: Resolve its filename. If necessary, parse it. - UINFO(4, "Link IfaceRef: " << nodep << endl); + UINFO(4, "Link IfaceRef: " << nodep); // Use findIdUpward instead of findIdFlat; it doesn't matter for now // but we might support modules-under-modules someday. AstNodeModule* const modp = resolveModule(nodep, nodep->ifaceName()); @@ -252,7 +252,7 @@ class LinkCellsVisitor final : public VNVisitor { // For historical reasons virtual interface reference variables remain VARs if (m_varp && !nodep->isVirtual()) m_varp->setIfaceRef(); // Note cannot do modport resolution here; modports are allowed underneath generates - UINFO(4, "Link IfaceRef done: " << nodep << endl); + UINFO(4, "Link IfaceRef done: " << nodep); } void visit(AstPackageExport* nodep) override { @@ -288,7 +288,7 @@ class LinkCellsVisitor final : public VNVisitor { // TODO this doesn't allow bind to dotted hier names, that would require // this move to post param, which would mean we do not auto-read modules // and means we cannot compute module levels until later. - UINFO(4, "Link Bind: " << nodep << endl); + UINFO(4, "Link Bind: " << nodep); AstNodeModule* const modp = resolveModule(nodep, nodep->name()); if (modp) { AstNode* const cellsp = nodep->cellsp()->unlinkFrBackWithNext(); @@ -322,13 +322,13 @@ class LinkCellsVisitor final : public VNVisitor { nodep->user1p(m_modp); // if (!nodep->modp() || cloned) { - UINFO(4, "Link Cell: " << nodep << endl); + UINFO(4, "Link Cell: " << nodep); // Use findIdFallback instead of findIdFlat; it doesn't matter for now // but we might support modules-under-modules someday. AstNodeModule* cellmodp = resolveModule(nodep, nodep->modName()); if (cellmodp) { if (cellmodp == m_modp || cellmodp->user2p() == m_modp) { - UINFO(1, "Self-recursive module " << cellmodp << endl); + UINFO(1, "Self-recursive module " << cellmodp); cellmodp->recursive(true); nodep->recursive(true); if (!cellmodp->recursiveClone()) { @@ -427,7 +427,7 @@ class LinkCellsVisitor final : public VNVisitor { if (ports.find(portp->name()) == ports.end() && ports.find("__pinNumber" + cvtToStr(portp->pinNum())) == ports.end()) { if (pinStar) { - UINFO(9, " need .* PORT " << portp << endl); + UINFO(9, " need .* PORT " << portp); // Create any not already connected AstPin* const newp = new AstPin{ nodep->fileline(), 0, portp->name(), @@ -519,7 +519,7 @@ class LinkCellsVisitor final : public VNVisitor { if (nodep->modp()) { // iterateChildren(nodep); } - UINFO(4, " Link Cell done: " << nodep << endl); + UINFO(4, " Link Cell done: " << nodep); } void visit(AstRefDType* nodep) override { @@ -630,6 +630,6 @@ public: // Link class functions void V3LinkCells::link(AstNetlist* nodep, VInFilter* filterp) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); { LinkCellsVisitor{nodep, filterp}; } } diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 45885310b..4ecb8d429 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -212,7 +212,7 @@ public: : m_syms{rootp} , m_mods{rootp} , m_step(step) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); s_errorThisp = this; V3Error::errorExitCb(preErrorDumpHandler); // If get error, dump self readModNames(); @@ -300,9 +300,9 @@ public: // Begin: ... blocks often replicate under genif/genfor, so // suppress duplicate checks. See t_gen_forif.v for an example. } else { - UINFO(4, "name " << name << endl); // Not always same as nodep->name - UINFO(4, "Var1 " << nodep << endl); - UINFO(4, "Var2 " << fnodep << endl); + UINFO(4, "name " << name); // Not always same as nodep->name + UINFO(4, "Var1 " << nodep); + UINFO(4, "Var2 " << fnodep); if (nodep->type() == fnodep->type()) { nodep->v3error("Duplicate declaration of " << nodeTextType(fnodep) << ": " << AstNode::prettyNameQ(name) @@ -324,7 +324,7 @@ public: void insertDUnit(AstNetlist* nodep) { // $unit on top scope VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; - UINFO(9, " INSERTdunit se" << cvtToHex(symp) << endl); + UINFO(9, " INSERTdunit se" << cvtToHex(symp)); symp->parentp(rootEntp()); // Needed so backward search can find name of top module symp->fallbackp(nullptr); rootEntp()->insert("$unit ", symp); // Space so can never name conflict with user code @@ -335,8 +335,7 @@ public: VSymEnt* insertTopCell(AstNodeModule* nodep, const string& scopename) { // Only called on the module at the very top of the hierarchy VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; - UINFO(9, - " INSERTtop se" << cvtToHex(symp) << " " << scopename << " " << nodep << endl); + UINFO(9, " INSERTtop se" << cvtToHex(symp) << " " << scopename << " " << nodep); symp->parentp(rootEntp()); // Needed so backward search can find name of top module symp->fallbackp(dunitEntp()); // Needed so can find $unit stuff nodep->user1p(symp); @@ -347,8 +346,7 @@ public: } VSymEnt* insertTopIface(AstCell* nodep, const string& scopename) { VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; - UINFO(9, " INSERTtopiface se" << cvtToHex(symp) << " " << scopename << " " << nodep - << endl); + UINFO(9, " INSERTtopiface se" << cvtToHex(symp) << " " << scopename << " " << nodep); symp->parentp(rootEntp()); // Needed so backward search can find name of top module symp->fallbackp(dunitEntp()); // Needed so can find $unit stuff nodep->user1p(symp); @@ -364,7 +362,7 @@ public: VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; UINFO(9, " INSERTcel se" << cvtToHex(symp) << " " << scopename << " above=se" << cvtToHex(abovep) << " mods=se" << cvtToHex(modSymp) - << " node=" << nodep << endl); + << " node=" << nodep); symp->parentp(abovep); symp->fallbackp(dunitEntp()); // Needed so can find $unit stuff nodep->user1p(symp); @@ -392,7 +390,7 @@ public: VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; UINFO(9, " INSERTinl se" << cvtToHex(symp) << " " << basename << " above=se" << cvtToHex(abovep) << " mods=se" << cvtToHex(modSymp) - << " node=" << nodep << endl); + << " node=" << nodep); symp->parentp(abovep); symp->fallbackp(modSymp); symp->symPrefix(nodep->name() + "__DOT__"); @@ -414,8 +412,8 @@ public: UASSERT_OBJ(abovep, nodep, "Null symbol table inserting node"); VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; UINFO(9, " INSERTblk se" << cvtToHex(symp) << " above=se" << cvtToHex(abovep) - << " pkg=" << cvtToHex(classOrPackagep) << " node=" << nodep - << endl); + << " pkg=" << cvtToHex(classOrPackagep) + << " node=" << nodep); symp->parentp(abovep); symp->classOrPackagep(classOrPackagep); symp->fallbackp(abovep); @@ -431,7 +429,7 @@ public: VSymEnt* const symp = new VSymEnt{&m_syms, nodep}; UINFO(9, " INSERTsym se" << cvtToHex(symp) << " name='" << name << "' above=se" << cvtToHex(abovep) << " pkg=" << cvtToHex(classOrPackagep) - << " node=" << nodep << endl); + << " node=" << nodep); // We don't remember the ent associated with each node, because we // need a unique scope entry for each instantiation symp->classOrPackagep(classOrPackagep); @@ -494,7 +492,7 @@ public: void computeIfaceVarSyms() { for (VSymEnt* varSymp : m_ifaceVarSyms) { AstVar* const varp = varSymp ? VN_AS(varSymp->nodep(), Var) : nullptr; - UINFO(9, " insAllIface se" << cvtToHex(varSymp) << " " << varp << endl); + UINFO(9, " insAllIface se" << cvtToHex(varSymp) << " " << varp); AstIfaceRefDType* const ifacerefp = ifaceRefFromArray(varp->subDTypep()); UASSERT_OBJ(ifacerefp, varp, "Non-ifacerefs on list!"); const bool varGotPort = varp && varp->user4(); @@ -509,8 +507,7 @@ public: if (!ifacerefp->ifaceViaCellp()) { if (!ifacerefp->cellp()) { // Probably a NotFoundModule, or a normal module if // made mistake - UINFO(1, "Associated cell " << AstNode::prettyNameQ(ifacerefp->cellName()) - << endl); + UINFO(1, "Associated cell " << AstNode::prettyNameQ(ifacerefp->cellName())); ifacerefp->v3error("Cannot find file containing interface: " << AstNode::prettyNameQ(ifacerefp->ifaceName())); continue; @@ -550,7 +547,7 @@ public: bool ok = false; if (foundp) { if (AstModport* const modportp = VN_CAST(foundp->nodep(), Modport)) { - UINFO(4, "Link Modport: " << modportp << endl); + UINFO(4, "Link Modport: " << modportp); ifacerefp->modportp(modportp); ifOrPortSymp = foundp; ok = true; @@ -576,14 +573,14 @@ public: // Track and later insert scope aliases; an interface referenced by // a child cell connecting to that interface // Typically lhsp=VAR w/dtype IFACEREF, rhsp=IFACE cell - UINFO(9, " insertScopeAlias se" << cvtToHex(lhsp) << " se" << cvtToHex(rhsp) << endl); + UINFO(9, " insertScopeAlias se" << cvtToHex(lhsp) << " se" << cvtToHex(rhsp)); UASSERT_OBJ( !(VN_IS(rhsp->nodep(), Cell) && !VN_IS(VN_AS(rhsp->nodep(), Cell)->modp(), Iface)), rhsp->nodep(), "Got a non-IFACE alias RHS"); m_scopeAliasMap[samn].emplace(lhsp, rhsp); } void computeScopeAliases() { - UINFO(9, "computeIfaceAliases\n"); + UINFO(9, "computeIfaceAliases"); for (int samn = 0; samn < SAMN__MAX; ++samn) { for (ScopeAliasMap::iterator it = m_scopeAliasMap[samn].begin(); it != m_scopeAliasMap[samn].end(); ++it) { @@ -599,8 +596,7 @@ public: } } UINFO(9, " iiasa: Insert alias se" << lhsp << " (" << lhsp->nodep()->typeName() - << ") <- se" << srcp << " " << srcp->nodep() - << endl); + << ") <- se" << srcp << " " << srcp->nodep()); // srcp should be an interface reference pointing to the interface we want to // import lhsp->importFromIface(symsp(), srcp); @@ -618,7 +614,7 @@ private: VSymEnt* findp = symp->findIdFallback(name); if (findp) return findp; if (altname != "") { - UINFO(8, " alt fallback\n"); + UINFO(8, " alt fallback"); findp = symp->findIdFallback(altname); } return findp; @@ -628,7 +624,7 @@ private: VSymEnt* findp = symp->findIdFlat(name); if (findp) return findp; if (altname != "") { - UINFO(8, " alt flat\n"); + UINFO(8, " alt flat"); findp = symp->findIdFlat(altname); } return findp; @@ -639,7 +635,7 @@ public: string& baddot, VSymEnt*& okSymp, bool firstId) { // Given a dotted hierarchy name, return where in scope it is // Note when dotname=="" we just fall through and return lookupSymp - UINFO(8, " dottedFind se" << cvtToHex(lookupSymp) << " '" << dotname << "'" << endl); + UINFO(8, " dottedFind se" << cvtToHex(lookupSymp) << " '" << dotname << "'"); string leftname = dotname; okSymp = lookupSymp; // So can list bad scopes while (leftname != "") { // foreach dotted part of xref name @@ -664,7 +660,7 @@ public: } } UINFO(8, " id " << ident << " alt " << altIdent << " left " << leftname - << " at se" << lookupSymp << endl); + << " at se" << lookupSymp); // Spec says; Look at existing module (cellnames then modname), // then look up (inst name or modname) if (firstId) { @@ -700,7 +696,7 @@ public: inlinep = lookupSymp ? VN_CAST(lookupSymp->nodep(), CellInline) : nullptr; // Replicated above if (lookupSymp) { - UINFO(9, " Up to " << lookupSymp << endl); + UINFO(9, " Up to " << lookupSymp); if (cellp || inlinep) crossedCell = true; if ((cellp && cellp->modp()->origName() == ident) || (inlinep && inlinep->origModName() == ident)) { @@ -710,7 +706,7 @@ public: lookupSymp = findSymp; if (crossedCell && VN_IS(lookupSymp->nodep(), Var)) { UINFO(9, " Not found but matches var name in parent " - << lookupSymp << endl); + << lookupSymp); return nullptr; } break; @@ -766,7 +762,7 @@ public: << dotname << " under se" << cvtToHex(lookupSymp) << ((lookupSymp->symPrefix() == "") ? "" : " as ") << ((lookupSymp->symPrefix() == "") ? "" : lookupSymp->symPrefix() + dotname) - << " at se" << lookupSymp << " fallback=" << fallback << endl); + << " at se" << lookupSymp << " fallback=" << fallback); string prefix = lookupSymp->symPrefix(); VSymEnt* foundp = nullptr; while (!foundp) { @@ -855,7 +851,7 @@ class LinkDotFindVisitor final : public VNVisitor { // because base classes are already resolved there. newp->isConstructor(true); nodep->addMembersp(newp); - UINFO(8, "Made implicit new for " << nodep->name() << ": " << nodep << endl); + UINFO(8, "Made implicit new for " << nodep->name() << ": " << nodep); m_statep->insertBlock(m_curSymp, newp->name(), newp, m_classOrPackagep); } @@ -885,7 +881,7 @@ class LinkDotFindVisitor final : public VNVisitor { if (!nodep->modulesp()) nodep->v3error("No top level module found"); for (AstNodeModule* modp = nodep->modulesp(); modp && modp->level() <= 2; modp = VN_AS(modp->nextp(), NodeModule)) { - UINFO(8, "Top Module: " << modp << endl); + UINFO(8, "Top Module: " << modp); m_scope = "TOP"; if (m_statep->forPrearray() && v3Global.opt.topIfacesSupported()) { @@ -945,7 +941,7 @@ class LinkDotFindVisitor final : public VNVisitor { void visit(AstNodeModule* nodep) override { // FindVisitor:: // Called on top module from Netlist, other modules from the cell creating them, // and packages - UINFO(8, " " << nodep << endl); + UINFO(8, " " << nodep); // m_curSymp/m_modSymp maybe nullptr for packages and non-top modules // Packages will be under top after the initial phases, but until then // need separate handling @@ -966,7 +962,7 @@ class LinkDotFindVisitor final : public VNVisitor { "itself, without changing parameters): " << AstNode::prettyNameQ(nodep->origName())); } else if (doit) { - UINFO(4, " Link Module: " << nodep << endl); + UINFO(4, " Link Module: " << nodep); UASSERT_OBJ(!nodep->dead(), nodep, "Module in instance tree mislabeled as dead?"); AstPackage* const pkgp = VN_CAST(nodep, Package); m_classOrPackagep = pkgp; @@ -979,7 +975,7 @@ class LinkDotFindVisitor final : public VNVisitor { m_scope = nodep->name(); m_curSymp = m_modSymp = m_statep->insertBlock(upperSymp, nodep->name(), nodep, m_classOrPackagep); - UINFO(9, "New module scope " << m_curSymp << endl); + UINFO(9, "New module scope " << m_curSymp); } } // @@ -998,7 +994,7 @@ class LinkDotFindVisitor final : public VNVisitor { m_statep->insertIfaceModSym(ifacep, m_curSymp); } } else if (isHierBlockWrapper(nodep->name())) { - UINFO(5, "Module is hierarchical block, must not be dead: " << nodep << endl); + UINFO(5, "Module is hierarchical block, must not be dead: " << nodep); m_scope = nodep->name(); VSymEnt* const upperSymp = m_curSymp ? m_curSymp : m_statep->rootEntp(); m_curSymp = m_modSymp @@ -1007,11 +1003,11 @@ class LinkDotFindVisitor final : public VNVisitor { nodep->user4(true); } else { // !doit if (nodep->hierParams()) { - UINFO(1, "Found module with hier type parameters" << endl); + UINFO(1, "Found module with hier type parameters"); m_hierParamsName = nodep->name(); for (const AstNode* stmtp = nodep->stmtsp(); stmtp; stmtp = stmtp->nextp()) { if (const AstTypedef* const tdef = VN_CAST(stmtp, Typedef)) { - UINFO(1, "Inserting hier type parameter typedef: " << tdef << endl); + UINFO(1, "Inserting hier type parameter typedef: " << tdef); VSymEnt* const upperSymp = m_curSymp ? m_curSymp : m_statep->rootEntp(); m_curSymp = m_modSymp = m_statep->insertBlock(upperSymp, nodep->name(), nodep, m_classOrPackagep); @@ -1020,14 +1016,14 @@ class LinkDotFindVisitor final : public VNVisitor { } else { // Will be optimized away later // Can't remove now, as our backwards iterator will throw up - UINFO(5, "Module not under any CELL or top - dead module: " << nodep << endl); + UINFO(5, "Module not under any CELL or top - dead module: " << nodep); } } } void visit(AstClass* nodep) override { // FindVisitor:: UASSERT_OBJ(m_curSymp, nodep, "Class not under module/package/$unit"); - UINFO(8, " " << nodep << endl); + UINFO(8, " " << nodep); VL_RESTORER(m_scope); VL_RESTORER(m_classOrPackagep); VL_RESTORER(m_modSymp); @@ -1038,14 +1034,14 @@ class LinkDotFindVisitor final : public VNVisitor { VL_RESTORER(m_modArgNum); VL_RESTORER(m_explicitNew); { - UINFO(4, " Link Class: " << nodep << endl); + UINFO(4, " Link Class: " << nodep); VSymEnt* const upperSymp = m_curSymp; m_scope = m_scope + "." + nodep->name(); m_classOrPackagep = nodep; m_curSymp = m_modSymp = m_statep->insertBlock(upperSymp, nodep->name(), nodep, m_classOrPackagep); m_statep->insertMap(m_curSymp, m_scope); - UINFO(9, "New module scope " << m_curSymp << endl); + UINFO(9, "New module scope " << m_curSymp); // m_paramNum = 0; m_modBlockNum = 0; @@ -1072,7 +1068,7 @@ class LinkDotFindVisitor final : public VNVisitor { // Ignored. Processed in next step } void visit(AstCell* nodep) override { // FindVisitor:: - UINFO(5, " CELL under " << m_scope << " is " << nodep << endl); + UINFO(5, " CELL under " << m_scope << " is " << nodep); // Process XREFs/etc inside pins if (nodep->recursive() && m_inRecursion) return; iterateChildren(nodep); @@ -1108,7 +1104,7 @@ class LinkDotFindVisitor final : public VNVisitor { } } void visit(AstCellInline* nodep) override { // FindVisitor:: - UINFO(5, " CELLINLINE under " << m_scope << " is " << nodep << endl); + UINFO(5, " CELLINLINE under " << m_scope << " is " << nodep); VSymEnt* aboveSymp = m_curSymp; // If baz__DOT__foo__DOT__bar, we need to find baz__DOT__foo and add bar to it. const string dottedname = nodep->name(); @@ -1137,7 +1133,7 @@ class LinkDotFindVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstNodeBlock* nodep) override { // FindVisitor:: - UINFO(5, " " << nodep << endl); + UINFO(5, " " << nodep); if (nodep->name() == "" && nodep->unnamed()) { // Unnamed blocks are only important when they contain var // decls, so search for them. (Otherwise adding all the @@ -1177,7 +1173,7 @@ class LinkDotFindVisitor final : public VNVisitor { } void visit(AstNodeFTask* nodep) override { // FindVisitor:: // NodeTask: Remember its name for later resolution - UINFO(5, " " << nodep << endl); + UINFO(5, " " << nodep); UASSERT_OBJ(m_curSymp && m_modSymp, nodep, "Function/Task not under module?"); if (nodep->name() == "new") m_explicitNew = true; // Remember the existing symbol table scope @@ -1403,8 +1399,8 @@ class LinkDotFindVisitor final : public VNVisitor { && VN_IS(nodep->backp(), ClockingItem)) { AstClockingItem* const itemp = VN_AS(nodep->backp(), ClockingItem); AstClockingItem* const finditemp = VN_AS(findvarp->backp(), ClockingItem); - UINFO(4, "ClockCompl: " << itemp << " ;; " << finditemp << endl); - UINFO(4, "ClockCompV: " << nodep << " ;; " << findvarp << endl); + UINFO(4, "ClockCompl: " << itemp << " ;; " << finditemp); + UINFO(4, "ClockCompV: " << nodep << " ;; " << findvarp); if (*itemp->exprp()->fileline() == *finditemp->exprp()->fileline()) { UASSERT_OBJ(finditemp->direction() == VDirection::INPUT && itemp->direction() == VDirection::OUTPUT, @@ -1423,9 +1419,9 @@ class LinkDotFindVisitor final : public VNVisitor { << LinkDotState::nodeTextType(foundp->nodep()) << ": " << nodep->prettyNameQ()); } else if (findvarp != nodep) { - UINFO(4, "DupVar: " << nodep << " ;; " << foundp->nodep() << endl); + UINFO(4, "DupVar: " << nodep << " ;; " << foundp->nodep()); UINFO(4, " found cur=se" << cvtToHex(m_curSymp) << " ;; parent=se" - << cvtToHex(foundp->parentp()) << endl); + << cvtToHex(foundp->parentp())); if (foundp->parentp() == m_curSymp // Only when on same level && !foundp->imported()) { // and not from package if (VN_IS(m_curSymp->nodep(), Clocking)) { @@ -1509,8 +1505,8 @@ class LinkDotFindVisitor final : public VNVisitor { const string svalue = v3Global.opt.parameter(nodep->name()); if (AstConst* const valuep = AstConst::parseParamLiteral(nodep->fileline(), svalue)) { - UINFO(9, " replace parameter " << nodep << endl); - UINFO(9, " with " << valuep << endl); + UINFO(9, " replace parameter " << nodep); + UINFO(9, " with " << valuep); if (nodep->valuep()) pushDeletep(nodep->valuep()->unlinkFrBack()); nodep->valuep(valuep); } @@ -1551,8 +1547,7 @@ class LinkDotFindVisitor final : public VNVisitor { const AstTypedef* tdefp = VN_CAST(stmtp, Typedef); if (tdefp && tdefp->name() == nodep->name() && m_statep->forPrimary()) { - UINFO(8, "Replacing type of" << nodep << endl - << " with " << tdefp << endl); + UINFO(8, "Replacing type of" << nodep << " -->with " << tdefp); AstNodeDType* const newDtp = tdefp->childDTypep(); AstNodeDType* const oldDtp = nodep->childDTypep(); @@ -1589,7 +1584,7 @@ class LinkDotFindVisitor final : public VNVisitor { if (!foundp) { ins = true; } else if (findvarp != nodep) { - UINFO(4, "DupVar: " << nodep << " ;; " << foundp << endl); + UINFO(4, "DupVar: " << nodep << " ;; " << foundp); if (foundp->parentp() == m_curSymp // Only when on same level && !foundp->imported()) { // and not from package nodep->v3error("Duplicate declaration of enum value: " @@ -1616,7 +1611,7 @@ class LinkDotFindVisitor final : public VNVisitor { if (ins) m_statep->insertSym(m_curSymp, nodep->name(), nodep, m_classOrPackagep); } void visit(AstPackageImport* nodep) override { // FindVisitor:: - UINFO(4, " Link: " << nodep << endl); + UINFO(4, " Link: " << nodep); if (!nodep->packagep()) return; // Errored in V3LinkCells VSymEnt* const srcp = m_statep->getNodeSym(nodep->packagep()); if (nodep->name() == "*") { @@ -1631,11 +1626,11 @@ class LinkDotFindVisitor final : public VNVisitor { if (!impp) nodep->v3error("Import object not found: " << nodep->prettyPkgNameQ()); } m_curSymp->importFromPackage(m_statep->symsp(), srcp, nodep->name()); - UINFO(9, " Link Done: " << nodep << endl); + UINFO(9, " Link Done: " << nodep); // No longer needed, but can't delete until any multi-instantiated modules are expanded } void visit(AstPackageExport* nodep) override { // FindVisitor:: - UINFO(9, " Link: " << nodep << endl); + UINFO(9, " Link: " << nodep); if (!nodep->packagep()) return; // Errored in V3LinkCells VSymEnt* const srcp = m_statep->getNodeSym(nodep->packagep()); if (nodep->name() != "*") { @@ -1646,11 +1641,11 @@ class LinkDotFindVisitor final : public VNVisitor { } } m_curSymp->exportFromPackage(m_statep->symsp(), srcp, nodep->name()); - UINFO(9, " Link Done: " << nodep << endl); + UINFO(9, " Link Done: " << nodep); // No longer needed, but can't delete until any multi-instantiated modules are expanded } void visit(AstPackageExportStarStar* nodep) override { // FindVisitor:: - UINFO(4, " Link: " << nodep << endl); + UINFO(4, " Link: " << nodep); m_curSymp->exportStarStar(m_statep->symsp()); // No longer needed, but can't delete until any multi-instantiated modules are expanded } @@ -1764,7 +1759,7 @@ public: // CONSTRUCTORS LinkDotFindVisitor(AstNetlist* rootp, LinkDotState* statep) : m_statep{statep} { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); iterate(rootp); } ~LinkDotFindVisitor() override = default; @@ -1799,7 +1794,7 @@ class LinkDotFindIfaceVisitor final : public VNVisitor { // VISITORS void visit(AstRefDType* nodep) override { // FindIfaceVisitor:: if (m_statep->forPrimary() && !nodep->classOrPackagep()) { - UINFO(9, " FindIfc: " << nodep << endl); + UINFO(9, " FindIfc: " << nodep); // If under a var, ignore the var itself as might be e.g. "intf intf;" // Critical tests: // t_interface_param_genblk.v // Checks this does make interface @@ -1812,7 +1807,7 @@ class LinkDotFindIfaceVisitor final : public VNVisitor { // --debugi-V3LinkDot 9 Passes with this commented out: if (foundp) foundNodep = foundp->nodep(); if (!foundNodep) foundNodep = m_statep->findModuleSym(nodep->name()); - if (foundNodep) UINFO(9, " Ifc foundNodep " << foundNodep << endl); + if (foundNodep) UINFO(9, " Ifc foundNodep " << foundNodep); if (AstIface* const defp = VN_CAST(foundNodep, Iface)) { // Must be found as module name, and not hidden/ by normal symbol (foundp) AstIfaceRefDType* const newp @@ -1821,7 +1816,7 @@ class LinkDotFindIfaceVisitor final : public VNVisitor { newp->addParamsp(nodep->paramsp()->unlinkFrBackWithNext()); newp->ifacep(defp); newp->user1u(nodep->user1u()); - UINFO(9, " Resolved interface " << nodep << " => " << defp << endl); + UINFO(9, " Resolved interface " << nodep << " => " << defp); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); return; @@ -1838,7 +1833,7 @@ class LinkDotFindIfaceVisitor final : public VNVisitor { if (ifacerefp && m_statep->existsNodeSym(nodep)) { // Can't resolve until interfaces and modport names are // known; see notes at top - UINFO(9, " FindIfc Var IfaceRef " << ifacerefp << endl); + UINFO(9, " FindIfc Var IfaceRef " << ifacerefp); if (!ifacerefp->isVirtual()) nodep->setIfaceRef(); VSymEnt* const symp = m_statep->getNodeSym(nodep); m_statep->insertIfaceVarSym(symp); @@ -1850,7 +1845,7 @@ public: // CONSTRUCTORS LinkDotFindIfaceVisitor(AstNetlist* rootp, LinkDotState* statep) : m_statep{statep} { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); iterate(rootp); } ~LinkDotFindIfaceVisitor() override = default; @@ -1894,9 +1889,9 @@ class LinkDotParamVisitor final : public VNVisitor { void visit(AstTypeTable*) override {} // ParamVisitor:: void visit(AstConstPool*) override {} // ParamVisitor:: void visit(AstNodeModule* nodep) override { // ParamVisitor:: - UINFO(5, " " << nodep << endl); + UINFO(5, " " << nodep); if ((nodep->dead() || !nodep->user4()) && !nodep->hierParams()) { - UINFO(4, "Mark dead module " << nodep << endl); + UINFO(4, "Mark dead module " << nodep); UASSERT_OBJ(m_statep->forPrearray(), nodep, "Dead module persisted past where should have removed"); // Don't remove now, because we may have a tree of @@ -1932,7 +1927,7 @@ class LinkDotParamVisitor final : public VNVisitor { } else { AstNodeExpr* const exprp = nodep->rhsp()->unlinkFrBack(); UINFO(9, "Defparam cell " << nodep->path() << "." << nodep->name() << " attach-to " - << cellp << " <= " << exprp << endl); + << cellp << " <= " << exprp); // Don't need to check the name of the defparam exists. V3Param does. AstPin* const pinp = new AstPin{nodep->fileline(), -1, // Pin# not relevant @@ -2010,7 +2005,7 @@ class LinkDotParamVisitor final : public VNVisitor { UASSERT(m_statep->forPrimary(), "Param types should have been resolved"); nodep->classOrPackageNodep(VN_AS(foundp->nodep(), ParamTypeDType)); } else { - if (foundp) UINFO(1, "found nodep = " << foundp->nodep() << endl); + if (foundp) UINFO(1, "found nodep = " << foundp->nodep()); nodep->v3error( "Forward typedef used as class/package does not resolve to class/package: " << nodep->prettyNameQ() << '\n' @@ -2051,7 +2046,7 @@ public: // CONSTRUCTORS LinkDotParamVisitor(AstNetlist* rootp, LinkDotState* statep) : m_statep{statep} { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); iterate(rootp); } ~LinkDotParamVisitor() override = default; @@ -2073,7 +2068,7 @@ class LinkDotScopeVisitor final : public VNVisitor { } void visit(AstConstPool*) override {} // ScopeVisitor:: void visit(AstScope* nodep) override { // ScopeVisitor:: - UINFO(8, " SCOPE " << nodep << endl); + UINFO(8, " SCOPE " << nodep); UASSERT_OBJ(m_statep->forScopeCreation(), nodep, "Scopes should only exist right after V3Scope"); // Using the CELL names, we created all hierarchy. We now need to match this Scope @@ -2089,12 +2084,12 @@ class LinkDotScopeVisitor final : public VNVisitor { VSymEnt* const varSymp = m_statep->insertSym(m_modSymp, nodep->varp()->name(), nodep, nullptr); if (nodep->varp()->isIfaceRef() && nodep->varp()->isIfaceParent()) { - UINFO(9, "Iface parent ref var " << nodep->varp()->name() << " " << nodep << endl); + UINFO(9, "Iface parent ref var " << nodep->varp()->name() << " " << nodep); // Find the interface cell the var references AstIfaceRefDType* const dtypep = LinkDotState::ifaceRefFromArray(nodep->varp()->dtypep()); UASSERT_OBJ(dtypep, nodep, "Non AstIfaceRefDType on isIfaceRef() var"); - UINFO(9, "Iface parent dtype " << dtypep << endl); + UINFO(9, "Iface parent dtype " << dtypep); const string ifcellname = dtypep->cellName(); string baddot; VSymEnt* okSymp; @@ -2104,7 +2099,7 @@ class LinkDotScopeVisitor final : public VNVisitor { cellSymp, nodep, "No symbol for interface instance: " << nodep->prettyNameQ(ifcellname)); UINFO(5, " Found interface instance: se" << cvtToHex(cellSymp) << " " - << cellSymp->nodep() << endl); + << cellSymp->nodep()); if (dtypep->modportName() != "") { VSymEnt* const mpSymp = m_statep->findDotted( nodep->fileline(), m_modSymp, ifcellname, baddot, okSymp, false); @@ -2113,7 +2108,7 @@ class LinkDotScopeVisitor final : public VNVisitor { << nodep->prettyNameQ(dtypep->modportName())); cellSymp = mpSymp; UINFO(5, " Found modport cell: se" << cvtToHex(cellSymp) << " " - << mpSymp->nodep() << endl); + << mpSymp->nodep()); } // Interface reference; need to put whole thing into // symtable, but can't clone it now as we may have a later @@ -2151,7 +2146,7 @@ class LinkDotScopeVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstAssignVarScope* nodep) override { // ScopeVisitor:: - UINFO(5, "ASSIGNVARSCOPE " << nodep << endl); + UINFO(5, "ASSIGNVARSCOPE " << nodep); if (debug() >= 9) nodep->dumpTree("- avs: "); VSymEnt* rhsSymp; { @@ -2176,12 +2171,11 @@ class LinkDotScopeVisitor final : public VNVisitor { } if (!symp) { UINFO(9, "No symbol for interface alias rhs (" - << std::string{refp ? "VARREF " : "VARXREF "} << scopename << ")" - << endl); + << std::string{refp ? "VARREF " : "VARXREF "} << scopename << ")"); } UASSERT_OBJ(symp, nodep, "No symbol for interface alias rhs"); UINFO(5, " Found a linked scope RHS: " << scopename << " se" << cvtToHex(symp) - << " " << symp->nodep() << endl); + << " " << symp->nodep()); rhsSymp = symp; } VSymEnt* lhsSymp; @@ -2199,7 +2193,7 @@ class LinkDotScopeVisitor final : public VNVisitor { scopename, baddot, okSymp, false); UASSERT_OBJ(symp, nodep, "No symbol for interface alias lhs"); UINFO(5, " Found a linked scope LHS: " << scopename << " se" << cvtToHex(symp) - << " " << symp->nodep() << endl); + << " " << symp->nodep()); lhsSymp = symp; } // Remember the alias - can't do it yet because we may have additional symbols to be added, @@ -2218,7 +2212,7 @@ public: // CONSTRUCTORS LinkDotScopeVisitor(AstNetlist* rootp, LinkDotState* statep) : m_statep{statep} { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); iterate(rootp); } ~LinkDotScopeVisitor() override = default; @@ -2235,7 +2229,7 @@ class LinkDotIfaceVisitor final : public VNVisitor { // VISITORS void visit(AstModport* nodep) override { // IfaceVisitor:: // Modport: Remember its name for later resolution - UINFO(5, " fiv: " << nodep << endl); + UINFO(5, " fiv: " << nodep); VL_RESTORER(m_curSymp); { // Create symbol table for the vars @@ -2245,7 +2239,7 @@ class LinkDotIfaceVisitor final : public VNVisitor { } } void visit(AstModportFTaskRef* nodep) override { // IfaceVisitor:: - UINFO(5, " fif: " << nodep << endl); + UINFO(5, " fif: " << nodep); iterateChildren(nodep); if (nodep->isExport()) nodep->v3warn(E_UNSUPPORTED, "Unsupported: modport export"); VSymEnt* const symp = m_curSymp->findIdFallback(nodep->name()); @@ -2268,7 +2262,7 @@ class LinkDotIfaceVisitor final : public VNVisitor { } } void visit(AstModportVarRef* nodep) override { // IfaceVisitor:: - UINFO(5, " fiv: " << nodep << endl); + UINFO(5, " fiv: " << nodep); iterateChildren(nodep); VSymEnt* const symp = m_curSymp->findIdFallback(nodep->name()); if (!symp) { @@ -2299,7 +2293,7 @@ public: LinkDotIfaceVisitor(AstIface* nodep, VSymEnt* curSymp, LinkDotState* statep) : m_statep{statep} , m_curSymp{curSymp} { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); iterate(nodep); } ~LinkDotIfaceVisitor() override = default; @@ -2480,7 +2474,7 @@ class LinkDotResolveVisitor final : public VNVisitor { } void checkNoDot(AstNode* nodep) { if (VL_UNLIKELY(m_ds.m_dotPos != DP_NONE)) { - UINFO(9, indent() << "ds=" << m_ds.ascii() << endl); + UINFO(9, indent() << "ds=" << m_ds.ascii()); nodep->v3error("Syntax error: Not expecting " << nodep->type() << " under a " << nodep->backp()->type() << " in dotted expression\n" @@ -2539,11 +2533,10 @@ class LinkDotResolveVisitor final : public VNVisitor { } void importDerivedClass(AstClass* derivedClassp, VSymEnt* baseSymp, AstClass* baseClassp) { // Also used for standard 'extends' from a base class - UINFO(8, indent() << "importDerivedClass to " << derivedClassp << " from " << baseClassp - << endl); + UINFO(8, indent() << "importDerivedClass to " << derivedClassp << " from " << baseClassp); for (VSymEnt::const_iterator it = baseSymp->begin(); it != baseSymp->end(); ++it) { if (AstNode* baseSubp = it->second->nodep()) { - UINFO(8, indent() << " SymFunc " << baseSubp << endl); + UINFO(8, indent() << " SymFunc " << baseSubp); const string impOrExtends = baseClassp->isInterfaceClass() ? " implements " : " extends "; if (VN_IS(baseSubp, NodeFTask)) { @@ -2670,7 +2663,7 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstNodeModule* nodep) override { if (nodep->dead()) return; LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); + UINFO(8, indent() << "visit " << nodep); checkNoDot(nodep); m_ds.init(m_curSymp); m_ds.m_dotSymp = m_curSymp = m_modSymp @@ -2684,7 +2677,7 @@ class LinkDotResolveVisitor final : public VNVisitor { } void visit(AstScope* nodep) override { LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); + UINFO(8, indent() << "visit " << nodep); checkNoDot(nodep); VL_RESTORER(m_modSymp); VL_RESTORER(m_curSymp); @@ -2703,7 +2696,7 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstCell* nodep) override { // Cell: Recurse inside or cleanup not founds LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); VL_RESTORER(m_usedPins); m_usedPins.clear(); @@ -2723,7 +2716,7 @@ class LinkDotResolveVisitor final : public VNVisitor { // instantiator's symbols else { m_pinSymp = m_statep->getNodeSym(nodep->modp()); - UINFO(4, indent() << "(Backto) visit " << nodep << endl); + UINFO(4, indent() << "(Backto) visit " << nodep); // if (debug()) nodep->dumpTree("- linkcell: "); // if (debug()) nodep->modp()->dumpTree("- linkcemd: "); iterateChildren(nodep); @@ -2735,7 +2728,7 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstClassRefDType* nodep) override { // Cell: Recurse inside or cleanup not founds LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); VL_RESTORER(m_usedPins); m_usedPins.clear(); @@ -2746,7 +2739,7 @@ class LinkDotResolveVisitor final : public VNVisitor { { // ClassRef's have pins, so track m_pinSymp = m_statep->getNodeSym(nodep->classp()); - UINFO(4, indent() << "(Backto) visit " << nodep << endl); + UINFO(4, indent() << "(Backto) visit " << nodep); // if (debug()) nodep->dumpTree("- linkcell: "); // if (debug()) nodep->modp()->dumpTree("- linkcemd: "); iterateChildren(nodep); @@ -2823,8 +2816,8 @@ class LinkDotResolveVisitor final : public VNVisitor { // Dot(Dot(Dot(ParseRef(text), ... if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); - UINFO(8, indent() << m_ds.ascii() << endl); + UINFO(8, indent() << "visit " << nodep); + UINFO(8, indent() << m_ds.ascii()); const DotStates lastStates = m_ds; const bool start = (m_ds.m_dotPos == DP_NONE); // Save, as m_dotp will be changed VL_RESTORER(m_randSymp); @@ -2843,7 +2836,7 @@ class LinkDotResolveVisitor final : public VNVisitor { m_ds.m_dotErr = true; } else { m_ds.m_dotSymp = classSymp; - UINFO(8, indent() << "this. " << m_ds.ascii() << endl); + UINFO(8, indent() << "this. " << m_ds.ascii()); } } else if (VN_IS(nodep->lhsp(), ParseRef) && nodep->lhsp()->name() == "super") { const VSymEnt* classSymp = getThisClassSymp(); @@ -2859,22 +2852,22 @@ class LinkDotResolveVisitor final : public VNVisitor { } else { if (m_statep->forPrimary() && m_extendsParam.find(classp) != m_extendsParam.end()) { - UINFO(9, indent() << "deferring until post-V3Param: " << nodep->lhsp() - << endl); + UINFO(9, indent() + << "deferring until post-V3Param: " << nodep->lhsp()); m_ds.m_unresolvedClass = true; } else { const auto baseClassp = cextp->classp(); UASSERT_OBJ(baseClassp, nodep, "Bad superclass"); m_ds.m_dotSymp = m_statep->getNodeSym(baseClassp); m_ds.m_super = true; - UINFO(8, indent() << "super. " << m_ds.ascii() << endl); + UINFO(8, indent() << "super. " << m_ds.ascii()); } } } } else if (AstClassOrPackageRef* const lhsp = VN_CAST(nodep->lhsp(), ClassOrPackageRef)) { // m_ds.m_dotText communicates the cell prefix between stages - UINFO(8, indent() << "iter.lhs " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.lhs " << m_ds.ascii() << " " << nodep); iterateAndNextNull(lhsp); if (!lhsp->classOrPackageSkipp() && lhsp->name() != "local::") { revisitLater(nodep); @@ -2894,10 +2887,10 @@ class LinkDotResolveVisitor final : public VNVisitor { m_ds.m_dotSymp = m_statep->getNodeSym(classOrPackageNodep); } } - UINFO(8, indent() << "iter.ldone " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.ldone " << m_ds.ascii() << " " << nodep); } else if (VN_IS(nodep->lhsp(), Dot) && VN_AS(nodep->lhsp(), Dot)->colon()) { // m_ds.m_dotText communicates the cell prefix between stages - UINFO(8, indent() << "iter.lhs " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.lhs " << m_ds.ascii() << " " << nodep); m_ds.m_dotPos = DP_PACKAGE; iterateAndNextNull(nodep->lhsp()); // nodep->lhsp() may be a new node @@ -2923,17 +2916,17 @@ class LinkDotResolveVisitor final : public VNVisitor { } return; } - UINFO(8, indent() << "iter.ldone " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.ldone " << m_ds.ascii() << " " << nodep); } else { m_ds.m_dotPos = DP_FIRST; - UINFO(8, indent() << "iter.lhs " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.lhs " << m_ds.ascii() << " " << nodep); iterateAndNextNull(nodep->lhsp()); - UINFO(8, indent() << "iter.ldone " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.ldone " << m_ds.ascii() << " " << nodep); // if (debug() >= 9) nodep->dumpTree("- dot-lho: "); } if (m_statep->forPrimary() && isParamedClassRef(nodep->lhsp())) { // Dots of paramed classes will be linked after deparameterization - UINFO(9, indent() << "deferring until post-V3Param: " << nodep->lhsp() << endl); + UINFO(9, indent() << "deferring until post-V3Param: " << nodep->lhsp()); m_ds.m_unresolvedClass = true; } if (m_ds.m_unresolvedCell @@ -2945,10 +2938,10 @@ class LinkDotResolveVisitor final : public VNVisitor { // Top 'final' dot RHS is final RHS, else it's a // DOT(DOT(x,*here*),real-rhs) which we consider a RHS if (start && m_ds.m_dotPos == DP_SCOPE) m_ds.m_dotPos = DP_FINAL; - UINFO(8, indent() << "iter.rhs " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.rhs " << m_ds.ascii() << " " << nodep); // m_ds.m_dotSymp points at lhsp()'s symbol table, so resolve RHS under that iterateAndNextNull(nodep->rhsp()); - UINFO(8, indent() << "iter.rdone " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "iter.rdone " << m_ds.ascii() << " " << nodep); // if (debug() >= 9) nodep->dumpTree("- dot-rho: "); } if (!m_ds.m_unresolvedClass) { @@ -2981,7 +2974,7 @@ class LinkDotResolveVisitor final : public VNVisitor { m_ds.m_dotp = lastStates.m_dotp; m_ds.m_unresolvedClass |= unresolvedClass; } - UINFO(8, indent() << "done " << m_ds.ascii() << " " << nodep << endl); + UINFO(8, indent() << "done " << m_ds.ascii() << " " << nodep); } void visit(AstSenItem* nodep) override { LINKDOT_VISIT_START(); @@ -2994,8 +2987,8 @@ class LinkDotResolveVisitor final : public VNVisitor { if (nodep->varrefp()) return; // only do this mapping once // If we have a TEXT token as our key, lookup if it's a LPARAM if (AstText* const textp = VN_CAST(nodep->keyp(), Text)) { - UINFO(9, indent() << "visit " << nodep << endl); - UINFO(9, indent() << " " << textp << endl); + UINFO(9, indent() << "visit " << nodep); + UINFO(9, indent() << " " << textp); // Lookup if (VSymEnt* const foundp = m_curSymp->findIdFallback(textp->text())) { if (AstVar* const varp = VN_CAST(foundp->nodep(), Var)) { @@ -3005,14 +2998,14 @@ class LinkDotResolveVisitor final : public VNVisitor { new AstVarRef{nodep->fileline(), foundp->imported() ? foundp->classOrPackagep() : nullptr, varp, VAccess::READ}); - UINFO(9, indent() << " new " << nodep->varrefp() << endl); + UINFO(9, indent() << " new " << nodep->varrefp()); } } if (AstEnumItem* const itemp = VN_CAST(foundp->nodep(), EnumItem)) { // Attach enum item value to PatMember nodep->varrefp( new AstEnumItemRef{nodep->fileline(), itemp, foundp->classOrPackagep()}); - UINFO(9, indent() << " new " << itemp << endl); + UINFO(9, indent() << " new " << itemp); } } } @@ -3021,8 +3014,8 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstParseRef* nodep) override { if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(9, indent() << "visit " << nodep << endl); - UINFO(9, indent() << m_ds.ascii() << endl); + UINFO(9, indent() << "visit " << nodep); + UINFO(9, indent() << m_ds.ascii()); if (m_ds.m_unresolvedClass) return; // m_curSymp is symbol table of outer expression // m_ds.m_dotSymp is symbol table relative to "."'s above now @@ -3095,7 +3088,7 @@ class LinkDotResolveVisitor final : public VNVisitor { allowVar = true; allowFTask = true; staticAccess = true; - UINFO(9, "chk pkg " << m_ds.ascii() << " lhsp=" << m_ds.m_dotp->lhsp() << endl); + UINFO(9, "chk pkg " << m_ds.ascii() << " lhsp=" << m_ds.m_dotp->lhsp()); UASSERT_OBJ(VN_IS(m_ds.m_dotp->lhsp(), ClassOrPackageRef), m_ds.m_dotp->lhsp(), "Bad package link"); AstClassOrPackageRef* const cpackagerefp @@ -3130,7 +3123,7 @@ class LinkDotResolveVisitor final : public VNVisitor { expectWhat = "variable"; allowVar = true; } else { - UINFO(1, "ds=" << m_ds.ascii() << endl); + UINFO(1, "ds=" << m_ds.ascii()); nodep->v3fatalSrc("Unhandled VParseRefExp"); } // Lookup @@ -3154,7 +3147,7 @@ class LinkDotResolveVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); return; } - UINFO(9, indent() << "randomize-with fromSym " << foundp->nodep() << endl); + UINFO(9, indent() << "randomize-with fromSym " << foundp->nodep()); AstLambdaArgRef* const lambdaRefp = new AstLambdaArgRef{nodep->fileline(), "item", false}; nodep->replaceWith(new AstMemberSel{nodep->fileline(), lambdaRefp, @@ -3173,7 +3166,7 @@ class LinkDotResolveVisitor final : public VNVisitor { } if (foundp) { UINFO(9, indent() << "found=se" << cvtToHex(foundp) << " exp=" << expectWhat - << " n=" << foundp->nodep() << endl); + << " n=" << foundp->nodep()); } // What fell out? bool ok = false; @@ -3212,7 +3205,7 @@ class LinkDotResolveVisitor final : public VNVisitor { m_ds.m_dotText = VString::dot(m_ds.m_dotText, ".", nodep->name()); m_ds.m_dotSymp = foundp; m_ds.m_dotPos = DP_SCOPE; - UINFO(9, indent() << " cell -> iface varref " << foundp->nodep() << endl); + UINFO(9, indent() << " cell -> iface varref " << foundp->nodep()); AstNode* const newp = new AstVarRef{nodep->fileline(), ifaceRefVarp, VAccess::READ}; nodep->replaceWith(newp); @@ -3239,8 +3232,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (ifacerefp && varp->isIfaceRef()) { UASSERT_OBJ(ifacerefp->ifaceViaCellp(), ifacerefp, "Unlinked interface"); // Really this is a scope reference into an interface - UINFO(9, indent() - << "varref-ifaceref " << m_ds.m_dotText << " " << nodep << endl); + UINFO(9, indent() << "varref-ifaceref " << m_ds.m_dotText << " " << nodep); m_ds.m_dotText = VString::dot(m_ds.m_dotText, ".", nodep->name()); m_ds.m_dotSymp = m_statep->getNodeSym(ifacerefp->ifaceViaCellp()); m_ds.m_dotPos = DP_SCOPE; @@ -3274,8 +3266,7 @@ class LinkDotResolveVisitor final : public VNVisitor { refp->dotted(dotted.substr(0, pos)); newp = refp; } else { - UINFO(9, indent() - << "deferring until post-V3Param: " << refp << endl); + UINFO(9, indent() << "deferring until post-V3Param: " << refp); newp = new AstUnlinkedRef{nodep->fileline(), refp, refp->name(), m_ds.m_unlinkedScopep->unlinkFrBack()}; m_ds.m_unlinkedScopep = nullptr; @@ -3295,7 +3286,7 @@ class LinkDotResolveVisitor final : public VNVisitor { refp->classOrPackagep(foundp->classOrPackagep()); newp = refp; } - UINFO(9, indent() << "new " << newp << endl); + UINFO(9, indent() << "new " << newp); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); m_ds.m_dotPos = DP_MEMBER; @@ -3304,11 +3295,10 @@ class LinkDotResolveVisitor final : public VNVisitor { } else if (const AstModport* const modportp = VN_CAST(foundp->nodep(), Modport)) { // A scope reference into an interface's modport (not // necessarily at a pin connection) - UINFO(9, indent() << "cell-ref-to-modport " << m_ds.m_dotText << " " << nodep - << endl); - UINFO(9, indent() << "unlinked " << m_ds.m_unlinkedScopep << endl); - UINFO(9, indent() << "dotSymp " << m_ds.m_dotSymp << " " << m_ds.m_dotSymp->nodep() - << endl); + UINFO(9, indent() << "cell-ref-to-modport " << m_ds.m_dotText << " " << nodep); + UINFO(9, indent() << "unlinked " << m_ds.m_unlinkedScopep); + UINFO(9, + indent() << "dotSymp " << m_ds.m_dotSymp << " " << m_ds.m_dotSymp->nodep()); // Iface was the previously dotted component if (!m_ds.m_dotSymp || !VN_IS(m_ds.m_dotSymp->nodep(), Cell) || !VN_AS(m_ds.m_dotSymp->nodep(), Cell)->modp() @@ -3335,7 +3325,7 @@ class LinkDotResolveVisitor final : public VNVisitor { m_ds.m_dotText = VString::dot(m_ds.m_dotText, ".", nodep->name()); m_ds.m_dotSymp = foundp; m_ds.m_dotPos = DP_SCOPE; - UINFO(9, indent() << "modport -> iface varref " << foundp->nodep() << endl); + UINFO(9, indent() << "modport -> iface varref " << foundp->nodep()); // We lose the modport name here, so we cannot detect mismatched modports. AstNodeExpr* newp = new AstVarRef{nodep->fileline(), ifaceRefVarp, VAccess::READ}; @@ -3343,7 +3333,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (cellarrayrefp) { // iface[vec].modport became CellArrayRef(iface, lsb) // Convert back to SelBit(iface, lsb) - UINFO(9, indent() << "Array modport to SelBit " << cellarrayrefp << endl); + UINFO(9, indent() << "Array modport to SelBit " << cellarrayrefp); newp = new AstSelBit{cellarrayrefp->fileline(), newp, cellarrayrefp->selp()->unlinkFrBack()}; newp->user3(true); // Don't process again @@ -3445,8 +3435,8 @@ class LinkDotResolveVisitor final : public VNVisitor { << " as a " << foundp->nodep()->typeName() << " but expected a " << expectWhat); } else if (m_ds.m_dotText == "") { - UINFO(1, " ErrParseRef curSymp=se" - << cvtToHex(m_curSymp) << " ds=" << m_ds.ascii() << endl); + UINFO(1, " ErrParseRef curSymp=se" << cvtToHex(m_curSymp) + << " ds=" << m_ds.ascii()); const string suggest = m_statep->suggestSymFallback( m_ds.m_dotSymp, nodep->name(), VNodeMatcher{}); nodep->v3error( @@ -3485,8 +3475,8 @@ class LinkDotResolveVisitor final : public VNVisitor { // Class: Recurse inside or cleanup not founds // checkNoDot not appropriate, can be under a dot LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); - UINFO(9, indent() << m_ds.ascii() << endl); + UINFO(8, indent() << "visit " << nodep); + UINFO(9, indent() << m_ds.ascii()); VL_RESTORER(m_usedPins); m_usedPins.clear(); UASSERT_OBJ(m_statep->forPrimary() || VN_IS(nodep->classOrPackageNodep(), ParamTypeDType) @@ -3514,7 +3504,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (refClassp && !m_statep->forPrimary()) classExtendImport(refClassp); m_ds.init(m_curSymp); - UINFO(4, indent() << "(Backto) Link ClassOrPackageRef: " << nodep << endl); + UINFO(4, indent() << "(Backto) Link ClassOrPackageRef: " << nodep); iterateChildren(nodep); AstClass* const modClassp = VN_CAST(m_modp, Class); @@ -3542,12 +3532,12 @@ class LinkDotResolveVisitor final : public VNVisitor { } if (m_ds.m_dotPos == DP_PACKAGE && nodep->classOrPackageSkipp()) { m_ds.m_dotSymp = m_statep->getNodeSym(nodep->classOrPackageSkipp()); - UINFO(9, indent() << "set sym " << m_ds.ascii() << endl); + UINFO(9, indent() << "set sym " << m_ds.ascii()); } } void visit(AstConstraint* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); if (nodep->isExternDef()) { if (const VSymEnt* const foundp @@ -3573,8 +3563,8 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstConstraintRef* nodep) override { if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); - UINFO(8, indent() << m_ds.ascii() << endl); + UINFO(8, indent() << "visit " << nodep); + UINFO(8, indent() << m_ds.ascii()); // No children defined } void visit(AstVarRef* nodep) override { @@ -3585,8 +3575,7 @@ class LinkDotResolveVisitor final : public VNVisitor { LINKDOT_VISIT_START(); iterateChildren(nodep); if (!nodep->varp()) { - UINFO(9, - indent() << "linkVarRef se" << cvtToHex(m_curSymp) << " n=" << nodep << endl); + UINFO(9, indent() << "linkVarRef se" << cvtToHex(m_curSymp) << " n=" << nodep); UASSERT_OBJ(m_curSymp, nodep, "nullptr lookup symbol table"); VSymEnt* const foundp = m_curSymp->findIdFallback(nodep->name()); if (AstVar* const varp @@ -3608,11 +3597,11 @@ class LinkDotResolveVisitor final : public VNVisitor { // due to creating new modules, flattening, etc. if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); + UINFO(8, indent() << "visit " << nodep); // No checkNoDot; created and iterated from a parseRef if (!m_modSymp) { // Module that is not in hierarchy. We'll be dead code eliminating it later. - UINFO(9, "Dead module for " << nodep << endl); + UINFO(9, "Dead module for " << nodep); nodep->varp(nullptr); } else { string baddot; @@ -3643,7 +3632,7 @@ class LinkDotResolveVisitor final : public VNVisitor { = foundp ? foundToVarp(foundp, nodep, nodep->access()) : nullptr; nodep->varp(varp); updateVarUse(nodep->varp()); - UINFO(7, indent() << "Resolved " << nodep << endl); // Also prints varp + UINFO(7, indent() << "Resolved " << nodep); // Also prints varp if (!nodep->varp()) { nodep->v3error("Can't find definition of " << AstNode::prettyNameQ(baddot) << " in dotted signal: '" @@ -3678,8 +3667,7 @@ class LinkDotResolveVisitor final : public VNVisitor { << okSymp->cellErrorScopes(nodep)); } else { while (vscp->user2p()) { // If V3Inline aliased it, pick up the new signal - UINFO(7, indent() << "Resolved pre-alias " << vscp - << endl); // Also prints taskp + UINFO(7, indent() << "Resolved pre-alias " << vscp); // Also prints taskp vscp = VN_AS(vscp->user2p(), VarScope); } // Convert the VarXRef to a VarRef, so we don't need @@ -3687,12 +3675,12 @@ class LinkDotResolveVisitor final : public VNVisitor { nodep->varp(vscp->varp()); nodep->varScopep(vscp); updateVarUse(nodep->varp()); - UINFO(7, indent() << "Resolved " << nodep << endl); // Also prints taskp + UINFO(7, indent() << "Resolved " << nodep); // Also prints taskp AstVarRef* const newvscp = new AstVarRef{nodep->fileline(), vscp, nodep->access()}; nodep->replaceWith(newvscp); VL_DO_DANGLING(nodep->deleteTree(), nodep); - UINFO(9, indent() << "new " << newvscp << endl); // Also prints taskp + UINFO(9, indent() << "new " << newvscp); // Also prints taskp } } } @@ -3713,7 +3701,7 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstMethodCall* nodep) override { // Created here so should already be resolved. LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); VL_RESTORER(m_ds); VL_RESTORER(m_randSymp); VL_RESTORER(m_randMethodCallp); @@ -3776,8 +3764,8 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstNodeFTaskRef* nodep) override { if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(8, indent() << "visit " << nodep << endl); - UINFO(8, indent() << m_ds.ascii() << endl); + UINFO(8, indent() << "visit " << nodep); + UINFO(8, indent() << m_ds.ascii()); if (m_ds.m_dotPos != DP_MEMBER || nodep->name() != "randomize") { // Visit arguments at the beginning. // They may be visitted even if the current node can't be linked now. @@ -3850,7 +3838,7 @@ class LinkDotResolveVisitor final : public VNVisitor { // References into packages don't care about cell hierarchy. } else if (!m_modSymp) { // Module that is not in hierarchy. We'll be dead code eliminating it later. - UINFO(9, indent() << "Dead module for " << nodep << endl); + UINFO(9, indent() << "Dead module for " << nodep); nodep->taskp(nullptr); } else if (nodep->dotted() == "" && nodep->taskp()) { // Earlier should have setup the links @@ -3870,7 +3858,7 @@ class LinkDotResolveVisitor final : public VNVisitor { } if (nodep->classOrPackagep()) { // Look only in specified package dotSymp = m_statep->getNodeSym(nodep->classOrPackagep()); - UINFO(8, indent() << "Override classOrPackage " << dotSymp << endl); + UINFO(8, indent() << "Override classOrPackage " << dotSymp); } else { if (nodep->inlinedDots() != "") { // Correct for current scope // Dotted lookup is always relative to module, as maybe @@ -3878,7 +3866,7 @@ class LinkDotResolveVisitor final : public VNVisitor { // to ignore (t_math_divw) dotSymp = m_modSymp; const string inl = AstNode::dedotName(nodep->inlinedDots()); - UINFO(8, indent() << "Inlined " << inl << endl); + UINFO(8, indent() << "Inlined " << inl); dotSymp = m_statep->findDotted(nodep->fileline(), dotSymp, inl, baddot, okSymp, true); if (!dotSymp) { @@ -3895,7 +3883,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (m_randSymp) { VSymEnt* const foundp = m_randSymp->findIdFlat(nodep->name()); if (foundp && m_inWith) { - UINFO(9, indent() << "randomize-with fromSym " << foundp->nodep() << endl); + UINFO(9, indent() << "randomize-with fromSym " << foundp->nodep()); AstNodeExpr* argsp = nullptr; if (nodep->pinsp()) { iterateAndNextNull(nodep->pinsp()); @@ -3930,7 +3918,7 @@ class LinkDotResolveVisitor final : public VNVisitor { } nodep->taskp(taskp); nodep->classOrPackagep(foundp->classOrPackagep()); - UINFO(7, indent() << "Resolved " << nodep << endl); // Also prints taskp + UINFO(7, indent() << "Resolved " << nodep); // Also prints taskp } else if (m_insideClassExtParam) { // The reference may point to a method declared in a super class, which is proved // by a parameter. In such a case, it can't be linked at the first stage. @@ -3938,15 +3926,14 @@ class LinkDotResolveVisitor final : public VNVisitor { } else { // Note ParseRef has similar error handling/message output UINFO(7, indent() << " ErrFtask curSymp=se" << cvtToHex(m_curSymp) - << " dotSymp=se" << cvtToHex(dotSymp) << endl); + << " dotSymp=se" << cvtToHex(dotSymp)); if (foundp) { if (VN_IS(foundp->nodep(), Var) && m_ds.m_dotText == "" && m_ftaskp && m_ftaskp->name() == foundp->nodep()->name()) { // This is a recursive reference to the function itself, not to the var nodep->taskp(m_ftaskp); nodep->classOrPackagep(foundp->classOrPackagep()); - UINFO(7, indent() << "Resolved recursive " << nodep - << endl); // Also prints taskp + UINFO(7, indent() << "Resolved recursive " << nodep); // Also prints taskp } else { nodep->v3error("Found definition of '" << m_ds.m_dotText << (m_ds.m_dotText == "" ? "" : ".") @@ -4032,7 +4019,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (m_ds.m_dotPos == DP_SCOPE || m_ds.m_dotPos == DP_FIRST) { // Already under dot, so this is {modulepart} DOT {modulepart} - UINFO(9, indent() << "deferring until after a V3Param pass: " << nodep << endl); + UINFO(9, indent() << "deferring until after a V3Param pass: " << nodep); m_ds.m_dotText += "__BRA__??__KET__"; m_ds.m_unresolvedCell = true; // And pass up m_ds.m_dotText @@ -4072,7 +4059,7 @@ class LinkDotResolveVisitor final : public VNVisitor { AstNode* const basefromp = AstArraySel::baseFromp(nodep, false); if (VN_IS(basefromp, Replicate)) { // From {...}[...] syntax in IEEE 2017 - if (basefromp) UINFO(9, indent() << " Related node: " << basefromp << endl); + if (basefromp) UINFO(9, indent() << " Related node: " << basefromp); } else { nodep->attrp(new AstAttrOf{nodep->fileline(), VAttrType::VAR_BASE, basefromp->cloneTree(false)}); @@ -4085,22 +4072,22 @@ class LinkDotResolveVisitor final : public VNVisitor { } void visit(AstNodeBlock* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); { VL_RESTORER(m_curSymp); VL_RESTORER(m_ds); if (nodep->name() != "") { m_ds.m_dotSymp = m_curSymp = m_statep->getNodeSym(nodep); - UINFO(5, indent() << "cur=se" << cvtToHex(m_curSymp) << endl); + UINFO(5, indent() << "cur=se" << cvtToHex(m_curSymp)); } iterateChildren(nodep); } - UINFO(5, indent() << "cur=se" << cvtToHex(m_curSymp) << endl); + UINFO(5, indent() << "cur=se" << cvtToHex(m_curSymp)); } void visit(AstNodeFTask* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); if (nodep->isExternDef()) { if (const VSymEnt* const foundp @@ -4148,7 +4135,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (!m_explicitSuperNewp && m_statep->forParamed()) { AstNodeStmt* const superNewp = addImplicitSuperNewCall(VN_AS(nodep, Func), classExtendsp); - UINFO(9, "created super new " << superNewp << endl); + UINFO(9, "created super new " << superNewp); iterate(superNewp); } } @@ -4158,13 +4145,13 @@ class LinkDotResolveVisitor final : public VNVisitor { } void visit(AstNodeForeach* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); symIterateChildren(nodep, m_statep->getNodeSym(nodep)); } void visit(AstWith* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); VL_RESTORER(m_curSymp); VL_RESTORER(m_inWith); @@ -4177,7 +4164,7 @@ class LinkDotResolveVisitor final : public VNVisitor { } void visit(AstLambdaArgRef* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); // No checknodot(nodep), visit(AstScope) will check for LambdaArgRef iterateChildren(nodep); } @@ -4274,7 +4261,7 @@ class LinkDotResolveVisitor final : public VNVisitor { void visit(AstClass* nodep) override { if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); checkNoDot(nodep); AstClass* const topclassp = VN_CAST(m_modp, Class); if (nodep->isInterfaceClass() && topclassp && topclassp->isInterfaceClass()) { @@ -4361,8 +4348,8 @@ class LinkDotResolveVisitor final : public VNVisitor { if (AstEnumItem* const aitemp = VN_CAST(itemp, EnumItem)) { AstEnumItemRef* const newp = new AstEnumItemRef{ aitemp->fileline(), aitemp, it->second->classOrPackagep()}; - UINFO(8, indent() << "Class import noderef '" << it->first << "' " << newp - << endl); + UINFO(8, indent() + << "Class import noderef '" << it->first << "' " << newp); nodep->addMembersp(newp); memberMap.insert(nodep, newp); } @@ -4375,7 +4362,7 @@ class LinkDotResolveVisitor final : public VNVisitor { // Resolve its reference if (nodep->user3SetOnce()) return; LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); if (AstNode* const cpackagep = nodep->classOrPackageOpp()) { if (AstClassOrPackageRef* const cpackagerefp = VN_CAST(cpackagep, ClassOrPackageRef)) { iterate(cpackagerefp); @@ -4458,7 +4445,7 @@ class LinkDotResolveVisitor final : public VNVisitor { return; } else { if (foundp) { - UINFO(1, "Found sym node: " << foundp->nodep() << endl); + UINFO(1, "Found sym node: " << foundp->nodep()); nodep->v3error("Expecting a data type: " << nodep->prettyNameQ()); } else { nodep->v3error("Can't find typedef/interface: " << nodep->prettyNameQ()); @@ -4506,17 +4493,17 @@ class LinkDotResolveVisitor final : public VNVisitor { } void visit(AstCellRef* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); iterateChildren(nodep); } void visit(AstCellArrayRef* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); // Expression already iterated } void visit(AstUnlinkedRef* nodep) override { LINKDOT_VISIT_START(); - UINFO(5, indent() << "visit " << nodep << endl); + UINFO(5, indent() << "visit " << nodep); // No need to iterate, if we have a UnlinkedVarXRef, we're already done } void visit(AstStmtExpr* nodep) override { @@ -4565,7 +4552,7 @@ public: // CONSTRUCTORS LinkDotResolveVisitor(AstNetlist* rootp, LinkDotState* statep) : m_statep{statep} { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); iterate(rootp); std::map modulesToRevisit = std::move(m_modulesToRevisit); m_lastDeferredp = nullptr; @@ -4624,25 +4611,25 @@ void V3LinkDot::linkDotGuts(AstNetlist* rootp, VLinkDotStep step) { } void V3LinkDot::linkDotPrimary(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); linkDotGuts(nodep, LDS_PRIMARY); V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeEitherLevel() >= 6); } void V3LinkDot::linkDotParamed(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); linkDotGuts(nodep, LDS_PARAMED); V3Global::dumpCheckGlobalTree("linkdotparam", 0, dumpTreeEitherLevel() >= 3); } void V3LinkDot::linkDotArrayed(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); linkDotGuts(nodep, LDS_ARRAYED); V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeEitherLevel() >= 6); } void V3LinkDot::linkDotScope(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); linkDotGuts(nodep, LDS_SCOPED); V3Global::dumpCheckGlobalTree("linkdot", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index a72ff6e1c..c49a6cf47 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -201,7 +201,7 @@ class LinkIncVisitor final : public VNVisitor { void unsupported_visit(AstNode* nodep) { VL_RESTORER(m_unsupportedHere); m_unsupportedHere = true; - UINFO(9, "Marking unsupported " << nodep << endl); + UINFO(9, "Marking unsupported " << nodep); iterateChildren(nodep); } void visit(AstLogAnd* nodep) override { unsupported_visit(nodep); } @@ -367,7 +367,7 @@ public: // Task class functions void V3LinkInc::linkIncrements(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { LinkIncVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("linkinc", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkJump.cpp b/src/V3LinkJump.cpp index 3f32a2b2c..a97d11f58 100644 --- a/src/V3LinkJump.cpp +++ b/src/V3LinkJump.cpp @@ -64,7 +64,7 @@ class LinkJumpVisitor final : public VNVisitor { // METHODS AstJumpLabel* findAddLabel(AstNode* nodep, bool endOfIter) { // Put label under given node, and if WHILE optionally at end of iteration - UINFO(4, "Create label for " << nodep << endl); + UINFO(4, "Create label for " << nodep); if (VN_IS(nodep, JumpLabel)) return VN_AS(nodep, JumpLabel); // Done // Made it previously? We always jump to the end, so this works out @@ -113,7 +113,7 @@ class LinkJumpVisitor final : public VNVisitor { // see t_func_return test. while (underp && VN_IS(underp, Var)) underp = underp->nextp(); UASSERT_OBJ(underp, nodep, "Break/disable/continue not under expected statement"); - UINFO(5, " Underpoint is " << underp << endl); + UINFO(5, " Underpoint is " << underp); if (VN_IS(underp, JumpLabel)) { return VN_AS(underp, JumpLabel); @@ -175,7 +175,7 @@ class LinkJumpVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstNodeBlock* nodep) override { - UINFO(8, " " << nodep << endl); + UINFO(8, " " << nodep); VL_RESTORER(m_inFork); VL_RESTORER(m_unrollFull); m_blockStack.push_back(nodep); @@ -336,11 +336,11 @@ class LinkJumpVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep), nodep); } void visit(AstDisable* nodep) override { - UINFO(8, " DISABLE " << nodep << endl); + UINFO(8, " DISABLE " << nodep); iterateChildren(nodep); AstNodeBlock* blockp = nullptr; for (AstNodeBlock* const stackp : vlstd::reverse_view(m_blockStack)) { - UINFO(9, " UNDERBLK " << stackp << endl); + UINFO(9, " UNDERBLK " << stackp); if (stackp->name() == nodep->name()) { blockp = stackp; break; @@ -381,7 +381,7 @@ public: // Task class functions void V3LinkJump::linkJump(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { LinkJumpVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("linkjump", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3LinkLValue.cpp b/src/V3LinkLValue.cpp index b119550f7..79a22193d 100644 --- a/src/V3LinkLValue.cpp +++ b/src/V3LinkLValue.cpp @@ -63,7 +63,7 @@ class LinkLValueVisitor final : public VNVisitor { } if (const AstClockingItem* const itemp = VN_CAST(nodep->varp()->backp(), ClockingItem)) { - UINFO(5, "ClkOut " << nodep << endl); + UINFO(5, "ClkOut " << nodep); if (itemp->outputp()) nodep->varp(itemp->outputp()->varp()); } if (m_setForcedByCode) { @@ -300,7 +300,7 @@ class LinkLValueVisitor final : public VNVisitor { if (nodep->varp() && nodep->access().isWriteOrRW()) { if (const AstClockingItem* const itemp = VN_CAST(nodep->varp()->backp(), ClockingItem)) { - UINFO(5, "ClkOut " << nodep << endl); + UINFO(5, "ClkOut " << nodep); if (itemp->outputp()) nodep->varp(itemp->outputp()->varp()); } } @@ -358,13 +358,13 @@ public: // Link class functions void V3LinkLValue::linkLValue(AstNetlist* nodep) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); { LinkLValueVisitor{nodep, VAccess::NOCHANGE}; } // Destruct before checking V3Global::dumpCheckGlobalTree("linklvalue", 0, dumpTreeEitherLevel() >= 6); } void V3LinkLValue::linkLValueSet(AstNode* nodep) { // Called by later link functions when it is known a node needs // to be converted to a lvalue. - UINFO(9, __FUNCTION__ << ": " << endl); + UINFO(9, __FUNCTION__ << ": "); { LinkLValueVisitor{nodep, VAccess::WRITE}; } } diff --git a/src/V3LinkLevel.cpp b/src/V3LinkLevel.cpp index fce12adaf..8f068d741 100644 --- a/src/V3LinkLevel.cpp +++ b/src/V3LinkLevel.cpp @@ -39,7 +39,7 @@ struct CmpLevel final { void V3LinkLevel::modSortByLevel() { // Sort modules by levels, root down to lowest children // Calculate levels again in case we added modules - UINFO(2, "modSortByLevel()\n"); + UINFO(2, "modSortByLevel()"); // level() was computed for us in V3LinkCells @@ -77,11 +77,11 @@ void V3LinkLevel::modSortByLevel() { // Reorder the netlist's modules to have modules in level sorted order stable_sort(mods.begin(), mods.end(), CmpLevel()); // Sort the vector - UINFO(9, "modSortByLevel() sorted\n"); // Comment required for gcc4.6.3 / bug666 + UINFO(9, "modSortByLevel() sorted"); // Comment required for gcc4.6.3 / bug666 for (AstNodeModule* nodep : mods) nodep->unlinkFrBack(); 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 + UINFO(9, "modSortByLevel() done"); // Comment required for gcc4.6.3 / bug666 V3Global::dumpCheckGlobalTree("cellsort", false, dumpTreeEitherLevel() >= 3); } @@ -156,11 +156,11 @@ void V3LinkLevel::timescaling(const ModVec& mods) { // Wrapping void V3LinkLevel::wrapTop(AstNetlist* rootp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // We do ONLY the top module AstNodeModule* const oldmodp = rootp->modulesp(); if (!oldmodp) { // Later V3LinkDot will warn - UINFO(1, "No module found to wrap\n"); + UINFO(1, "No module found to wrap"); return; } @@ -211,7 +211,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { if (AstVar* const oldvarp = VN_CAST(subnodep, Var)) { if (oldvarp->isIO()) { if (!ioNames.insert(oldvarp->name()).second) { - // UINFO(8, "Multitop dup I/O found: " << oldvarp << endl); + // UINFO(8, "Multitop dup I/O found: " << oldvarp); dupNames.insert(oldvarp->name()); } } else if (v3Global.opt.topIfacesSupported() && oldvarp->isIfaceRef()) { @@ -220,7 +220,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { const AstIfaceRefDType* const ifacerefp = VN_AS(subtypep, IfaceRefDType); if (!ifacerefp->cellp()) { if (!ioNames.insert(oldvarp->name()).second) { - // UINFO(8, "Multitop dup interface found: " << oldvarp << endl); + // UINFO(8, "Multitop dup interface found: " << oldvarp); dupNames.insert(oldvarp->name()); } } @@ -233,8 +233,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { = VN_AS(arrsubtypep, IfaceRefDType); if (!ifacerefp->cellp()) { if (!ioNames.insert(oldvarp->name()).second) { - // UINFO(8, "Multitop dup interface array found: " << oldvarp - // << endl); + // UINFO(8, "Multitop dup interface array found: " << oldvarp); dupNames.insert(oldvarp->name()); } } @@ -250,7 +249,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { oldmodp && oldmodp->level() <= 2; oldmodp = VN_AS(oldmodp->nextp(), NodeModule)) { if (VN_IS(oldmodp, Package)) continue; // Add instance - UINFO(5, "LOOP " << oldmodp << endl); + UINFO(5, "LOOP " << oldmodp); AstCell* const cellp = new AstCell{ newmodp->fileline(), newmodp->fileline(), @@ -265,7 +264,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { // Add pins for (AstNode* subnodep = oldmodp->stmtsp(); subnodep; subnodep = subnodep->nextp()) { if (AstVar* const oldvarp = VN_CAST(subnodep, Var)) { - UINFO(8, "VARWRAP " << oldvarp << endl); + UINFO(8, "VARWRAP " << oldvarp); if (oldvarp->isIO()) { string name = oldvarp->name(); if (dupNames.find(name) != dupNames.end()) { diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index 16050d065..cd0a309bb 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -134,9 +134,9 @@ class LinkParseVisitor final : public VNVisitor { FileLine* const nodeFlp = nodep->fileline(); FileLine* const childFlp = childp->fileline(); FileLine* const nextFlp = nextp->fileline(); - // UINFO(0, "checkInd " << nodeFlp->firstColumn() << " " << nodep << endl); - // UINFO(0, " child " << childFlp->firstColumn() << " " << childp << endl); - // UINFO(0, " next " << nextFlp->firstColumn() << " " << nextp << endl); + // UINFO(0, "checkInd " << nodeFlp->firstColumn() << " " << nodep); + // UINFO(0, " child " << childFlp->firstColumn() << " " << childp); + // UINFO(0, " next " << nextFlp->firstColumn() << " " << nextp); // Same filename, later line numbers (no macro magic going on) if (nodeFlp->filenameno() != childFlp->filenameno()) return; if (nodeFlp->filenameno() != nextFlp->filenameno()) return; @@ -231,7 +231,7 @@ class LinkParseVisitor final : public VNVisitor { void visit(AstNodeFTaskRef* nodep) override { if (!nodep->user1SetOnce()) { // Process only once. cleanFileline(nodep); - UINFO(5, " " << nodep << endl); + UINFO(5, " " << nodep); VL_RESTORER(m_valueModp); m_valueModp = nullptr; iterateChildren(nodep); @@ -498,7 +498,7 @@ class LinkParseVisitor final : public VNVisitor { void visit(AstDefImplicitDType* nodep) override { cleanFileline(nodep); - UINFO(8, " DEFIMPLICIT " << nodep << endl); + UINFO(8, " DEFIMPLICIT " << nodep); // Must remember what names we've already created, and combine duplicates // so that for "var enum {...} a,b" a & b will share a common typedef. // Change to unique name space per module so that an addition of @@ -507,7 +507,7 @@ class LinkParseVisitor final : public VNVisitor { const ImplTypedefMap::iterator it = m_implTypedef.find(nodep->name()); if (it != m_implTypedef.end()) { defp = it->second; - UINFO(9, "Reused impltypedef " << nodep << " --> " << defp << endl); + UINFO(9, "Reused impltypedef " << nodep << " --> " << defp); } else { // Definition must be inserted right after the variable (etc) that needed it // AstVar, AstTypedef, AstNodeFTask are common containers @@ -532,7 +532,7 @@ class LinkParseVisitor final : public VNVisitor { // Rename so that name doesn't change if a type is added/removed elsewhere // But the m_implTypedef is stil by old name so we can find it for next new lookups defp->name("__typeimpmod" + cvtToStr(m_implTypedef.size())); - UINFO(9, "New impltypedef " << defp << endl); + UINFO(9, "New impltypedef " << defp); backp->addNextHere(defp); } } @@ -549,7 +549,7 @@ class LinkParseVisitor final : public VNVisitor { void visit(AstNodeForeach* nodep) override { // FOREACH(array, loopvars, body) - UINFO(9, "FOREACH " << nodep << endl); + UINFO(9, "FOREACH " << nodep); cleanFileline(nodep); // Separate iteration vars from base from variable // Input: @@ -928,7 +928,7 @@ public: // Link class functions void V3LinkParse::linkParse(AstNetlist* rootp) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); { LinkParseVisitor{rootp}; } // Destruct before checking V3Global::dumpCheckGlobalTree("linkparse", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index d1c96f131..85eb490f9 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -61,7 +61,7 @@ class LinkResolveVisitor final : public VNVisitor { // TODO: could move to V3LinkParse to get them out of the way of elaboration void visit(AstNodeModule* nodep) override { // Module: Create sim table for entire module and iterate - UINFO(8, "MODULE " << nodep << endl); + UINFO(8, "MODULE " << nodep); if (nodep->dead()) return; VL_RESTORER(m_modp); VL_RESTORER(m_senitemCvtNum); @@ -179,7 +179,7 @@ class LinkResolveVisitor final : public VNVisitor { void visit(AstNodeFTaskRef* nodep) override { iterateChildren(nodep); if (AstLet* letp = VN_CAST(nodep->taskp(), Let)) { - UINFO(7, "letSubstitute() " << nodep << " <- " << letp << endl); + UINFO(7, "letSubstitute() " << nodep << " <- " << letp); if (letp->user2()) { nodep->v3error("Recursive let substitution " << letp->prettyNameQ()); nodep->replaceWith(new AstConst{nodep->fileline(), AstConst::BitFalse{}}); @@ -208,7 +208,7 @@ class LinkResolveVisitor final : public VNVisitor { const auto it = portToExprs.find(refp->varp()); if (it != portToExprs.end()) { AstNodeExpr* const pinp = it->second; - UINFO(9, "let pin subst " << refp << " <- " << pinp << endl); + UINFO(9, "let pin subst " << refp << " <- " << pinp); // Side effects are copied into pins, to match other simulators refp->replaceWith(pinp->cloneTree(false)); VL_DO_DANGLING(pushDeletep(refp), refp); @@ -445,7 +445,7 @@ class LinkResolveVisitor final : public VNVisitor { } void visit(AstUdpTable* nodep) override { - UINFO(5, "UDPTABLE " << nodep << endl); + UINFO(5, "UDPTABLE " << nodep); if (!v3Global.opt.bboxUnsup()) { // We don't warn until V3Inst, so that UDPs that are in libraries and // never used won't result in any warnings. @@ -559,7 +559,7 @@ public: // Link class functions void V3LinkResolve::linkResolve(AstNetlist* rootp) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); { const LinkResolveVisitor visitor{rootp}; LinkBotupVisitor{rootp}; diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index 43f890110..f61dd2303 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -93,7 +93,7 @@ class LocalizeVisitor final : public VNVisitor { // cannot cope with. This should be rare (introduced by V3Depth). if (funcps.size() > 1 && existsNonLeaf(funcps)) continue; - UINFO(4, "Localizing " << nodep << endl); + UINFO(4, "Localizing " << nodep); ++m_statLocVars; // Yank the VarScope from it's parent and schedule them for deletion. Leave the Var @@ -138,7 +138,7 @@ class LocalizeVisitor final : public VNVisitor { } void visit(AstCFunc* nodep) override { - UINFO(4, " CFUNC " << nodep << endl); + UINFO(4, " CFUNC " << nodep); VL_RESTORER(m_cfuncp); VL_RESTORER(m_nodeDepth); m_cfuncp = nodep; @@ -179,7 +179,7 @@ class LocalizeVisitor final : public VNVisitor { && !nodep->varp()->sensIfacep() // Not sensitive to an interface && !nodep->varp()->valuep() // Does not have an initializer ) { - UINFO(4, "Consider for localization: " << nodep << endl); + UINFO(4, "Consider for localization: " << nodep); m_varScopeps.push_back(nodep); } // No iterate; Don't want varrefs under it (e.g.: in child dtype?) @@ -202,7 +202,7 @@ class LocalizeVisitor final : public VNVisitor { if (nodep->access().isReadOrRW() && !varScopep->user2()) { // Variable is read, but is not known to have been assigned in this function. Mark // as not optimizable. - UINFO(4, "Not optimizable (not written): " << nodep << endl); + UINFO(4, "Not optimizable (not written): " << nodep); varScopep->user1(1); } } @@ -227,7 +227,7 @@ public: // Localize class functions void V3Localize::localizeAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { LocalizeVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("localize", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3MergeCond.cpp b/src/V3MergeCond.cpp index 376daa47b..52aa77532 100644 --- a/src/V3MergeCond.cpp +++ b/src/V3MergeCond.cpp @@ -645,7 +645,7 @@ class MergeCondVisitor final : public VNVisitor { AstNodeIf* recursivep = nullptr; // Merge if list is longer than one node if (m_mgFirstp != m_mgLastp) { - UINFO(6, "MergeCond - First: " << m_mgFirstp << " Last: " << m_mgLastp << endl); + UINFO(6, "MergeCond - First: " << m_mgFirstp << " Last: " << m_mgLastp); ++m_statMerges; if (m_listLenght > m_statLongestList) m_statLongestList = m_listLenght; @@ -886,7 +886,7 @@ public: // MergeConditionals class functions void V3MergeCond::mergeAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { MergeCondVisitor{nodep}; } V3Global::dumpCheckGlobalTree("merge_cond", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Name.cpp b/src/V3Name.cpp index bce4a577c..4402804e2 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -168,7 +168,7 @@ public: // Name class functions void V3Name::nameAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { NameVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("name", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Number.cpp b/src/V3Number.cpp index 612c0ccf6..b73ea73e9 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -1977,7 +1977,7 @@ V3Number& V3Number::opDiv(const V3Number& lhs, const V3Number& rhs) { // i op j, max(L(lhs),L(rhs)) bit return, if any 4-state, 4-state return NUM_ASSERT_OP_ARGS2(lhs, rhs); NUM_ASSERT_LOGIC_ARGS2(lhs, rhs); - // UINFO(9, "opdiv "<>divs-start "<>divs-start " << lhs << " " << rhs); NUM_ASSERT_OP_ARGS2(lhs, rhs); NUM_ASSERT_LOGIC_ARGS2(lhs, rhs); if (lhs.isFourState() || rhs.isFourState()) return setAllBitsX(); @@ -2001,13 +2001,13 @@ V3Number& V3Number::opDivS(const V3Number& lhs, const V3Number& rhs) { V3Number rhsNoSign = rhs; if (rhs.isNegative()) rhsNoSign.opNegate(rhs); const V3Number qNoSign = opDiv(lhsNoSign, rhsNoSign); - // UINFO(9, " >divs-mid "<divs-mid " << lhs << " " << rhs << " " << qNoSign); if ((lhs.isNegative() && !rhs.isNegative()) || (!lhs.isNegative() && rhs.isNegative())) { opNegate(qNoSign); } else { opAssign(qNoSign); } - UINFO(9, " ifp{V3File::new_ifstream(filename)}; if (ifp->fail()) { diff --git a/src/V3OrderParallel.cpp b/src/V3OrderParallel.cpp index 57ab4c3c5..4111d244b 100644 --- a/src/V3OrderParallel.cpp +++ b/src/V3OrderParallel.cpp @@ -553,7 +553,7 @@ public: static void dumpCpFilePrefixed(const V3Graph& graph, const string& nameComment) { const string filename = v3Global.debugFilename(nameComment) + ".txt"; - UINFO(1, "Writing " << filename << endl); + UINFO(1, "Writing " << filename); const std::unique_ptr ofp{V3File::new_ofstream(filename)}; std::ostream* const osp = &(*ofp); // &* needed to deref unique_ptr if (osp->fail()) v3fatalStatic("Can't write file: " << filename); @@ -1231,8 +1231,8 @@ public: v3Global.rootp()->fileline()->v3warn( UNOPTTHREADS, "Thread scheduler is unable to provide requested " "parallelism; suggest asking for fewer threads."); - UINFO(1, "Critical path limit was=" << oldLimit << " now=" << m_scoreLimit - << endl); + UINFO(1, + "Critical path limit was=" << oldLimit << " now=" << m_scoreLimit); continue; } // Really stop @@ -1297,7 +1297,7 @@ public: // increases from low numbers up toward cpLimit. It may be // helpful to see progress during slow partitions. Maybe // display something by default even? - UINFO(6, "New scoreLimitBeforeRescore: " << m_scoreLimitBeforeRescore << endl); + UINFO(6, "New scoreLimitBeforeRescore: " << m_scoreLimitBeforeRescore); } // Finally merge this candidate. @@ -1440,7 +1440,7 @@ private: << recipientNewCpFwd.propagateCp << "\n" << "donorNewCpFwd = " << donorNewCpFwd.cp << (donorNewCpFwd.propagate ? " true " : " false ") - << donorNewCpFwd.propagateCp << endl); + << donorNewCpFwd.propagateCp); recipientp->setCritPathCost(GraphWay::FORWARD, recipientNewCpFwd.cp); if (recipientNewCpFwd.propagate) { @@ -1503,7 +1503,7 @@ private: // behave identically without the caching (just slower) m_sb.rescore(); - UINFO(6, "Did rescore. Merges since previous = " << m_mergesSinceRescore << endl); + UINFO(6, "Did rescore. Merges since previous = " << m_mergesSinceRescore); m_mergesSinceRescore = 0; m_scoreLimitBeforeRescore = 0xffffffff; @@ -1714,7 +1714,7 @@ class DpiImportCallVisitor final : public VNVisitor { // we have a normal DPI which induces DPI hazard by default. m_hasDpiHazard = V3Config::getProfileData(nodep->cname()) == 0; UINFO(9, "DPI wrapper '" << nodep->cname() - << "' has dpi hazard = " << m_hasDpiHazard << endl); + << "' has dpi hazard = " << m_hasDpiHazard); } } iterateChildren(nodep); @@ -2055,7 +2055,7 @@ static void debugMTaskGraphStats(V3Graph& graph, const string& stage) { if (!debug() && !dumpLevel() && !dumpGraphLevel()) return; UINFO(4, "\n"); - UINFO(4, " Stats for " << stage << endl); + UINFO(4, " Stats for " << stage); uint32_t mtaskCount = 0; uint32_t totalCost = 0; std::array mtaskCostHist; @@ -2070,14 +2070,14 @@ static void debugMTaskGraphStats(V3Graph& graph, const string& stage) { UASSERT(log2Cost < 32, "log2Cost overflow in debugMTaskGraphStats"); ++mtaskCostHist[log2Cost]; } - UINFO(4, " Total mtask cost = " << totalCost << "\n"); - UINFO(4, " Mtask count = " << mtaskCount << "\n"); - UINFO(4, " Avg cost / mtask = " - << ((mtaskCount > 0) ? cvtToStr(totalCost / mtaskCount) : "INF!") << "\n"); - UINFO(4, " Histogram of mtask costs:\n"); + UINFO(4, " Total mtask cost = " << totalCost); + UINFO(4, " Mtask count = " << mtaskCount); + UINFO(4, " Avg cost / mtask = " << ((mtaskCount > 0) ? cvtToStr(totalCost / mtaskCount) + : "INF!")); + UINFO(4, " Histogram of mtask costs:"); for (unsigned i = 0; i < 32; ++i) { if (mtaskCostHist[i]) { - UINFO(4, " 2^" << i << ": " << mtaskCostHist[i] << endl); + UINFO(4, " 2^" << i << ": " << mtaskCostHist[i]); V3Stats::addStat("MTask graph, " + stage + ", mtask cost 2^" + (i < 10 ? " " : "") + cvtToStr(i), mtaskCostHist[i]); @@ -2102,12 +2102,12 @@ static void debugMTaskGraphStats(V3Graph& graph, const string& stage) { V3Stats::addStat("MTask graph, " + stage + ", parallelism factor", report.parallelismFactor()); if (debug() >= 4) { UINFO(0, "\n"); - UINFO(0, " MTask Parallelism estimate based costs at stage" << stage << ":\n"); - UINFO(0, " Critical path cost = " << report.criticalPathCost() << "\n"); - UINFO(0, " Total graph cost = " << report.totalGraphCost() << "\n"); - UINFO(0, " MTask vertex count = " << report.vertexCount() << "\n"); - UINFO(0, " Edge count = " << report.edgeCount() << "\n"); - UINFO(0, " Parallelism factor = " << report.parallelismFactor() << "\n"); + UINFO(0, " MTask Parallelism estimate based costs at stage" << stage << ":"); + UINFO(0, " Critical path cost = " << report.criticalPathCost()); + UINFO(0, " Total graph cost = " << report.totalGraphCost()); + UINFO(0, " MTask vertex count = " << report.vertexCount()); + UINFO(0, " Edge count = " << report.edgeCount()); + UINFO(0, " Parallelism factor = " << report.parallelismFactor()); } } @@ -2127,7 +2127,7 @@ static void hashGraphDebug(const V3Graph& graph, const char* debugName) { hash = vx2Id[edge.top()] + 31U * hash; // The K&R hash function } } - UINFO(0, "Hash of shape (not contents) of " << debugName << " = " << cvtToStr(hash) << endl); + UINFO(0, "Hash of shape (not contents) of " << debugName << " = " << cvtToStr(hash)); } //************************************************************************* @@ -2330,7 +2330,7 @@ class Partitioner final { const unsigned fudgeDenominator = 5; const uint32_t cpLimit = ((totalGraphCost * fudgeNumerator) / (targetParFactor * fudgeDenominator)); - UINFO(4, "Partitioner set cpLimit = " << cpLimit << endl); + UINFO(4, "Partitioner set cpLimit = " << cpLimit); Contraction::apply(*m_mTaskGraphp, cpLimit, m_entryMTaskp, m_exitMTaskp, // --debugPartition is used by tests @@ -2481,7 +2481,7 @@ AstExecGraph* V3Order::createParallel(OrderGraph& orderGraph, const std::string& const bool newEntry = logicMTaskToExecMTask.emplace(mTaskp, execMTaskp).second; UASSERT_OBJ(newEntry, mTaskp, "LogicMTasks should be processed in dependencyorder"); UINFO(3, "Final '" << tag << "' LogicMTask " << mTaskp->id() << " maps to ExecMTask" - << execMTaskp->id() << std::endl); + << execMTaskp->id()); // Add the dependency edges between ExecMTasks for (const V3GraphEdge& edge : mTaskp->inEdges()) { @@ -2505,7 +2505,7 @@ AstExecGraph* V3Order::createParallel(OrderGraph& orderGraph, const std::string& } void V3Order::selfTestParallel() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); PropagateCp::selfTest(); PropagateCp::selfTest(); Contraction::selfTest(); diff --git a/src/V3OrderProcessDomains.cpp b/src/V3OrderProcessDomains.cpp index 4307bd45e..190447d2f 100644 --- a/src/V3OrderProcessDomains.cpp +++ b/src/V3OrderProcessDomains.cpp @@ -85,13 +85,13 @@ class V3OrderProcessDomains final { // else, if all inputs are from flops, it's end-of-sequential code // else, it's full combo code void processDomains() { - UINFO(2, " Domains...\n"); + UINFO(2, " Domains..."); // Buffer to hold external sensitivities std::vector externalDomainps; // For each vertex for (V3GraphVertex& it : m_graph.vertices()) { OrderEitherVertex* const vtxp = it.as(); - UINFO(5, " pdi: " << vtxp << endl); + UINFO(5, " pdi: " << vtxp); // Sequential logic already has its domain set if (vtxp->domainp()) continue; @@ -99,7 +99,7 @@ class V3OrderProcessDomains final { // For logic, start with the explicit hybrid sensitivities OrderLogicVertex* const lvtxp = vtxp->cast(); if (lvtxp) domainp = lvtxp->hybridp(); - if (domainp) UINFO(6, " hybr d=" << debugDomain(domainp) << " " << vtxp << endl); + if (domainp) UINFO(6, " hybr d=" << debugDomain(domainp) << " " << vtxp); // For each incoming edge, examine the source vertex for (V3GraphEdge& edge : vtxp->inEdges()) { @@ -111,7 +111,7 @@ class V3OrderProcessDomains final { AstSenTree* fromDomainp = fromVtxp->domainp(); - UINFO(6, " from d=" << debugDomain(fromDomainp) << " " << fromVtxp << endl); + UINFO(6, " from d=" << debugDomain(fromDomainp) << " " << fromVtxp); UASSERT(fromDomainp == m_deleteDomainp || !fromDomainp->hasCombo(), "There should be no need for combinational domains"); @@ -122,7 +122,7 @@ class V3OrderProcessDomains final { m_externalDomains(vscp, externalDomainps); for (AstSenTree* const externalDomainp : externalDomainps) { UINFO(6, " xtrn d=" << debugDomain(externalDomainp) << " " << fromVtxp - << " because of " << vscp << endl); + << " because of " << vscp); UASSERT_OBJ(!externalDomainp->hasCombo(), vscp, "There should be no need for combinational domains"); fromDomainp = combineDomains(fromDomainp, externalDomainp); @@ -150,7 +150,7 @@ class V3OrderProcessDomains final { // Set the domain of the vertex vtxp->domainp(domainp); - UINFO(5, " done d=" << debugDomain(domainp) << " " << vtxp << endl); + UINFO(5, " done d=" << debugDomain(domainp) << " " << vtxp); } } diff --git a/src/V3OrderSerial.cpp b/src/V3OrderSerial.cpp index a23280d8a..23b3a7cc4 100644 --- a/src/V3OrderSerial.cpp +++ b/src/V3OrderSerial.cpp @@ -34,7 +34,7 @@ VL_DEFINE_DEBUG_FUNCTIONS; std::vector V3Order::createSerial(OrderGraph& graph, const std::string& tag, const TrigToSenMap& trigToSen, bool slow) { - UINFO(2, " Constructing serial code for '" + tag + "'\n"); + UINFO(2, " Constructing serial code for '" + tag + "'"); // Build the move graph OrderMoveDomScope::clear(); diff --git a/src/V3Os.cpp b/src/V3Os.cpp index 43a55739c..5b6eea6f7 100644 --- a/src/V3Os.cpp +++ b/src/V3Os.cpp @@ -92,9 +92,9 @@ string V3Os::getenvStr(const string& envvar, const string& defaultValue) { void V3Os::setenvStr(const string& envvar, const string& value, const string& why) { if (why != "") { - UINFO(1, "export " << envvar << "='" << value << "' # " << why << endl); + UINFO(1, "export " << envvar << "='" << value << "' # " << why); } else { - UINFO(1, "export " << envvar << "='" << value << "'" << endl); + UINFO(1, "export " << envvar << "='" << value << "'"); } #if defined(_WIN32) || defined(__MINGW32__) _putenv_s(envvar.c_str(), value.c_str()); @@ -263,8 +263,8 @@ string V3Os::filenameRelativePath(const string& filename, const string& base) VL auto aIt = a.begin(); auto bIt = b.begin(); while (aIt != a.end() && bIt != b.end()) { - // UINFO(9, "fnrp scan " << (aIt - a.begin()) << " " << a.substr(aIt - a.begin()) << endl); - // UINFO(9, "fnrp scan " << (bIt - b.begin()) << " " << b.substr(bIt - b.begin()) << endl); + // UINFO(9, "fnrp scan " << (aIt - a.begin()) << " " << a.substr(aIt - a.begin())); + // UINFO(9, "fnrp scan " << (bIt - b.begin()) << " " << b.substr(bIt - b.begin())); auto aWordIt = aIt; // position of next slash for (; aWordIt != a.end(); ++aWordIt) { if (isSlash(*aWordIt)) break; @@ -370,7 +370,7 @@ void V3Os::filesystemFlushBuildDir(const string& dirname) { // Linux kernel may not reread from NFS unless timestamp modified const int err = utimes(dirname.c_str(), nullptr); // Not an error - if (err != 0) UINFO(1, "-Info: File not utimed: " << dirname << endl); + if (err != 0) UINFO(1, "-Info: File not utimed: " << dirname); #endif filesystemFlush(dirname); } @@ -472,7 +472,7 @@ void V3Os::u_sleep(int64_t usec) { // METHODS (sub command) int V3Os::system(const string& command) { - UINFO(1, "Running system: " << command << endl); + UINFO(1, "Running system: " << command); const int ret = ::system(command.c_str()); if (VL_UNCOVERABLE(ret == -1)) { v3fatal("Failed to execute command:" // LCOV_EXCL_LINE @@ -481,7 +481,7 @@ int V3Os::system(const string& command) { } else { UASSERT(WIFEXITED(ret), "system(" << command << ") returned unexpected value of " << ret); const int exit_code = WEXITSTATUS(ret); - UINFO(1, command << " returned exit code of " << exit_code << std::endl); + UINFO(1, command << " returned exit code of " << exit_code); UASSERT(exit_code >= 0, "exit code must not be negative"); return exit_code; } diff --git a/src/V3Param.cpp b/src/V3Param.cpp index b0a12f8dd..b2da22bde 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -158,19 +158,18 @@ public: UASSERT_OBJ(paramIt != paramsIt->second.end(), modvarp, "must be registered"); AstConst* const defValuep = VN_CAST(paramIt->second->valuep(), Const); if (defValuep && areSame(constp, defValuep)) { - UINFO(5, "Setting default value of " << constp << " to " << modvarp - << std::endl); + UINFO(5, "Setting default value of " << constp << " to " << modvarp); continue; // Skip this parameter because setting the same value } const auto pIt = vlstd::as_const(params).find(modvarp->name()); - UINFO(5, "Comparing " << modvarp->name() << " " << constp << std::endl); + UINFO(5, "Comparing " << modvarp->name() << " " << constp); if (pIt == params.end() || paramIdx >= params.size() || !areSame(constp, pIt->second.get())) { found = false; break; } UINFO(5, "Matched " << modvarp->name() << " " << constp << " and " - << pIt->second.get() << std::endl); + << pIt->second.get()); ++paramIdx; } } @@ -398,7 +397,7 @@ class ParamProcessor final { } newname = pair.first->second; } - UINFO(4, "Name: " << srcModp->name() << "->" << longname << "->" << newname << endl); + UINFO(4, "Name: " << srcModp->name() << "->" << longname << "->" << newname); return newname; } AstNodeDType* arraySubDTypep(AstNodeDType* nodep) { @@ -439,7 +438,7 @@ class ParamProcessor final { for (AstPin* pinp = startpinp; pinp; pinp = VN_AS(pinp->nextp(), Pin)) { if (pinp->modVarp()) { // Find it in the clone structure - // UINFO(8,"Clone find 0x"<modVarp()<modVarp()); const auto cloneiter = clonemapp->find(pinp->modVarp()); UASSERT_OBJ(cloneiter != clonemapp->end(), pinp, "Couldn't find pin in clone list"); @@ -558,7 +557,7 @@ class ParamProcessor final { longname += type.str(); } } - UINFO(9, " module params longname: " << longname << endl); + UINFO(9, " module params longname: " << longname); const auto iter = m_longMap.find(longname); if (iter != m_longMap.end()) return iter->second; // Already calculated @@ -645,7 +644,7 @@ class ParamProcessor final { m_modNameMap.emplace(newModp->name(), ModInfo{newModp}); const auto iter = m_modNameMap.find(newname); CloneMap* const clonemapp = &(iter->second.m_cloneMap); - UINFO(4, " De-parameterize to new: " << newModp << endl); + UINFO(4, " De-parameterize to new: " << newModp); // Grab all I/O so we can remap our pins later // Note we allow multiple users of a parameterized model, @@ -658,12 +657,12 @@ class ParamProcessor final { const AstIfaceRefDType* const portIrefp = it->first; const AstIfaceRefDType* const pinIrefp = it->second; AstIfaceRefDType* const cloneIrefp = portIrefp->clonep(); - UINFO(8, " IfaceOld " << portIrefp << endl); - UINFO(8, " IfaceTo " << pinIrefp << endl); + UINFO(8, " IfaceOld " << portIrefp); + UINFO(8, " IfaceTo " << pinIrefp); UASSERT_OBJ(cloneIrefp, portIrefp, "parameter clone didn't hit AstIfaceRefDType"); - UINFO(8, " IfaceClo " << cloneIrefp << endl); + UINFO(8, " IfaceClo " << cloneIrefp); cloneIrefp->ifacep(pinIrefp->ifaceViaCellp()); - UINFO(8, " IfaceNew " << cloneIrefp << endl); + UINFO(8, " IfaceNew " << cloneIrefp); } // Assign parameters to the constants specified // DOES clone() so must be finished with module clonep() before here @@ -678,7 +677,7 @@ class ParamProcessor final { // Remove any existing parameter if (modvarp->valuep()) modvarp->valuep()->unlinkFrBack()->deleteTree(); // Set this parameter to value requested by cell - UINFO(9, " set param " << modvarp << " = " << newp << endl); + UINFO(9, " set param " << modvarp << " = " << newp); modvarp->valuep(newp->cloneTree(false)); modvarp->overriddenParam(overridden); } else if (AstParamTypeDType* const modptp = pinp->modPTypep()) { @@ -698,7 +697,7 @@ class ParamProcessor final { // Already made this flavor? auto it = m_modNameMap.find(newname); if (it != m_modNameMap.end()) { - UINFO(4, " De-parameterize to prev: " << it->second.m_modp << endl); + UINFO(4, " De-parameterize to prev: " << it->second.m_modp); } else { deepCloneModule(srcModp, ifErrorp, paramsp, newname, ifaceRefRefs); it = m_modNameMap.find(newname); @@ -777,7 +776,7 @@ class ParamProcessor final { pinp->v3error("Parameter type variable isn't a type: Param " << modvarp->prettyNameQ()); } else { - UINFO(9, "Parameter type assignment expr=" << exprp << " to " << origp << endl); + UINFO(9, "Parameter type assignment expr=" << exprp << " to " << origp); V3Const::constifyParamsEdit(pinp->exprp()); // Reconcile typedefs // Constify may have caused pinp->exprp to change rawTypep = VN_AS(pinp->exprp(), NodeDType); @@ -848,7 +847,7 @@ class ParamProcessor final { IfaceRefDType); } - UINFO(9, " portIfaceRef " << portIrefp << endl); + UINFO(9, " portIfaceRef " << portIrefp); if (!portIrefp) { pinp->v3error("Interface port " << modvarp->prettyNameQ() @@ -858,9 +857,9 @@ class ParamProcessor final { << modvarp->prettyNameQ() << " is not connected to interface/modport pin expression"); } else { - UINFO(9, " pinIfaceRef " << pinIrefp << endl); + UINFO(9, " pinIfaceRef " << pinIrefp); if (portIrefp->ifaceViaCellp() != pinIrefp->ifaceViaCellp()) { - UINFO(9, " IfaceRefDType needs reconnect " << pinIrefp << endl); + UINFO(9, " IfaceRefDType needs reconnect " << pinIrefp); longnamer += ("_" + paramSmallName(srcModp, pinp->modVarp()) + paramValueNumber(pinIrefp)); any_overridesr = true; @@ -922,7 +921,7 @@ class ParamProcessor final { srcModpr = paramedModp; any_overrides = true; } else if (!any_overrides) { - UINFO(8, "Cell parameters all match original values, skipping expansion.\n"); + UINFO(8, "Cell parameters all match original values, skipping expansion."); // If it's the first use of the default instance, create a copy and store it in user3p. // user3p will also be used to check if the default instance is used. if (!srcModpr->user3p() && (VN_IS(srcModpr, Class) || VN_IS(srcModpr, Iface))) { @@ -940,7 +939,7 @@ class ParamProcessor final { = moduleFindOrClone(srcModpr, nodep, paramsp, newname, ifaceRefRefs); // We need to relink the pins to the new module relinkPinsByName(pinsp, modInfop->m_modp); - UINFO(8, " Done with " << modInfop->m_modp << endl); + UINFO(8, " Done with " << modInfop->m_modp); srcModpr = modInfop->m_modp; } @@ -1001,7 +1000,7 @@ public: // Cell: Check for parameters in the instantiation. // We always run this, even if no parameters, as need to look for interfaces, // and remove any recursive references - UINFO(4, "De-parameterize: " << nodep << endl); + UINFO(4, "De-parameterize: " << nodep); // Create new module name with _'s between the constants if (debug() >= 10) nodep->dumpTree("- cell: "); // Evaluate all module constants @@ -1025,7 +1024,7 @@ public: // Set name for later warnings (if srcModpr changed value due to cloning) srcModpr->someInstanceName(instanceName); - UINFO(8, " Done with orig " << nodep << endl); + UINFO(8, " Done with orig " << nodep); // if (debug() >= 10) // v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("param-out.tree")); } @@ -1192,7 +1191,7 @@ class ParamVisitor final : public VNVisitor { } if (m_iterateModule) { // Iterating from visitCells - UINFO(4, " MOD-under-MOD. " << nodep << endl); + UINFO(4, " MOD-under-MOD. " << nodep); m_workQueue.emplace(nodep->level(), nodep); // Delay until current module is done // visitCells (which we are returning to) will process nodep from m_workQueue later return; @@ -1249,11 +1248,11 @@ class ParamVisitor final : public VNVisitor { for (; candp; candp = candp->nextp()) { if (nodep->name() == candp->name()) { if (AstVar* const varp = VN_CAST(candp, Var)) { - UINFO(9, "Found interface parameter: " << varp << endl); + UINFO(9, "Found interface parameter: " << varp); nodep->varp(varp); return true; } else if (const AstPin* const pinp = VN_CAST(candp, Pin)) { - UINFO(9, "Found interface parameter: " << pinp << endl); + UINFO(9, "Found interface parameter: " << pinp); UASSERT_OBJ(pinp->exprp(), pinp, "Interface parameter pin missing expression"); VL_DO_DANGLING(nodep->replaceWith(pinp->exprp()->cloneTree(false)), nodep); return true; @@ -1269,7 +1268,7 @@ class ParamVisitor final : public VNVisitor { const AstNode* backp = nodep; while ((backp = backp->backp())) { if (VN_IS(backp, NodeModule)) { - UINFO(9, "Hit module boundary, done looking for interface" << endl); + UINFO(9, "Hit module boundary, done looking for interface"); break; } if (const AstVar* const varp = VN_CAST(backp, Var)) { @@ -1292,7 +1291,7 @@ class ParamVisitor final : public VNVisitor { // Interfaces passed in on the port map have ifaces if (const AstIface* const ifacep = ifacerefp->ifacep()) { if (dotted == backp->name()) { - UINFO(9, "Iface matching scope: " << ifacep << endl); + UINFO(9, "Iface matching scope: " << ifacep); if (ifaceParamReplace(nodep, ifacep->stmtsp())) { // return; } @@ -1301,7 +1300,7 @@ class ParamVisitor final : public VNVisitor { // Interfaces declared in this module have cells else if (const AstCell* const cellp = ifacerefp->cellp()) { if (dotted == cellp->name()) { - UINFO(9, "Iface matching scope: " << cellp << endl); + UINFO(9, "Iface matching scope: " << cellp); if (ifaceParamReplace(nodep, cellp->paramsp())) { // return; } @@ -1376,7 +1375,7 @@ class ParamVisitor final : public VNVisitor { // Generate Statements void visit(AstGenIf* nodep) override { - UINFO(9, " GENIF " << nodep << endl); + UINFO(9, " GENIF " << nodep); iterateAndNextNull(nodep->condp()); // We suppress errors when widthing params since short-circuiting in // the conditional evaluation may mean these error can never occur. We @@ -1407,8 +1406,8 @@ class ParamVisitor final : public VNVisitor { if (AstGenFor* const forp = VN_AS(nodep->genforp(), GenFor)) { // We should have a GENFOR under here. We will be replacing the begin, // so process here rather than at the generate to avoid iteration problems - UINFO(9, " BEGIN " << nodep << endl); - UINFO(9, " GENFOR " << forp << endl); + UINFO(9, " BEGIN " << nodep); + UINFO(9, " GENFOR " << forp); // Visit child nodes before unrolling iterateAndNextNull(forp->initsp()); iterateAndNextNull(forp->condp()); @@ -1441,7 +1440,7 @@ class ParamVisitor final : public VNVisitor { nodep->v3fatalSrc("GENFOR should have been wrapped in BEGIN"); } void visit(AstGenCase* nodep) override { - UINFO(9, " GENCASE " << nodep << endl); + UINFO(9, " GENCASE " << nodep); bool hit = false; AstNode* keepp = nullptr; iterateAndNextNull(nodep->exprp()); @@ -1556,7 +1555,7 @@ public: // Param class functions void V3Param::param(AstNetlist* rootp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ParamVisitor{rootp}; } // Destruct before checking V3Global::dumpCheckGlobalTree("param", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3ParseGrammar.cpp b/src/V3ParseGrammar.cpp index 6d435e8ef..42d54bc0a 100644 --- a/src/V3ParseGrammar.cpp +++ b/src/V3ParseGrammar.cpp @@ -191,8 +191,8 @@ AstNodeDType* V3ParseGrammar::createArray(AstNodeDType* basep, AstNodeRange* nra AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name, AstNodeRange* arrayp, AstNode* attrsp) { AstNodeDType* dtypep = GRAMMARP->m_varDTypep; - UINFO(5, " creVar " << name << " decl=" << GRAMMARP->m_varDecl << " io=" - << GRAMMARP->m_varIO << " dt=" << (dtypep ? "set" : "") << endl); + UINFO(5, " creVar " << name << " decl=" << GRAMMARP->m_varDecl + << " io=" << GRAMMARP->m_varIO << " dt=" << (dtypep ? "set" : "")); if (GRAMMARP->m_varIO == VDirection::NONE // In non-ANSI port list && GRAMMARP->m_varDecl == VVarType::PORT) { // Just a port list with variable name (not v2k format); AstPort already created diff --git a/src/V3ParseImp.cpp b/src/V3ParseImp.cpp index 5775b3e52..3c2f7bc93 100644 --- a/src/V3ParseImp.cpp +++ b/src/V3ParseImp.cpp @@ -75,7 +75,7 @@ void V3ParseImp::importIfInStd(FileLine* fileline, const string& id) { if (fileline->filename() == V3Options::getStdPackagePath()) return; if (AstPackage* const stdpkgp = v3Global.rootp()->stdPackagep()) { // else e.g. --no-std-package - UINFO(9, "import and keep std:: for " << fileline << "\n"); + UINFO(9, "import and keep std:: for " << fileline); AstPackageImport* const impp = new AstPackageImport{stdpkgp->fileline(), stdpkgp, "*"}; unitPackage(stdpkgp->fileline())->addStmtsp(impp); v3Global.setUsesStdPackage(); @@ -126,7 +126,7 @@ AstPragma* V3ParseImp::createTimescale(FileLine* fl, bool unitSet, double unitVa bool bad; unit = VTimescale{unitVal, bad /*ref*/}; if (bad) { - UINFO(1, "Value = " << unitVal << endl); + UINFO(1, "Value = " << unitVal); fl->v3error("timeunit illegal value"); } } @@ -135,7 +135,7 @@ AstPragma* V3ParseImp::createTimescale(FileLine* fl, bool unitSet, double unitVa bool bad; prec = VTimescale{precVal, bad /*ref*/}; if (bad) { - UINFO(1, "Value = " << precVal << endl); + UINFO(1, "Value = " << precVal); fl->v3error("timeprecision illegal value"); } } @@ -298,7 +298,7 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i const string nondirname = V3Os::filenameNonDir(modfilename); const string modname = V3Os::filenameNonDirExt(modfilename); - UINFO(2, __FUNCTION__ << ": " << modname << (inLibrary ? " [LIB]" : "") << endl); + UINFO(2, __FUNCTION__ << ": " << modname << (inLibrary ? " [LIB]" : "")); m_lexFileline = new FileLine{fileline}; m_lexFileline->newContent(); m_bisonLastFileline = m_lexFileline; @@ -366,7 +366,7 @@ void V3ParseImp::dumpInputsFile() { } if (!append) { append = true; - UINFO(1, "Writing all preprocessed output to " << vppfilename << endl); + UINFO(1, "Writing all preprocessed output to " << vppfilename); *ofp << "// Dump of all post-preprocessor input\n"; *ofp << "// Blank lines and `line directives have been removed\n"; *ofp << "//\n"; @@ -380,7 +380,7 @@ void V3ParseImp::dumpInputsFile() { void V3ParseImp::lexFile(const string& modname) { // Prepare for lexing - UINFO(3, "Lexing " << modname << endl); + UINFO(3, "Lexing " << modname); s_parsep = this; lexFileline()->warnResetDefault(); // Reenable warnings on each file lexDestroy(); // Restart from clean slate. @@ -434,7 +434,7 @@ size_t V3ParseImp::tokenPipeScanIdType(size_t depthIn) { // and caller must check does NOT match tokenPipeScanIdCell size_t depth = depthIn; // UINFO(9, "tokenPipeScanType START d=" - // << depth << " " << V3ParseImp::tokenName(tokenPeekp(depth)->token) << endl); + // << depth << " " << V3ParseImp::tokenName(tokenPeekp(depth)->token)); if (tokenPeekp(depth)->token == '#' && tokenPeekp(depth + 1)->token == '(') { depth = tokenPipeScanParam(depth, false); // Not :: as then it's a yaID__CC, we'll parse that in tokenPipeScanId @@ -446,7 +446,7 @@ size_t V3ParseImp::tokenPipeScanIdType(size_t depthIn) { if (tokenPeekp(depth)->token != yaID__LEX && tokenPeekp(depth)->token != yP_TICKBRA) return depthIn; ++depth; - // UINFO(9, "tokenPipeScanType MATCH\n"); + // UINFO(9, "tokenPipeScanType MATCH"); return depth; } @@ -546,7 +546,7 @@ size_t V3ParseImp::tokenPipeScanTypeEq(size_t depth) { int V3ParseImp::tokenPipelineId(int token) { const V3ParseBisonYYSType* nexttokp = tokenPeekp(0); // First char after yaID const int nexttok = nexttokp->token; - UINFO(9, "tokenPipelineId tok=" << yylval.token << endl); + UINFO(9, "tokenPipelineId tok=" << yylval.token); UASSERT(yylval.token == yaID__LEX, "Start with ID"); if (nexttok == yP_COLONCOLON) return yaID__CC; VL_RESTORER(yylval); // Remember value, as about to read ahead diff --git a/src/V3PreExpr.h b/src/V3PreExpr.h index b89746c15..d7621780c 100644 --- a/src/V3PreExpr.h +++ b/src/V3PreExpr.h @@ -136,7 +136,7 @@ class V3PreExpr final { static void selfTestOne(const string& expr, bool expect) { // This hacky self-test parser just looks at first character of // operator, and requires space separation of operators/values - UINFO(9, "V3PreExpr selfTestOne " << expr << endl); + UINFO(9, "V3PreExpr selfTestOne " << expr); FileLine* const flp = nullptr; V3PreExpr parser; parser.reset(flp); @@ -166,11 +166,11 @@ class V3PreExpr final { // METHODS void pushOp(const V3PreExprToken& token) { - // UINFO(9, " pushOp " << token.ascii() << endl); + // UINFO(9, " pushOp " << token.ascii()); m_ops.push_back(token); } void pushValue(const V3PreExprToken& token) { - // UINFO(9, " pushValue " << token.ascii() << endl); + // UINFO(9, " pushValue " << token.ascii()); m_values.push_back(token); } V3PreExprToken popValue() { @@ -180,13 +180,13 @@ class V3PreExpr final { } const V3PreExprToken tok = m_values.back(); m_values.pop_back(); - // UINFO(9, " popValue " << tok.ascii() << endl; + // UINFO(9, " popValue " << tok.ascii()); return tok; } void reduce() { UASSERT(!m_ops.empty(), "lost op stack beginning END"); V3PreExprToken tok = m_ops.back(); - // UINFO(9, "Reduce " << tok.ascii() << endl); + // UINFO(9, "Reduce " << tok.ascii()); m_ops.pop_back(); switch (tok.token()) { case V3PreExprToken::KET: { @@ -241,7 +241,7 @@ class V3PreExpr final { while (!m_inputs.empty()) { V3PreExprToken tok = m_inputs.front(); m_inputs.pop_front(); - UINFO(9, "input read " << tok.ascii() << endl); + UINFO(9, "input read " << tok.ascii()); if (tok.isValue()) { pushValue(tok); continue; @@ -251,7 +251,7 @@ class V3PreExpr final { V3PreExprToken topTok = m_ops.back(); auto action = parseTable[topTok.token()][tok.token()]; UINFO(9, "pop action " << actionAscii(action) << " from parseTable[" << topTok.ascii() - << "][" << tok.ascii() << "]\n"); + << "][" << tok.ascii() << "]"); switch (action) { case RR: // Reduce reduce(); @@ -279,7 +279,7 @@ public: } void pushInput(const V3PreExprToken& token) { if (!m_firstFileline) m_firstFileline = token.fileline(); - UINFO(9, "pushInput " << token.ascii() << endl); + UINFO(9, "pushInput " << token.ascii()); m_inputs.push_back(token); } bool result() { diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 9e10f7821..0cb788bc4 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -345,7 +345,7 @@ FileLine* V3PreProcImp::defFileline(const string& name) { } void V3PreProcImp::define(FileLine* fl, const string& name, const string& value, const string& params, bool cmdline) { - UINFO(4, "DEFINE '" << name << "' as '" << value << "' params '" << params << "'" << endl); + UINFO(4, "DEFINE '" << name << "' as '" << value << "' params '" << params << "'"); if (!V3LanguageWords::isKeyword("`"s + name).empty()) { fl->v3error("Attempting to define built-in directive: '`" << name << "' (IEEE 1800-2023 22.5.1)"); @@ -619,13 +619,13 @@ string V3PreProcImp::defineSubst(VDefineRef* refp) { // Note we parse the definition parameters and value here. If a // parameterized define is used many, many times, we could cache the // parsed result. - UINFO(4, "defineSubstIn `" << refp->name() << " " << refp->params() << endl); + UINFO(4, "defineSubstIn `" << refp->name() << " " << refp->params()); for (unsigned i = 0; i < refp->args().size(); i++) { - UINFO(4, "defineArg[" << i << "] = '" << refp->args()[i] << "'" << endl); + UINFO(4, "defineArg[" << i << "] = '" << refp->args()[i] << "'"); } // Grab value const string value = defValue(refp->name()); - UINFO(4, "defineValue '" << V3PreLex::cleanDbgStrg(value) << "'" << endl); + UINFO(4, "defineValue '" << V3PreLex::cleanDbgStrg(value) << "'"); std::map argValueByName; { // Parse argument list into map @@ -640,8 +640,8 @@ string V3PreProcImp::defineSubst(VDefineRef* refp) { const char* cp = params.c_str(); if (*cp == '(') cp++; for (; *cp; cp++) { - // UINFO(4," Parse Paren="<args().size() > numArgs) { @@ -714,7 +714,7 @@ string V3PreProcImp::defineSubst(VDefineRef* refp) { bool backslashesc = false; // In \.....{space} block // Note we go through the loop once more at the nullptr end-of-string for (const char* cp = value.c_str(); (*cp) || argName != ""; cp = (*cp ? cp + 1 : cp)) { - // UINFO(4, "CH "<<*cp<<" an "<(m_states.size()) << ") dr" << m_defRefs.size() << ": <" << m_lexp->currentStartState() - << ">" << tokenName(tok) << ": " << buf << endl); + << ">" << tokenName(tok) << ": " << buf); if (s_debugFileline >= 9) { std::cout << m_lexp->m_tokFilelinep->warnContextSecondary() << endl; } @@ -1078,13 +1078,13 @@ int V3PreProcImp::getStateToken() { string name(yyourtext() + 1, yyourleng() - 1); if (defExists(name)) { // JOIN(DEFREF) // Put back the `` and process the defref - UINFO(5, "```: define " << name << " exists, expand first\n"); + UINFO(5, "```: define " << name << " exists, expand first"); // After define, unputString("``"). Not now as would lose yyourtext() m_defPutJoin = true; - UINFO(5, "TOKEN now DEFREF\n"); + UINFO(5, "TOKEN now DEFREF"); tok = VP_DEFREF; } else { // DEFREF(JOIN) - UINFO(5, "```: define " << name << " doesn't exist, join first\n"); + UINFO(5, "```: define " << name << " doesn't exist, join first"); // FALLTHRU, handle as with VP_SYMBOL_JOIN } } @@ -1097,7 +1097,7 @@ int V3PreProcImp::getStateToken() { || tok == VP_DEFREF_JOIN || tok == VP_JOIN) { // a`` -> string doesn't include the ``, so can just grab next and continue string out(yyourtext(), yyourleng()); - UINFO(5, "`` LHS:" << out << endl); + UINFO(5, "`` LHS:" << out); // a``b``c can have multiple joins, so we need a stack m_joinStack.push(out); statePush(ps_JOIN); @@ -1118,7 +1118,7 @@ int V3PreProcImp::getStateToken() { m_lastSym.assign(yyourtext(), yyourleng()); if (state() == ps_DEFNAME_IFDEF || state() == ps_DEFNAME_IFNDEF) { bool enable = defExists(m_lastSym); - UINFO(4, "Ifdef " << m_lastSym << (enable ? " ON" : " OFF") << endl); + UINFO(4, "Ifdef " << m_lastSym << (enable ? " ON" : " OFF")); if (state() == ps_DEFNAME_IFNDEF) enable = !enable; m_ifdefStack.push(VPreIfEntry{enable, false}); if (!enable) parsingOff(); @@ -1134,7 +1134,7 @@ int V3PreProcImp::getStateToken() { if (!lastIf.on()) parsingOn(); // Handle `if portion const bool enable = !lastIf.everOn() && defExists(m_lastSym); - UINFO(4, "Elsif " << m_lastSym << (enable ? " ON" : " OFF") << endl); + UINFO(4, "Elsif " << m_lastSym << (enable ? " ON" : " OFF")); m_ifdefStack.push(VPreIfEntry{enable, lastIf.everOn()}); if (!enable) parsingOff(); } @@ -1142,7 +1142,7 @@ int V3PreProcImp::getStateToken() { goto next_tok; } else if (state() == ps_DEFNAME_UNDEF) { if (!m_off) { - UINFO(4, "Undef " << m_lastSym << endl); + UINFO(4, "Undef " << m_lastSym); undef(m_lastSym); } statePop(); @@ -1161,7 +1161,7 @@ int V3PreProcImp::getStateToken() { if (yyourleng() == 1 && yyourtext()[0] == '(' && (state() == ps_DEFNAME_IFDEF || state() == ps_DEFNAME_IFNDEF || state() == ps_DEFNAME_ELSIF)) { - UINFO(4, "ifdef() start (\n"); + UINFO(4, "ifdef() start ("); m_lexp->pushStateExpr(); m_exprParser.reset(fileline()); m_exprParenLevel = 1; @@ -1222,7 +1222,7 @@ int V3PreProcImp::getStateToken() { } else { // Done with parsing expression bool enable = m_exprParser.result(); - UINFO(4, "ifdef() result=" << enable << endl); + UINFO(4, "ifdef() result=" << enable); if (state() == ps_EXPR_IFDEF || state() == ps_EXPR_IFNDEF) { if (state() == ps_EXPR_IFNDEF) enable = !enable; m_ifdefStack.push(VPreIfEntry{enable, false}); @@ -1239,7 +1239,7 @@ int V3PreProcImp::getStateToken() { if (!lastIf.on()) parsingOn(); // Handle `if portion enable = !lastIf.everOn() && enable; - UINFO(4, "Elsif " << m_lastSym << (enable ? " ON" : " OFF") << endl); + UINFO(4, "Elsif " << m_lastSym << (enable ? " ON" : " OFF")); m_ifdefStack.push(VPreIfEntry{enable, lastIf.everOn()}); if (!enable) parsingOff(); } @@ -1322,7 +1322,7 @@ int V3PreProcImp::getStateToken() { value = trimWhitespace(value, true); // Define it UINFO(4, "Define " << m_lastSym << " " << formals << " = '" - << V3PreLex::cleanDbgStrg(value) << "'" << endl); + << V3PreLex::cleanDbgStrg(value) << "'"); define(fileline(), m_lastSym, value, formals, false); } } else { @@ -1353,7 +1353,7 @@ int V3PreProcImp::getStateToken() { VDefineRef* refp = &(m_defRefs.top()); refp->nextarg(refp->nextarg() + m_lexp->m_defValue); m_lexp->m_defValue = ""; - UINFO(4, "defarg++ " << refp->nextarg() << endl); + UINFO(4, "defarg++ " << refp->nextarg()); if (tok == VP_DEFARG && yyourleng() == 1 && yyourtext()[0] == ',') { refp->args().push_back(refp->nextarg()); stateChange(ps_DEFARG); @@ -1378,7 +1378,7 @@ int V3PreProcImp::getStateToken() { const string lhs = m_joinStack.top(); m_joinStack.pop(); out.insert(0, lhs); - UINFO(5, "``-end-defarg Out:" << out << endl); + UINFO(5, "``-end-defarg Out:" << out); statePop(); } if (!m_off) { @@ -1427,7 +1427,7 @@ int V3PreProcImp::getStateToken() { if (tok == VP_STRING) { statePop(); m_lastSym.assign(yyourtext(), yyourleng()); - UINFO(4, "Include " << m_lastSym << endl); + UINFO(4, "Include " << m_lastSym); // Drop leading and trailing quotes. m_lastSym.erase(0, 1); m_lastSym.erase(m_lastSym.length() - 1, 1); @@ -1466,11 +1466,11 @@ int V3PreProcImp::getStateToken() { UASSERT(!m_joinStack.empty(), "`` join stack empty, but in a ``"); const string lhs = m_joinStack.top(); m_joinStack.pop(); - UINFO(5, "`` LHS:" << lhs << endl); + UINFO(5, "`` LHS:" << lhs); string rhs(yyourtext(), yyourleng()); - UINFO(5, "`` RHS:" << rhs << endl); + UINFO(5, "`` RHS:" << rhs); const string out = lhs + rhs; - UINFO(5, "`` Out:" << out << endl); + UINFO(5, "`` Out:" << out); unputString(out); statePop(); goto next_tok; @@ -1542,14 +1542,14 @@ int V3PreProcImp::getStateToken() { const VPreIfEntry lastIf = m_ifdefStack.top(); m_ifdefStack.pop(); const bool enable = !lastIf.everOn(); - UINFO(4, "Else " << (enable ? " ON" : " OFF") << endl); + UINFO(4, "Else " << (enable ? " ON" : " OFF")); m_ifdefStack.push(VPreIfEntry{enable, lastIf.everOn()}); if (!lastIf.on()) parsingOn(); if (!enable) parsingOff(); } goto next_tok; case VP_ENDIF: - UINFO(4, "Endif " << endl); + UINFO(4, "Endif "); if (m_ifdefStack.empty()) { fileline()->v3error("`endif with no matching `if"); } else { @@ -1565,7 +1565,7 @@ int V3PreProcImp::getStateToken() { // m_off not right here, but inside substitution, to make this work: // `ifdef NEVER `DEFUN(`endif) string name(yyourtext() + 1, yyourleng() - 1); - UINFO(4, "DefRef " << name << endl); + UINFO(4, "DefRef " << name); if (m_defPutJoin) { m_defPutJoin = false; unputString("``"); @@ -1577,7 +1577,7 @@ int V3PreProcImp::getStateToken() { // Substitute if (!defExists(name)) { // Not found, return original string as-is m_defDepth = 0; - UINFO(4, "Defref `" << name << " => not_defined" << endl); + UINFO(4, "Defref `" << name << " => not_defined"); if (m_off) { goto next_tok; } else { @@ -1603,7 +1603,7 @@ int V3PreProcImp::getStateToken() { const string lhs = m_joinStack.top(); m_joinStack.pop(); out.insert(0, lhs); - UINFO(5, "``-end-defref Out:" << out << endl); + UINFO(5, "``-end-defref Out:" << out); statePop(); } if (!m_off) { @@ -1624,7 +1624,7 @@ int V3PreProcImp::getStateToken() { } goto next_tok; } else { // Found, with parameters - UINFO(4, "Defref `" << name << " => parameterized" << endl); + UINFO(4, "Defref `" << name << " => parameterized"); // The CURRENT macro needs the paren saved, it's not a // property of the child macro if (!m_defRefs.empty()) m_defRefs.top().parenLevel(m_lexp->m_parenLevel); @@ -1646,7 +1646,7 @@ int V3PreProcImp::getStateToken() { return tok; case VP_UNDEFINEALL: if (!m_off) { - UINFO(4, "Undefineall " << endl); + UINFO(4, "Undefineall "); undefineall(); } goto next_tok; @@ -1691,7 +1691,7 @@ int V3PreProcImp::getFinalToken(string& buf) { if (false && debug() >= 5) { const string bufcln = V3PreLex::cleanDbgStrg(buf); const string flcol = m_lexp->m_tokFilelinep->asciiLineCol(); - UINFO(0, flcol << ": FIN: " << tokenName(tok) << ": " << bufcln << endl); + UINFO(0, flcol << ": FIN: " << tokenName(tok) << ": " << bufcln); } // Track `line const char* bufp = buf.c_str(); @@ -1706,8 +1706,7 @@ int V3PreProcImp::getFinalToken(string& buf) { if (debug() >= 5) { const string flcol = m_lexp->m_tokFilelinep->asciiLineCol(); UINFO(0, flcol << ": FIN: readjust, fin at " << m_finFilelinep->lastLineno() - << " request at " << m_lexp->m_tokFilelinep->lastLineno() - << endl); + << " request at " << m_lexp->m_tokFilelinep->lastLineno()); } m_finFilelinep->filename(m_lexp->m_tokFilelinep->filename()); m_finFilelinep->lineno(m_lexp->m_tokFilelinep->lastLineno()); @@ -1751,7 +1750,7 @@ string V3PreProcImp::getline() { if (debug() >= 5) { const string bufcln = V3PreLex::cleanDbgStrg(buf); const string flcol = m_lexp->m_tokFilelinep->asciiLineCol(); - UINFO(0, flcol << ": GETFETC: " << tokenName(tok) << ": " << bufcln << endl); + UINFO(0, flcol << ": GETFETC: " << tokenName(tok) << ": " << bufcln); } if (tok == VP_EOF) { // Add a final newline, if the user forgot the final \n. @@ -1771,7 +1770,7 @@ string V3PreProcImp::getline() { if (debug() >= 4) { const string lncln = V3PreLex::cleanDbgStrg(theLine); const string flcol = m_lexp->m_tokFilelinep->asciiLineCol(); - UINFO(0, flcol << ": GETLINE: " << lncln << endl); + UINFO(0, flcol << ": GETLINE: " << lncln); } return theLine; } diff --git a/src/V3PreShell.cpp b/src/V3PreShell.cpp index c93c74371..e8c41a8e9 100644 --- a/src/V3PreShell.cpp +++ b/src/V3PreShell.cpp @@ -87,7 +87,7 @@ protected: bool preproc(FileLine* fl, const string& modname, VInFilter* filterp, V3ParseImp* parsep, const string& errmsg) { // "" for no error // Preprocess the given module, putting output in vppFilename - UINFO(1, "Preprocessing " << modname << endl); + UINFO(1, "Preprocessing " << modname); // Preprocess s_filterp = filterp; @@ -140,7 +140,7 @@ private: } if (filename == "") return ""; // Not found - UINFO(2, " Reading " << filename << endl); + UINFO(2, " Reading " << filename); s_preprocp->openFile(fl, filterp, filename); return filename; } diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 168ea0d86..a9d7f9581 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -67,7 +67,7 @@ class PremitVisitor final : public VNVisitor { AstVar* createWideTemp(AstNodeExpr* nodep) { UASSERT_OBJ(m_stmtp, nodep, "Attempting to create temporary with no insertion point"); - UINFO(4, "createWideTemp: " << nodep << endl); + UINFO(4, "createWideTemp: " << nodep); VNRelinker relinker; nodep->unlinkFrBack(&relinker); @@ -118,7 +118,7 @@ class PremitVisitor final : public VNVisitor { void visitShift(AstNodeBiop* nodep) { // Shifts of > 32/64 bits in C++ will wrap-around and generate non-0s - UINFO(4, " ShiftFix " << nodep << endl); + UINFO(4, " ShiftFix " << nodep); const AstConst* const shiftp = VN_CAST(nodep->rhsp(), Const); if (shiftp && shiftp->num().mostSetBitP1() > 32) { shiftp->v3error( @@ -181,7 +181,7 @@ class PremitVisitor final : public VNVisitor { m_inWhileCondp = nullptr void visit(AstWhile* nodep) override { - UINFO(4, " WHILE " << nodep << endl); + UINFO(4, " WHILE " << nodep); // cppcheck-suppress shadowVariable // Also restored below START_STATEMENT_OR_RETURN(nodep); iterateAndNextNull(nodep->precondsp()); @@ -241,7 +241,7 @@ class PremitVisitor final : public VNVisitor { && nodep->filep()->sameGateTree(VN_AS(searchp, Display)->filep())) { // There's another display next; we can just wait to flush } else { - UINFO(4, "Autoflush " << nodep << endl); + UINFO(4, "Autoflush " << nodep); nodep->addNextHere( new AstFFlush{nodep->fileline(), nodep->filep() ? nodep->filep()->cloneTreePure(true) : nullptr}); @@ -367,7 +367,7 @@ public: // Premit class functions void V3Premit::premitAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { PremitVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("premit", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3ProtectLib.cpp b/src/V3ProtectLib.cpp index 9b09a7a5f..aec3c1bd4 100644 --- a/src/V3ProtectLib.cpp +++ b/src/V3ProtectLib.cpp @@ -541,6 +541,6 @@ public: // ProtectLib class functions void V3ProtectLib::protect() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); ProtectVisitor{v3Global.rootp()}; } diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index c1e5c756d..1f9f0edbd 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -189,7 +189,7 @@ class RandomizeMarkVisitor final : public VNVisitor { } void setPackageRefs() { for (AstNodeVarRef* staticRefp : m_staticRefs) { - UINFO(9, "Updated classOrPackage ref for " << staticRefp->name() << endl); + UINFO(9, "Updated classOrPackage ref for " << staticRefp->name()); staticRefp->classOrPackagep(VN_AS(staticRefp->varp()->user2p(), NodeModule)); } } @@ -1457,7 +1457,7 @@ class RandomizeVisitor final : public VNVisitor { } AstVar* enumValueTabp(AstEnumDType* const nodep) { if (nodep->user2p()) return VN_AS(nodep->user2p(), Var); - UINFO(9, "Construct Venumvaltab " << nodep << endl); + UINFO(9, "Construct Venumvaltab " << nodep); AstNodeArrayDType* const vardtypep = new AstUnpackArrayDType{ nodep->fileline(), nodep->dtypep(), new AstRange{nodep->fileline(), static_cast(nodep->itemCount()), 0}}; @@ -1521,7 +1521,7 @@ class RandomizeVisitor final : public VNVisitor { = new AstVar{varp->fileline(), VVarType::MEMBER, varp->name() + "__Vrandc", newdtp}; newp->isInternal(true); varp->addNextHere(newp); - UINFO(9, "created " << varp << endl); + UINFO(9, "created " << varp); return newp; } AstNodeStmt* createArrayForeachLoop(FileLine* const fl, AstNodeDType* const dtypep, @@ -1997,7 +1997,7 @@ class RandomizeVisitor final : public VNVisitor { iterateChildren(nodep); if (!nodep->user1()) return; // Doesn't need randomize, or already processed - UINFO(9, "Define randomize() for " << nodep << endl); + UINFO(9, "Define randomize() for " << nodep); nodep->baseMostClassp()->needRNG(true); AstFunc* const randomizep = V3Randomize::newRandomizeFunc(m_memberMap, nodep); AstVar* const fvarp = VN_AS(randomizep->fvarp(), Var); @@ -2367,7 +2367,7 @@ public: // Randomize method class functions void V3Randomize::randomizeNetlist(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { const RandomizeMarkVisitor markVisitor{nodep}; RandomizeVisitor randomizeVisitor{nodep}; diff --git a/src/V3Reloop.cpp b/src/V3Reloop.cpp index fc0f69f30..19133d323 100644 --- a/src/V3Reloop.cpp +++ b/src/V3Reloop.cpp @@ -74,11 +74,11 @@ class ReloopVisitor final : public VNVisitor { if (!m_mgAssignps.empty()) { const uint32_t items = m_mgIndexHi - m_mgIndexLo + 1; UINFO(9, "End merge iter=" << items << " " << m_mgIndexHi << ":" << m_mgIndexLo << " " - << m_mgOffset << " " << m_mgAssignps[0] << endl); + << m_mgOffset << " " << m_mgAssignps[0]); if (items >= static_cast(v3Global.opt.reloopLimit())) { UINFO(6, "Reloop merging items=" << items << " " << m_mgIndexHi << ":" << m_mgIndexLo << " " << m_mgOffset << " " - << m_mgAssignps[0] << endl); + << m_mgAssignps[0]); ++m_statReloops; m_statReItems += items; @@ -212,14 +212,14 @@ class ReloopVisitor final : public VNVisitor { m_mgIndexHi = lindex; } UINFO(9, "Continue merge i=" << lindex << " " << m_mgIndexHi << ":" << m_mgIndexLo - << " " << nodep << endl); + << " " << nodep); m_mgAssignps.push_back(nodep); m_mgNextp = nodep->nextp(); return; } else { - UINFO(9, "End merge i=" - << lindex << " " << m_mgIndexHi << ":" << m_mgIndexLo << " " << nodep - << endl); // This assign doesn't merge with previous assign, + UINFO(9, "End merge i=" << lindex << " " << m_mgIndexHi << ":" << m_mgIndexLo + << " " << nodep); + // This assign doesn't merge with previous assign, // but should start a new merge mergeEnd(); } @@ -237,7 +237,7 @@ class ReloopVisitor final : public VNVisitor { m_mgConstRp = rconstp; m_mgIndexLo = lindex; m_mgIndexHi = lindex; - UINFO(9, "Start merge i=" << lindex << " o=" << m_mgOffset << nodep << endl); + UINFO(9, "Start merge i=" << lindex << " o=" << m_mgOffset << nodep); } void visit(AstExprStmt* nodep) override { iterateChildren(nodep); } //-------------------- @@ -258,7 +258,7 @@ public: // Reloop class functions void V3Reloop::reloopAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ReloopVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("reloop", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3Sampled.cpp b/src/V3Sampled.cpp index 45fdbfafc..14b82acb0 100644 --- a/src/V3Sampled.cpp +++ b/src/V3Sampled.cpp @@ -57,7 +57,7 @@ class SampledVisitor final : public VNVisitor { m_scopep->addVarsp(newvscp); // At the top of _eval, assign them (use valuep here as temporary storage during V3Sched) newvarp->valuep(new AstVarRef{flp, vscp, VAccess::READ}); - UINFO(4, "New Sampled: " << newvscp << endl); + UINFO(4, "New Sampled: " << newvscp); return newvscp; } @@ -100,7 +100,7 @@ public: // Sampled class functions void V3Sampled::sampledAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { SampledVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("sampled", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Sched.cpp b/src/V3Sched.cpp index 8b2b12629..cfb810d4b 100644 --- a/src/V3Sched.cpp +++ b/src/V3Sched.cpp @@ -1379,7 +1379,7 @@ void schedule(AstNetlist* netlistp) { // Orders a region's logic and creates the region eval function const auto order = [&](const std::string& name, const std::vector& logic) -> EvalKit { - UINFO(2, "Scheduling " << name << " #logic = " << logic.size() << endl); + UINFO(2, "Scheduling " << name << " #logic = " << logic.size()); AstVarScope* const trigVscp = scopeTopp->createTempLike("__V" + name + "Triggered", actTrigVscp); const auto trigMap = cloneMapWithNewTriggerReferences(actTrigMap, trigVscp); diff --git a/src/V3SchedPartition.cpp b/src/V3SchedPartition.cpp index 447534f26..dc695adc8 100644 --- a/src/V3SchedPartition.cpp +++ b/src/V3SchedPartition.cpp @@ -331,7 +331,7 @@ void colorActiveRegion(V3Graph& graph) { LogicRegions partition(LogicByScope& clockedLogic, LogicByScope& combinationalLogic, LogicByScope& hybridLogic) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Build the graph const std::unique_ptr graphp diff --git a/src/V3SchedVirtIface.cpp b/src/V3SchedVirtIface.cpp index 6fa88ee37..3a7ba6b4c 100644 --- a/src/V3SchedVirtIface.cpp +++ b/src/V3SchedVirtIface.cpp @@ -222,7 +222,7 @@ public: } //namespace VirtIfaceTriggers makeVirtIfaceTriggers(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); if (v3Global.hasVirtIfaces()) { VirtIfaceVisitor visitor{nodep}; V3Global::dumpCheckGlobalTree("sched_vif", 0, dumpTreeEitherLevel() >= 6); diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index f295d478a..cc89adb07 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -97,7 +97,7 @@ class ScopeVisitor final : public VNVisitor { scopename = m_aboveScopep->name() + "." + m_aboveCellp->name(); } - UINFO(4, " MOD AT " << scopename << " " << nodep << endl); + UINFO(4, " MOD AT " << scopename << " " << nodep); AstNode::user1ClearTree(); m_scopep = new AstScope{ @@ -128,7 +128,7 @@ class ScopeVisitor final : public VNVisitor { } // Create scope for the current usage of this module - UINFO(4, " back AT " << scopename << " " << nodep << endl); + UINFO(4, " back AT " << scopename << " " << nodep); AstNode::user1ClearTree(); m_modp = nodep; if (m_modp->isTop()) { @@ -159,7 +159,7 @@ class ScopeVisitor final : public VNVisitor { scopename = m_aboveScopep->name() + "." + nodep->name(); } - UINFO(4, " CLASS AT " << scopename << " " << nodep << endl); + UINFO(4, " CLASS AT " << scopename << " " << nodep); AstNode::user1ClearTree(); const AstNode* const abovep @@ -184,7 +184,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstNodeProcedure* nodep) override { // Add to list of blocks under this scope - UINFO(4, " Move " << nodep << endl); + UINFO(4, " Move " << nodep); AstNode* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -192,7 +192,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstAssignAlias* nodep) override { // Add to list of blocks under this scope - UINFO(4, " Move " << nodep << endl); + UINFO(4, " Move " << nodep); AstNode* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -200,7 +200,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstAssignVarScope* nodep) override { // Copy under the scope but don't recurse - UINFO(4, " Move " << nodep << endl); + UINFO(4, " Move " << nodep); AstNode* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -208,7 +208,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstAssignW* nodep) override { // Add to list of blocks under this scope - UINFO(4, " Move " << nodep << endl); + UINFO(4, " Move " << nodep); AstNode* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -216,7 +216,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstAlwaysPublic* nodep) override { // Add to list of blocks under this scope - UINFO(4, " Move " << nodep << endl); + UINFO(4, " Move " << nodep); AstNode* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -224,7 +224,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstCoverToggle* nodep) override { // Add to list of blocks under this scope - UINFO(4, " Move " << nodep << endl); + UINFO(4, " Move " << nodep); AstNode* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -232,7 +232,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstCFunc* nodep) override { // Add to list of blocks under this scope - UINFO(4, " CFUNC " << nodep << endl); + UINFO(4, " CFUNC " << nodep); AstCFunc* const clonep = nodep->cloneTree(false); nodep->user2p(clonep); m_scopep->addBlocksp(clonep); @@ -242,7 +242,7 @@ class ScopeVisitor final : public VNVisitor { } void visit(AstNodeFTask* nodep) override { // Add to list of blocks under this scope - UINFO(4, " FTASK " << nodep << endl); + UINFO(4, " FTASK " << nodep); AstNodeFTask* clonep; if (nodep->classMethod()) { // Only one scope will be created, so avoid pointless cloning @@ -265,7 +265,7 @@ class ScopeVisitor final : public VNVisitor { if (ifacerefp->cellp()) scopep = VN_AS(ifacerefp->cellp()->user2p(), Scope); } AstVarScope* const varscp = new AstVarScope{nodep->fileline(), scopep, nodep}; - UINFO(6, " New scope " << varscp << endl); + UINFO(6, " New scope " << varscp); if (m_aboveCellp && !m_aboveCellp->isTrace()) varscp->trace(false); nodep->user1p(varscp); if (v3Global.opt.isClocker(varscp->prettyName())) { @@ -363,18 +363,18 @@ class ScopeCleanupVisitor final : public VNVisitor { } void visit(AstNodeFTaskRef* nodep) override { // The crossrefs are dealt with in V3LinkDot - UINFO(9, " Old pkg-taskref " << nodep << endl); + UINFO(9, " Old pkg-taskref " << nodep); if (nodep->classOrPackagep()) { // Point to the clone UASSERT_OBJ(nodep->taskp(), nodep, "Unlinked"); AstNodeFTask* const newp = VN_AS(nodep->taskp()->user2p(), NodeFTask); UASSERT_OBJ(newp, nodep, "No clone for package function"); nodep->taskp(newp); - UINFO(9, " New pkg-taskref " << nodep << endl); + UINFO(9, " New pkg-taskref " << nodep); } else if (!VN_IS(nodep, MethodCall)) { nodep->taskp(nullptr); VIsCached::clearCacheTree(); - UINFO(9, " New pkg-taskref " << nodep << endl); + UINFO(9, " New pkg-taskref " << nodep); } iterateChildren(nodep); } @@ -398,7 +398,7 @@ public: // Scope class functions void V3Scope::scopeAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { const ScopeVisitor visitor{nodep}; ScopeCleanupVisitor{nodep}; diff --git a/src/V3Simulate.h b/src/V3Simulate.h index c2a3f79ea..f62f7dc75 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -211,7 +211,7 @@ public: if (!m_whyNotNodep) { m_whyNotNodep = nodep; if (debug() >= 5) { // LCOV_EXCL_START - UINFO(0, "Clear optimizable: " << why); + UINFO_PREFIX("Clear optimizable: " << why); if (nodep) std::cout << ": " << nodep; std::cout << std::endl; } // LCOV_EXCL_STOP @@ -257,7 +257,7 @@ public: void newValue(AstNode* nodep, const AstNodeExpr* valuep) { if (const AstConst* const constp = VN_CAST(valuep, Const)) { newConst(nodep)->num().opAssign(constp->num()); - UINFO(9, " new val " << valuep->name() << " on " << nodep << endl); + UINFO(9, " new val " << valuep->name() << " on " << nodep); } else if (fetchValueNull(nodep) != valuep) { // const_cast, as clonep() is set on valuep, but nothing should care setValue(nodep, newTrackedClone(const_cast(valuep))); @@ -266,7 +266,7 @@ public: void newOutValue(AstNode* nodep, const AstNodeExpr* valuep) { if (const AstConst* const constp = VN_CAST(valuep, Const)) { newOutConst(nodep)->num().opAssign(constp->num()); - UINFO(9, " new oval " << valuep->name() << " on " << nodep << endl); + UINFO(9, " new oval " << valuep->name() << " on " << nodep); } else if (fetchOutValueNull(nodep) != valuep) { // const_cast, as clonep() is set on valuep, but nothing should care setOutValue(nodep, newTrackedClone(const_cast(valuep))); @@ -312,13 +312,13 @@ private: AstNodeExpr* fetchValue(AstNode* nodep) { AstNodeExpr* const valuep = fetchValueNull(nodep); UASSERT_OBJ(valuep, nodep, "No value found for node."); - // UINFO(9, " fetch val " << *valuep << " on " << nodep << endl); + // UINFO(9, " fetch val " << *valuep << " on " << nodep); return valuep; } AstConst* fetchConst(AstNode* nodep) { AstConst* const constp = fetchConstNull(nodep); UASSERT_OBJ(constp, nodep, "No value found for node."); - // UINFO(9, " fetch num " << *constp << " on " << nodep << endl); + // UINFO(9, " fetch num " << *constp << " on " << nodep); return constp; } AstConst* fetchOutConst(AstNode* nodep) { @@ -342,12 +342,12 @@ public: private: void setValue(AstNode* nodep, AstNodeExpr* valuep) { UASSERT_OBJ(valuep, nodep, "Simulate setting null value"); - UINFO(9, " set val " << valuep->name() << " on " << nodep << endl); + UINFO(9, " set val " << valuep->name() << " on " << nodep); m_varAux(nodep).valuep = valuep; } void setOutValue(AstNode* nodep, AstNodeExpr* valuep) { UASSERT_OBJ(valuep, nodep, "Simulate setting null value"); - UINFO(9, " set oval " << valuep->name() << " on " << nodep << endl); + UINFO(9, " set oval " << valuep->name() << " on " << nodep); m_varAux(nodep).outValuep = valuep; } @@ -357,7 +357,7 @@ private: m_dataCount += nodep->width(); } if (!ignorePredict && !nodep->isPredictOptimizable()) { - // UINFO(9, " !predictopt " << nodep << endl); + // UINFO(9, " !predictopt " << nodep); clearOptimizable(nodep, "Isn't predictable"); } if (!nodep->isPure()) m_isImpure = true; @@ -382,8 +382,7 @@ private: static std::set s_typePrinted; const auto pair = s_typePrinted.emplace(nodep->type()); if (pair.second) - UINFO(0, - "Unknown node type in SimulateVisitor: " << nodep->prettyTypeName() << endl); + UINFO(0, "Unknown node type in SimulateVisitor: " << nodep->prettyTypeName()); #endif } } @@ -531,7 +530,7 @@ private: } void visit(AstNodeIf* nodep) override { if (jumpingOver(nodep)) return; - UINFO(5, " IF " << nodep << endl); + UINFO(5, " IF " << nodep); checkNodeInfo(nodep); if (m_checkOnly) { iterateChildrenConst(nodep); @@ -738,7 +737,7 @@ private: } const uint32_t index = fetchConst(selp->bitp())->toUInt(); AstNodeExpr* const valuep = newTrackedClone(fetchValue(nodep->rhsp())); - UINFO(9, " set val[" << index << "] = " << valuep << endl); + UINFO(9, " set val[" << index << "] = " << valuep); // Values are in the "real" tree under the InitArray so can eventually extract it, // Not in the usual setValue (via m_varAux) initp->addIndexValuep(index, valuep); @@ -861,7 +860,7 @@ private: } void visit(AstNodeCase* nodep) override { if (jumpingOver(nodep)) return; - UINFO(5, " CASE " << nodep << endl); + UINFO(5, " CASE " << nodep); checkNodeInfo(nodep); if (m_checkOnly) { iterateChildrenConst(nodep); @@ -929,7 +928,7 @@ private: if (jumpingOver(nodep)) return; checkNodeInfo(nodep); if (!m_checkOnly) { - UINFO(5, " JUMP GO " << nodep << endl); + UINFO(5, " JUMP GO " << nodep); m_jumpp = nodep; } } @@ -940,7 +939,7 @@ private: checkNodeInfo(nodep); iterateChildrenConst(nodep); if (m_jumpp && m_jumpp->labelp() == nodep) { - UINFO(5, " JUMP DONE " << nodep << endl); + UINFO(5, " JUMP DONE " << nodep); m_jumpp = nullptr; } } @@ -957,7 +956,7 @@ private: void visit(AstNodeFor* nodep) override { // Doing lots of Whiles is slow, so only for parameters - UINFO(5, " FOR " << nodep << endl); + UINFO(5, " FOR " << nodep); if (!m_params) { badNodeType(nodep); return; @@ -969,7 +968,7 @@ private: int loops = 0; iterateAndNextConstNull(nodep->initsp()); while (true) { - UINFO(5, " FOR-ITER " << nodep << endl); + UINFO(5, " FOR-ITER " << nodep); iterateAndNextConstNull(nodep->condp()); if (!optimizable()) break; if (!fetchConst(nodep->condp())->num().isNeqZero()) { // @@ -991,7 +990,7 @@ private: void visit(AstWhile* nodep) override { // Doing lots of Whiles is slow, so only for parameters if (jumpingOver(nodep)) return; - UINFO(5, " WHILE " << nodep << endl); + UINFO(5, " WHILE " << nodep); if (!m_params) { badNodeType(nodep); return; @@ -1002,7 +1001,7 @@ private: } else if (optimizable()) { int loops = 0; while (true) { - UINFO(5, " WHILE-ITER " << nodep << endl); + UINFO(5, " WHILE-ITER " << nodep); iterateAndNextConstNull(nodep->precondsp()); if (jumpingOver(nodep)) break; iterateAndNextConstNull(nodep->condp()); @@ -1032,7 +1031,7 @@ private: void visit(AstFuncRef* nodep) override { if (jumpingOver(nodep)) return; if (!optimizable()) return; // Accelerate - UINFO(5, " FUNCREF " << nodep << endl); + UINFO(5, " FUNCREF " << nodep); checkNodeInfo(nodep); if (!m_params) { badNodeType(nodep); diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp index 5744f5ed8..b96d980ad 100644 --- a/src/V3Slice.cpp +++ b/src/V3Slice.cpp @@ -94,7 +94,7 @@ class SliceVisitor final : public VNVisitor { } AstNodeExpr* newp; if (AstInitArray* const initp = VN_CAST(nodep, InitArray)) { - UINFO(9, " cloneInitArray(" << elements << "," << elemIdx << ") " << nodep << endl); + UINFO(9, " cloneInitArray(" << elements << "," << elemIdx << ") " << nodep); auto considerOrder = [](const auto* nodep, int idxFromLeft) -> int { return !nodep->rangep()->ascending() @@ -191,12 +191,12 @@ class SliceVisitor final : public VNVisitor { } if (!newp) newp = new AstConst{nodep->fileline(), 0}; } else if (AstNodeCond* const snodep = VN_CAST(nodep, NodeCond)) { - UINFO(9, " cloneCond(" << elements << "," << elemIdx << ") " << nodep << endl); + UINFO(9, " cloneCond(" << elements << "," << elemIdx << ") " << nodep); return snodep->cloneType(snodep->condp()->cloneTree(false, needPure), cloneAndSel(snodep->thenp(), elements, elemIdx, needPure), cloneAndSel(snodep->elsep(), elements, elemIdx, needPure)); } else if (const AstSliceSel* const snodep = VN_CAST(nodep, SliceSel)) { - UINFO(9, " cloneSliceSel(" << elements << "," << elemIdx << ") " << nodep << endl); + UINFO(9, " cloneSliceSel(" << elements << "," << elemIdx << ") " << nodep); const int leOffset = (snodep->declRange().lo() + (!snodep->declRange().ascending() ? snodep->declRange().elements() - 1 - elemIdx @@ -204,7 +204,7 @@ class SliceVisitor final : public VNVisitor { newp = new AstArraySel{nodep->fileline(), snodep->fromp()->cloneTree(false, needPure), leOffset}; } else if (AstExprStmt* const snodep = VN_CAST(nodep, ExprStmt)) { - UINFO(9, " cloneExprStmt(" << elements << "," << elemIdx << ") " << nodep << endl); + UINFO(9, " cloneExprStmt(" << elements << "," << elemIdx << ") " << nodep); AstNodeExpr* const resultSelp = cloneAndSel(snodep->resultp(), elements, elemIdx, needPure); if (snodep->stmtsp()) { @@ -215,7 +215,7 @@ class SliceVisitor final : public VNVisitor { } } else if (VN_IS(nodep, NodeVarRef) || VN_IS(nodep, NodeSel) || VN_IS(nodep, CMethodHard) || VN_IS(nodep, MemberSel) || VN_IS(nodep, StructSel)) { - UINFO(9, " cloneSel(" << elements << "," << elemIdx << ") " << nodep << endl); + UINFO(9, " cloneSel(" << elements << "," << elemIdx << ") " << nodep); const int leOffset = !arrayp->rangep()->ascending() ? arrayp->rangep()->elementsConst() - 1 - elemIdx : elemIdx; @@ -248,7 +248,7 @@ class SliceVisitor final : public VNVisitor { return false; } - UINFO(4, "Slice optimizing " << nodep << endl); + UINFO(4, "Slice optimizing " << nodep); ++m_statAssigns; // Left and right could have different ascending/descending range, @@ -319,7 +319,7 @@ class SliceVisitor final : public VNVisitor { void expandBiOp(AstNodeBiop* nodep) { if (nodep->user1SetOnce()) return; // Process once - UINFO(9, " Bi-Eq/Neq expansion " << nodep << endl); + UINFO(9, " Bi-Eq/Neq expansion " << nodep); // Only expand if lhs is an unpacked array (we assume type checks already passed) const AstNodeDType* const fromDtp = nodep->lhsp()->dtypep()->skipRefp(); @@ -390,7 +390,7 @@ public: // Link class functions void V3Slice::sliceAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { SliceVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("slice", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Split.cpp b/src/V3Split.cpp index fe0b48d89..323ebd5b3 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -294,14 +294,14 @@ private: } } void scoreboardPushStmt(AstNode* nodep) { - // UINFO(9, " push " << nodep << endl); + // UINFO(9, " push " << nodep); SplitLogicVertex* const vertexp = new SplitLogicVertex{&m_graph, nodep}; m_stmtStackps.push_back(vertexp); UASSERT_OBJ(!nodep->user3p(), nodep, "user3p should not be used; cleared in processBlock"); nodep->user3p(vertexp); } void scoreboardPopStmt() { - // UINFO(9, " pop" << endl); + // UINFO(9, " pop"); UASSERT(!m_stmtStackps.empty(), "Stack underflow"); m_stmtStackps.pop_back(); } @@ -321,7 +321,7 @@ protected: if (vertex.outEmpty() && vertex.is()) { if (debug() >= 9) { const SplitVarStdVertex& sVtx = static_cast(vertex); - UINFO(0, "Will prune deps on var " << sVtx.nodep() << endl); + UINFO(0, "Will prune deps on var " << sVtx.nodep()); sVtx.nodep()->dumpTree("- "); } for (V3GraphEdge& edge : vertex.inEdges()) { @@ -344,7 +344,7 @@ protected: void visit(AstAssignDly* nodep) override { VL_RESTORER(m_inDly); m_inDly = true; - UINFO(4, " ASSIGNDLY " << nodep << endl); + UINFO(4, " ASSIGNDLY " << nodep); iterateChildren(nodep); } void visit(AstVarRef* nodep) override { @@ -380,7 +380,7 @@ protected: // SPEEDUP: We add duplicate edges, that should be fixed if (m_inDly && nodep->access().isWriteOrRW()) { - UINFO(4, " VARREFDLY: " << nodep << endl); + UINFO(4, " VARREFDLY: " << nodep); // Delayed variable is different from non-delayed variable if (!vscp->user2p()) { SplitVarPostVertex* const vpostp = new SplitVarPostVertex{&m_graph, vscp}; @@ -397,12 +397,12 @@ protected: if (nodep->access().isWriteOrRW()) { // Non-delay; need to maintain existing ordering // with all consumers of the signal - UINFO(4, " VARREFLV: " << nodep << endl); + UINFO(4, " VARREFLV: " << nodep); for (SplitLogicVertex* ivxp : m_stmtStackps) { new SplitLVEdge{&m_graph, vstdp, ivxp}; } } else { - UINFO(4, " VARREF: " << nodep << endl); + UINFO(4, " VARREF: " << nodep); makeRvalueEdges(vstdp); } } @@ -415,7 +415,7 @@ protected: // This is overly pessimistic; we could treat jumps as barriers, and // reorder everything between jumps/labels, however jumps are rare // in always, so the performance gain probably isn't worth the work. - UINFO(9, " NoReordering " << nodep << endl); + UINFO(9, " NoReordering " << nodep); m_noReorderWhy = "JumpGo"; iterateChildren(nodep); } @@ -425,11 +425,11 @@ protected: void visit(AstNode* nodep) override { // **** SPECIAL default type that sets PLI_ORDERING if (!m_stmtStackps.empty() && !nodep->isPure()) { - UINFO(9, " NotSplittable " << nodep << endl); + UINFO(9, " NotSplittable " << nodep); scoreboardPli(nodep); } if (nodep->isTimingControl()) { - UINFO(9, " NoReordering " << nodep << endl); + UINFO(9, " NoReordering " << nodep); m_noReorderWhy = "TimingControl"; } iterateChildren(nodep); @@ -453,7 +453,7 @@ protected: void cleanupBlockGraph(AstNode* nodep) { // Transform the graph into what we need - UINFO(5, "ReorderBlock " << nodep << endl); + UINFO(5, "ReorderBlock " << nodep); m_graph.removeRedundantEdgesMax(&V3GraphEdge::followAlwaysTrue); if (dumpGraphLevel() >= 9) m_graph.dumpDotFilePrefixed("reorderg_nodup", false); @@ -536,13 +536,13 @@ protected: if (++newOrder != nextp->user4()) leaveAlone = false; } if (leaveAlone) { - UINFO(6, " No changes\n"); + UINFO(6, " No changes"); } else { VNRelinker replaceHandle; // Where to add the list AstNode* newListp = nullptr; for (auto it = rankMap.cbegin(); it != rankMap.cend(); ++it) { AstNode* const nextp = it->second; - UINFO(6, " New order: " << nextp << endl); + UINFO(6, " New order: " << nextp); if (nextp == nodep) { nodep->unlinkFrBack(&replaceHandle); } else { @@ -573,11 +573,11 @@ protected: // Just one, so can't reorder. Just look for more blocks/statements. iterate(nodep); } else { - UINFO(9, " processBlock " << nodep << endl); + UINFO(9, " processBlock " << nodep); // Process block and followers scanBlock(nodep); if (m_noReorderWhy != "") { // Jump or something nasty - UINFO(9, " NoReorderBlock because " << m_noReorderWhy << endl); + UINFO(9, " NoReorderBlock because " << m_noReorderWhy); } else { // Reorder statements in this block cleanupBlockGraph(nodep); @@ -597,7 +597,7 @@ protected: } void visit(AstAlways* nodep) override { - UINFO(4, " ALW " << nodep << endl); + UINFO(4, " ALW " << nodep); if (debug() >= 9) nodep->dumpTree("- alwIn:: "); scoreboardClear(); processBlock(nodep->stmtsp()); @@ -605,7 +605,7 @@ protected: } void visit(AstNodeIf* nodep) override { - UINFO(4, " IF " << nodep << endl); + UINFO(4, " IF " << nodep); iterateAndNextNull(nodep->condp()); processBlock(nodep->thensp()); processBlock(nodep->elsesp()); @@ -650,7 +650,7 @@ private: = reinterpret_cast(nodep->user3p()); const uint32_t color = vertexp->color(); m_colors.insert(color); - UINFO(8, " SVL " << vertexp << " has color " << color << "\n"); + UINFO(8, " SVL " << vertexp << " has color " << color); // Record that all containing ifs have this color. for (auto it = m_ifStack.cbegin(); it != m_ifStack.cend(); ++it) { @@ -694,7 +694,7 @@ public: : m_origAlwaysp{nodep} , m_ifColorp{ifColorp} , m_newBlocksp{newBlocksp} { - UINFO(6, " splitting always " << nodep << endl); + UINFO(6, " splitting always " << nodep); } ~EmitSplitVisitor() override = default; @@ -922,7 +922,7 @@ protected: const SplitNodeVertex* const nvxp = static_cast(vxp); UINFO(0, "Cannot prune if-node due to edge " - << &oedge << " pointing to node " << nvxp->nodep() << endl); + << &oedge << " pointing to node " << nvxp->nodep()); nvxp->nodep()->dumpTree("- "); } @@ -956,13 +956,13 @@ protected: if (m_noReorderWhy != "") { // We saw a jump or something else rare that we don't handle. - UINFO(9, " NoSplitBlock because " << m_noReorderWhy << endl); + UINFO(9, " NoSplitBlock because " << m_noReorderWhy); return; } // Look across the entire tree of if/else blocks in the always, // and color regions that must be kept together. - UINFO(5, "SplitVisitor @ " << nodep << endl); + UINFO(5, "SplitVisitor @ " << nodep); colorAlwaysGraph(); // Map each AstNodeIf to the set of colors (split always blocks) @@ -982,7 +982,7 @@ protected: } } void visit(AstNodeIf* nodep) override { - UINFO(4, " IF " << nodep << endl); + UINFO(4, " IF " << nodep); if (!nodep->condp()->isPure()) m_noReorderWhy = "Impure IF condition"; { VL_RESTORER(m_curIfConditional); @@ -1001,12 +1001,12 @@ private: // Split class functions void V3Split::splitReorderAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { ReorderVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("reorder", 0, dumpTreeEitherLevel() >= 3); } void V3Split::splitAlwaysAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { SplitVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("split", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3SplitAs.cpp b/src/V3SplitAs.cpp index e0de302db..4f29d6767 100644 --- a/src/V3SplitAs.cpp +++ b/src/V3SplitAs.cpp @@ -73,13 +73,13 @@ class SplitAsCleanVisitor final : public VNVisitor { void visit(AstVarRef* nodep) override { if (nodep->access().isWriteOrRW()) { if (nodep->varScopep() == m_splitVscp) { - UINFO(6, " CL VAR " << nodep << endl); + UINFO(6, " CL VAR " << nodep); m_matches = true; } } } void visit(AstNodeStmt* nodep) override { - UINFO(6, " CL STMT " << nodep << endl); + UINFO(6, " CL STMT " << nodep); const bool oldKeep = m_keepStmt; { VL_RESTORER(m_matches); @@ -89,16 +89,16 @@ class SplitAsCleanVisitor final : public VNVisitor { iterateChildren(nodep); if (m_keepStmt || (m_modeMatch ? m_matches : !m_matches)) { - UINFO(6, " Keep STMT " << nodep << endl); + UINFO(6, " Keep STMT " << nodep); m_keepStmt = true; } else { - UINFO(6, " Delete STMT " << nodep << endl); + UINFO(6, " Delete STMT " << nodep); VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); } } // If something below matches, the upper statement remains too. m_keepStmt = oldKeep || m_keepStmt; - UINFO(9, " upKeep=" << m_keepStmt << " STMT " << nodep << endl); + UINFO(9, " upKeep=" << m_keepStmt << " STMT " << nodep); } void visit(AstExprStmt* nodep) override { // A function call inside the splitting assignment @@ -159,8 +159,8 @@ class SplitAsVisitor final : public VNVisitor { AstVarScope* const splitVscp = visitor.splitVscp(); // Now isolate the always if (splitVscp) { - UINFO(3, "Split " << nodep << endl); - UINFO(3, " For " << splitVscp << endl); + UINFO(3, "Split " << nodep); + UINFO(3, " For " << splitVscp); // If we did this last time! Something's stuck! UASSERT_OBJ(splitVscp != lastSplitVscp, nodep, "Infinite loop in isolate_assignments removal for: " @@ -189,7 +189,7 @@ public: // SplitAs class functions void V3SplitAs::splitAsAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { SplitAsVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("splitas", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 7261a877e..346e98961 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -459,9 +459,9 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { void visit(AstNode* nodep) override { iterateChildren(nodep); } void visit(AstNodeModule* nodep) override { - UINFO(4, "Start checking " << nodep->prettyNameQ() << "\n"); + UINFO(4, "Start checking " << nodep->prettyNameQ()); if (!VN_IS(nodep, Module)) { - UINFO(4, "Skip " << nodep->prettyNameQ() << "\n"); + UINFO(4, "Skip " << nodep->prettyNameQ()); return; } UASSERT_OBJ(!m_modp, m_modp, "Nested module declaration"); @@ -522,7 +522,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { } } void visit(AstPin* nodep) override { - UINFO(5, nodep->modVarp()->prettyNameQ() << " pin \n"); + UINFO(5, nodep->modVarp()->prettyNameQ() << " pin "); AstNode* const exprp = nodep->exprp(); if (!exprp) return; // Not connected pin m_foundTargetVar.clear(); @@ -548,7 +548,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { if (!nodep->attrSplitVar()) return; // Nothing to do if (!cannotSplitReason(nodep)) { m_refs.registerVar(nodep); - UINFO(4, nodep->name() << " is added to candidate list.\n"); + UINFO(4, nodep->name() << " is added to candidate list."); } } void visit(AstVarRef* nodep) override { @@ -559,7 +559,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { } } void visit(AstVarXRef* nodep) override { - UINFO(4, nodep->varp() << " Has hierarchical reference\n"); + UINFO(4, nodep->varp() << " Has hierarchical reference"); m_forPackedSplit.m_hasXref.emplace(nodep->varp()); } void visit(AstSel* nodep) override { @@ -570,7 +570,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { if (AstVarRef* const refp = isTargetVref(nodep->fromp())) { const AstConst* const indexp = VN_CAST(nodep->bitp(), Const); if (indexp) { // OK - UINFO(4, "add " << nodep << " for " << refp->varp()->prettyName() << "\n"); + UINFO(4, "add " << nodep << " for " << refp->varp()->prettyName()); if (indexp->toSInt() < outerMostSizeOfUnpackedArray(refp->varp())) { m_refs.tryAdd(m_contextp, refp, nodep, indexp->toSInt(), m_inFTaskp); } else { @@ -597,7 +597,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { nodep->declRange().ascending()}; UASSERT_OBJ(dtypep->lo() <= selRange.lo() && selRange.hi() <= dtypep->hi(), nodep, "Range check for AstSliceSel must have been finished in V3Width.cpp"); - UINFO(4, "add " << nodep << " for " << refp->varp()->prettyName() << "\n"); + UINFO(4, "add " << nodep << " for " << refp->varp()->prettyName()); m_refs.tryAdd(m_contextp, refp, nodep, nodep->declRange().hi(), nodep->declRange().lo(), m_inFTaskp); } else { @@ -618,7 +618,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { AstVar* const varp = newVar(fl, VVarType::VAR, name, dtypep); // Variable will be registered in the caller side. UINFO(4, varp->prettyNameQ() - << " is created lsb:" << dtypep->lo() << " msb:" << dtypep->hi() << "\n"); + << " is created lsb:" << dtypep->lo() << " msb:" << dtypep->hi()); // Use AstAssign if true, otherwise AstAssignW const bool use_simple_assign = (context && VN_IS(context, NodeFTaskRef)) || (assignp && VN_IS(assignp, Assign)); @@ -629,7 +629,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { AstNodeExpr* rhsp = new AstArraySel{ fl, newVarRef(fl, varp, !lvalue ? VAccess::WRITE : VAccess::READ), i}; AstNode* const refp = lhsp; - UINFO(9, "Creating assign idx:" << i << " + " << start_idx << "\n"); + UINFO(9, "Creating assign idx:" << i << " + " << start_idx); if (!lvalue) std::swap(lhsp, rhsp); AstNode* newassignp; if (use_simple_assign) { @@ -684,7 +684,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { for (const auto& pair : refs) { UINFO(4, "In module " << m_modp->name() << " var " << pair.first->prettyNameQ() << " which has " << pair.second.size() - << " refs will be split.\n"); + << " refs will be split."); AstVar* const varp = pair.first; AstNode* insertp = varp; const AstUnpackArrayDType* const dtypep @@ -730,8 +730,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { refp->access(), ref.ftask()); newp = newrefp; refp->varp()->addNextHere(newrefp->varp()); - UINFO(4, - "Create " << newrefp->varp()->prettyNameQ() << " for " << refp << "\n"); + UINFO(4, "Create " << newrefp->varp()->prettyNameQ() << " for " << refp); } ref.nodep()->replaceWith(newp); pushDeletep(ref.nodep()); @@ -760,7 +759,7 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl { m_refs.swap(next); const size_t n = collapse(next); UINFO(4, n << " Variables are split " << trial << " th trial in " - << m_modp->prettyNameQ() << '\n'); + << m_modp->prettyNameQ()); if (trial == 0) m_numSplit += n; } doDeletes(); @@ -784,7 +783,7 @@ public: const std::pair dim = nodep->dtypep()->dimensions(false); UINFO(7, nodep->prettyNameQ() << " pub:" << nodep->isSigPublic() << " pri:" << nodep->isPrimaryIO() - << " io:" << nodep->isInout() << " typ:" << nodep->varType() << "\n"); + << " io:" << nodep->isInout() << " typ:" << nodep->varType()); const char* reason = nullptr; // Public variable cannot be split. // at least one unpacked dimension must exist @@ -792,8 +791,7 @@ public: reason = "it is not an unpacked array"; if (!reason) reason = cannotSplitVarCommonReason(nodep); if (reason) { - UINFO(5, - "Check " << nodep->prettyNameQ() << " cannot split because" << reason << ".\n"); + UINFO(5, "Check " << nodep->prettyNameQ() << " cannot split because" << reason); } return reason; } @@ -980,7 +978,7 @@ class SplitPackedVarVisitor final : public VNVisitor, public SplitVarImpl { } } else { // Finally find a good candidate const bool inserted = m_refs.emplace(nodep, PackedVarRef{nodep}).second; - if (inserted) UINFO(4, nodep->prettyNameQ() << " is added to candidate list.\n"); + if (inserted) UINFO(4, nodep->prettyNameQ() << " is added to candidate list."); } } void visit(AstVarRef* nodep) override { @@ -995,7 +993,7 @@ class SplitPackedVarVisitor final : public VNVisitor, public SplitVarImpl { refit->second.append(PackedVarRefEntry{nodep, basicp->lo(), varp->width()}, nodep->access()); UINFO(5, varp->prettyName() - << " Entire bit of [" << basicp->lo() << "+:" << varp->width() << "] \n"); + << " Entire bit of [" << basicp->lo() << "+:" << varp->width() << "]"); } void visit(AstSel* nodep) override { const AstVarRef* const vrefp = VN_CAST(nodep->fromp(), VarRef); @@ -1022,17 +1020,17 @@ class SplitPackedVarVisitor final : public VNVisitor, public SplitVarImpl { vrefp->access()); UINFO(5, varp->prettyName() << " [" << consts[0]->toSInt() << ":+" << consts[1]->toSInt() - << "] lsb:" << refit->second.basicp()->lo() << "\n"); + << "] lsb:" << refit->second.basicp()->lo()); } else { if (varp->attrSplitVar()) { warnNoSplit(vrefp->varp(), nodep, "its bit range cannot be determined statically"); varp->attrSplitVar(false); } if (!consts[0]) { - UINFO(4, "LSB " << nodep->lsbp() << " is expected to be constant, but not\n"); + UINFO(4, "LSB " << nodep->lsbp() << " is expected to be constant, but not"); } if (!consts[1]) { - UINFO(4, "WIDTH " << nodep->widthp() << " is expected to be constant, but not\n"); + UINFO(4, "WIDTH " << nodep->widthp() << " is expected to be constant, but not"); } m_refs.erase(varp); iterateChildren(nodep); @@ -1115,8 +1113,7 @@ class SplitPackedVarVisitor final : public VNVisitor, public SplitVarImpl { // newvar.varp()->trace(varp->isTrace()); m_netp->typeTablep()->addTypesp(dtypep); varp->addNextHere(newvar.varp()); - UINFO(4, newvar.varp()->prettyNameQ() - << " is added for " << varp->prettyNameQ() << '\n'); + UINFO(4, newvar.varp()->prettyNameQ() << " is added for " << varp->prettyNameQ()); } } static void updateReferences(AstVar* varp, PackedVarRef& pref, @@ -1175,7 +1172,7 @@ class SplitPackedVarVisitor final : public VNVisitor, public SplitVarImpl { ref.dedup(); UINFO(4, "In module " << m_modp->name() << " var " << varp->prettyNameQ() << " which has " << ref.lhs().size() << " lhs refs and " - << ref.rhs().size() << " rhs refs will be split.\n"); + << ref.rhs().size() << " rhs refs will be split."); std::vector vars = ref.splitPlan(varp, !varp->isTrace()); // If traced, all bit must be kept if (vars.empty()) continue; @@ -1347,8 +1344,7 @@ public: reason = "its type is unknown"; // LCOV_EXCL_LINE } if (reason) { - UINFO(5, - "Check " << nodep->prettyNameQ() << " cannot split because" << reason << endl); + UINFO(5, "Check " << nodep->prettyNameQ() << " cannot split because" << reason); } return reason; } @@ -1362,7 +1358,7 @@ const char* SplitVarImpl::cannotSplitPackedVarReason(const AstVar* varp) { // Split class functions void V3SplitVar::splitVariable(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); SplitVarRefs refs; { const SplitUnpackedVarVisitor visitor{nodep}; diff --git a/src/V3StackCount.cpp b/src/V3StackCount.cpp index 23202acf9..ed1789adf 100644 --- a/src/V3StackCount.cpp +++ b/src/V3StackCount.cpp @@ -80,7 +80,7 @@ private: return savedCount; } void endVisitBase(uint32_t savedCount, AstNode* nodep) { - UINFO(8, "cost " << std::setw(6) << std::left << m_stackSize << " " << nodep << endl); + UINFO(8, "cost " << std::setw(6) << std::left << m_stackSize << " " << nodep); if (!m_ignoreRemaining) m_stackSize += savedCount; } @@ -91,13 +91,13 @@ private: iterateAndNextConstNull(nodep->condp()); const uint32_t savedCount = m_stackSize; - UINFO(8, "thensp:\n"); + UINFO(8, "thensp:"); reset(); iterateAndNextConstNull(nodep->thensp()); uint32_t ifCount = m_stackSize; if (nodep->branchPred().unlikely()) ifCount = 0; - UINFO(8, "elsesp:\n"); + UINFO(8, "elsesp:"); reset(); iterateAndNextConstNull(nodep->elsesp()); uint32_t elseCount = m_stackSize; @@ -120,12 +120,12 @@ private: iterateAndNextConstNull(nodep->condp()); const uint32_t savedCount = m_stackSize; - UINFO(8, "?\n"); + UINFO(8, "?"); reset(); iterateAndNextConstNull(nodep->thenp()); const uint32_t ifCount = m_stackSize; - UINFO(8, ":\n"); + UINFO(8, ":"); reset(); iterateAndNextConstNull(nodep->elsep()); const uint32_t elseCount = m_stackSize; diff --git a/src/V3Stats.cpp b/src/V3Stats.cpp index 76fdb92c6..394ba1de2 100644 --- a/src/V3Stats.cpp +++ b/src/V3Stats.cpp @@ -102,7 +102,7 @@ public: StatsVisitor(AstNetlist* nodep, const std::string& stage, bool fastOnly) : m_fastOnly{fastOnly} , m_accump{fastOnly ? &m_dumpster : &m_counters} { - UINFO(9, "Starting stats, fastOnly=" << fastOnly << endl); + UINFO(9, "Starting stats, fastOnly=" << fastOnly); memset(&m_counters, 0, sizeof(m_counters)); memset(&m_dumpster, 0, sizeof(m_dumpster)); diff --git a/src/V3StatsReport.cpp b/src/V3StatsReport.cpp index 5697f5ceb..0998fa489 100644 --- a/src/V3StatsReport.cpp +++ b/src/V3StatsReport.cpp @@ -228,7 +228,7 @@ void V3Stats::infoHeader(std::ofstream& os, const string& prefix) { } void V3Stats::statsReport() { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); // Open stats file const string filename diff --git a/src/V3String.cpp b/src/V3String.cpp index 120ff6547..5cbcd3dab 100644 --- a/src/V3String.cpp +++ b/src/V3String.cpp @@ -703,7 +703,7 @@ string VSpellCheck::bestCandidateInfo(const string& goal, EditDistance& distance const EditDistance dist = editDistance(goal, candidate); UINFO(9, "EditDistance dist=" << dist << " cutoff=" << cutoff << " goal=" << goal - << " candidate=" << candidate << endl); + << " candidate=" << candidate); if (dist < distancer && dist <= cutoff) { distancer = dist; bestCandidate = candidate; diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index 08af8a416..19fd3d9d8 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -146,7 +146,7 @@ public: } } void deleteAssign(AstNodeAssign* nodep) { - UINFO(5, "Delete " << nodep << endl); + UINFO(5, "Delete " << nodep); VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); } void deleteUnusedAssign() { @@ -188,9 +188,7 @@ class SubstUseVisitor final : public VNVisitorConst { } else { // A simple variable; needs checking. if (m_origStep < nodep->varp()->user2()) { - if (m_ok) { - UINFO(9, " RHS variable changed since subst recorded: " << nodep << endl); - } + if (m_ok) { UINFO(9, " RHS variable changed since subst recorded: " << nodep); } m_ok = false; } } @@ -205,7 +203,7 @@ public: // CONSTRUCTORS SubstUseVisitor(AstNode* nodep, int origStep) : m_origStep{origStep} { - UINFO(9, " SubstUseVisitor " << origStep << " " << nodep << endl); + UINFO(9, " SubstUseVisitor " << origStep << " " << nodep); iterateConst(nodep); } ~SubstUseVisitor() override = default; @@ -259,10 +257,10 @@ class SubstVisitor final : public VNVisitor { SubstVarEntry* const entryp = getEntryp(varrefp); hit = true; if (m_ops > SUBST_MAX_OPS_SUBST) { - UINFO(8, " ASSIGNtooDeep " << varrefp << endl); + UINFO(8, " ASSIGNtooDeep " << varrefp); entryp->assignComplex(); } else { - UINFO(8, " ASSIGNwhole " << varrefp << endl); + UINFO(8, " ASSIGNwhole " << varrefp); entryp->assignWhole(m_assignStep, nodep); } } @@ -273,10 +271,10 @@ class SubstVisitor final : public VNVisitor { SubstVarEntry* const entryp = getEntryp(varrefp); hit = true; if (m_ops > SUBST_MAX_OPS_SUBST) { - UINFO(8, " ASSIGNtooDeep " << varrefp << endl); + UINFO(8, " ASSIGNtooDeep " << varrefp); entryp->assignWordComplex(word); } else { - UINFO(8, " ASSIGNword" << word << " " << varrefp << endl); + UINFO(8, " ASSIGNword" << word << " " << varrefp); entryp->assignWord(m_assignStep, word, nodep); } } @@ -304,7 +302,7 @@ class SubstVisitor final : public VNVisitor { // Nicely formed lvalues handled in NodeAssign // Other lvalues handled as unknown mess in AstVarRef const int word = constp->toUInt(); - UINFO(8, " USEword" << word << " " << varrefp << endl); + UINFO(8, " USEword" << word << " " << varrefp); SubstVarEntry* const entryp = getEntryp(varrefp); if (AstNodeExpr* const substp = entryp->substWord(nodep, word)) { // Check that the RHS hasn't changed value since we recorded it. @@ -327,25 +325,25 @@ class SubstVisitor final : public VNVisitor { if (nodep->access().isWriteOrRW()) { m_assignStep++; nodep->varp()->user2(m_assignStep); - UINFO(9, " ASSIGNstep u2=" << nodep->varp()->user2() << " " << nodep << endl); + UINFO(9, " ASSIGNstep u2=" << nodep->varp()->user2() << " " << nodep); } if (isSubstVar(nodep->varp())) { SubstVarEntry* const entryp = getEntryp(nodep); if (nodep->access().isWriteOrRW()) { - UINFO(8, " ASSIGNcpx " << nodep << endl); + UINFO(8, " ASSIGNcpx " << nodep); entryp->assignComplex(); } else if (AstNodeExpr* const substp = entryp->substWhole(nodep)) { // Check that the RHS hasn't changed value since we recorded it. const SubstUseVisitor visitor{substp, entryp->getWholeStep()}; if (visitor.ok()) { - UINFO(8, " USEwhole " << nodep << endl); + UINFO(8, " USEwhole " << nodep); VL_DO_DANGLING(replaceSubstEtc(nodep, substp), nodep); } else { - UINFO(8, " USEwholeButChg " << nodep << endl); + UINFO(8, " USEwholeButChg " << nodep); entryp->consumeWhole(); } } else { // Consumed w/o substitute - UINFO(8, " USEwtf " << nodep << endl); + UINFO(8, " USEwtf " << nodep); entryp->consumeWhole(); } } @@ -384,7 +382,7 @@ public: // Subst class functions void V3Subst::substituteAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { SubstVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("subst", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3SymTable.h b/src/V3SymTable.h index 20166c97e..a65b55b58 100644 --- a/src/V3SymTable.h +++ b/src/V3SymTable.h @@ -119,7 +119,7 @@ public: void imported(bool flag) { m_imported = flag; } void insert(const string& name, VSymEnt* entp) { UINFO(9, " SymInsert se" << cvtToHex(this) << " '" << name << "' se" << cvtToHex(entp) - << " " << entp->nodep() << endl); + << " " << entp->nodep()); if (name != "" && m_idNameMap.find(name) != m_idNameMap.end()) { // If didn't already report warning if (!V3Error::errorCount()) { // LCOV_EXCL_START @@ -135,7 +135,7 @@ public: const auto it = m_idNameMap.find(name); if (name != "" && it != m_idNameMap.end()) { UINFO(9, " SymReinsert se" << cvtToHex(this) << " '" << name << "' se" - << cvtToHex(entp) << " " << entp->nodep() << endl); + << cvtToHex(entp) << " " << entp->nodep()); it->second = entp; // Replace } else { insert(name, entp); @@ -147,10 +147,9 @@ public: const auto it = m_idNameMap.find(name); UINFO(9, " SymFind se" << cvtToHex(this) << " '" << name << "' -> " - << (it == m_idNameMap.end() - ? "NONE" - : "se" + cvtToHex(it->second) + " n=" + cvtToHex(it->second->nodep())) - << endl); + << (it == m_idNameMap.end() ? "NONE" + : "se" + cvtToHex(it->second) + + " n=" + cvtToHex(it->second->nodep()))); if (it != m_idNameMap.end()) return (it->second); return nullptr; } @@ -242,7 +241,7 @@ public: } void importFromIface(VSymGraph* graphp, const VSymEnt* srcp, bool onlyUnmodportable = false) { // Import interface tokens from source symbol table into this symbol table, recursively - UINFO(9, " importIf se" << cvtToHex(this) << " from se" << cvtToHex(srcp) << endl); + UINFO(9, " importIf se" << cvtToHex(this) << " from se" << cvtToHex(srcp)); for (IdNameMap::const_iterator it = srcp->m_idNameMap.begin(); it != srcp->m_idNameMap.end(); ++it) { const string& name = it->first; @@ -317,7 +316,7 @@ public: void dumpFilePrefixed(const string& nameComment) { if (dumpTreeLevel()) { const string filename = v3Global.debugFilename(nameComment) + ".txt"; - UINFO(2, "Dumping " << filename << endl); + UINFO(2, "Dumping " << filename); const std::unique_ptr logp{V3File::new_ofstream(filename)}; if (logp->fail()) v3fatal("Can't write file: " << filename); dumpSelf(*logp, ""); diff --git a/src/V3TSP.cpp b/src/V3TSP.cpp index ee42d1d17..5d768d54c 100644 --- a/src/V3TSP.cpp +++ b/src/V3TSP.cpp @@ -334,7 +334,7 @@ public: // Go on a random tour. Fun! std::vector tour; do { - UINFO(6, "Adding " << cur_vertexp->key() << " to tour.\n"); + UINFO(6, "Adding " << cur_vertexp->key() << " to tour."); tour.push_back(cur_vertexp); // Look for an arbitrary edge we've not yet marked @@ -345,7 +345,7 @@ public: markedEdgesp->insert(edgeId); Vertex* const neighborp = castVertexp(edge.top()); UINFO(6, "following edge " << edgeId << " from " << cur_vertexp->key() - << " to " << neighborp->key() << endl); + << " to " << neighborp->key()); cur_vertexp = neighborp; goto found; } @@ -353,7 +353,7 @@ public: v3fatalSrc("No unmarked edges found in tour"); found:; } while (cur_vertexp != startp); - UINFO(6, "stopped, got back to start of tour @ " << cur_vertexp->key() << endl); + UINFO(6, "stopped, got back to start of tour @ " << cur_vertexp->key()); // Look for nodes on the tour that still have // un-marked edges. If we find one, recurse. @@ -365,7 +365,7 @@ public: for (V3GraphEdge& edge : vxp->outEdges()) { const uint32_t edgeId = getEdgeId(&edge); if (markedEdgesp->end() == markedEdgesp->find(edgeId)) { - UINFO(6, "Recursing.\n"); + UINFO(6, "Recursing."); findEulerTourRecurse(markedEdgesp, vxp, sortedOutp); recursed = true; goto recursed; @@ -376,9 +376,11 @@ public: sortedOutp->push_back(vxp->key()); } - UINFO(6, "Tour was: "); - for (const Vertex* vxp : tour) UINFONL(6, "- " << vxp->key()); - UINFONL(6, "-\n"); + if (debug() >= 6) { + UINFO(0, "Tour was:"); + for (const Vertex* vxp : tour) std::cout << "- " << vxp->key() << '\n'; + std::cout << "-\n"; + } } void dumpGraph(std::ostream& os, const string& nameComment) const { diff --git a/src/V3Table.cpp b/src/V3Table.cpp index 52d7cb531..74fd45945 100644 --- a/src/V3Table.cpp +++ b/src/V3Table.cpp @@ -172,7 +172,7 @@ class TableVisitor final : public VNVisitor { public: void simulateVarRefCb(AstVarRef* nodep) { // Called by TableSimulateVisitor on each unique varref encountered - UINFO(9, " SimVARREF " << nodep << endl); + UINFO(9, " SimVARREF " << nodep); AstVarScope* const vscp = nodep->varScopep(); if (nodep->access().isWriteOrRW()) { // We'll make the table with a separate natural alignment for each output var, so @@ -233,9 +233,9 @@ private: << " in width (bits)=" << m_inWidthBits << " out width (bytes)=" << m_outWidthBytes << " Spacetime=" << (space / time) << "(" << space << "/" << time << ")" - << ": " << nodep << endl); + << ": " << nodep); if (chkvis.optimizable()) { - UINFO(3, " Table Optimize spacetime=" << (space / time) << " " << nodep << endl); + UINFO(3, " Table Optimize spacetime=" << (space / time) << " " << nodep); m_totalBytes += space; } return chkvis.optimizable(); @@ -287,7 +287,7 @@ private: for (uint32_t i = 0; i <= VL_MASK_I(m_inWidthBits); ++i) { const uint32_t inValue = i; // Make a new simulation structure so we can set new input values - UINFO(8, " Simulating " << std::hex << inValue << endl); + UINFO(8, " Simulating " << std::hex << inValue); // Above simulateVisitor clears user 3, so // all outputs default to nullptr to mean 'recirculating'. @@ -304,7 +304,7 @@ private: // We are using 32 bit arithmetic, because there's no way the input table can be // 2^32 bytes! UASSERT_OBJ(shift <= 32, nodep, "shift overflow"); - UINFO(8, " Input " << invscp->name() << " = " << cnst.name() << endl); + UINFO(8, " Input " << invscp->name() << " = " << cnst.name()); } // Simulate @@ -317,12 +317,12 @@ private: V3Number outputAssignedMask{nodep, static_cast(m_outVarps.size()), 0}; for (TableOutputVar& tov : m_outVarps) { if (V3Number* const outnump = simvis.fetchOutNumberNull(tov.varScopep())) { - UINFO(8, " Output " << tov.name() << " = " << *outnump << endl); + UINFO(8, " Output " << tov.name() << " = " << *outnump); UASSERT_OBJ(!outnump->isAnyXZ(), outnump, "Table should not contain X/Z"); outputAssignedMask.setBit(tov.ord(), 1); // Mark output as assigned tov.addValue(inValue, *outnump); } else { - UINFO(8, " Output " << tov.name() << " not set for this input\n"); + UINFO(8, " Output " << tov.name() << " not set for this input"); tov.setMayBeUnassigned(); } } @@ -388,13 +388,13 @@ private: iterateChildren(nodep); } void visit(AstScope* nodep) override { - UINFO(4, " SCOPE " << nodep << endl); + UINFO(4, " SCOPE " << nodep); VL_RESTORER(m_scopep); m_scopep = nodep; iterateChildren(nodep); } void visit(AstAlways* nodep) override { - UINFO(4, " ALWAYS " << nodep << endl); + UINFO(4, " ALWAYS " << nodep); if (treeTest(nodep)) { // Well, then, I'll be a memory hog. replaceWithTable(nodep); @@ -426,7 +426,7 @@ void TableSimulateVisitor::varRefCb(AstVarRef* nodep) { // Table class functions void V3Table::tableAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { TableVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("table", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 0c139f185..e7bdcea80 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -147,7 +147,7 @@ private: void convertAssignWToAlways() { // Wire assigns must become always statements to deal with insertion // of multiple statements. Perhaps someday make all wassigns into always's? - UINFO(5, " IM_WireRep " << m_assignwp << endl); + UINFO(5, " IM_WireRep " << m_assignwp); m_assignwp->convertToAlways(); VL_DO_CLEAR(pushDeletep(m_assignwp), m_assignwp = nullptr); } @@ -182,7 +182,7 @@ private: for (AstNode* stmtp = nodep->varsp(); stmtp; stmtp = stmtp->nextp()) { if (AstVarScope* const vscp = VN_CAST(stmtp, VarScope)) { if (vscp->varp()->isFuncLocal() || vscp->varp()->isUsedLoopIdx()) { - UINFO(9, " funcvsc " << vscp << endl); + UINFO(9, " funcvsc " << vscp); m_varToScopeMap.emplace(std::make_pair(nodep, vscp->varp()), vscp); } } @@ -217,7 +217,7 @@ private: const AstArg* const argp = itr.second; if (const AstNodeExpr* const pinp = argp->exprp()) { if ((portp->isRef() || portp->isConstRef()) && !VN_IS(pinp, VarRef)) { - UINFO(9, "No function inline due to ref " << pinp << endl); + UINFO(9, "No function inline due to ref " << pinp); taskVtxp->noInline(true); } } @@ -225,7 +225,7 @@ private: } } void visit(AstNodeFTask* nodep) override { - UINFO(9, " TASK " << nodep << endl); + UINFO(9, " TASK " << nodep); VL_RESTORER(m_curVxp); m_curVxp = getFTaskVertex(nodep); if (nodep->dpiImport()) m_curVxp->noInline(true); @@ -489,8 +489,8 @@ class TaskVisitor final : public VNVisitor { if (!pinp) { // Too few arguments in function call } else { - UINFO(9, " Port " << portp << endl); - UINFO(9, " pin " << pinp << endl); + UINFO(9, " Port " << portp); + UINFO(9, " pin " << pinp); if (inlineTask) { pushDeletep(pinp->unlinkFrBack()); // Cloned in assignment below VL_DO_DANGLING(argp->unlinkFrBack()->deleteTree(), argp); // Args no longer needed @@ -629,7 +629,7 @@ class TaskVisitor final : public VNVisitor { } // Create function output variables if (outvscp) { - // UINFO(0, "setflag on " << funcp->fvarp() << " to " << outvscp << endl); + // UINFO(0, "setflag on " << funcp->fvarp() << " to " << outvscp); refp->taskp()->fvarp()->user2p(outvscp); } // Replace variable refs @@ -1463,7 +1463,7 @@ class TaskVisitor final : public VNVisitor { // Includes handling AstMethodCall, AstNew UASSERT_OBJ(nodep->taskp(), nodep, "Unlinked?"); iterateIntoFTask(nodep->taskp()); // First, do hierarchical funcs - UINFO(4, " FTask REF " << nodep << endl); + UINFO(4, " FTask REF " << nodep); if (debug() >= 9) nodep->dumpTree("- inlfunc: "); UASSERT_OBJ(m_scopep, nodep, "func ref not under scope"); const string namePrefix = ((VN_IS(nodep, FuncRef) ? "__Vfunc_" : "__Vtask_") @@ -1518,10 +1518,10 @@ class TaskVisitor final : public VNVisitor { nodep->unlinkFrBack(); VL_DO_DANGLING(nodep->deleteTree(), nodep); } - UINFO(4, " FTask REF Done.\n"); + UINFO(4, " FTask REF Done."); } void visit(AstNodeFTask* nodep) override { - UINFO(4, " visitFTask " << nodep << endl); + UINFO(4, " visitFTask " << nodep); VL_RESTORER(m_insStmtp); m_insStmtp = nodep->stmtsp(); // Might be null if no statements, but we won't use it if (!nodep->user1SetOnce()) { // Just one creation needed per function @@ -1568,7 +1568,7 @@ class TaskVisitor final : public VNVisitor { if (nodep->isFunction()) { if (AstVar* const portp = VN_CAST(nodep->fvarp(), Var)) { AstVarScope* const vscp = m_statep->findVarScope(m_scopep, portp); - UINFO(9, " funcremovevsc " << vscp << endl); + UINFO(9, " funcremovevsc " << vscp); VL_DO_DANGLING(pushDeletep(vscp->unlinkFrBack()), vscp); } } @@ -1576,7 +1576,7 @@ class TaskVisitor final : public VNVisitor { nextp = stmtp->nextp(); if (AstVar* const portp = VN_CAST(stmtp, Var)) { AstVarScope* const vscp = m_statep->findVarScope(m_scopep, portp); - UINFO(9, " funcremovevsc " << vscp << endl); + UINFO(9, " funcremovevsc " << vscp); VL_DO_DANGLING(pushDeletep(vscp->unlinkFrBack()), vscp); } } @@ -1654,7 +1654,7 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp, // func calls are made right in C) // Missing pin/expr? We return (pinvar, nullptr) // Extra pin/expr? We clean it up - UINFO(9, "taskConnects " << nodep << endl); + UINFO(9, "taskConnects " << nodep); std::map nameToIndex; V3TaskConnects tconnects; UASSERT_OBJ(nodep->taskp(), nodep, "unlinked"); @@ -1755,7 +1755,7 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp, if (!VN_IS(newvaluep, Const)) { if (statep) { portp->pinNum(i + 1); // Make sure correct, will use to build name - UINFO(9, "taskConnects arg wrapper needed " << portp->valuep() << endl); + UINFO(9, "taskConnects arg wrapper needed " << portp->valuep()); argWrap.emplace(portp); } else { // statep = nullptr, called too late or otherwise to handle args // Problem otherwise is we might have a varref, task @@ -1774,7 +1774,7 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp, newvaluep = newvaluep->cloneTree(true); // To avoid problems with callee needing to know to deleteTree // or not, we make this into a pin - UINFO(9, "Default pin for " << portp << endl); + UINFO(9, "Default pin for " << portp); AstArg* const newp = new AstArg{nodep->fileline(), portp->name(), newvaluep}; if (tconnects[i].second) { // Have a "nullptr" pin already defined for it VL_DO_CLEAR(tconnects[i].second->unlinkFrBack()->deleteTree(), @@ -1784,9 +1784,9 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp, reorganize = true; } if (tconnects[i].second) { - UINFO(9, "Connect " << portp << " -> " << tconnects[i].second << endl); + UINFO(9, "Connect " << portp << " -> " << tconnects[i].second); } else { - UINFO(9, "Connect " << portp << " -> NONE" << endl); + UINFO(9, "Connect " << portp << " -> NONE"); } } @@ -1812,12 +1812,12 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp, nodep->dumpTree("- ftref-out: "); for (int i = 0; i < tpinnum; ++i) { UINFO(0, " pin " << i << " pin=" << cvtToHex(tconnects[i].first) - << " conn=" << cvtToHex(tconnects[i].second) << endl); + << " conn=" << cvtToHex(tconnects[i].second)); } } // LCOV_EXCL_STOP if (!argWrap.empty()) { - UINFO(9, "Arg wrapper generation " << nodep << endl); + UINFO(9, "Arg wrapper generation " << nodep); // Create wrapper function with default argument settings. // Needed because the default needs symbol table of the called function. taskConnectWrap(nodep, tconnects, statep, argWrap); @@ -2042,7 +2042,7 @@ string V3Task::assignDpiToInternal(const string& lhsName, AstVar* varp) { } void V3Task::taskAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { TaskStateVisitor visitors{nodep}; const TaskVisitor visitor{nodep, &visitors}; diff --git a/src/V3Timing.cpp b/src/V3Timing.cpp index 0d6be45b7..e077b9518 100644 --- a/src/V3Timing.cpp +++ b/src/V3Timing.cpp @@ -266,7 +266,7 @@ class TimingSuspendableVisitor final : public VNVisitor { getNeedsProcDepVtx(nodep); addFlags(nodep, T_ALLOCS_PROC); if (VN_IS(nodep, Always)) { - UINFO(1, "Always does " << (nodep->needProcess() ? "" : "NOT ") << "need process\n"); + UINFO(1, "Always does " << (nodep->needProcess() ? "" : "NOT ") << "need process"); } iterateChildren(nodep); } @@ -1256,7 +1256,7 @@ public: // Timing class functions void V3Timing::timingAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); TimingSuspendableVisitor susVisitor{nodep}; if (v3Global.usesTiming()) TimingControlVisitor{nodep}; V3Global::dumpCheckGlobalTree("timing", 0, dumpTreeEitherLevel() >= 3); diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 6b0761040..cbc8833f4 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -201,7 +201,7 @@ class TraceVisitor final : public VNVisitor { // METHODS void detectDuplicates() { - UINFO(9, "Finding duplicates\n"); + UINFO(9, "Finding duplicates"); // Note uses user4 V3DupFinder dupFinder; // Duplicate code detection // Hash all of the traced values and find if there are any duplicates @@ -217,8 +217,8 @@ class TraceVisitor final : public VNVisitor { UASSERT_OBJ(dupDeclp, nodep, "Trace duplicate of wrong type"); TraceTraceVertex* const dupvertexp = dupDeclp->user1u().toGraphVertex()->cast(); - UINFO(8, " Orig " << nodep << endl); - UINFO(8, " dup " << dupDeclp << endl); + UINFO(8, " Orig " << nodep); + UINFO(8, " dup " << dupDeclp); // Mark the hashed node as the original and our // iterating node as duplicated vvertexp->duplicatep(dupvertexp); @@ -308,14 +308,14 @@ class TraceVisitor final : public VNVisitor { for (V3GraphVertex& vtx : m_graph.vertices()) { if (TraceTraceVertex* const vtxp = vtx.cast()) { ActCodeSet actSet; - UINFO(9, " Add to sort: " << vtxp << endl); + UINFO(9, " Add to sort: " << vtxp); if (debug() >= 9) vtxp->nodep()->dumpTree("- trnode: "); for (const V3GraphEdge& edge : vtxp->inEdges()) { const TraceActivityVertex* const cfvertexp = edge.fromp()->cast(); UASSERT_OBJ(cfvertexp, vtxp->nodep(), "Should have been function pointing to this trace"); - UINFO(9, " Activity: " << cfvertexp << endl); + UINFO(9, " Activity: " << cfvertexp); if (cfvertexp->activityAlways()) { // If code 0, we always trace; ignore other codes actSet.insert(TraceActivityVertex::ACTIVITY_ALWAYS); @@ -568,7 +568,7 @@ class TraceVisitor final : public VNVisitor { topFuncp->addStmtsp(callp->makeStmt()); } // Done - UINFO(5, " newCFunc " << funcp << endl); + UINFO(5, " newCFunc " << funcp); return funcp; } @@ -850,7 +850,7 @@ class TraceVisitor final : public VNVisitor { void visit(AstStmtExpr* nodep) override { if (!m_finding && !nodep->user2()) { if (AstCCall* const callp = VN_CAST(nodep->exprp(), CCall)) { - UINFO(8, " CCALL " << callp << endl); + UINFO(8, " CCALL " << callp); // See if there are other calls in same statement list; // If so, all funcs might share the same activity code TraceActivityVertex* const activityVtxp @@ -859,7 +859,7 @@ class TraceVisitor final : public VNVisitor { if (AstStmtExpr* const stmtp = VN_CAST(nextp, StmtExpr)) { if (AstCCall* const ccallp = VN_CAST(stmtp->exprp(), CCall)) { stmtp->user2(true); // Processed - UINFO(8, " SubCCALL " << ccallp << endl); + UINFO(8, " SubCCALL " << ccallp); V3GraphVertex* const ccallFuncVtxp = getCFuncVertexp(ccallp->funcp()); activityVtxp->slow(ccallp->funcp()->slow()); new V3GraphEdge{&m_graph, activityVtxp, ccallFuncVtxp, 1}; @@ -871,7 +871,7 @@ class TraceVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstCFunc* nodep) override { - UINFO(8, " CFUNC " << nodep << endl); + UINFO(8, " CFUNC " << nodep); V3GraphVertex* const funcVtxp = getCFuncVertexp(nodep); if (!m_finding) { // If public, we need a unique activity code to allow for sets // directly in this func @@ -888,7 +888,7 @@ class TraceVisitor final : public VNVisitor { iterateChildren(nodep); } void visit(AstTraceDecl* nodep) override { - UINFO(8, " TRACE " << nodep << endl); + UINFO(8, " TRACE " << nodep); if (!m_finding) { V3GraphVertex* const vertexp = new TraceTraceVertex{&m_graph, nodep}; nodep->user1p(vertexp); @@ -944,7 +944,7 @@ public: // Trace class functions void V3Trace::traceAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { TraceVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("trace", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp index 1b4afbf44..35b0459f5 100644 --- a/src/V3TraceDecl.cpp +++ b/src/V3TraceDecl.cpp @@ -290,7 +290,7 @@ class TraceDeclVisitor final : public VNVisitor { void fixupPlaceholders() { // Fix up cell initialization placehodlers - UINFO(9, "fixupPlaceholders()\n"); + UINFO(9, "fixupPlaceholders()"); for (const auto& item : m_cellInitPlaceholders) { const AstScope* const parentp = std::get<0>(item); const AstCell* const cellp = std::get<1>(item); @@ -331,7 +331,7 @@ class TraceDeclVisitor final : public VNVisitor { if (!v3Global.opt.debugCheck()) return; checkCallsRecurse(funcp); if (!m_declUncalledps.empty()) { - for (auto tracep : m_declUncalledps) UINFO(0, "-nodep " << tracep << "\n"); + for (auto tracep : m_declUncalledps) UINFO(0, "-nodep " << tracep); (*(m_declUncalledps.begin()))->v3fatalSrc("Created TraceDecl which is never called"); } } @@ -347,7 +347,7 @@ class TraceDeclVisitor final : public VNVisitor { // VISITORS void visit(AstScope* nodep) override { - UINFO(9, "visit " << nodep << "\n"); + UINFO(9, "visit " << nodep); UASSERT_OBJ(!m_currScopep, nodep, "Should not nest"); UASSERT_OBJ(m_subFuncps.empty(), nodep, "Should not nest"); UASSERT_OBJ(m_entries.empty(), nodep, "Should not nest"); @@ -716,7 +716,7 @@ public: // Trace class functions void V3TraceDecl::traceDeclAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { TraceDeclVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("tracedecl", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index c7f889f6c..c5edf8c12 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -200,7 +200,7 @@ private: TristateVertex* makeVertex(AstNode* nodep) { TristateVertex* vertexp = reinterpret_cast(nodep->user4p()); if (!vertexp) { - UINFO(6, " New vertex " << nodep << endl); + UINFO(6, " New vertex " << nodep); vertexp = new TristateVertex{&m_graph, nodep}; nodep->user4p(vertexp); } @@ -215,7 +215,7 @@ private: if (!vtxp->isTristate()) return; // tristate involved if (vtxp->user() == 1) return; vtxp->user(1); // Recursed - UINFO(9, " Mark tri " << level << " " << vtxp << endl); + UINFO(9, " Mark tri " << level << " " << vtxp); if (!vtxp->varp()) { // not a var where we stop the recursion for (V3GraphEdge& edge : vtxp->outEdges()) { TristateVertex* const vvertexp = static_cast(edge.top()); @@ -252,7 +252,7 @@ private: if (!(vtxp->isTristate() || vtxp->feedsTri())) return; // tristate involved if (vtxp->user() == 3) return; vtxp->user(3); // Recursed - UINFO(9, " Mark feedstri " << level << " " << vtxp << endl); + UINFO(9, " Mark feedstri " << level << " " << vtxp); if (!vtxp->varp()) { // not a var where we stop the recursion for (V3GraphEdge& edge : vtxp->inEdges()) { TristateVertex* const vvertexp = static_cast(edge.fromp()); @@ -283,7 +283,7 @@ public: AstNode::user4ClearTree(); // Wipe all node user4p's that point to vertexes } void graphWalk(AstNodeModule* nodep) { - UINFO(9, " Walking " << nodep << endl); + UINFO(9, " Walking " << nodep); for (V3GraphVertex& vtx : m_graph.vertices()) { graphWalkRecurseFwd(static_cast(&vtx), 0); } @@ -353,13 +353,13 @@ class TristatePinVisitor final : public TristateBaseVisitor { void visit(AstVarRef* nodep) override { UASSERT_OBJ(!nodep->access().isRW(), nodep, "Tristate unexpected on R/W access flip"); if (m_lvalue && !nodep->access().isWriteOrRW()) { - UINFO(9, " Flip-to-LValue " << nodep << endl); + UINFO(9, " Flip-to-LValue " << nodep); nodep->access(VAccess::WRITE); } else if (!m_lvalue && !nodep->access().isReadOnly()) { - UINFO(9, " Flip-to-RValue " << nodep << endl); + UINFO(9, " Flip-to-RValue " << nodep); nodep->access(VAccess::READ); // Mark the ex-output as tristated - UINFO(9, " setTristate-subpin " << nodep->varp() << endl); + UINFO(9, " setTristate-subpin " << nodep->varp()); m_tgraph.setTristate(nodep->varp()); } } @@ -490,7 +490,7 @@ class TristateVisitor final : public TristateBaseVisitor { = new AstVar{invarp->fileline(), isTop ? VVarType::VAR : VVarType::MODULETEMP, invarp->name() + "__en", invarp}; // Inherited VDirection::INPUT - UINFO(9, " newenv " << newp << endl); + UINFO(9, " newenv " << newp); modAddStmtp(invarp, newp); invarp->user1p(newp); // find envar given invarp } @@ -544,7 +544,7 @@ class TristateVisitor final : public TristateBaseVisitor { = new AstVar{invarp->fileline(), isTop ? VVarType::VAR : VVarType::MODULETEMP, invarp->name() + "__out", invarp}; // Inherited VDirection::OUTPUT - UINFO(9, " newout " << newp << endl); + UINFO(9, " newout " << newp); modAddStmtp(invarp, newp); m_varAux(invarp).outVarp = newp; // find outvar given invarp } @@ -553,13 +553,13 @@ class TristateVisitor final : public TristateBaseVisitor { AstVar* getCreateUnconnVarp(AstNode* fromp, AstNodeDType* dtypep) { AstVar* const newp = new AstVar{fromp->fileline(), VVarType::MODULETEMP, "__Vtriunconn" + cvtToStr(m_unique++), dtypep}; - UINFO(9, " newunc " << newp << endl); + UINFO(9, " newunc " << newp); modAddStmtp(newp, newp); return newp; } void mapInsertLhsVarRef(AstVarRef* nodep) { - UINFO(9, " mapInsertLhsVarRef " << nodep << endl); + UINFO(9, " mapInsertLhsVarRef " << nodep); AstVar* const key = nodep->varp(); const auto pair = m_lhsmap.emplace(key, nullptr); if (pair.second) pair.first->second = new RefStrengthVec; @@ -619,12 +619,12 @@ class TristateVisitor final : public TristateBaseVisitor { if (it == m_lhsmap.end()) { // This variable is floating, set output enable to // always be off on this assign - UINFO(8, " Adding driver to var " << varp << endl); + UINFO(8, " Adding driver to var " << varp); AstConst* const constp = newAllZerosOrOnes(varp, false); AstVarRef* const varrefp = new AstVarRef{varp->fileline(), varp, VAccess::WRITE}; AstNode* const newp = new AstAssignW{varp->fileline(), varrefp, constp}; - UINFO(9, " newoev " << newp << endl); + UINFO(9, " newoev " << newp); varrefp->user1p(newAllZerosOrOnes(varp, false)); nodep->addStmtsp(newp); mapInsertLhsVarRef(varrefp); // insertTristates will convert @@ -645,7 +645,7 @@ class TristateVisitor final : public TristateBaseVisitor { if (m_tgraph.isTristate(invarp)) { insertTristatesSignal(nodep, invarp, refsp); } else { - UINFO(8, " NO TRISTATE ON:" << invarp << endl); + UINFO(8, " NO TRISTATE ON:" << invarp); } // Delete the map and vector list now that we have expanded it. m_lhsmap.erase(invarp); @@ -669,7 +669,7 @@ class TristateVisitor final : public TristateBaseVisitor { AstVar* const newLhsp = new AstVar{varp->fileline(), VVarType::MODULETEMP, varp->name() + "__out" + cvtToStr(m_unique), varp}; // 2-state ok; sep enable - UINFO(9, " newout " << newLhsp << endl); + UINFO(9, " newout " << newLhsp); nodep->addStmtsp(newLhsp); refp->varp(newLhsp); @@ -677,13 +677,13 @@ class TristateVisitor final : public TristateBaseVisitor { AstVar* const newEnLhsp = new AstVar{varp->fileline(), VVarType::MODULETEMP, varp->name() + "__en" + cvtToStr(m_unique++), envarp}; // 2-state ok - UINFO(9, " newenlhsp " << newEnLhsp << endl); + UINFO(9, " newenlhsp " << newEnLhsp); nodep->addStmtsp(newEnLhsp); AstNode* const enLhspAssignp = new AstAssignW{ refp->fileline(), new AstVarRef{refp->fileline(), newEnLhsp, VAccess::WRITE}, getEnp(refp)}; - UINFO(9, " newenlhspAssignp " << enLhspAssignp << endl); + UINFO(9, " newenlhspAssignp " << enLhspAssignp); nodep->addStmtsp(enLhspAssignp); // now append this driver to the driver logic. @@ -699,17 +699,17 @@ class TristateVisitor final : public TristateBaseVisitor { } AstNode* const assp = new AstAssignW{ varp->fileline(), new AstVarRef{varp->fileline(), varp, VAccess::WRITE}, orp}; - UINFO(9, " newassp " << assp << endl); + UINFO(9, " newassp " << assp); nodep->addStmtsp(assp); AstNode* const enAssp = new AstAssignW{ envarp->fileline(), new AstVarRef{envarp->fileline(), envarp, VAccess::WRITE}, enp}; - UINFO(9, " newenassp " << enAssp << endl); + UINFO(9, " newenassp " << enAssp); nodep->addStmtsp(enAssp); } void insertTristatesSignal(AstNodeModule* nodep, AstVar* const invarp, RefStrengthVec* refsp) { - UINFO(8, " TRISTATE EXPANDING:" << invarp << endl); + UINFO(8, " TRISTATE EXPANDING:" << invarp); ++m_statTriSigs; m_tgraph.didProcess(invarp); @@ -734,7 +734,7 @@ class TristateVisitor final : public TristateBaseVisitor { outvarp = getCreateOutVarp(invarp, isTopInout); outvarp->varType2Out(); lhsp = outvarp; // Must assign to __out, not to normal input signal - UINFO(9, " TRISTATE propagates up with " << lhsp << endl); + UINFO(9, " TRISTATE propagates up with " << lhsp); // Create an output enable port (__en) // May already be created if have foo === 1'bz somewhere envarp @@ -742,7 +742,7 @@ class TristateVisitor final : public TristateBaseVisitor { // outvarp->user1p(envarp); m_varAux(outvarp).pullp = m_varAux(invarp).pullp; // AstPull* propagation - if (m_varAux(invarp).pullp) UINFO(9, "propagate pull to " << outvarp << endl); + if (m_varAux(invarp).pullp) UINFO(9, "propagate pull to " << outvarp); } else if (invarp->user1p()) { envarp = VN_AS(invarp->user1p(), Var); // From CASEEQ, foo === 1'bz } @@ -766,13 +766,13 @@ class TristateVisitor final : public TristateBaseVisitor { // var__strength variable AstVar* varStrengthp = new AstVar{fl, VVarType::MODULETEMP, strengthVarName, invarp}; // 2-state ok; sep enable; - UINFO(9, " newstrength " << varStrengthp << endl); + UINFO(9, " newstrength " << varStrengthp); nodep->addStmtsp(varStrengthp); // var__strength__en variable AstVar* enVarStrengthp = new AstVar{fl, VVarType::MODULETEMP, strengthVarName + "__en", invarp}; // 2-state ok; - UINFO(9, " newenstrength " << enVarStrengthp << endl); + UINFO(9, " newenstrength " << enVarStrengthp); nodep->addStmtsp(enVarStrengthp); aggregateTriSameStrength(nodep, varStrengthp, enVarStrengthp, beginStrength, @@ -1044,7 +1044,7 @@ class TristateVisitor final : public TristateBaseVisitor { // VISITORS void visit(AstConst* nodep) override { - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (m_graphing) { if (!m_alhs && nodep->num().hasZ()) m_tgraph.setTristate(nodep); } else { @@ -1055,7 +1055,7 @@ class TristateVisitor final : public TristateBaseVisitor { // We can ignore the output override by making a temporary AstVar* const varp = getCreateUnconnVarp(nodep, nodep->dtypep()); AstNode* const newp = new AstVarRef{nodep->fileline(), varp, VAccess::WRITE}; - UINFO(9, " const->" << newp << endl); + UINFO(9, " const->" << newp); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } else if (m_tgraph.isTristate(nodep)) { @@ -1089,7 +1089,7 @@ class TristateVisitor final : public TristateBaseVisitor { return; } iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); // Generate the new output enable signal for this cond if either // expression 1 or 2 have an output enable '__en' signal. If the // condition has an enable, not sure what to do, so generate an @@ -1109,7 +1109,7 @@ class TristateVisitor final : public TristateBaseVisitor { // two expressions with the same conditional. AstNodeExpr* const enp = new AstCond{nodep->fileline(), condp->cloneTree(false), en1p, en2p}; - UINFO(9, " newcond " << enp << endl); + UINFO(9, " newcond " << enp); nodep->user1p(enp); // propagate up COND(lhsp->enable, rhsp->enable) thenp->user1p(nullptr); elsep->user1p(nullptr); @@ -1139,7 +1139,7 @@ class TristateVisitor final : public TristateBaseVisitor { } } else { if (m_alhs) { - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (nodep->user1p()) { // Form a "deposit" instruction. Would be nicer if we made this a new AST type AstNodeExpr* const newp @@ -1151,7 +1151,7 @@ class TristateVisitor final : public TristateBaseVisitor { iterateChildren(nodep); } else { iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (nodep->lsbp()->user1p()) { nodep->v3warn(E_UNSUPPORTED, "Unsupported RHS tristate construct: " << nodep->prettyTypeName()); @@ -1161,7 +1161,7 @@ class TristateVisitor final : public TristateBaseVisitor { AstNodeExpr* const enp = new AstSel{nodep->fileline(), en1p, nodep->lsbp()->cloneTreePure(true), nodep->widthp()->cloneTree(true)}; - UINFO(9, " newsel " << enp << endl); + UINFO(9, " newsel " << enp); nodep->user1p(enp); // propagate up SEL(fromp->enable, value) m_tgraph.didProcess(nodep); } @@ -1181,7 +1181,7 @@ class TristateVisitor final : public TristateBaseVisitor { } } else { if (m_alhs) { - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (nodep->user1p()) { // Each half of the concat gets a select of the enable expression AstNodeExpr* const enp = VN_AS(nodep->user1p(), NodeExpr); @@ -1196,7 +1196,7 @@ class TristateVisitor final : public TristateBaseVisitor { iterateChildren(nodep); } else { iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); // Generate the new output enable signal, just as a concat // identical to the data concat AstNodeExpr* const expr1p = nodep->lhsp(); @@ -1206,7 +1206,7 @@ class TristateVisitor final : public TristateBaseVisitor { AstNodeExpr* const en1p = getEnp(expr1p); AstNodeExpr* const en2p = getEnp(expr2p); AstNodeExpr* const enp = new AstConcat{nodep->fileline(), en1p, en2p}; - UINFO(9, " newconc " << enp << endl); + UINFO(9, " newconc " << enp); nodep->user1p(enp); // propagate up CONCAT(lhsp->enable, rhsp->enable) expr1p->user1p(nullptr); expr2p->user1p(nullptr); @@ -1218,7 +1218,7 @@ class TristateVisitor final : public TristateBaseVisitor { void visit(AstBufIf1* nodep) override { // For BufIf1, the enable is the LHS expression iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (m_graphing) { associateLogic(nodep->rhsp(), nodep); m_tgraph.setTristate(nodep); @@ -1242,15 +1242,15 @@ class TristateVisitor final : public TristateBaseVisitor { expr2p->user1p(enp); // Becomes new node // Don't need the BufIf any more, can just have the data direct nodep->replaceWith(expr2p); - UINFO(9, " bufif datap=" << expr2p << endl); - UINFO(9, " bufif enp=" << enp << endl); + UINFO(9, " bufif datap=" << expr2p); + UINFO(9, " bufif enp=" << enp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } } void visitAndOr(AstNodeBiop* nodep, bool isAnd) { iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (m_graphing) { associateLogic(nodep->lhsp(), nodep); associateLogic(nodep->rhsp(), nodep); @@ -1293,7 +1293,7 @@ class TristateVisitor final : public TristateBaseVisitor { new AstOr{nodep->fileline(), new AstAnd{nodep->fileline(), en1p->cloneTree(false), subexpr1p}, new AstAnd{nodep->fileline(), en2p->cloneTree(false), subexpr2p}}}; - UINFO(9, " neweqn " << enp << endl); + UINFO(9, " neweqn " << enp); nodep->user1p(enp); expr1p->user1p(nullptr); expr2p->user1p(nullptr); @@ -1327,7 +1327,7 @@ class TristateVisitor final : public TristateBaseVisitor { } nodep->user2(U2_NONGRAPH); iterateAndNextNull(nodep->rhsp()); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (debug() >= 9) nodep->dumpTree("- assign: "); // if the rhsp of this assign statement has an output enable driver, // then propagate the corresponding output enable assign statement. @@ -1336,7 +1336,7 @@ class TristateVisitor final : public TristateBaseVisitor { if (nodep->rhsp()->user1p()) { nodep->lhsp()->user1p(nodep->rhsp()->user1p()); nodep->rhsp()->user1p(nullptr); - UINFO(9, " enp<-rhs " << nodep->lhsp()->user1p() << endl); + UINFO(9, " enp<-rhs " << nodep->lhsp()->user1p()); m_tgraph.didProcess(nodep); } m_alhs = true; // And user1p() will indicate tristate equation, if any @@ -1373,7 +1373,7 @@ class TristateVisitor final : public TristateBaseVisitor { // Otherwise we'd need to attach an enable to every signal, then optimize them // away later when we determine the signal has no tristate iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); // Constification always moves const to LHS AstConst* const constp = VN_CAST(nodep->lhsp(), Const); if (constp && constp->user1p()) { @@ -1397,7 +1397,7 @@ class TristateVisitor final : public TristateBaseVisitor { // Keep the caseeq if there are X's present new AstEqCase{fl, new AstConst{fl, oneIfEnOne}, rhsp}}; if (neq) newp = new AstLogNot{fl, newp}; - UINFO(9, " newceq " << newp << endl); + UINFO(9, " newceq " << newp); if (debug() >= 9) nodep->dumpTree("- caseeq-old: "); if (debug() >= 9) newp->dumpTree("- caseeq-new: "); nodep->replaceWith(newp); @@ -1413,7 +1413,7 @@ class TristateVisitor final : public TristateBaseVisitor { new AstEqCase{fl, constp, rhsp}}; if (neq) newp = new AstLogNot{fl, newp}; rhsp->user1p(nullptr); - UINFO(9, " newceq " << newp << endl); + UINFO(9, " newceq " << newp); if (debug() >= 9) nodep->dumpTree("- caseeq-old: "); if (debug() >= 9) newp->dumpTree("- caseeq-new: "); nodep->replaceWith(newp); @@ -1446,7 +1446,7 @@ class TristateVisitor final : public TristateBaseVisitor { dropop[0] = VN_IS(nodep->rhsp(), Const) && VN_AS(nodep->rhsp(), Const)->num().isAnyZ(); dropop[1] = VN_IS(nodep->thsp(), Const) && VN_AS(nodep->thsp(), Const)->num().isAnyZ(); dropop[2] = VN_IS(nodep->fhsp(), Const) && VN_AS(nodep->fhsp(), Const)->num().isAnyZ(); - UINFO(4, " COUNTBITS(" << dropop[0] << dropop[1] << dropop[2] << " " << nodep << endl); + UINFO(4, " COUNTBITS(" << dropop[0] << dropop[1] << dropop[2] << " " << nodep); if (m_graphing) { iterateAndNextNull(nodep->lhsp()); if (!dropop[0]) iterateAndNextNull(nodep->rhsp()); @@ -1475,7 +1475,7 @@ class TristateVisitor final : public TristateBaseVisitor { } AstVar* const envarp = getCreateEnVarp(varrefp->varp(), false); // If any drops, we need to add in the count of Zs (from __en) - UINFO(4, " COUNTBITS('z)-> " << nodep << endl); + UINFO(4, " COUNTBITS('z)-> " << nodep); VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); AstNodeExpr* newp = new AstCountOnes{ @@ -1502,7 +1502,7 @@ class TristateVisitor final : public TristateBaseVisitor { } } void visit(AstPull* nodep) override { - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); AstVarRef* varrefp = nullptr; if (VN_IS(nodep->lhsp(), VarRef)) { varrefp = VN_AS(nodep->lhsp(), VarRef); @@ -1590,7 +1590,7 @@ class TristateVisitor final : public TristateBaseVisitor { return; // No __en signals on this pin } // Tristate exists: - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (debug() >= 9) nodep->dumpTree("- pin-pre: "); // Empty/in-only; need Z to propagate @@ -1602,7 +1602,7 @@ class TristateVisitor final : public TristateBaseVisitor { // to have this. && !nodep->modVarp()->declDirection().isWritable()); if (!nodep->exprp()) { // No-connect; covert to empty connection - UINFO(5, "Unconnected pin terminate " << nodep << endl); + UINFO(5, "Unconnected pin terminate " << nodep); AstVar* const ucVarp = getCreateUnconnVarp(nodep, nodep->modVarp()->dtypep()); nodep->exprp(new AstVarRef{nodep->fileline(), ucVarp, // We converted, so use declaration output state @@ -1616,7 +1616,7 @@ class TristateVisitor final : public TristateBaseVisitor { // the input value. So make a temporary connection. const AstAssignW* const reAssignp = V3Inst::pinReconnectSimple(nodep, m_cellp, true, true); - UINFO(5, "Input pin buffering: " << reAssignp << endl); + UINFO(5, "Input pin buffering: " << reAssignp); m_tgraph.setTristate(reAssignp->lhsp()); } @@ -1634,18 +1634,18 @@ class TristateVisitor final : public TristateBaseVisitor { } else { enModVarp->varType2Out(); } - UINFO(9, " newenv " << enVarp << endl); + UINFO(9, " newenv " << enVarp); AstPin* const enpinp = new AstPin{nodep->fileline(), nodep->pinNum(), enModVarp->name(), // should be {var}"__en" new AstVarRef{nodep->fileline(), enVarp, VAccess::WRITE}}; enpinp->modVarp(enModVarp); - UINFO(9, " newpin " << enpinp << endl); + UINFO(9, " newpin " << enpinp); enpinp->user2(U2_BOTH); // don't iterate the pin later nodep->addNextHere(enpinp); m_modp->addStmtsp(enVarp); enrefp = new AstVarRef{nodep->fileline(), enVarp, VAccess::READ}; - UINFO(9, " newvrf " << enrefp << endl); + UINFO(9, " newvrf " << enrefp); if (debug() >= 9) enpinp->dumpTree("- pin-ena: "); } // Create new output pin @@ -1665,7 +1665,7 @@ class TristateVisitor final : public TristateBaseVisitor { outModVarp->name(), // should be {var}"__out" outexprp}; outpinp->modVarp(outModVarp); - UINFO(9, " newpin " << outpinp << endl); + UINFO(9, " newpin " << outpinp); outpinp->user2(U2_BOTH); // don't iterate the pin later nodep->addNextHere(outpinp); // Simplify @@ -1715,7 +1715,7 @@ class TristateVisitor final : public TristateBaseVisitor { } } if (exprrefp) { - UINFO(9, "outref " << exprrefp << endl); + UINFO(9, "outref " << exprrefp); // Mark as now tristated; iteration will pick it up from there exprrefp->user1p(enrefp); if (!outAssignp) { @@ -1727,7 +1727,7 @@ class TristateVisitor final : public TristateBaseVisitor { // Propagate any pullups/pulldowns upwards if necessary if (exprrefp) { if (AstPull* const pullp = m_varAux(nodep->modVarp()).pullp) { - UINFO(9, "propagate pull on " << exprrefp << endl); + UINFO(9, "propagate pull on " << exprrefp); setPullDirection(exprrefp->varp(), pullp); } } @@ -1741,13 +1741,13 @@ class TristateVisitor final : public TristateBaseVisitor { else { if (nodep->user2() & U2_NONGRAPH) return; // This pin is already expanded nodep->user2(U2_NONGRAPH); - UINFO(9, " " << nodep << endl); + UINFO(9, " " << nodep); iteratePinGuts(nodep); } } void visit(AstVarRef* nodep) override { - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (m_graphing) { if (nodep->access().isWriteOrRW()) associateLogic(nodep, nodep->varp()); if (nodep->access().isReadOrRW()) associateLogic(nodep->varp(), nodep); @@ -1758,7 +1758,7 @@ class TristateVisitor final : public TristateBaseVisitor { // VarMap so that after the walk through the module we can expand // any tristate logic on the driver. if (nodep->access().isWriteOrRW() && m_tgraph.isTristate(nodep->varp())) { - UINFO(9, " Ref-to-lvalue " << nodep << endl); + UINFO(9, " Ref-to-lvalue " << nodep); UASSERT_OBJ(!nodep->access().isRW(), nodep, "Tristate unexpected on R/W access"); m_tgraph.didProcess(nodep); mapInsertLhsVarRef(nodep); @@ -1770,7 +1770,7 @@ class TristateVisitor final : public TristateBaseVisitor { // and in a position where it feeds upstream to another tristate && m_tgraph.feedsTri(nodep)) { // Then propagate the enable from the original variable - UINFO(9, " Ref-to-tri " << nodep << endl); + UINFO(9, " Ref-to-tri " << nodep); AstVar* const enVarp = getCreateEnVarp(nodep->varp(), false); nodep->user1p(new AstVarRef{nodep->fileline(), enVarp, VAccess::READ}); } @@ -1780,7 +1780,7 @@ class TristateVisitor final : public TristateBaseVisitor { void visit(AstVar* nodep) override { iterateChildren(nodep); - UINFO(9, dbgState() << nodep << endl); + UINFO(9, dbgState() << nodep); if (m_graphing) { // If tri0/1 force a pullup if (nodep->user2() & U2_GRAPHING) return; // Already processed @@ -1789,7 +1789,7 @@ class TristateVisitor final : public TristateBaseVisitor { AstNode* const newp = new AstPull{ nodep->fileline(), new AstVarRef{nodep->fileline(), nodep, VAccess::WRITE}, nodep->isPullup()}; - UINFO(9, " newpul " << newp << endl); + UINFO(9, " newpul " << newp); nodep->addNextHere(newp); // We'll iterate on the new AstPull later } @@ -1800,7 +1800,7 @@ class TristateVisitor final : public TristateBaseVisitor { // possibly create connection errors. // One example of problems is this: "output z; task t; z <= {something}; endtask" ) { - UINFO(9, " setTristate-inout " << nodep << endl); + UINFO(9, " setTristate-inout " << nodep); m_tgraph.setTristate(nodep); } } else { // !graphing @@ -1812,7 +1812,7 @@ class TristateVisitor final : public TristateBaseVisitor { } void visit(AstNodeModule* nodep) override { - UINFO(8, nodep << endl); + UINFO(8, nodep); VL_RESTORER(m_modp); VL_RESTORER(m_graphing); VL_RESTORER(m_unique); @@ -1895,7 +1895,7 @@ public: // Tristate class functions void V3Tristate::tristateAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { TristateVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("tristate", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Udp.cpp b/src/V3Udp.cpp index 9256a2a78..1570a2614 100644 --- a/src/V3Udp.cpp +++ b/src/V3Udp.cpp @@ -231,7 +231,7 @@ public: }; void V3Udp::udpResolve(AstNetlist* rootp) { - UINFO(4, __FUNCTION__ << ": " << endl); + UINFO(4, __FUNCTION__ << ": "); { const UdpVisitor visitor{rootp}; } // Destruct before checking V3Global::dumpCheckGlobalTree("udp", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index c9ae78929..ca8492353 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -57,7 +57,7 @@ public: // CONSTRUCTORS explicit UndrivenVarEntry(AstVar* varp) : m_varp(varp) { // Construction for when a var is used - UINFO(9, "create " << varp << endl); + UINFO(9, "create " << varp); m_wholeFlags.resize(FLAGS_PER_BIT); for (int i = 0; i < FLAGS_PER_BIT; i++) m_wholeFlags[i] = false; m_bitFlags.resize(varp->width() * FLAGS_PER_BIT); @@ -114,11 +114,11 @@ private: public: void usedWhole() { - UINFO(9, "set u[*] " << m_varp->name() << endl); + UINFO(9, "set u[*] " << m_varp->name()); m_wholeFlags[FLAG_USED] = true; } void drivenWhole() { - UINFO(9, "set d[*] " << m_varp->name() << endl); + UINFO(9, "set d[*] " << m_varp->name()); m_wholeFlags[FLAG_DRIVEN] = true; } void drivenWhole(const AstNodeVarRef* nodep, const FileLine* fileLinep) { @@ -145,13 +145,13 @@ public: const AstAlways* getAlwCombp() const { return m_alwCombp; } const FileLine* getAlwCombFileLinep() const { return m_alwCombFileLinep; } void usedBit(int bit, int width) { - UINFO(9, "set u[" << (bit + width - 1) << ":" << bit << "] " << m_varp->name() << endl); + UINFO(9, "set u[" << (bit + width - 1) << ":" << bit << "] " << m_varp->name()); for (int i = 0; i < width; i++) { if (bitNumOk(bit + i)) m_bitFlags[(bit + i) * FLAGS_PER_BIT + FLAG_USED] = true; } } void drivenBit(int bit, int width) { - UINFO(9, "set d[" << (bit + width - 1) << ":" << bit << "] " << m_varp->name() << endl); + UINFO(9, "set d[" << (bit + width - 1) << ":" << bit << "] " << m_varp->name()); for (int i = 0; i < width; i++) { if (bitNumOk(bit + i)) m_bitFlags[(bit + i) * FLAGS_PER_BIT + FLAG_DRIVEN] = true; } @@ -382,7 +382,7 @@ class UndrivenVisitor final : public VNVisitorConst { // Don't warn if already driven earlier as "a=0; if(a) a=1;" is fine. if (usr == 2 && m_alwaysCombp && entryp->isUsedNotDrivenBit(lsb, nodep->width())) { - UINFO(9, " Select. Entryp=" << cvtToHex(entryp) << endl); + UINFO(9, " Select. Entryp=" << cvtToHex(entryp)); warnAlwCombOrder(varrefp); } entryp->drivenBit(lsb, nodep->width()); @@ -426,7 +426,7 @@ class UndrivenVisitor final : public VNVisitorConst { && nodep->varp()->attrFileDescr(); // FD's are also being read from if (m_inBBox || nodep->access().isWriteOrRW()) { if (usr == 2 && m_alwaysCombp && entryp->isUsedNotDrivenAny()) { - UINFO(9, " Full bus. Entryp=" << cvtToHex(entryp) << endl); + UINFO(9, " Full bus. Entryp=" << cvtToHex(entryp)); warnAlwCombOrder(nodep); } if (entryp->isDrivenWhole() && !m_inBBox && !VN_IS(nodep, VarXRef) @@ -516,13 +516,13 @@ class UndrivenVisitor final : public VNVisitorConst { AstNode::user2ClearTree(); m_alwaysp = nodep; if (nodep->keyword() == VAlwaysKwd::ALWAYS_COMB) { - UINFO(9, " " << nodep << endl); + UINFO(9, " " << nodep); m_alwaysCombp = nodep; } else { m_alwaysCombp = nullptr; } iterateChildrenConst(nodep); - if (nodep->keyword() == VAlwaysKwd::ALWAYS_COMB) UINFO(9, " Done " << nodep << endl); + if (nodep->keyword() == VAlwaysKwd::ALWAYS_COMB) UINFO(9, " Done " << nodep); } void visit(AstNodeFTaskRef* nodep) override { VL_RESTORER(m_inFTaskRef); @@ -570,7 +570,7 @@ public: // Undriven class functions void V3Undriven::undrivenAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { UndrivenVisitor{nodep}; } if (v3Global.opt.stats()) V3Stats::statsStage("undriven"); } diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp index 5ad89aece..6a489fb16 100644 --- a/src/V3Unknown.cpp +++ b/src/V3Unknown.cpp @@ -84,7 +84,7 @@ class UnknownVisitor final : public VNVisitor { if (m_assignwp) { // Wire assigns must become always statements to deal with insertion // of multiple statements. Perhaps someday make all wassigns into always's? - UINFO(5, " IM_WireRep " << m_assignwp << endl); + UINFO(5, " IM_WireRep " << m_assignwp); m_assignwp->convertToAlways(); VL_DO_CLEAR(pushDeletep(m_assignwp), m_assignwp = nullptr); } @@ -115,7 +115,7 @@ class UnknownVisitor final : public VNVisitor { VNRelinker replaceHandle; AstNodeExpr* const earliercondp = ifp->condp()->unlinkFrBack(&replaceHandle); AstNodeExpr* const newp = new AstLogAnd{condp->fileline(), condp, earliercondp}; - UINFO(4, "Edit BOUNDLVALUE " << newp << endl); + UINFO(4, "Edit BOUNDLVALUE " << newp); replaceHandle.relink(newp); } else { AstVar* const varp @@ -142,7 +142,7 @@ class UnknownVisitor final : public VNVisitor { // VISITORS void visit(AstNodeModule* nodep) override { - UINFO(4, " MOD " << nodep << endl); + UINFO(4, " MOD " << nodep); VL_RESTORER(m_modp); VL_RESTORER(m_constXCvt); VL_RESTORER(m_allowXUnique); @@ -195,7 +195,7 @@ class UnknownVisitor final : public VNVisitor { iterateChildren(nodep); } void visitEqNeqCase(AstNodeBiop* nodep) { - UINFO(4, " N/EQCASE->EQ " << nodep << endl); + UINFO(4, " N/EQCASE->EQ " << nodep); V3Const::constifyEdit(nodep->lhsp()); // lhsp may change V3Const::constifyEdit(nodep->rhsp()); // rhsp may change if (VN_IS(nodep->lhsp(), Const) && VN_IS(nodep->rhsp(), Const)) { @@ -227,7 +227,7 @@ class UnknownVisitor final : public VNVisitor { } } void visitEqNeqWild(AstNodeBiop* nodep) { - UINFO(4, " N/EQWILD->EQ " << nodep << endl); + UINFO(4, " N/EQWILD->EQ " << nodep); V3Const::constifyEdit(nodep->lhsp()); // lhsp may change V3Const::constifyEdit(nodep->rhsp()); // rhsp may change if (VN_IS(nodep->lhsp(), Const) && VN_IS(nodep->rhsp(), Const)) { @@ -275,7 +275,7 @@ class UnknownVisitor final : public VNVisitor { void visit(AstIsUnknown* nodep) override { iterateChildren(nodep); // Ahh, we're two state, so this is easy - UINFO(4, " ISUNKNOWN->0 " << nodep << endl); + UINFO(4, " ISUNKNOWN->0 " << nodep); AstConst* const newp = new AstConst{nodep->fileline(), AstConst::BitFalse{}}; nodep->replaceWith(newp); VL_DO_DANGLING(nodep->deleteTree(), nodep); @@ -286,7 +286,7 @@ class UnknownVisitor final : public VNVisitor { dropop[0] = VN_IS(nodep->rhsp(), Const) && VN_AS(nodep->rhsp(), Const)->num().isAnyX(); dropop[1] = VN_IS(nodep->thsp(), Const) && VN_AS(nodep->thsp(), Const)->num().isAnyX(); dropop[2] = VN_IS(nodep->fhsp(), Const) && VN_AS(nodep->fhsp(), Const)->num().isAnyX(); - UINFO(4, " COUNTBITS(" << dropop[0] << dropop[1] << dropop[2] << " " << nodep << endl); + UINFO(4, " COUNTBITS(" << dropop[0] << dropop[1] << dropop[2] << " " << nodep); AstNodeExpr* nonXp = nullptr; if (!dropop[0]) { @@ -296,7 +296,7 @@ class UnknownVisitor final : public VNVisitor { } else if (!dropop[2]) { nonXp = nodep->fhsp(); } else { // Was all X-s - UINFO(4, " COUNTBITS('x)->0 " << nodep << endl); + UINFO(4, " COUNTBITS('x)->0 " << nodep); AstConst* const newp = new AstConst{nodep->fileline(), AstConst::BitFalse{}}; nodep->replaceWith(newp); VL_DO_DANGLING(nodep->deleteTree(), nodep); @@ -318,7 +318,7 @@ class UnknownVisitor final : public VNVisitor { } void visit(AstConst* nodep) override { if (m_constXCvt && nodep->num().isFourState()) { - UINFO(4, " CONST4 " << nodep << endl); + UINFO(4, " CONST4 " << nodep); if (debug() >= 9) nodep->dumpTree("- Const_old: "); // CONST(num) -> VARREF(newvarp) // -> VAR(newvarp) @@ -338,7 +338,7 @@ class UnknownVisitor final : public VNVisitor { AstConst* const newp = new AstConst{nodep->fileline(), numnew}; nodep->replaceWith(newp); VL_DO_DANGLING(nodep->deleteTree(), nodep); - UINFO(4, " -> " << newp << endl); + UINFO(4, " -> " << newp); } else { // Make a Vxrand variable // We use the special XTEMP type so it doesn't break pure functions @@ -457,7 +457,7 @@ class UnknownVisitor final : public VNVisitor { if (modconstp->width() <= 32 && modconstp->toUInt() <= static_cast(declElements)) { UINFO(9, "arraysel mod const " << declElements - << " >= " << modconstp->toUInt() << endl); + << " >= " << modconstp->toUInt()); return; } } @@ -530,7 +530,7 @@ const std::string UnknownVisitor::m_xrandPrefix = "__Vxrand"; // Unknown class functions void V3Unknown::unknownAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { UnknownVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("unknown", 0, dumpTreeEitherLevel() >= 3); } diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index d36083c5a..67ed5f1d0 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -57,7 +57,7 @@ class UnrollVisitor final : public VNVisitor { bool cantUnroll(AstNode* nodep, const char* reason) const { if (m_generate) nodep->v3warn(E_UNSUPPORTED, "Unsupported: Can't unroll generate for; " << reason); - UINFO(4, " Can't Unroll: " << reason << " :" << nodep << endl); + UINFO(4, " Can't Unroll: " << reason << " :" << nodep); // if (debug() >= 9) nodep->dumpTree("- cant: "); V3Stats::addStatSum("Unrolling gave up, "s + reason, 1); return false; @@ -85,11 +85,11 @@ class UnrollVisitor final : public VNVisitor { AstNode* const incp, // Maybe under nodep or in bodysp AstNode* bodysp) { // To keep the IF levels low, we return as each test fails. - UINFO(4, " FOR Check " << nodep << endl); - if (initp) UINFO(6, " Init " << initp << endl); - if (precondsp) UINFO(6, " Pcon " << precondsp << endl); - if (condp) UINFO(6, " Cond " << condp << endl); - if (incp) UINFO(6, " Inc " << incp << endl); + UINFO(4, " FOR Check " << nodep); + if (initp) UINFO(6, " Init " << initp); + if (precondsp) UINFO(6, " Pcon " << precondsp); + if (condp) UINFO(6, " Cond " << condp); + if (incp) UINFO(6, " Inc " << incp); if (unrollFull.isSetFalse()) return cantUnroll(nodep, "pragma unroll_disable"); @@ -143,9 +143,9 @@ class UnrollVisitor final : public VNVisitor { // if (m_forVscp) { - UINFO(8, " Loop Variable: " << m_forVscp << endl); + UINFO(8, " Loop Variable: " << m_forVscp); } else { - UINFO(8, " Loop Variable: " << m_forVarp << endl); + UINFO(8, " Loop Variable: " << m_forVarp); } if (debug() >= 9) nodep->dumpTree("- for: "); @@ -210,7 +210,7 @@ class UnrollVisitor final : public VNVisitor { SimulateVisitor simvis; simvis.mainParamEmulate(clonep); if (!simvis.optimizable()) { - UINFO(4, "Unable to simulate" << endl); + UINFO(4, "Unable to simulate"); if (debug() >= 9) nodep->dumpTree("- _simtree: "); VL_DO_DANGLING(clonep->deleteTree(), clonep); return false; @@ -218,7 +218,7 @@ class UnrollVisitor final : public VNVisitor { // Fetch the result V3Number* resp = simvis.fetchNumberNull(clonep); if (!resp) { - UINFO(3, "No number returned from simulation" << endl); + UINFO(3, "No number returned from simulation"); VL_DO_DANGLING(clonep->deleteTree(), clonep); return false; } @@ -265,7 +265,7 @@ class UnrollVisitor final : public VNVisitor { bool forUnroller(AstNode* nodep, const VOptionBool& unrollFull, AstAssign* initp, AstNode* condp, AstNode* precondsp, AstNode* incp, AstNode* bodysp) { - UINFO(9, "forUnroller " << nodep << endl); + UINFO(9, "forUnroller " << nodep); V3Number loopValue{nodep}; if (!simulateTree(initp->rhsp(), nullptr, initp, loopValue)) { // return false; @@ -296,7 +296,7 @@ class UnrollVisitor final : public VNVisitor { if (stmtsp) { int times = 0; while (true) { - UINFO(8, " Looping " << loopValue << endl); + UINFO(8, " Looping " << loopValue); V3Number res{nodep}; if (!simulateTree(condp, &loopValue, nullptr, res)) { nodep->v3error("Loop unrolling failed."); @@ -451,7 +451,7 @@ class UnrollVisitor final : public VNVisitor { void visit(AstVarRef* nodep) override { if (m_varModeCheck && nodep->varp() == m_forVarp && nodep->varScopep() == m_forVscp && nodep->access().isWriteOrRW()) { - UINFO(8, " Itervar assigned to: " << nodep << endl); + UINFO(8, " Itervar assigned to: " << nodep); m_varAssignHit = true; } @@ -506,14 +506,14 @@ UnrollStateful::UnrollStateful() UnrollStateful::~UnrollStateful() { delete m_unrollerp; } void UnrollStateful::unrollGen(AstNodeFor* nodep, const string& beginName) { - UINFO(5, __FUNCTION__ << ": " << endl); + UINFO(5, __FUNCTION__ << ": "); m_unrollerp->process(nodep, true, beginName); } void UnrollStateful::unrollAll(AstNetlist* nodep) { m_unrollerp->process(nodep, false, ""); } void V3Unroll::unrollAll(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { UnrollStateful unroller; unroller.unrollAll(nodep); diff --git a/src/V3VariableOrder.cpp b/src/V3VariableOrder.cpp index ea884cb17..0ab4188f1 100644 --- a/src/V3VariableOrder.cpp +++ b/src/V3VariableOrder.cpp @@ -254,7 +254,7 @@ public: // V3VariableOrder static functions void V3VariableOrder::orderAll(AstNetlist* netlistp) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); MTaskAffinityMap mTaskAffinity; diff --git a/src/V3Width.cpp b/src/V3Width.cpp index ee596ee6c..acc3b0647 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -939,7 +939,7 @@ class WidthVisitor final : public VNVisitor { // Real: Not allowed // Signed: unsigned output, input either // Convert all range values to constants - UINFO(6, "RANGE " << nodep << endl); + UINFO(6, "RANGE " << nodep); V3Const::constifyParamsEdit(nodep->leftp()); // May relink pointed to node V3Const::constifyParamsEdit(nodep->rightp()); // May relink pointed to node checkConstantOrReplace(nodep->leftp(), "left side of bit range isn't a constant"); @@ -1043,7 +1043,7 @@ class WidthVisitor final : public VNVisitor { ? " or " + cvtToStr(nodep->lsbp()->widthMin() / elw) : "") << " bits."); - UINFO(1, " Related node: " << nodep << endl); + UINFO(1, " Related node: " << nodep); } } if (VN_IS(nodep->lsbp(), Const) && nodep->msbConst() > frommsb) { @@ -1057,14 +1057,14 @@ class WidthVisitor final : public VNVisitor { // actually generated. AstNodeVarRef* lrefp = AstNodeVarRef::varRefLValueRecurse(nodep); if (m_doGenerate) { - UINFO(5, "Selection index out of range inside generate\n"); + UINFO(5, "Selection index out of range inside generate"); } else { nodep->v3warn(SELRANGE, "Selection index out of range: " << nodep->msbConst() << ":" << nodep->lsbConst() << " outside " << frommsb << ":" << fromlsb); - UINFO(1, " Related node: " << nodep << endl); + UINFO(1, " Related node: " << nodep); } - if (lrefp) UINFO(9, " Select extend lrefp " << lrefp << endl); + if (lrefp) UINFO(9, " Select extend lrefp " << lrefp); if (lrefp && lrefp->access().isWriteOrRW()) { // lvarref[X] = ..., the expression assigned is too wide // WTF to do @@ -1124,7 +1124,7 @@ class WidthVisitor final : public VNVisitor { nodep->dtypeFrom(adtypep->subDTypep()); // Need to strip off array reference } else { // Note PackArrayDType doesn't use an ArraySel but a normal Sel. - UINFO(1, " Related dtype: " << fromDtp << endl); + UINFO(1, " Related dtype: " << fromDtp); nodep->v3fatalSrc("Array reference exceeds dimension of array"); frommsb = fromlsb = 0; } @@ -1141,8 +1141,8 @@ class WidthVisitor final : public VNVisitor { : "") << " bits."); if (!nodep->fileline()->warnIsOff(V3ErrorCode::WIDTH)) { - UINFO(1, " Related node: " << nodep << endl); - UINFO(1, " Related dtype: " << nodep->dtypep() << endl); + UINFO(1, " Related node: " << nodep); + UINFO(1, " Related dtype: " << nodep->dtypep()); } } if (!m_doGenerate) { @@ -1155,7 +1155,7 @@ class WidthVisitor final : public VNVisitor { "Selection index out of range: " << (VN_AS(nodep->bitp(), Const)->toSInt() + fromlsb) << " outside " << frommsb << ":" << fromlsb); - UINFO(1, " Related node: " << nodep << endl); + UINFO(1, " Related node: " << nodep); } widthCheckSized(nodep, "Extract Range", nodep->bitp(), selwidthDTypep, EXTEND_EXP, false /*NOWARN*/); @@ -1169,7 +1169,7 @@ class WidthVisitor final : public VNVisitor { const AstNodeDType* const fromDtp = nodep->fromp()->dtypep()->skipRefp(); const AstAssocArrayDType* const adtypep = VN_CAST(fromDtp, AssocArrayDType); if (!adtypep) { - UINFO(1, " Related dtype: " << fromDtp << endl); + UINFO(1, " Related dtype: " << fromDtp); nodep->v3fatalSrc("Associative array reference is not to associative array"); } iterateCheckTyped(nodep, "Associative select", nodep->bitp(), adtypep->keyDTypep(), @@ -1184,7 +1184,7 @@ class WidthVisitor final : public VNVisitor { const AstNodeDType* const fromDtp = nodep->fromp()->dtypep()->skipRefp(); const AstWildcardArrayDType* const adtypep = VN_CAST(fromDtp, WildcardArrayDType); if (!adtypep) { - UINFO(1, " Related dtype: " << fromDtp << endl); + UINFO(1, " Related dtype: " << fromDtp); nodep->v3fatalSrc("Wildcard array reference is not to wildcard array"); } const AstBasicDType* const basicp = nodep->bitp()->dtypep()->skipRefp()->basicp(); @@ -1208,7 +1208,7 @@ class WidthVisitor final : public VNVisitor { const AstNodeDType* const fromDtp = nodep->fromp()->dtypep()->skipRefp(); const AstUnpackArrayDType* const adtypep = VN_CAST(fromDtp, UnpackArrayDType); if (!adtypep) { - UINFO(1, " Related dtype: " << fromDtp << endl); + UINFO(1, " Related dtype: " << fromDtp); nodep->v3fatalSrc("Packed array reference exceeds dimension of array"); } // Build new array Dtype based on the original's base type, but with new bounds @@ -1542,8 +1542,8 @@ class WidthVisitor final : public VNVisitor { } if (newp) { newp->dtypeFrom(nodep); - UINFO(9, "powOld " << nodep << endl); - UINFO(9, "powNew " << newp << endl); + UINFO(9, "powOld " << nodep); + UINFO(9, "powNew " << newp); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } @@ -1786,7 +1786,7 @@ class WidthVisitor final : public VNVisitor { case VAttrType::TYPENAME: { UASSERT_OBJ(nodep->fromp(), nodep, "Unprovided expression"); const string result = nodep->fromp()->dtypep()->prettyDTypeName(true); - UINFO(9, "typename '" << result << "' from " << nodep->fromp()->dtypep() << "\n"); + UINFO(9, "typename '" << result << "' from " << nodep->fromp()->dtypep()); AstNode* const newp = new AstConst{nodep->fileline(), AstConst::String{}, result}; nodep->replaceWith(newp); VL_DO_DANGLING(nodep->deleteTree(), nodep); @@ -1799,7 +1799,7 @@ class WidthVisitor final : public VNVisitor { default: { // Everything else resolved earlier nodep->dtypeSetLogicUnsized(32, 1, VSigning::UNSIGNED); // Approximation, unsized 32 - UINFO(1, "Missing ATTR type case node: " << nodep << endl); + UINFO(1, "Missing ATTR type case node: " << nodep); nodep->v3fatalSrc("Missing ATTR type case"); break; } @@ -1843,7 +1843,7 @@ class WidthVisitor final : public VNVisitor { const int width = nodep->subDTypep()->width() * nodep->rangep()->elementsConst(); nodep->widthForce(width, width); } - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstAssocArrayDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed @@ -1851,7 +1851,7 @@ class WidthVisitor final : public VNVisitor { nodep->refDTypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); nodep->keyDTypep(iterateEditMoveDTypep(nodep, nodep->keyDTypep())); nodep->dtypep(nodep); // The array itself, not subDtype - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstBracketArrayDType* nodep) override { // Type inserted only because parser didn't know elementsp() type @@ -1895,7 +1895,7 @@ class WidthVisitor final : public VNVisitor { // Iterate into subDTypep() to resolve that type and update pointer. nodep->refDTypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); nodep->dtypep(nodep); // The array itself, not subDtype - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstQueueDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed @@ -1906,12 +1906,12 @@ class WidthVisitor final : public VNVisitor { if (VN_IS(nodep->boundp(), Unbounded)) { nodep->boundp()->unlinkFrBack()->deleteTree(); // nullptr will represent unbounded } - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstVoidDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed nodep->dtypep(nodep); - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstUnsizedArrayDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed @@ -1919,7 +1919,7 @@ class WidthVisitor final : public VNVisitor { nodep->refDTypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); // Cleanup array size nodep->dtypep(nodep); // The array itself, not subDtype - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstWildcardArrayDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed @@ -1927,7 +1927,7 @@ class WidthVisitor final : public VNVisitor { nodep->refDTypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); // Cleanup array size nodep->dtypep(nodep); // The array itself, not subDtype - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstBasicDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed @@ -1950,7 +1950,7 @@ class WidthVisitor final : public VNVisitor { nodep->cvtRangeConst(); // TODO: If BasicDType now looks like a generic type, we can convert to a real generic // dtype Instead for now doing this in V3WidthCommit - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstConstDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed @@ -1959,7 +1959,7 @@ class WidthVisitor final : public VNVisitor { userIterateChildren(nodep, nullptr); nodep->dtypep(nodep); // Should already be set, but be clear it's not the subDType nodep->widthFromSub(nodep->subDTypep()); - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstRefDType* nodep) override { if (nodep->doingWidth()) { // Early exit if have circular parameter definition @@ -2000,7 +2000,7 @@ class WidthVisitor final : public VNVisitor { UASSERT_OBJ(nodep->subDTypep(), nodep, "Unlinked"); nodep->dtypeFrom(nodep->subDTypep()); nodep->widthFromSub(nodep->subDTypep()); - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); // No nodep->typedefp(nullptr) for now; V3WidthCommit needs to check accesses nodep->doingWidth(false); } @@ -2122,7 +2122,7 @@ class WidthVisitor final : public VNVisitor { } void visit(AstCast* nodep) override { if (nodep->didWidth()) return; - UINFO(9, "CAST " << nodep << endl); + UINFO(9, "CAST " << nodep); nodep->dtypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); if (m_vup->prelim()) { if (debug() >= 9) nodep->dumpTree("- CastPre: "); @@ -2333,9 +2333,9 @@ class WidthVisitor final : public VNVisitor { if (const AstDynArrayDType* const unsizedp = VN_CAST(dtp->skipRefp(), DynArrayDType)) { if (!np) { - UINFO(9, "Dynamic becomes unsized array (var itself) " << nodep << endl); + UINFO(9, "Dynamic becomes unsized array (var itself) " << nodep); } else { - UINFO(9, "Dynamic becomes unsized array (subDType) " << dtp << endl); + UINFO(9, "Dynamic becomes unsized array (subDType) " << dtp); } AstUnsizedArrayDType* const newp = new AstUnsizedArrayDType{unsizedp->fileline(), unsizedp->subDTypep()}; @@ -2365,7 +2365,7 @@ class WidthVisitor final : public VNVisitor { if (implicitParam) { if (nodep->valuep()) { userIterateAndNext(nodep->valuep(), WidthVP{nodep->dtypep(), PRELIM}.p()); - UINFO(9, "implicitParamPRELIMIV " << nodep->valuep() << endl); + UINFO(9, "implicitParamPRELIMIV " << nodep->valuep()); // Although nodep will get a different width for parameters // just below, we want the init numbers to retain their // width/minwidth until parameters are replaced. @@ -2418,7 +2418,7 @@ class WidthVisitor final : public VNVisitor { } iterateCheckAssign(nodep, "Initial value", nodep->valuep(), FINAL, nodep->dtypep()); - UINFO(9, "implicitParamFromIV " << nodep->valuep() << endl); + UINFO(9, "implicitParamFromIV " << nodep->valuep()); // UINFO below will print variable nodep } else { // Or, if nothing assigned, they're integral @@ -2436,7 +2436,7 @@ class WidthVisitor final : public VNVisitor { iterateCheckAssign(nodep, "Initial value", nodep->valuep(), FINAL, nodep->dtypep()); } userIterateAndNext(nodep->delayp(), WidthVP{nodep->dtypep(), PRELIM}.p()); - UINFO(4, "varWidthed " << nodep << endl); + UINFO(4, "varWidthed " << nodep); // if (debug()) nodep->dumpTree("- InitOut: "); nodep->didWidth(true); nodep->doingWidth(false); @@ -2487,7 +2487,7 @@ class WidthVisitor final : public VNVisitor { void visit(AstEnumDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed - UINFO(5, " ENUMDTYPE " << nodep << endl); + UINFO(5, " ENUMDTYPE " << nodep); nodep->refDTypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); nodep->dtypep(nodep); AstBasicDType* basicp = nodep->dtypep()->skipRefp()->basicp(); @@ -2508,7 +2508,7 @@ class WidthVisitor final : public VNVisitor { itemp = VN_AS(itemp->nextp(), EnumItem)) { if (itemp->valuep()) { if (debug() >= 9) { - UINFO(0, "EnumInit " << itemp << endl); + UINFO(0, "EnumInit " << itemp); itemp->valuep()->dumpTree("- EnumInit: "); } V3Const::constifyParamsEdit(itemp->valuep()); // itemp may change @@ -2550,7 +2550,7 @@ class WidthVisitor final : public VNVisitor { } } void visit(AstEnumItem* nodep) override { - UINFO(5, " ENUMITEM " << nodep << endl); + UINFO(5, " ENUMITEM " << nodep); VL_RESTORER(m_enumItemp); m_enumItemp = nodep; AstNodeDType* const vdtypep = m_vup->dtypep(); @@ -2734,8 +2734,8 @@ class WidthVisitor final : public VNVisitor { if (VN_IS(arrayp, NodeArrayDType) || VN_IS(arrayp, AssocArrayDType)) { userIterateChildren(nodep, WidthVP{arrayp->subDTypep(), BOTH}.p()); } else { - UINFO(1, "on " << nodep << endl); - UINFO(1, "dtype object " << arrayp << endl); + UINFO(1, "on " << nodep); + UINFO(1, "dtype object " << arrayp); nodep->v3fatalSrc("InitArray on non-array"); } } @@ -2889,14 +2889,14 @@ class WidthVisitor final : public VNVisitor { void visit(AstIfaceRefDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed - UINFO(5, " IFACEREF " << nodep << endl); + UINFO(5, " IFACEREF " << nodep); userIterateChildren(nodep, m_vup); nodep->dtypep(nodep); - UINFO(4, "dtWidthed " << nodep << endl); + UINFO(4, "dtWidthed " << nodep); } void visit(AstNodeUOrStructDType* nodep) override { if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed - UINFO(5, " NODEUORS " << nodep << endl); + UINFO(5, " NODEUORS " << nodep); // if (debug() >= 9) nodep->dumpTree("- class-in: "); if (!nodep->packed() && v3Global.opt.structsPacked()) nodep->packed(true); userIterateChildren(nodep, nullptr); // First size all members @@ -3032,7 +3032,7 @@ class WidthVisitor final : public VNVisitor { userIterateChildren(nodep, WidthVP{SELF, BOTH}.p()); } void visit(AstMemberSel* nodep) override { - UINFO(5, " MEMBERSEL " << nodep << endl); + UINFO(5, " MEMBERSEL " << nodep); if (nodep->didWidth()) return; if (debug() >= 9) nodep->dumpTree("- mbs-in: "); userIterateChildren(nodep, WidthVP{SELF, BOTH}.p()); @@ -3040,14 +3040,14 @@ class WidthVisitor final : public VNVisitor { // Find the fromp dtype - should be a class UASSERT_OBJ(nodep->fromp()->dtypep(), nodep->fromp(), "Unlinked data type"); AstNodeDType* const fromDtp = nodep->fromp()->dtypep()->skipRefToEnump(); - UINFO(9, " from dt " << fromDtp << endl); + UINFO(9, " from dt " << fromDtp); const AstMemberSel* const fromSel = VN_CAST(nodep->fromp(), MemberSel); if (AstClocking* const clockingp = fromSel && fromSel->varp() ? VN_CAST(fromSel->varp()->firstAbovep(), Clocking) : nullptr) { // In: MEMBERSEL{MEMBERSEL{vifaceref, "cb", cb_event}, "clockvar", null} // Out: MEMBERSEL{vifaceref, "clockvar", clockvar} - UINFO(9, " from clocking " << clockingp << endl); + UINFO(9, " from clocking " << clockingp); if (AstVar* const varp = memberSelClocking(nodep, clockingp)) { if (!varp->didWidth()) userIterate(varp, nullptr); AstMemberSel* fromp = VN_AS(nodep->fromp(), MemberSel); @@ -3060,7 +3060,7 @@ class WidthVisitor final : public VNVisitor { = VN_CAST(nodep->fromp()->dtypep(), IfaceRefDType)) { nodep->varp()->sensIfacep(adtypep->ifacep()); } - UINFO(9, " done clocking msel " << nodep << endl); + UINFO(9, " done clocking msel " << nodep); nodep->didWidth(true); // Must not visit again: will confuse scopes return; } @@ -3083,7 +3083,7 @@ class WidthVisitor final : public VNVisitor { nodep->didWidth(true); return; } - UINFO(1, "found object " << foundp << endl); + UINFO(1, "found object " << foundp); nodep->v3fatalSrc("MemberSel of non-variable\n" << nodep->warnContextPrimary() << '\n' << foundp->warnOther() << "... Location of found object\n" @@ -3168,10 +3168,10 @@ class WidthVisitor final : public VNVisitor { // We don't support constraints yet, so just keep as unlinked for now // Presumably we'll next see a constraint_mode AstMethodCall nodep->dtypep(nodep->findConstraintRefDType()); - UINFO(9, "Unsupported constraint select " << nodep << endl); + UINFO(9, "Unsupported constraint select " << nodep); return true; } - UINFO(1, "found object " << foundp << endl); + UINFO(1, "found object " << foundp); nodep->v3fatalSrc("MemberSel of non-variable\n" << nodep->warnContextPrimary() << '\n' << foundp->warnOther() << "... Location of found object\n" @@ -3236,16 +3236,16 @@ class WidthVisitor final : public VNVisitor { = VN_CAST(m_memberMap.findMember(adtypep, nodep->name()), MemberDType)) { if (m_attrp) { // Looking for the base of the attribute nodep->dtypep(memberp); - UINFO(9, " MEMBERSEL(attr) -> " << nodep << endl); - UINFO(9, " dt-> " << nodep->dtypep() << endl); + UINFO(9, " MEMBERSEL(attr) -> " << nodep); + UINFO(9, " dt-> " << nodep->dtypep()); } else if (adtypep->packed()) { AstSel* const newp = new AstSel{nodep->fileline(), nodep->fromp()->unlinkFrBack(), memberp->lsb(), memberp->width()}; // Must skip over the member to find the union; as the member may disappear later newp->dtypep(memberp->subDTypep()->skipRefToEnump()); newp->didWidth(true); // Don't replace dtype with basic type - UINFO(9, " MEMBERSEL -> " << newp << endl); - UINFO(9, " dt-> " << newp->dtypep() << endl); + UINFO(9, " MEMBERSEL -> " << newp); + UINFO(9, " dt-> " << newp->dtypep()); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); // Should be able to treat it as a normal-ish nodesel - maybe. @@ -3256,8 +3256,8 @@ class WidthVisitor final : public VNVisitor { // Must skip over the member to find the union; as the member may disappear later newp->dtypep(memberp->subDTypep()->skipRefToEnump()); newp->didWidth(true); // Don't replace dtype with basic type - UINFO(9, " MEMBERSEL -> " << newp << endl); - UINFO(9, " dt-> " << newp->dtypep() << endl); + UINFO(9, " MEMBERSEL -> " << newp); + UINFO(9, " dt-> " << newp->dtypep()); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); // Should be able to treat it as a normal-ish nodesel - maybe. @@ -3279,7 +3279,7 @@ class WidthVisitor final : public VNVisitor { } void visit(AstMethodCall* nodep) override { - UINFO(5, " METHODCALL " << nodep << endl); + UINFO(5, " METHODCALL " << nodep); if (nodep->didWidth()) return; if (debug() >= 9) nodep->dumpTree("- mts-in: "); // Should check types the method requires, but at present we don't do much @@ -3290,7 +3290,7 @@ class WidthVisitor final : public VNVisitor { UASSERT_OBJ(nodep->fromp() && nodep->fromp()->dtypep(), nodep, "Unsized expression"); AstNodeDType* const fromDtp = nodep->fromp()->dtypep()->skipRefToEnump(); AstBasicDType* const basicp = fromDtp ? fromDtp->basicp() : nullptr; - UINFO(9, " from dt " << fromDtp << endl); + UINFO(9, " from dt " << fromDtp); userIterate(fromDtp, WidthVP{SELF, BOTH}.p()); if (nodep->name() == "rand_mode") { methodCallRandMode(nodep); @@ -3718,7 +3718,7 @@ class WidthVisitor final : public VNVisitor { } else if (const AstNodeSel* const ichildp = VN_CAST(childp, NodeSel)) { methodCallLValueRecurse(nodep, ichildp->fromp(), access); } else { - UINFO(1, " Related node: " << childp << endl); + UINFO(1, " Related node: " << childp); nodep->v3warn(E_UNSUPPORTED, "Unsupported: Non-variable on LHS of built-in method '" << nodep->prettyName() << "'"); } @@ -3947,10 +3947,10 @@ class WidthVisitor final : public VNVisitor { } void methodCallIfaceRef(AstMethodCall* nodep, AstIfaceRefDType* adtypep) { AstIface* const ifacep = adtypep->ifacep(); - UINFO(5, __FUNCTION__ << ":" << nodep << endl); + UINFO(5, __FUNCTION__ << ":" << nodep); if (AstNodeFTask* const ftaskp = VN_CAST(m_memberMap.findMember(ifacep, nodep->name()), NodeFTask)) { - UINFO(5, __FUNCTION__ << "AstNodeFTask" << nodep << endl); + UINFO(5, __FUNCTION__ << "AstNodeFTask" << nodep); userIterate(ftaskp, nullptr); if (ftaskp->isStatic()) { AstNodeExpr* argsp = nullptr; @@ -4452,7 +4452,7 @@ class WidthVisitor final : public VNVisitor { } // The AstNodeAssign visitor will be soon be replacing this node, make sure it gets it if (!VN_IS(nodep->backp(), NodeAssign)) { - UINFO(1, "Got backp " << nodep->backp() << endl); + UINFO(1, "Got backp " << nodep->backp()); nodep->v3error( "dynamic new() not expected in this context (expected under an assign)"); return; @@ -4468,7 +4468,7 @@ class WidthVisitor final : public VNVisitor { void visit(AstPattern* nodep) override { if (nodep->didWidthAndSet()) return; - UINFO(9, "PATTERN " << nodep << endl); + UINFO(9, "PATTERN " << nodep); if (nodep->childDTypep()) { // data_type '{ pattern } nodep->dtypep(iterateEditMoveDTypep(nodep, nodep->subDTypep())); } @@ -4485,7 +4485,7 @@ class WidthVisitor final : public VNVisitor { { dtypep = dtypep->skipRefp(); nodep->dtypep(dtypep); - UINFO(9, " dtypep " << dtypep << endl); + UINFO(9, " dtypep " << dtypep); nodep->dtypep(dtypep); // Determine replication count, and replicate initial value as // widths need to be individually determined @@ -4733,7 +4733,7 @@ class WidthVisitor final : public VNVisitor { void patternArray(AstPattern* nodep, AstNodeArrayDType* arrayDtp, AstPatMember* defaultp) { const VNumRange range = arrayDtp->declRange(); PatVecMap patmap = patVectorMap(nodep, range); - UINFO(9, "ent " << range.left() << " to " << range.right() << endl); + UINFO(9, "ent " << range.left() << " to " << range.right()); AstNode* newp = nullptr; bool allConstant = true; const bool isConcat = nodep->itemsp() && VN_AS(nodep->itemsp(), PatMember)->isConcat(); @@ -4879,7 +4879,7 @@ class WidthVisitor final : public VNVisitor { const AstBasicDType* bdtypep = VN_AS(vdtypep, BasicDType); const VNumRange range = bdtypep->declRange(); PatVecMap patmap = patVectorMap(nodep, range); - UINFO(9, "ent " << range.hi() << " to " << range.lo() << endl); + UINFO(9, "ent " << range.hi() << " to " << range.lo()); AstNodeExpr* newp = nullptr; for (int ent = range.hi(); ent >= range.lo(); --ent) { AstPatMember* newpatp = nullptr; @@ -4983,7 +4983,7 @@ class WidthVisitor final : public VNVisitor { AstNodeDType* const vdtypep = m_vup->dtypeNullp(); UASSERT_OBJ(vdtypep, nodep, "Pattern member type not assigned by AstPattern visitor"); nodep->dtypep(vdtypep); - UINFO(9, " PATMEMBER " << nodep << endl); + UINFO(9, " PATMEMBER " << nodep); UASSERT_OBJ(!nodep->lhssp()->nextp(), nodep, "PatMember value should be singular w/replicates removed"); // Need to propagate assignment type downwards, even on prelim @@ -5047,7 +5047,7 @@ class WidthVisitor final : public VNVisitor { if (AstAttrOf* const exprap = VN_CAST(nodep->exprp(), AttrOf)) { if (exprap->attrType() == VAttrType::TYPEID) { AstNodeDType* const exprDtp = VN_AS(exprap->fromp(), NodeDType); - UINFO(9, "case type exprDtp " << exprDtp << endl); + UINFO(9, "case type exprDtp " << exprDtp); // V3Param may have a pointer to this case statement, and we need // dotted references to remain properly named, so rather than // removing we convert it to a "normal" expression "case (1) ..." @@ -5192,9 +5192,9 @@ class WidthVisitor final : public VNVisitor { return; } fromDtp = fromDtp->skipRefp(); - UINFO(9, "- foreachArg " << argsp << endl); - UINFO(9, "- from on " << fromp << endl); - UINFO(9, "- from dtp " << fromDtp << endl); + UINFO(9, "- foreachArg " << argsp); + UINFO(9, "- from on " << fromp); + UINFO(9, "- from dtp " << fromDtp); if (VN_IS(fromDtp, NodeArrayDType) || VN_IS(fromDtp, DynArrayDType) || VN_IS(fromDtp, QueueDType)) { @@ -5377,7 +5377,7 @@ class WidthVisitor final : public VNVisitor { // Just let all arguments seek their natural sizes userIterateChildren(nodep, WidthVP{SELF, BOTH}.p()); // - UINFO(9, " Display in " << nodep->text() << endl); + UINFO(9, " Display in " << nodep->text()); string newFormat; bool inPct = false; AstNodeExpr* argp = nodep->exprsp(); @@ -5524,7 +5524,7 @@ class WidthVisitor final : public VNVisitor { } } nodep->text(newFormat); - UINFO(9, " Display out " << nodep->text() << endl); + UINFO(9, " Display out " << nodep->text()); } void visit(AstCReturn* nodep) override { assertAtStatement(nodep); @@ -5868,8 +5868,8 @@ class WidthVisitor final : public VNVisitor { << modSize << "," << " and expression which is an interface array of size " << exprSize << "."); - UINFO(1, " Related lo: " << modDTypep << endl); - UINFO(1, " Related hi: " << conDTypep << endl); + UINFO(1, " Related lo: " << modDTypep); + UINFO(1, " Related hi: " << conDTypep); } else if ((exprArrayp && !modArrayp) || (!exprArrayp && modArrayp)) { nodep->v3error("Illegal " << nodep->prettyOperatorName() << "," << " mismatch between port which is" @@ -5877,8 +5877,8 @@ class WidthVisitor final : public VNVisitor { << " and expression which is" << (exprArrayp ? "" : " not") << " an array. (IEEE 1800-2023 7.6)"); - UINFO(1, " Related lo: " << modDTypep << endl); - UINFO(1, " Related hi: " << conDTypep << endl); + UINFO(1, " Related lo: " << modDTypep); + UINFO(1, " Related hi: " << conDTypep); } iterateCheckAssign(nodep, "pin connection", nodep->exprp(), FINAL, subDTypep); } @@ -6100,7 +6100,7 @@ class WidthVisitor final : public VNVisitor { void processFTaskRefArgs(AstNodeFTaskRef* nodep) { // For arguments, is assignment-like context; see IEEE rules in AstNodeAssign // Function hasn't been widthed, so make it so. - UINFO(5, " FTASKREF " << nodep << endl); + UINFO(5, " FTASKREF " << nodep); UASSERT_OBJ(nodep->taskp(), nodep, "Unlinked"); if (nodep->didWidth()) return; userIterate(nodep->taskp(), nullptr); @@ -6121,7 +6121,7 @@ class WidthVisitor final : public VNVisitor { // pointer, so need to iterate separately later if (portp->attrSFormat() && (!VN_IS(pinp, SFormatF) || pinp->nextp())) { // Not already done - UINFO(4, " sformat via metacomment: " << nodep << endl); + UINFO(4, " sformat via metacomment: " << nodep); VNRelinker handle; argp->unlinkFrBackWithNext(&handle); // Format + additional args, if any AstNodeExpr* argsp = nullptr; @@ -6154,7 +6154,7 @@ class WidthVisitor final : public VNVisitor { && !(VN_IS(pinp, VarRef) && VN_AS(pinp, VarRef)->varp()->basicp()->keyword() == VBasicDTypeKwd::STRING)) { - UINFO(4, " Add CvtPackString: " << pinp << endl); + UINFO(4, " Add CvtPackString: " << pinp); VNRelinker handle; pinp->unlinkFrBack(&handle); // No next, that's the next pin AstNodeExpr* const newp = new AstCvtPackString{pinp->fileline(), pinp}; @@ -6233,7 +6233,7 @@ class WidthVisitor final : public VNVisitor { void visit(AstNodeFTaskRef* nodep) override { // For arguments, is assignment-like context; see IEEE rules in AstNodeAssign // Function hasn't been widthed, so make it so. - UINFO(5, " FTASKREF " << nodep << endl); + UINFO(5, " FTASKREF " << nodep); AstWith* withp = nullptr; if (nodep->name() == "rand_mode" || nodep->name() == "constraint_mode") { v3Global.useRandomizeMethods(true); @@ -6774,12 +6774,12 @@ class WidthVisitor final : public VNVisitor { "Type compare expects type reference"); AstNodeDType* const lhsDtp = VN_AS(lhsap->fromp(), NodeDType); AstNodeDType* const rhsDtp = VN_AS(rhsap->fromp(), NodeDType); - UINFO(9, "==type lhsDtp " << lhsDtp << endl); - UINFO(9, "==type rhsDtp " << lhsDtp << endl); + UINFO(9, "==type lhsDtp " << lhsDtp); + UINFO(9, "==type rhsDtp " << lhsDtp); const bool invert = VN_IS(nodep, NeqT); const bool identical = AstNode::computeCastable(lhsDtp, rhsDtp, nodep) == VCastable::SAMEISH; - UINFO(9, "== " << identical << endl); + UINFO(9, "== " << identical); const bool eq = invert ^ identical; AstNode* const newp = new AstConst{nodep->fileline(), AstConst::BitTrue{}, eq}; nodep->replaceWith(newp); @@ -6954,7 +6954,7 @@ class WidthVisitor final : public VNVisitor { // because the rhs could be larger, and we need to have proper editing to get the widths // to be the same for our operations. // - // if (debug() >= 9) { UINFO(0,"rus "<dumpTree("- rusin: "); } + // if (debug() >= 9) { UINFO(0, "rus " << m_vup); nodep->dumpTree("- rusin: "); } if (m_vup->prelim()) { // First stage evaluation // Determine expression widths only relying on what's in the subops userIterateAndNext(nodep->lhsp(), WidthVP{CONTEXT_DET, PRELIM}.p()); @@ -7064,8 +7064,7 @@ class WidthVisitor final : public VNVisitor { // node, while the output dtype is the *expected* sign. // It is reasonable to have sign extension with unsigned output, // for example $unsigned(a)+$signed(b), the SIGNED(B) will be unsigned dtype out - UINFO(4, - " widthExtend_(r=" << static_cast(extendRule) << ") old: " << nodep << endl); + UINFO(4, " widthExtend_(r=" << static_cast(extendRule) << ") old: " << nodep); if (extendRule == EXTEND_OFF) return; AstConst* const constp = VN_CAST(nodep, Const); const int expWidth = expDTypep->width(); @@ -7112,7 +7111,7 @@ class WidthVisitor final : public VNVisitor { nodep = newp; } nodep->dtypep(expDTypep); - UINFO(4, " _new: " << nodep << endl); + UINFO(4, " _new: " << nodep); } void fixWidthReduce(AstNodeExpr* nodep) { @@ -7123,7 +7122,7 @@ class WidthVisitor final : public VNVisitor { // Attempt to fix it quietly const int expWidth = 1; const int expSigned = false; - UINFO(4, " widthReduce_old: " << nodep << endl); + UINFO(4, " widthReduce_old: " << nodep); AstConst* const constp = VN_CAST(nodep, Const); if (constp) { V3Number num(nodep, expWidth); @@ -7152,7 +7151,7 @@ class WidthVisitor final : public VNVisitor { nodep = newp; } nodep->dtypeChgWidthSigned(expWidth, expWidth, VSigning::fromBool(expSigned)); - UINFO(4, " _new: " << nodep << endl); + UINFO(4, " _new: " << nodep); } bool fixAutoExtend(AstNodeExpr*& nodepr, int expWidth) { @@ -7358,7 +7357,7 @@ class WidthVisitor final : public VNVisitor { V3Number selected{constp, 8}; selected.opSel(constp->num(), cindex * 8 + 7, cindex * 8); UINFO(0, " aindex=" << aindex << " cindex=" << cindex - << " c=" << selected << endl); + << " c=" << selected); if (!selected.isFourState()) { if (const uint32_t c = selected.toUInt()) { newp->addIndexValuep( @@ -7367,7 +7366,7 @@ class WidthVisitor final : public VNVisitor { } } } - UINFO(6, " unpackFromString: " << nodep << endl); + UINFO(6, " unpackFromString: " << nodep); rhsp->replaceWith(newp); VL_DO_DANGLING(pushDeletep(rhsp), rhsp); rhsp = newp; @@ -7400,7 +7399,7 @@ class WidthVisitor final : public VNVisitor { // For DOUBLE under a logical op, add implied test against zero, never a warning AstNodeDType* const underVDTypep = underp ? underp->dtypep()->skipRefp() : nullptr; if (underp && underVDTypep->isDouble()) { - UINFO(6, " spliceCvtCmpD0: " << underp << endl); + UINFO(6, " spliceCvtCmpD0: " << underp); VNRelinker linker; underp->unlinkFrBack(&linker); AstNode* const newp @@ -7509,7 +7508,7 @@ class WidthVisitor final : public VNVisitor { std::max(subDTypep->width(), underp->width()), std::max(subDTypep->widthMin(), underp->widthMin()), VSigning::fromBool(underp->isSigned())); - UINFO(9, "Assignment of opposite-signed RHS to LHS: " << nodep << endl); + UINFO(9, "Assignment of opposite-signed RHS to LHS: " << nodep); } underp = userIterateSubtreeReturnEdits(underp, WidthVP{subDTypep, FINAL}.p()); } else { @@ -7659,7 +7658,7 @@ class WidthVisitor final : public VNVisitor { // For integer used in REAL context, convert to real // We don't warn here, "2.0 * 2" is common and reasonable if (nodep && !nodep->dtypep()->skipRefp()->isDouble()) { - UINFO(6, " spliceCvtD: " << nodep << endl); + UINFO(6, " spliceCvtD: " << nodep); VNRelinker linker; nodep->unlinkFrBack(&linker); AstNodeExpr* newp; @@ -7678,7 +7677,7 @@ class WidthVisitor final : public VNVisitor { // IEEE-2012 11.8.1: Signed: Type coercion creates signed // 11.8.2: Argument to convert is self-determined if (nodep && nodep->dtypep()->skipRefp()->isDouble()) { - UINFO(6, " spliceCvtS: " << nodep << endl); + UINFO(6, " spliceCvtS: " << nodep); VNRelinker linker; nodep->unlinkFrBack(&linker); if (const AstConst* const constp = VN_CAST(nodep, Const)) { @@ -7701,7 +7700,7 @@ class WidthVisitor final : public VNVisitor { // IEEE-2012 11.8.1: Signed: Type coercion creates signed // 11.8.2: Argument to convert is self-determined if (nodep && !(nodep->dtypep()->basicp() && nodep->dtypep()->basicp()->isString())) { - UINFO(6, " spliceCvtString: " << nodep << endl); + UINFO(6, " spliceCvtString: " << nodep); VNRelinker linker; nodep->unlinkFrBack(&linker); AstNodeExpr* const newp = new AstCvtPackString{nodep->fileline(), nodep}; @@ -7754,7 +7753,7 @@ class WidthVisitor final : public VNVisitor { nodep->v3fatalSrc("Node needs sign change, but bad case: " << nodep); break; } - UINFO(6, " ReplaceWithUOrSVersion: " << nodep << " w/ " << newp << endl); + UINFO(6, " ReplaceWithUOrSVersion: " << nodep << " w/ " << newp); nodep->replaceWithKeepDType(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); return newp; @@ -7792,7 +7791,7 @@ class WidthVisitor final : public VNVisitor { nodep->v3fatalSrc("Node needs conversion to double, but bad case: " << nodep); break; } - UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp << endl); + UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp); nodep->replaceWith(newp); // No width change; the default created type (bool or double) is correct VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -7824,7 +7823,7 @@ class WidthVisitor final : public VNVisitor { nodep->v3fatalSrc("Node needs conversion to string, but bad case: " << nodep); break; } - UINFO(6, " ReplaceWithNVersion: " << nodep << " w/ " << newp << endl); + UINFO(6, " ReplaceWithNVersion: " << nodep << " w/ " << newp); nodep->replaceWith(newp); // No width change; the default created type (bool or string) is correct VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -7843,7 +7842,7 @@ class WidthVisitor final : public VNVisitor { nodep->v3fatalSrc("Node needs conversion to double, but bad case: " << nodep); break; } - UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp << endl); + UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp); nodep->replaceWithKeepDType(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); return newp; @@ -7888,7 +7887,7 @@ class WidthVisitor final : public VNVisitor { const bool child1 = (parentp->getChildDTypep() == dtnodep); const bool child2 = (parentp->getChild2DTypep() == dtnodep); if (child1 || child2) { - UINFO(9, "iterateEditMoveDTypep child iterating " << dtnodep << endl); + UINFO(9, "iterateEditMoveDTypep child iterating " << dtnodep); // Iterate, this might edit the dtypes which means dtnodep now lost VL_DO_DANGLING(userIterate(dtnodep, nullptr), dtnodep); // Figure out the new dtnodep, remained a child of parent so find it there @@ -7898,12 +7897,12 @@ class WidthVisitor final : public VNVisitor { "iterateEditMoveDTypep didn't get width resolution of " << dtnodep->prettyTypeName()); // Move to under netlist - UINFO(9, "iterateEditMoveDTypep child moving " << dtnodep << endl); + UINFO(9, "iterateEditMoveDTypep child moving " << dtnodep); dtnodep->unlinkFrBack(); v3Global.rootp()->typeTablep()->addTypesp(dtnodep); } if (!dtnodep->didWidth()) { - UINFO(9, "iterateEditMoveDTypep pointer iterating " << dtnodep << endl); + UINFO(9, "iterateEditMoveDTypep pointer iterating " << dtnodep); // See notes in visit(AstBracketArrayDType*) UASSERT_OBJ(!VN_IS(dtnodep, BracketArrayDType), parentp, "Brackets should have been iterated as children"); @@ -7920,7 +7919,7 @@ class WidthVisitor final : public VNVisitor { AstNodeDType* dtypep = nodep->skipRefp(); VNumRange declRange; // ranged() set false for (int i = 1; i <= dim; ++i) { - // UINFO(9, " dim at "<declRange(); @@ -7942,7 +7941,7 @@ class WidthVisitor final : public VNVisitor { case VAttrType::DIM_BITS: { int bits = 1; while (dtypep) { - // UINFO(9, " bits at "<declRange().elements(); dtypep = adtypep->subDTypep()->skipRefp(); @@ -7979,7 +7978,7 @@ class WidthVisitor final : public VNVisitor { } if (!valp) valp = new AstConst{fileline, AstConst::Signed32{}, val}; UINFO(9, " $dimension " << attrType.ascii() << "(" << cvtToHex(dtypep) << "," << dim - << ")=" << valp << endl); + << ")=" << valp); return valp; } AstVar* dimensionVarp(AstNodeDType* nodep, VAttrType attrType, uint32_t msbdim) { @@ -8039,7 +8038,7 @@ class WidthVisitor final : public VNVisitor { const auto pair = nodep->tableMap().emplace(attrType, nullptr); if (pair.second) { UINFO(9, "Construct Venumtab attr=" << attrType.ascii() << " assoc=" << assoc - << " max=" << msbdim << " for " << nodep << endl); + << " max=" << msbdim << " for " << nodep); AstNodeDType* basep; if (attrType == VAttrType::ENUM_NAME) { basep = nodep->findStringDType(); @@ -8229,7 +8228,7 @@ class WidthVisitor final : public VNVisitor { } void makeOpenArrayShell(AstNodeFTaskRef* nodep) { - UINFO(4, "Replicate openarray function " << nodep->taskp() << endl); + UINFO(4, "Replicate openarray function " << nodep->taskp()); AstNodeFTask* const oldTaskp = nodep->taskp(); oldTaskp->dpiOpenParentInc(); UASSERT_OBJ(!oldTaskp->dpiOpenChild(), oldTaskp, @@ -8277,7 +8276,7 @@ class WidthVisitor final : public VNVisitor { void assertAtStatement(AstNode* nodep) { if (VL_UNCOVERABLE(m_vup && !m_vup->selfDtm())) { - UINFO(1, "-: " << m_vup << endl); + UINFO(1, "-: " << m_vup); nodep->v3fatalSrc("No dtype expected at statement " << nodep->prettyTypeName()); } } @@ -8377,7 +8376,7 @@ public: // Width class functions void V3Width::width(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { // We should do it in bottom-up module order, but it works in any order. const WidthClearVisitor cvisitor{nodep}; @@ -8391,7 +8390,7 @@ void V3Width::width(AstNetlist* nodep) { //! Single node parameter propagation //! Smaller step... Only do a single node for parameter propagation AstNode* V3Width::widthParamsEdit(AstNode* nodep) { - UINFO(4, __FUNCTION__ << ": " << nodep << endl); + UINFO(4, __FUNCTION__ << ": " << nodep); // We should do it in bottom-up module order, but it works in any order. WidthVisitor visitor{true, false}; nodep = visitor.mainAcceptEdit(nodep); @@ -8410,7 +8409,7 @@ AstNode* V3Width::widthParamsEdit(AstNode* nodep) { //! @return Pointer to the edited node. AstNode* V3Width::widthGenerateParamsEdit( AstNode* nodep) { //!< [in] AST whose parameters widths are to be analyzed. - UINFO(4, __FUNCTION__ << ": " << nodep << endl); + UINFO(4, __FUNCTION__ << ": " << nodep); // We should do it in bottom-up module order, but it works in any order. WidthVisitor visitor{true, true}; nodep = visitor.mainAcceptEdit(nodep); diff --git a/src/V3WidthCommit.cpp b/src/V3WidthCommit.cpp index 4b9bbeb12..53e2e152f 100644 --- a/src/V3WidthCommit.cpp +++ b/src/V3WidthCommit.cpp @@ -65,7 +65,7 @@ private: if (AstBasicDType* const bdtypep = VN_CAST(nodep, BasicDType)) { AstBasicDType* const newp = nodep->findInsertSameDType(bdtypep); if (newp != bdtypep && debug() >= 9) { - UINFO(9, "dtype replacement "); + UINFO_PREFIX("dtype replacement "); nodep->dumpSmall(std::cout); std::cout << " ----> "; newp->dumpSmall(std::cout); @@ -112,8 +112,8 @@ private: how = "'protected'"; } if (how) { - UINFO(9, "refclass " << refClassp << endl); - UINFO(9, "defclass " << defClassp << endl); + UINFO(9, "refclass " << refClassp); + UINFO(9, "defclass " << defClassp); nodep->v3warn(ENCAPSULATED, nodep->prettyNameQ() << " is hidden as " << how << " within this context (IEEE 1800-2023 8.18)\n" @@ -170,7 +170,7 @@ private: void visit(AstCastWrap* nodep) override { iterateChildren(nodep); editDType(nodep); - UINFO(6, " Replace " << nodep << " w/ " << nodep->lhsp() << endl); + UINFO(6, " Replace " << nodep << " w/ " << nodep->lhsp()); nodep->replaceWith(nodep->lhsp()->unlinkFrBack()); VL_DO_DANGLING(pushDeletep(nodep), nodep); } @@ -326,7 +326,7 @@ public: // V3WidthCommit class functions void V3WidthCommit::widthCommit(AstNetlist* nodep) { - UINFO(2, __FUNCTION__ << ": " << endl); + UINFO(2, __FUNCTION__ << ":"); { WidthCommitVisitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("widthcommit", 0, dumpTreeEitherLevel() >= 6); } diff --git a/src/V3WidthRemove.h b/src/V3WidthRemove.h index beaafdf04..b50bffdc4 100644 --- a/src/V3WidthRemove.h +++ b/src/V3WidthRemove.h @@ -36,7 +36,7 @@ class WidthRemoveVisitor final : public VNVisitor { VL_DEFINE_DEBUG_FUNCTIONS; void replaceWithSignedVersion(AstNode* nodep, AstNode* newp) { - UINFO(6, " Replace " << nodep << " w/ " << newp << endl); + UINFO(6, " Replace " << nodep << " w/ " << newp); nodep->replaceWithKeepDType(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } diff --git a/src/V3WidthSel.cpp b/src/V3WidthSel.cpp index fbed8af3a..38fbd3b25 100644 --- a/src/V3WidthSel.cpp +++ b/src/V3WidthSel.cpp @@ -69,7 +69,7 @@ class WidthSelVisitor final : public VNVisitor { }; static FromData fromDataForArray(AstNode* nodep, AstNode* basefromp) { // What is the data type and information for this SEL-ish's from()? - UINFO(9, " fromData start ddtypep = " << basefromp << endl); + UINFO(9, " fromData start ddtypep = " << basefromp); VNumRange fromRange; // constructs to isRanged(false) while (basefromp) { if (VN_IS(basefromp, AttrOf)) { @@ -81,7 +81,7 @@ class WidthSelVisitor final : public VNVisitor { UASSERT_OBJ(basefromp && basefromp->dtypep(), nodep, "Select with no from dtype"); AstNodeDType* const ddtypep = basefromp->dtypep()->skipRefp(); AstNodeDType* const errp = ddtypep; - UINFO(9, " fromData.ddtypep = " << ddtypep << endl); + UINFO(9, " fromData.ddtypep = " << ddtypep); if (const AstNodeArrayDType* const adtypep = VN_CAST(ddtypep, NodeArrayDType)) { fromRange = adtypep->declRange(); } else if (VN_IS(ddtypep, AssocArrayDType)) { @@ -226,7 +226,7 @@ class WidthSelVisitor final : public VNVisitor { void visit(AstSelBit* nodep) override { // Select of a non-width specified part of an array, i.e. "array[2]" // This select style has a lsb and msb (no user specified width) - UINFO(6, "SELBIT " << nodep << endl); + UINFO(6, "SELBIT " << nodep); if (debug() >= 9) nodep->backp()->dumpTree("- SELBT0: "); // lhsp/rhsp do not need to be constant AstNodeExpr* const fromp = nodep->fromp()->unlinkFrBack(); @@ -235,7 +235,7 @@ class WidthSelVisitor final : public VNVisitor { const FromData fromdata = fromDataForArray(nodep, fromp); AstNodeDType* const ddtypep = fromdata.m_dtypep; const VNumRange fromRange = fromdata.m_fromRange; - UINFO(6, " ddtypep " << ddtypep << endl); + UINFO(6, " ddtypep " << ddtypep); if (const AstUnpackArrayDType* const adtypep = VN_CAST(ddtypep, UnpackArrayDType)) { // SELBIT(array, index) -> ARRAYSEL(array, index) AstNodeExpr* subp = rhsp; @@ -327,7 +327,7 @@ class WidthSelVisitor final : public VNVisitor { } else { newp = new AstGetcRefN{nodep->fileline(), fromp, rhsp}; } - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } else if (VN_IS(ddtypep, BasicDType)) { @@ -337,7 +337,7 @@ class WidthSelVisitor final : public VNVisitor { // Unsized so width from user new AstConst{nodep->fileline(), AstConst::Unsized32{}, 1}}; newp->declRange(fromRange); - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); if (debug() >= 9) newp->dumpTree("- SELBTn: "); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -348,7 +348,7 @@ class WidthSelVisitor final : public VNVisitor { // Unsized so width from user new AstConst{nodep->fileline(), AstConst::Unsized32{}, 1}}; newp->declRange(fromRange); - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); if (debug() >= 9) newp->dumpTree("- SELBTn: "); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -365,7 +365,7 @@ class WidthSelVisitor final : public VNVisitor { // Select of a range specified part of an array, i.e. "array[2:3]" // SELEXTRACT(from,msb,lsb) -> SEL(from, lsb, 1+msb-lsb) // This select style has a (msb or lsb) and width - UINFO(6, "SELEXTRACT " << nodep << endl); + UINFO(6, "SELEXTRACT " << nodep); // if (debug() >= 9) nodep->dumpTree("- SELEX0: "); // Below 2 lines may change nodep->widthp() V3Const::constifyParamsNoWarnEdit(nodep->leftp()); // May relink pointed to node @@ -393,7 +393,7 @@ class WidthSelVisitor final : public VNVisitor { newp->dtypep(ddtypep); newp->didWidth(true); newp->protect(false); - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); return; @@ -483,7 +483,7 @@ class WidthSelVisitor final : public VNVisitor { AstSel* const newp = new AstSel{nodep->fileline(), fromp, newSubLsbOf(lsbp, fromRange), widthp}; newp->declRange(fromRange); - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); // if (debug() >= 9) newp->dumpTree("- SELEXnew: "); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -505,14 +505,14 @@ class WidthSelVisitor final : public VNVisitor { AstSel* const newp = new AstSel{nodep->fileline(), fromp, newSubLsbOf(lsbp, fromRange), widthp}; newp->declRange(fromRange); - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); // if (debug() >= 9) newp->dumpTree("- SELEXnew: "); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); } else { // nullptr=bad extract, or unknown node type nodep->v3error("Illegal range select; type already selected, or bad dimension: " << "data type is " << fromdata.m_errp->prettyDTypeNameQ()); - UINFO(1, " Related ddtype: " << ddtypep << endl); + UINFO(1, " Related ddtype: " << ddtypep); // How to recover? We'll strip a dimension. nodep->replaceWith(fromp); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -526,7 +526,7 @@ class WidthSelVisitor final : public VNVisitor { void replaceSelPlusMinus(AstNodePreSel* nodep) { // Select of a range specified with +: or -:, i.e. "array[2+:3], [2-:3]" // This select style has a lsb and width - UINFO(6, "SELPLUS/MINUS " << nodep << endl); + UINFO(6, "SELPLUS/MINUS " << nodep); // Below 2 lines may change nodep->widthp() if (debug() >= 9) nodep->dumpTree("- SELPM0: "); V3Width::widthParamsEdit(nodep->rhsp()); // constifyEdit doesn't ensure widths finished @@ -611,7 +611,7 @@ class WidthSelVisitor final : public VNVisitor { AstSel* const newp = new AstSel{nodep->fileline(), fromp, newlsbp, newwidthp}; newp->declRange(fromRange); newp->declElWidth(elwidth); - UINFO(6, " new " << newp << endl); + UINFO(6, " new " << newp); if (debug() >= 9) newp->dumpTree("- SELNEW: "); nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep); @@ -649,7 +649,7 @@ public: // Width class functions AstNode* V3Width::widthSelNoIterEdit(AstNode* nodep) { - UINFO(4, __FUNCTION__ << ": " << nodep << endl); + UINFO(4, __FUNCTION__ << ": " << nodep); WidthSelVisitor visitor; nodep = visitor.mainAcceptEdit(nodep); return nodep; diff --git a/src/Verilator.cpp b/src/Verilator.cpp index 5f25e88fa..1add95bdd 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -648,7 +648,7 @@ static void process() { } static void verilate(const string& argString) { - UINFO(1, "Option --verilate: Start Verilation\n"); + UINFO(1, "Option --verilate: Start Verilation"); // Can we skip doing everything if times are ok? V3File::addSrcDepend(v3Global.opt.buildDepBin()); @@ -656,7 +656,7 @@ static void verilate(const string& argString) { && V3File::checkTimes(v3Global.opt.hierTopDataDir() + "/" + v3Global.opt.prefix() + "__verFiles.dat", argString)) { - UINFO(1, "--skip-identical: No change to any source files, exiting\n"); + UINFO(1, "--skip-identical: No change to any source files, exiting"); return; } // Undocumented debugging - cannot be a switch as then command line @@ -696,7 +696,7 @@ static void verilate(const string& argString) { V3PreShell::selfTest(); V3Broken::selfTest(); V3ThreadPool::selfTest(); - UINFO(2, "selfTest done\n"); + UINFO(2, "selfTest done"); } // Read first filename @@ -792,7 +792,7 @@ static void execBuildJob() { UASSERT(v3Global.opt.gmake(), "--build requires GNU Make."); UASSERT(!v3Global.opt.cmake(), "--build cannot use CMake."); VlOs::DeltaWallTime buildWallTime{true}; - UINFO(1, "Start Build\n"); + UINFO(1, "Start Build"); const string cmdStr = buildMakeCmd(v3Global.opt.prefix() + ".mk", ""); V3Os::filesystemFlushBuildDir(v3Global.opt.hierTopDataDir()); @@ -852,7 +852,7 @@ int main(int argc, char** argv) { if (v3Global.opt.verilate()) { verilate(argString); } else { - UINFO(1, "Option --no-verilate: Skip Verilation\n"); + UINFO(1, "Option --no-verilate: Skip Verilation"); } if (v3Global.hierPlanp() && v3Global.opt.gmake()) { @@ -874,5 +874,5 @@ int main(int argc, char** argv) { V3Stats::summaryReport(); } - UINFO(1, "Done, Exiting...\n"); + UINFO(1, "Done, Exiting..."); } diff --git a/src/VlcBucket.h b/src/VlcBucket.h index 203d86290..ba4bc92ec 100644 --- a/src/VlcBucket.h +++ b/src/VlcBucket.h @@ -42,7 +42,7 @@ class VlcBuckets final { const uint64_t oldsize = m_dataSize; if (m_dataSize < point) m_dataSize = (point + 64) & ~63ULL; // Keep power of two m_dataSize *= 2; - // UINFO(9, "Realloc "<(std::realloc(m_datap, allocSize())); if (VL_UNCOVERABLE(!newp)) { // cppcheck-suppress doubleFree // cppcheck 1.90 bug - realloc doesn't free on fail @@ -68,7 +68,7 @@ public: // METHODS void addData(uint64_t point, uint64_t hits) { if (hits >= sufficient()) { - // UINFO(9," addData "<dump(bucketsToo); } diff --git a/src/VlcTop.cpp b/src/VlcTop.cpp index c4930f349..8294bdeb9 100644 --- a/src/VlcTop.cpp +++ b/src/VlcTop.cpp @@ -31,7 +31,7 @@ //###################################################################### void VlcTop::readCoverage(const string& filename, bool nonfatal) { - UINFO(2, "readCoverage " << filename << endl); + UINFO(2, "readCoverage " << filename); std::ifstream is{filename.c_str()}; if (!is) { @@ -44,7 +44,7 @@ void VlcTop::readCoverage(const string& filename, bool nonfatal) { while (!is.eof()) { const string line = V3Os::getline(is); - // UINFO(9," got "<= 9) { + UINFO_PREFIX("Left on iter" << nextrank << ": "); // LCOV_EXCL_LINE remaining.dump(); // LCOV_EXCL_LINE } VlcTest* bestTestp = nullptr; @@ -216,7 +216,7 @@ void VlcTop::annotateCalc() { if (!filename.empty() && lineno != 0) { VlcSource& source = sources().findNewSource(filename); UINFO(9, "AnnoCalc count " << filename << ":" << lineno << ":" << point.column() << " " - << point.count() << " " << point.linescov() << '\n'); + << point.count() << " " << point.linescov()); // Base coverage source.insertPoint(lineno, &point); // Additional lines covered by this statement @@ -254,12 +254,12 @@ void VlcTop::annotateCalcNeeded() { int totOk = 0; for (auto& si : m_sources) { VlcSource& source = si.second; - // UINFO(1,"Source "< " << outfilename << endl); + UINFO(1, "annotateOutputFile " << filename << " -> " << outfilename); std::ifstream is{filename.c_str()}; if (!is) { @@ -310,8 +310,8 @@ void VlcTop::annotateOutputFiles(const string& dirname) { os << " " << line << '\n'; } else { VlcSourceCount& sc = lit->second; - // UINFO(0,"Source - // "<