Apply 'make format'
This commit is contained in:
parent
75097a083e
commit
d9dfe983ae
|
|
@ -300,27 +300,26 @@ class BeginVisitor final : public VNVisitor {
|
|||
void visit(AstVar* nodep) override {
|
||||
// If static variable, move it outside a function.
|
||||
if (nodep->lifetime().isStatic() && m_ftaskp) {
|
||||
if (nodep->user1()) {
|
||||
return;
|
||||
}
|
||||
if (nodep->user1()) { return; }
|
||||
const std::string newName
|
||||
= m_ftaskp->name() + "__Vstatic__" + dot(m_unnamedScope, nodep->name());
|
||||
if (nodep->isIO()) {
|
||||
// Create a port that is used for passing value between argument and static variable
|
||||
// Create a port that is used for passing value between argument and static
|
||||
// variable
|
||||
AstVar* const portp = nodep->cloneTreePure(false);
|
||||
portp->user1(true);
|
||||
nodep->replaceWith(portp);
|
||||
|
||||
if (nodep->isInput() || nodep->isInout()) {
|
||||
AstAssign* const initAssignp = new AstAssign{nodep->fileline(),
|
||||
new AstVarRef{nodep->fileline(), nodep, VAccess::WRITE},
|
||||
AstAssign* const initAssignp = new AstAssign{
|
||||
nodep->fileline(), new AstVarRef{nodep->fileline(), nodep, VAccess::WRITE},
|
||||
new AstVarRef{portp->fileline(), portp, VAccess::READ}};
|
||||
portp->addNextHere(initAssignp);
|
||||
}
|
||||
|
||||
if (nodep->isWritable()) {
|
||||
AstAssign* const endAssignp = new AstAssign{nodep->fileline(),
|
||||
new AstVarRef{portp->fileline(), portp, VAccess::WRITE},
|
||||
AstAssign* const endAssignp = new AstAssign{
|
||||
nodep->fileline(), new AstVarRef{portp->fileline(), portp, VAccess::WRITE},
|
||||
new AstVarRef{nodep->fileline(), nodep, VAccess::READ}};
|
||||
m_ftaskp->addStmtsp(endAssignp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,12 +443,10 @@ class DynScopeVisitor final : public VNVisitor {
|
|||
if (!isEvent && m_afterTimingControl && nodep->varp()->isWritable()
|
||||
&& nodep->access().isWriteOrRW()) {
|
||||
// The output variable may not exist after a delay, so we can't just write to it
|
||||
nodep->v3error(
|
||||
"Writing to an "
|
||||
<< nodep->varp()->verilogKwd()
|
||||
<< " automatic variable of a "
|
||||
<< (m_inFunc ? "function" : "task")
|
||||
<< " after a timing control is not allowed");
|
||||
nodep->v3error("Writing to an " << nodep->varp()->verilogKwd()
|
||||
<< " automatic variable of a "
|
||||
<< (m_inFunc ? "function" : "task")
|
||||
<< " after a timing control is not allowed");
|
||||
}
|
||||
if (!framep->instance().initialized()) framep->createInstancePrototype();
|
||||
framep->captureVarInsert(nodep->varp());
|
||||
|
|
|
|||
|
|
@ -250,7 +250,8 @@ class LinkParseVisitor final : public VNVisitor {
|
|||
VL_RESTORER(m_lifetimeAllowed);
|
||||
m_lifetimeAllowed = true;
|
||||
VL_RESTORER(m_hasTimingControl);
|
||||
m_hasTimingControl = nodep->exists([](const AstNode* const nodep) {return nodep->isTimingControl();});
|
||||
m_hasTimingControl
|
||||
= nodep->exists([](const AstNode* const nodep) { return nodep->isTimingControl(); });
|
||||
if (!nodep->lifetime().isNone()) {
|
||||
m_lifetime = nodep->lifetime().makeImplicit();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue