Refactor V3Delayed to enable algorithmic extension (#5090)

No functional change.

This patch is just cleanup with some non-functional changes to enable
the next patch. Most importantly createDlyOnSet, which implements NBAs
for arrays, has a new streamlined implementation that does the same
thing. Some output code is perturbed due to statement/local variable
insertion order.

Also renamed Vdlyvfoo to VdlyFoo for easier readability of the generated
code.
This commit is contained in:
Geza Lore 2024-05-01 23:06:25 +01:00 committed by GitHub
parent b5b937e2f2
commit d841a791e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 424 additions and 430 deletions

View File

@ -2434,13 +2434,11 @@ public:
ASTGEN_MEMBERS_AstAlwaysObserved;
};
class AstAlwaysPost final : public AstNodeProcedure {
// Like always but post assignments for memory assignment IFs
// @astgen op1 := sensesp : Optional[AstSenTree] // Sensitivity list iff clocked
// Like always but 'post' scheduled, e.g. for array NBA commits
public:
AstAlwaysPost(FileLine* fl, AstSenTree* sensesp, AstNode* stmtsp)
: ASTGEN_SUPER_AlwaysPost(fl, stmtsp) {
this->sensesp(sensesp);
}
AstAlwaysPost(FileLine* fl)
: ASTGEN_SUPER_AlwaysPost(fl, nullptr) {}
ASTGEN_MEMBERS_AstAlwaysPost;
};
class AstAlwaysPostponed final : public AstNodeProcedure {

File diff suppressed because it is too large Load Diff

View File

@ -128,7 +128,7 @@ private:
if (writesToVirtIface(nodep)) {
// Convert to always, as we have to assign the trigger var
FileLine* const flp = nodep->fileline();
AstAlwaysPost* const postp = new AstAlwaysPost{flp, nullptr, nullptr};
AstAlwaysPost* const postp = new AstAlwaysPost{flp};
nodep->replaceWith(postp);
postp->addStmtsp(
new AstAssign{flp, nodep->lhsp()->unlinkFrBack(), nodep->rhsp()->unlinkFrBack()});