From bf035d17f32dd96f6f0b983e622bcf9cd75d112f Mon Sep 17 00:00:00 2001 From: github action Date: Wed, 25 Mar 2026 19:47:34 +0000 Subject: [PATCH] Apply 'make format' --- src/V3Active.cpp | 5 ++--- src/V3Covergroup.cpp | 28 ++++++++++++++-------------- src/VlcTop.cpp | 40 +++++++++++++++++++++++----------------- 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/V3Active.cpp b/src/V3Active.cpp index 2e6d4093d..0736977c5 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -623,8 +623,7 @@ public: // Shared state for covergroup sampling passes struct CovergroupState final { - std::unordered_map - m_sampleFuncs; // Class -> sample CFunc + std::unordered_map m_sampleFuncs; // Class -> sample CFunc std::unordered_map m_samplingEvents; // Class -> owned sampling event (if any) }; @@ -773,7 +772,7 @@ void V3Active::activeAll(AstNetlist* nodep) { // Add automatic covergroup sampling in two focused passes CovergroupState state; CovergroupCollectVisitor{nodep, state}; // Pass 1: collect CFuncs and events - CovergroupInjectVisitor{nodep, state}; // Pass 2: inject sample() calls + CovergroupInjectVisitor{nodep, state}; // Pass 2: inject sample() calls for (const auto& itpair : state.m_samplingEvents) itpair.second->deleteTree(); } V3Global::dumpCheckGlobalTree("active", 0, dumpTreeEitherLevel() >= 3); diff --git a/src/V3Covergroup.cpp b/src/V3Covergroup.cpp index 5bdacc8fb..a1f96498a 100644 --- a/src/V3Covergroup.cpp +++ b/src/V3Covergroup.cpp @@ -317,10 +317,10 @@ class FunctionalCoverageVisitor final : public VNVisitor { if (excluded.find(v) != excluded.end()) continue; // Create single-value bin - AstConst* const valConstp = new AstConst{coverpointp->fileline(), - V3Number(coverpointp->fileline(), width, v)}; - AstConst* const valConstp2 = new AstConst{coverpointp->fileline(), - V3Number(coverpointp->fileline(), width, v)}; + AstConst* const valConstp = new AstConst{ + coverpointp->fileline(), V3Number(coverpointp->fileline(), width, v)}; + AstConst* const valConstp2 = new AstConst{ + coverpointp->fileline(), V3Number(coverpointp->fileline(), width, v)}; AstInsideRange* const rangep = new AstInsideRange{coverpointp->fileline(), valConstp, valConstp2}; @@ -360,10 +360,10 @@ class FunctionalCoverageVisitor final : public VNVisitor { } // Create constants for range - AstConst* const loConstp = new AstConst{coverpointp->fileline(), - V3Number(coverpointp->fileline(), width, lo)}; - AstConst* const hiConstp = new AstConst{coverpointp->fileline(), - V3Number(coverpointp->fileline(), width, hi)}; + AstConst* const loConstp = new AstConst{ + coverpointp->fileline(), V3Number(coverpointp->fileline(), width, lo)}; + AstConst* const hiConstp = new AstConst{ + coverpointp->fileline(), V3Number(coverpointp->fileline(), width, hi)}; // Create InsideRange [lo:hi] AstInsideRange* const rangep @@ -1194,8 +1194,8 @@ class FunctionalCoverageVisitor final : public VNVisitor { UINFO(4, " Created cross bin variable: " << varName << endl); // Track this for coverage computation - AstCoverBin* const pseudoBinp = new AstCoverBin{crossp->fileline(), binName, - static_cast(nullptr), false, false}; + AstCoverBin* const pseudoBinp = new AstCoverBin{ + crossp->fileline(), binName, static_cast(nullptr), false, false}; m_binInfos.push_back(BinInfo(pseudoBinp, varp, 1, nullptr, crossp)); // Generate matching code: if (bin1 && bin2 && ... && binN) varName++; @@ -1601,11 +1601,11 @@ class FunctionalCoverageVisitor final : public VNVisitor { + std::to_string(fl->firstColumn()) + "\", "); const std::string crossSuffix = crossp ? ", \"cross\", \"1\"" : ""; if (binp->binsType() == VCoverBinsType::BINS_IGNORE) { - cstmtp->add("\"bin\", \"" + binName + "\", \"bin_type\", \"ignore\"" - + crossSuffix + ");"); + cstmtp->add("\"bin\", \"" + binName + "\", \"bin_type\", \"ignore\"" + crossSuffix + + ");"); } else if (binp->binsType() == VCoverBinsType::BINS_ILLEGAL) { - cstmtp->add("\"bin\", \"" + binName + "\", \"bin_type\", \"illegal\"" - + crossSuffix + ");"); + cstmtp->add("\"bin\", \"" + binName + "\", \"bin_type\", \"illegal\"" + crossSuffix + + ");"); } else { cstmtp->add("\"bin\", \"" + binName + "\"" + crossSuffix + ");"); } diff --git a/src/VlcTop.cpp b/src/VlcTop.cpp index 4fc913277..9f8bed6ca 100644 --- a/src/VlcTop.cpp +++ b/src/VlcTop.cpp @@ -297,8 +297,10 @@ void VlcTop::covergroup() { grandTotal += cp.normalTotal; grandCovered += cp.normalCovered; for (const auto& bin : cp.bins) { - if (bin.binType == "ignore") ++grandIgnored; - else if (bin.binType == "illegal") ++grandIllegal; + if (bin.binType == "ignore") + ++grandIgnored; + else if (bin.binType == "illegal") + ++grandIllegal; } } } @@ -317,8 +319,8 @@ void VlcTop::covergroup() { std::cout << "COVERGROUP COVERAGE REPORT\n"; std::cout << "==========================\n"; std::cout << "\n"; - std::cout << "TOTAL: " << grandCovered << "/" << grandTotal - << " bins covered (" << pctStr(grandCovered, grandTotal) << "%)\n"; + std::cout << "TOTAL: " << grandCovered << "/" << grandTotal << " bins covered (" + << pctStr(grandCovered, grandTotal) << "%)\n"; if (grandIgnored || grandIllegal) std::cout << " (" << grandIgnored << " ignored, " << grandIllegal << " illegal)\n"; @@ -333,16 +335,16 @@ void VlcTop::covergroup() { } std::cout << "\n" << divider << "\n"; - std::cout << "Covergroup Type: " << cg.typeName - << " [" << cg.filename << ":" << cg.lineno << "]\n"; - std::cout << " Type Coverage: " << cgCovered << "/" << cgTotal - << " bins (" << pctStr(cgCovered, cgTotal) << "%)\n"; + std::cout << "Covergroup Type: " << cg.typeName << " [" << cg.filename << ":" << cg.lineno + << "]\n"; + std::cout << " Type Coverage: " << cgCovered << "/" << cgTotal << " bins (" + << pctStr(cgCovered, cgTotal) << "%)\n"; for (const auto& cp : cg.coverpoints) { std::cout << "\n"; std::cout << " " << (cp.isCross ? "Cross" : "Coverpoint") << ": " << cp.name << "\n"; - std::cout << " Coverage: " << cp.normalCovered << "/" << cp.normalTotal - << " bins (" << pctStr(cp.normalCovered, cp.normalTotal) << "%)\n"; + std::cout << " Coverage: " << cp.normalCovered << "/" << cp.normalTotal << " bins (" + << pctStr(cp.normalCovered, cp.normalTotal) << "%)\n"; std::cout << " Bins:\n"; // Align bin name column to max name length in this coverpoint @@ -352,14 +354,18 @@ void VlcTop::covergroup() { for (const auto& bin : cp.bins) { const char* status; - if (bin.binType == "ignore") status = "IGNORE "; - else if (bin.binType == "illegal") status = "ILLEGAL"; - else if (bin.covered) status = "COVERED"; - else status = "ZERO "; + if (bin.binType == "ignore") + status = "IGNORE "; + else if (bin.binType == "illegal") + status = "ILLEGAL"; + else if (bin.covered) + status = "COVERED"; + else + status = "ZERO "; - std::cout << " " << status << " " - << std::left << std::setw(static_cast(maxNameLen)) << bin.name - << std::right << " " << bin.count << " hits\n"; + std::cout << " " << status << " " << std::left + << std::setw(static_cast(maxNameLen)) << bin.name << std::right + << " " << bin.count << " hits\n"; } } }