mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 10:33:13 +02:00
Support logic and set operations on binsof (#8306)
This commit is contained in:
+39
-4
@@ -1209,8 +1209,44 @@ void AstCoverBin::dumpJson(std::ostream& str) const {
|
||||
dumpJsonBoolIf(str, "isWildcard", isWildcard());
|
||||
str << ", \"binsType\": \"" << binsType().ascii() << "\"";
|
||||
}
|
||||
void AstCoverBinsof::dump(std::ostream& str) const {
|
||||
Super::dump(str);
|
||||
if (isNegated()) str << " [NEGATED]";
|
||||
}
|
||||
void AstCoverBinsof::dumpJson(std::ostream& str) const {
|
||||
Super::dumpJson(str);
|
||||
dumpJsonBoolIf(str, "isNegated", isNegated());
|
||||
}
|
||||
void AstCoverCross::dump(std::ostream& str) const { Super::dump(str); }
|
||||
void AstCoverCross::dumpJson(std::ostream& str) const { Super::dumpJson(str); }
|
||||
string AstCoverCrossDType::cppTemplateArgs() const {
|
||||
return cvtToStr(dimensions()) + ", " + cvtToStr(tuples()) + ", " + cvtToStr(bins()) + ", "
|
||||
+ cvtToStr(autoBins()) + ", " + cvtToStr(binWords());
|
||||
}
|
||||
void AstCoverCrossDType::dump(std::ostream& str) const {
|
||||
Super::dump(str);
|
||||
str << " [" << cppTemplateArgs() << "]";
|
||||
}
|
||||
void AstCoverCrossDType::dumpJson(std::ostream& str) const {
|
||||
dumpJsonNumFunc(str, dimensions);
|
||||
dumpJsonNumFunc(str, tuples);
|
||||
dumpJsonNumFunc(str, bins);
|
||||
dumpJsonNumFunc(str, autoBins);
|
||||
dumpJsonNumFunc(str, binWords);
|
||||
dumpJsonGen(str);
|
||||
}
|
||||
void AstCoverCrossDType::dumpSmall(std::ostream& str) const {
|
||||
Super::dumpSmall(str);
|
||||
str << "covercross[" << cppTemplateArgs() << "]";
|
||||
}
|
||||
void AstCoverCrossSelect::dump(std::ostream& str) const {
|
||||
Super::dump(str);
|
||||
str << (isOr() ? " [OR]" : " [AND]");
|
||||
}
|
||||
void AstCoverCrossSelect::dumpJson(std::ostream& str) const {
|
||||
Super::dumpJson(str);
|
||||
dumpJsonBoolIf(str, "isOr", isOr());
|
||||
}
|
||||
void AstCoverInc::dump(std::ostream& str) const {
|
||||
Super::dump(str);
|
||||
str << " -> ";
|
||||
@@ -2148,6 +2184,9 @@ AstNodeDType::CTypeRecursed AstNodeDType::cTypeRecurse(bool compound, bool packe
|
||||
// + 1 below as VlQueue uses 0 to mean unlimited, 1 to mean size() max is 1
|
||||
if (adtypep->boundp()) info.m_type += ", " + cvtToStr(adtypep->boundConst() + 1);
|
||||
info.m_type += ">";
|
||||
} else if (const auto* const adtypep = VN_CAST(dtypep, CoverCrossDType)) {
|
||||
UASSERT_OBJ(!packed, this, "Unsupported type for packed struct or union");
|
||||
info.m_type = "VlCoverCrossT<" + adtypep->cppTemplateArgs() + ">*";
|
||||
} else if (const auto* const adtypep = VN_CAST(dtypep, CoverpointDType)) {
|
||||
UASSERT_OBJ(!packed, this, "Unsupported type for packed struct or union");
|
||||
info.m_type = "VlCoverpointT<" + cvtToStr(adtypep->hitBound()) + ">*";
|
||||
@@ -2228,10 +2267,6 @@ AstNodeDType::CTypeRecursed AstNodeDType::cTypeRecurse(bool compound, bool packe
|
||||
info.m_type = "VlStdRandomizer";
|
||||
} else if (bdtypep->isCovergroupInstHandle()) {
|
||||
info.m_type = "VlCovInstHandle";
|
||||
} else if (bdtypep->isCovergroupCross()) {
|
||||
// Borrowed pointer: VlCovergroupInst owns the cross runtime, so its bins outlive the
|
||||
// SV covergroup object (the coverage DB holds raw count pointers read at write() time)
|
||||
info.m_type = "VlCoverCross*";
|
||||
} else if (bdtypep->isEvent()) {
|
||||
info.m_type = v3Global.assignsEvents() ? "VlAssignableEvent" : "VlEvent";
|
||||
} else if (dtypep->widthMin() <= 8) { // Handle unpacked arrays; not bdtypep->width
|
||||
|
||||
Reference in New Issue
Block a user