Add comment and rename function
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
This commit is contained in:
parent
d576a49f8a
commit
559a1363f5
|
|
@ -102,7 +102,7 @@ public:
|
||||||
AstVarRef* const rdRefp = new AstVarRef{flp, m_rdVscp, VAccess::WRITE};
|
AstVarRef* const rdRefp = new AstVarRef{flp, m_rdVscp, VAccess::WRITE};
|
||||||
std::vector<AstAssign*> assigns;
|
std::vector<AstAssign*> assigns;
|
||||||
AstNodeStmt* const rdUpdateStmtsp
|
AstNodeStmt* const rdUpdateStmtsp
|
||||||
= getAssignStmtsRecursep(rdRefp, vscp, rdRefp, assigns);
|
= getForcedUpdateStmtsRecursep(rdRefp, vscp, rdRefp, assigns);
|
||||||
|
|
||||||
// To use these statements for __En initialization, replace references to __Rd with
|
// To use these statements for __En initialization, replace references to __Rd with
|
||||||
// ones to __En and replace assignments RHS with 0
|
// ones to __En and replace assignments RHS with 0
|
||||||
|
|
@ -142,10 +142,13 @@ public:
|
||||||
vscp->scopep()->addBlocksp(activep);
|
vscp->scopep()->addBlocksp(activep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AstNodeStmt* getAssignStmtsRecursep(AstNodeExpr* const lhsp, AstVarScope* const vscp,
|
AstNodeStmt* getForcedUpdateStmtsRecursep(AstNodeExpr* const lhsp, AstVarScope* const vscp,
|
||||||
AstVarRef* const lhsVarRefp,
|
AstVarRef* const lhsVarRefp,
|
||||||
std::vector<AstAssign*>& assigns) {
|
std::vector<AstAssign*>& assigns) {
|
||||||
// Create stataments that assigns
|
// Create stataments that update values of __Rd variable.
|
||||||
|
// lhsp is either a reference to that variable or ArraySel or MemberSel on it.
|
||||||
|
// lhsVarRefp is a reference to that variable in lhsp subtree.
|
||||||
|
// assigns is a vector to which all assignments to __Rd are added.
|
||||||
FileLine* const flp = lhsp->fileline();
|
FileLine* const flp = lhsp->fileline();
|
||||||
const AstNodeDType* const lhsDtypep = lhsp->dtypep()->skipRefp();
|
const AstNodeDType* const lhsDtypep = lhsp->dtypep()->skipRefp();
|
||||||
if (lhsDtypep->isIntegralOrPacked() || VN_IS(lhsDtypep, BasicDType)) {
|
if (lhsDtypep->isIntegralOrPacked() || VN_IS(lhsDtypep, BasicDType)) {
|
||||||
|
|
@ -165,7 +168,7 @@ public:
|
||||||
AstStructSel* const structSelp = new AstStructSel{flp, lhsCopyp, mdtp->name()};
|
AstStructSel* const structSelp = new AstStructSel{flp, lhsCopyp, mdtp->name()};
|
||||||
structSelp->dtypep(mdtp);
|
structSelp->dtypep(mdtp);
|
||||||
AstNodeStmt* const memberStmtp
|
AstNodeStmt* const memberStmtp
|
||||||
= getAssignStmtsRecursep(structSelp, vscp, lhsVarRefCopyp, assigns);
|
= getForcedUpdateStmtsRecursep(structSelp, vscp, lhsVarRefCopyp, assigns);
|
||||||
stmtsp = firstIter ? memberStmtp : stmtsp->addNext(memberStmtp);
|
stmtsp = firstIter ? memberStmtp : stmtsp->addNext(memberStmtp);
|
||||||
firstIter = false;
|
firstIter = false;
|
||||||
}
|
}
|
||||||
|
|
@ -193,7 +196,7 @@ public:
|
||||||
AstArraySel* const lhsSelp
|
AstArraySel* const lhsSelp
|
||||||
= new AstArraySel{flp, lhsp, readRefp->cloneTree(false)};
|
= new AstArraySel{flp, lhsp, readRefp->cloneTree(false)};
|
||||||
AstNodeStmt* const loopBodyp
|
AstNodeStmt* const loopBodyp
|
||||||
= getAssignStmtsRecursep(lhsSelp, vscp, lhsVarRefp, assigns);
|
= getForcedUpdateStmtsRecursep(lhsSelp, vscp, lhsVarRefp, assigns);
|
||||||
currWhilep->addStmtsp(loopBodyp);
|
currWhilep->addStmtsp(loopBodyp);
|
||||||
AstAssign* const currIncrp = new AstAssign{
|
AstAssign* const currIncrp = new AstAssign{
|
||||||
flp, new AstVarRef{flp, loopVarScopep, VAccess::WRITE},
|
flp, new AstVarRef{flp, loopVarScopep, VAccess::WRITE},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue