Add covergroup runtime registry (#8134)

This commit is contained in:
Matthew Ballance
2026-09-07 14:02:03 -04:00
committed by GitHub
parent cd2475fbd4
commit 048d18a84f
27 changed files with 1661 additions and 141 deletions
+6
View File
@@ -541,6 +541,8 @@ string EmitCFunc::emitVarResetRecurse(const AstVar* varp, bool constructing,
depth + 1, suffix + ".atDefault()", nullptr);
} else if (VN_IS(dtypep, CDType)) {
return ""; // Constructor does it
} else if (VN_IS(dtypep, CoverpointDType)) {
return ""; // Covergroup constructor creates the runtime and assigns the pointer
} else if (const AstClassRefDType* const adtypep = VN_CAST(dtypep, ClassRefDType)) {
return adtypep->rawPointer() ? varNameProtected + suffix + " = nullptr;\n" : "";
} else if (VN_IS(dtypep, IfaceRefDType)) {
@@ -594,6 +596,10 @@ string EmitCFunc::emitVarResetRecurse(const AstVar* varp, bool constructing,
return "";
} else if (basicp && (basicp->isRandomGenerator() || basicp->isStdRandomGenerator())) {
return "";
} else if (basicp && (basicp->isCovergroupInstHandle() || basicp->isCovergroupCross())) {
// The handle's own constructor deals with it; the cross is a borrowed pointer that
// the covergroup constructor assigns once it creates the runtime
return "";
} else if (basicp && (basicp->isEvent())) {
return "VlAssignableEvent{};\n";
} else if (basicp) {