Fix events in observed region (#7546)

This commit is contained in:
Todd Strader
2026-05-07 17:02:41 -04:00
committed by GitHub
parent 1a367a13fc
commit 752b77ea77
3 changed files with 57 additions and 0 deletions
+14
View File
@@ -486,6 +486,18 @@ class ActiveVisitor final : public VNVisitor {
}
}
static void markEventEdges(AstSenTree* sentreep) {
for (AstSenItem* senip = sentreep->sensesp(); senip;
senip = VN_AS(senip->nextp(), SenItem)) {
if (!senip->sensp()) continue;
if (const AstNodeDType* const dtypep = senip->sensp()->dtypep()) {
if (const AstBasicDType* const basicp = dtypep->basicp()) {
if (basicp->isEvent()) senip->edgeType(VEdgeType::ET_EVENT);
}
}
}
}
// VISITORS
void visit(AstScope* nodep) override {
m_namer.main(nodep); // Clear last scope's names, and collect this scope's existing names
@@ -528,6 +540,7 @@ class ActiveVisitor final : public VNVisitor {
}
void visit(AstAlwaysObserved* nodep) override {
UASSERT_OBJ(nodep->sentreep(), nodep, "Should have a sentree");
markEventEdges(nodep->sentreep());
AstSenTree* const sentreep = nodep->sentreep();
sentreep->unlinkFrBack();
// Make a new active for it, needs to be the only item under the active for V3Sched
@@ -536,6 +549,7 @@ class ActiveVisitor final : public VNVisitor {
}
void visit(AstAlwaysReactive* nodep) override {
UASSERT_OBJ(nodep->sentreep(), nodep, "Should have a sentree");
markEventEdges(nodep->sentreep());
AstSenTree* const sentreep = nodep->sentreep();
sentreep->unlinkFrBack();
// Make a new active for it, needs to be the only item under the active for V3Sched