Internals: Minor cleanups preparing for initialization fixes. No functional change.

This commit is contained in:
Wilson Snyder
2026-02-07 14:16:12 -05:00
parent 9068e2e5b5
commit bbb231dfe2
12 changed files with 52 additions and 45 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ public:
VNumRange declRange() const VL_MT_STABLE { return VNumRange{hi(), lo()}; }
AstNodeModule* classOrPackagep() const { return m_classOrPackagep; }
void classOrPackagep(AstNodeModule* classpackagep) { m_classOrPackagep = classpackagep; }
bool isConstrainedRand() { return m_constrainedRand; }
bool isConstrainedRand() const { return m_constrainedRand; }
void markConstrainedRand(bool flag) { m_constrainedRand = flag; }
};
+1 -1
View File
@@ -1367,7 +1367,7 @@ public:
return resultp()->isPure();
}
bool sameNode(const AstNode*) const override { return true; }
bool hasResult() { return m_hasResult; }
bool hasResult() const { return m_hasResult; }
void hasResult(bool flag) { m_hasResult = flag; }
};
class AstFError final : public AstNodeExpr {
+8 -8
View File
@@ -2110,26 +2110,26 @@ public:
if (flag) m_funcLocalSticky = true;
}
void funcReturn(bool flag) { m_funcReturn = flag; }
bool gotNansiType() const { return m_gotNansiType; }
void gotNansiType(bool flag) { m_gotNansiType = flag; }
bool gotNansiType() { return m_gotNansiType; }
bool hasStrengthAssignment() const { return m_hasStrengthAssignment; }
void hasStrengthAssignment(bool flag) { m_hasStrengthAssignment = flag; }
bool hasStrengthAssignment() { return m_hasStrengthAssignment; }
void isDpiOpenArray(bool flag) { m_isDpiOpenArray = flag; }
bool isDpiOpenArray() const VL_MT_SAFE { return m_isDpiOpenArray; }
void isDpiOpenArray(bool flag) { m_isDpiOpenArray = flag; }
bool isHideLocal() const { return m_isHideLocal; }
void isHideLocal(bool flag) { m_isHideLocal = flag; }
bool isHideProtected() const { return m_isHideProtected; }
void isHideProtected(bool flag) { m_isHideProtected = flag; }
void noCReset(bool flag) { m_noCReset = flag; }
bool noCReset() const { return m_noCReset; }
void noReset(bool flag) { m_noReset = flag; }
void noCReset(bool flag) { m_noCReset = flag; }
bool noReset() const { return m_noReset; }
void noSubst(bool flag) { m_noSubst = flag; }
void noReset(bool flag) { m_noReset = flag; }
bool noSubst() const { return m_noSubst; }
void substConstOnly(bool flag) { m_substConstOnly = flag; }
void noSubst(bool flag) { m_noSubst = flag; }
bool substConstOnly() const { return m_substConstOnly; }
void overriddenParam(bool flag) { m_overridenParam = flag; }
void substConstOnly(bool flag) { m_substConstOnly = flag; }
bool overriddenParam() const { return m_overridenParam; }
void overriddenParam(bool flag) { m_overridenParam = flag; }
void trace(bool flag) { m_trace = flag; }
void isLatched(bool flag) { m_isLatched = flag; }
bool isForceable() const { return m_isForceable; }
+1 -1
View File
@@ -68,7 +68,7 @@ class BeginVisitor final : public VNVisitor {
// STATE - for current visit position (use VL_RESTORER)
AstNodeModule* m_modp = nullptr; // Current module
AstNodeFTask* m_ftaskp = nullptr; // Current function/task
AstNode* m_liftedp = nullptr; // Local nodes we are lifting into m_ftaskp
AstNode* m_liftedp = nullptr; // Local nodes we are lifting into m_ftaskp
string m_displayScope; // Name of %m in $display/AstScopeName
string m_namedScope; // Name of begin blocks above us
string m_unnamedScope; // Name of begin blocks, including unnamed blocks
+2
View File
@@ -144,6 +144,8 @@ class EmitCFunc VL_NOT_FINAL : public EmitCConstInit {
} m_emitDispState;
protected:
VL_DEFINE_DEBUG_FUNCTIONS;
EmitCLazyDecls m_lazyDecls{*this}; // Visitor for emitting lazy declarations
bool m_useSelfForThis = false; // Replace "this" with "vlSelf"
bool m_usevlSelfRef = false; // Use vlSelfRef reference instead of vlSelf pointer
+7 -4
View File
@@ -350,6 +350,7 @@ class DynScopeVisitor final : public VNVisitor {
void visit(AstNodeModule* nodep) override {
VL_RESTORER(m_modp);
if (!VN_IS(nodep, Class)) m_modp = nodep;
VL_RESTORER(m_id);
m_id = 0;
iterateChildren(nodep);
}
@@ -385,10 +386,12 @@ class DynScopeVisitor final : public VNVisitor {
bindNodeToDynScope(varp, framep);
}
for (AstNode* stmtp = nodep->stmtsp(); stmtp; stmtp = stmtp->nextp()) {
AstAssign* const asgnp = VN_CAST(stmtp, Assign);
UASSERT_OBJ(asgnp, stmtp, "Invalid node under block item initialization part of fork");
bindNodeToDynScope(asgnp->lhsp(), framep);
iterate(asgnp->rhsp());
if (AstAssign* const asgnp = VN_CAST(stmtp, Assign)) {
bindNodeToDynScope(asgnp->lhsp(), framep);
iterate(asgnp->rhsp());
} else {
stmtp->v3fatalSrc("Invalid node under block item initialization part of fork");
}
}
for (AstNode* stmtp = nodep->forksp(); stmtp; stmtp = stmtp->nextp()) {