Skip to content

Commit

Permalink
Wrap task calls into AstStmtExpr
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
  • Loading branch information
RRozak committed Nov 15, 2023
1 parent bcd960d commit 2f814bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/V3Randomize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ class RandomizeVisitor final : public VNVisitor {
auto* newp = VN_AS(m_memberMap.findMember(nodep, "new"), NodeFTask);
UASSERT_OBJ(newp, nodep, "No new() in class");
auto* taskp = newSetupConstraintsTask(nodep);
newp->addStmtsp(new AstTaskRef{fl, taskp->name(), nullptr});
AstTaskRef* const setupTaskRefp = new AstTaskRef{fl, taskp->name(), nullptr};
setupTaskRefp->taskp(taskp);
newp->addStmtsp(new AstStmtExpr{fl, setupTaskRefp});

nodep->user1(false);

Expand All @@ -392,7 +394,7 @@ class RandomizeVisitor final : public VNVisitor {
auto* const methodp = new AstCMethodHard{
fl, new AstVarRef{fl, genp, VAccess::READWRITE}, "hard", exprp};
methodp->dtypeSetVoid();
taskp->addStmtsp(methodp);
taskp->addStmtsp(new AstStmtExpr{fl, methodp});
}
});
}
Expand Down

0 comments on commit 2f814bd

Please sign in to comment.