Skip to content

Commit

Permalink
Move resize function after the call to contraint resolver
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Nov 5, 2024
1 parent 5e55be1 commit 983b285
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/V3Randomize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1937,22 +1937,22 @@ class RandomizeVisitor final : public VNVisitor {
UASSERT_OBJ(newp, randModeClassp, "No new() in class");
addSetRandMode(newp, genp, randModeVarp);
}

AstTask* const resizeAllTaskp
= VN_AS(m_memberMap.findMember(nodep, "__Vresize_constrained_arrays"), Task);
if (resizeAllTaskp) {
AstTaskRef* const resizeTaskRefp
= new AstTaskRef{fl, resizeAllTaskp->name(), nullptr};
resizeTaskRefp->taskp(resizeAllTaskp);
randomizep->addStmtsp(resizeTaskRefp->makeStmt());
}
} else {
beginValp = new AstConst{fl, AstConst::WidthedValue{}, 32, 1};
}

AstVarRef* const fvarRefp = new AstVarRef{fl, fvarp, VAccess::WRITE};
randomizep->addStmtsp(new AstAssign{fl, fvarRefp, beginValp});

AstTask* const resizeAllTaskp
= VN_AS(m_memberMap.findMember(nodep, "__Vresize_constrained_arrays"), Task);
if (resizeAllTaskp) {
AstTaskRef* const resizeTaskRefp
= new AstTaskRef{fl, resizeAllTaskp->name(), nullptr};
resizeTaskRefp->taskp(resizeAllTaskp);
randomizep->addStmtsp(resizeTaskRefp->makeStmt());
}

AstFunc* const basicRandomizep
= V3Randomize::newRandomizeFunc(m_memberMap, nodep, "__Vbasic_randomize");
addBasicRandomizeBody(basicRandomizep, nodep, randModeVarp);
Expand Down

0 comments on commit 983b285

Please sign in to comment.