mirror of
https://github.com/verilator/verilator.git
synced 2026-09-01 18:36:28 +02:00
Generate AstNode accessors via astgen
Introduce the @astgen directives parsed by astgen, currently used for the generation child node (operand) accessors. Please see the updated internal documentation for details.
This commit is contained in:
+8
-8
@@ -157,13 +157,13 @@ private:
|
||||
varp = new AstVar(oldvarscp->fileline(), VVarType::BLOCKTEMP, name,
|
||||
VFlagBitPacked(), width);
|
||||
}
|
||||
addmodp->addStmtp(varp);
|
||||
addmodp->addStmtsp(varp);
|
||||
m_modVarMap.emplace(std::make_pair(addmodp, name), varp);
|
||||
}
|
||||
|
||||
AstVarScope* const varscp
|
||||
= new AstVarScope(oldvarscp->fileline(), oldvarscp->scopep(), varp);
|
||||
oldvarscp->scopep()->addVarp(varscp);
|
||||
oldvarscp->scopep()->addVarsp(varscp);
|
||||
return varscp;
|
||||
}
|
||||
|
||||
@@ -387,15 +387,15 @@ private:
|
||||
postLogicp = new AstIf(nodep->fileline(),
|
||||
new AstVarRef(nodep->fileline(), setvscp, VAccess::READ));
|
||||
UINFO(9, " Created " << postLogicp << endl);
|
||||
finalp->addStmtp(postLogicp);
|
||||
finalp->addStmtsp(postLogicp);
|
||||
finalp->user3p(setvscp); // Remember IF's vset variable
|
||||
finalp->user4p(postLogicp); // and the associated IF, as we may be able to reuse it
|
||||
}
|
||||
postLogicp->addIfsp(new AstAssign(nodep->fileline(), selectsp, valreadp));
|
||||
postLogicp->addThensp(new AstAssign(nodep->fileline(), selectsp, valreadp));
|
||||
if (m_procp->isSuspendable()) {
|
||||
FileLine* const flp = nodep->fileline();
|
||||
postLogicp->addIfsp(new AstAssign{flp, new AstVarRef{flp, setvscp, VAccess::WRITE},
|
||||
new AstConst{flp, 0}});
|
||||
postLogicp->addThensp(new AstAssign{flp, new AstVarRef{flp, setvscp, VAccess::WRITE},
|
||||
new AstConst{flp, 0}});
|
||||
}
|
||||
return newlhsp;
|
||||
}
|
||||
@@ -475,11 +475,11 @@ private:
|
||||
AstAlwaysPost* const postp = new AstAlwaysPost{flp, nullptr, nullptr};
|
||||
{
|
||||
AstIf* const ifp = new AstIf{flp, dlyRef(VAccess::READ)};
|
||||
postp->addStmtp(ifp);
|
||||
postp->addStmtsp(ifp);
|
||||
AstCMethodHard* const callp = new AstCMethodHard{flp, vrefp, "fire"};
|
||||
callp->statement(true);
|
||||
callp->dtypeSetVoid();
|
||||
ifp->addIfsp(callp);
|
||||
ifp->addThensp(callp);
|
||||
}
|
||||
|
||||
AstActive* const activep = createActive(nodep);
|
||||
|
||||
Reference in New Issue
Block a user