Internals: Inline AstVar::isToggleCoverable()

Inline into the single call site, remove unnecessary isSc() and
isPrimaryIO() guards (these flags are set only in a later pass).

No functional change.
This commit is contained in:
Geza Lore 2026-06-14 16:29:27 +01:00
parent 9a0cd289e8
commit 77e6a21224
2 changed files with 6 additions and 9 deletions

View File

@ -2458,12 +2458,6 @@ public:
bool isWor() const { return varType().isWor(); }
bool isWiredNet() const { return varType().isWiredNet(); }
bool isTemp() const { return varType().isTemp(); }
bool isToggleCoverable() const {
return ((isIO() || isSignal())
&& (isIO() || isBitLogic())
// Wrapper would otherwise duplicate wrapped module's coverage
&& !isSc() && !isPrimaryIO() && !isConst() && !isDouble() && !isString());
}
bool isClassMember() const { return varType() == VVarType::MEMBER; }
bool isVirtIface() const {
if (AstIfaceRefDType* const dtp = VN_CAST(dtypep(), IfaceRefDType)) {

View File

@ -166,10 +166,13 @@ class CoverageVisitor final : public VNVisitor {
// METHODS
// Return non-nullptr reason if this variable shouldn't have toggle coverage
const char* varIgnoreToggle(const AstVar* nodep) {
// Return true if this shouldn't be traced
// See also similar rule in V3TraceDecl::varIgnoreTrace
if (!nodep->isToggleCoverable()) return "Not relevant signal type";
const bool cover = nodep->isIO() || (nodep->isSignal() && nodep->isBitLogic());
if (!cover) return "Not relevant signal";
if (nodep->isConst()) return "Signal is constant";
if (nodep->isDouble()) return "Signal is double";
if (nodep->isString()) return "Signal is string";
if (!v3Global.opt.coverageUnderscore()) {
const string prettyName = nodep->prettyName();
if (prettyName[0] == '_') return "Leading underscore";