Support assert under assert (#6146).

This commit is contained in:
Wilson Snyder
2025-12-16 20:45:31 -05:00
parent f1ee434dca
commit 41c4f948fe
6 changed files with 96 additions and 19 deletions
-9
View File
@@ -50,7 +50,6 @@ class LinkResolveVisitor final : public VNVisitor {
string m_randcIllegalWhy; // Why randc illegal
AstNode* m_randcIllegalp = nullptr; // Node causing randc illegal
AstNodeFTask* m_ftaskp = nullptr; // Function or task we're inside
AstNodeCoverOrAssert* m_assertp = nullptr; // Current assertion
int m_senitemCvtNum = 0; // Temporary signal counter
std::deque<AstGenFor*> m_underGenFors; // Stack of GenFor underneath
bool m_underGenerate = false; // Under GenFor/GenIf
@@ -119,14 +118,6 @@ class LinkResolveVisitor final : public VNVisitor {
VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
}
void visit(AstNodeCoverOrAssert* nodep) override {
if (m_assertp) {
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Assert not allowed under another assert");
}
VL_RESTORER(m_assertp);
m_assertp = nodep;
iterateChildren(nodep);
}
void visit(AstVar* nodep) override {
iterateChildren(nodep);
if (m_classp && !nodep->isParam()) nodep->varType(VVarType::MEMBER);