Internals: Make AstAssignW a procedural statement (#6280) (#6556)

Initial idea was to remodel AssignW as Assign under Alway. Trying that
uncovered some issues, the most difficult of them was that a delay
attached to a continuous assignment behaves differently from a delay
attached to a blocking assignment statement, so we need to keep the
knowledge of which flavour an assignment was until V3Timing.

So instead of removing AstAssignW, we always wrap it in an AstAlways,
with a special `keyword()` type. This makes it into a proper procedural
statement, which is almost equivalent to AstAssign, except for the case
when they contain a delay. We still gain the benefits of #6280 and can
simplify some code. Every AstNodeStmt should now be under an
AstNodeProcedure - which we should rename to AstProcess, or an
AstNodeFTask). As a result, V3Table can now handle AssignW for free.
Also uncovered and fixed a bug in handling intra-assignment delays if
a function is present on the RHS of an AssignW.

There is more work to be done towards #6280, and potentially simplifying
AssignW handing, but this is the minimal change required to tick it off
the TODO list for #6280.
This commit is contained in:
Geza Lore
2025-10-14 09:05:19 +01:00
committed by GitHub
parent 958d096e7f
commit eb53bca6fd
55 changed files with 1540 additions and 1411 deletions
+8 -1
View File
@@ -282,7 +282,14 @@ class CoverageVisitor final : public VNVisitor {
}
iterateChildren(nodep);
}
void visit(AstAlways* nodep) override {
if (nodep->keyword() == VAlwaysKwd::CONT_ASSIGN) {
// Don't want line coverage for it, iterate for expression/toggle coverage only
iterateChildren(nodep);
return;
}
iterateProcedure(nodep);
}
void visit(AstNodeProcedure* nodep) override { iterateProcedure(nodep); }
void visit(AstLoop* nodep) override {
UASSERT_OBJ(!nodep->contsp(), nodep, "'contsp' only used before LinkJump");