Support procedural concurrent assertions with inferred clock (#7581)

This commit is contained in:
Yilou Wang
2026-05-13 07:42:28 -04:00
committed by GitHub
parent 1ffa6b277d
commit 05302080a9
3 changed files with 94 additions and 10 deletions
+8 -10
View File
@@ -415,24 +415,22 @@ class AssertVisitor final : public VNVisitor {
nodep->v3fatalSrc("Unhandled assert type");
}
iterateAndNextNull(nodep->passsp());
AstSenTree* const sentreep = nodep->sentreep();
AstSenTree* sentreep = nodep->sentreep();
if (nodep->immediate()) {
UASSERT_OBJ(!sentreep, nodep, "Immediate assertions don't have sensitivity");
} else {
UASSERT_OBJ(sentreep, nodep, "Concurrent assertions must have sensitivity");
if (m_procedurep) {
if (!nodep->senFromAlways()) {
// To support this need queue of asserts to activate
nodep->v3warn(E_UNSUPPORTED,
"Unsupported: Procedural concurrent assertion with"
" clocking event inside always (IEEE 1800-2023 16.14.6)");
}
// Change type to concurrent and relink after process
nodep->immediate(false);
// Explicit inline clock differs from the enclosing always: hoist
// and warn. To support this need queue of asserts to activate.
if (m_procedurep && !nodep->senFromAlways()) {
nodep->v3warn(E_UNSUPPORTED,
"Unsupported: Procedural concurrent assertion with"
" clocking event inside always (IEEE 1800-2023 16.14.6)");
static_cast<AstNode*>(m_procedurep)->addNext(nodep->unlinkFrBack());
return; // Later iterate will pick up
}
sentreep->unlinkFrBack();
if (m_procedurep) { VL_DO_DANGLING(pushDeletep(sentreep), sentreep); }
}
//
const string& message = nodep->name();