Apply 'make format'
This commit is contained in:
parent
6634a399e6
commit
bf035d17f3
|
|
@ -623,8 +623,7 @@ public:
|
|||
// Shared state for covergroup sampling passes
|
||||
|
||||
struct CovergroupState final {
|
||||
std::unordered_map<const AstClass*, AstCFunc*>
|
||||
m_sampleFuncs; // Class -> sample CFunc
|
||||
std::unordered_map<const AstClass*, AstCFunc*> m_sampleFuncs; // Class -> sample CFunc
|
||||
std::unordered_map<const AstClass*, AstSenTree*>
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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<AstNode*>(nullptr), false, false};
|
||||
AstCoverBin* const pseudoBinp = new AstCoverBin{
|
||||
crossp->fileline(), binName, static_cast<AstNode*>(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 + ");");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<int>(maxNameLen)) << bin.name
|
||||
<< std::right << " " << bin.count << " hits\n";
|
||||
std::cout << " " << status << " " << std::left
|
||||
<< std::setw(static_cast<int>(maxNameLen)) << bin.name << std::right
|
||||
<< " " << bin.count << " hits\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue