Fix looping
Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
parent
22cad93083
commit
bf586ce95f
|
|
@ -300,16 +300,21 @@ class BeginVisitor final : public VNVisitor {
|
||||||
void visit(AstVar* nodep) override {
|
void visit(AstVar* nodep) override {
|
||||||
// If static variable, move it outside a function.
|
// If static variable, move it outside a function.
|
||||||
if (nodep->lifetime().isStatic() && m_ftaskp) {
|
if (nodep->lifetime().isStatic() && m_ftaskp) {
|
||||||
|
if (nodep->user1()) {
|
||||||
|
UINFO(0, "RETURN");
|
||||||
|
return;
|
||||||
|
}
|
||||||
UINFO(0, "TASK IS STATIC " << m_ftaskp->lifetime().isStatic());
|
UINFO(0, "TASK IS STATIC " << m_ftaskp->lifetime().isStatic());
|
||||||
const std::string newName
|
const std::string newName
|
||||||
= m_ftaskp->name() + "__Vstatic__" + dot(m_unnamedScope, nodep->name());
|
= m_ftaskp->name() + "__Vstatic__" + dot(m_unnamedScope, nodep->name());
|
||||||
AstVar* newVarp = nodep->cloneTreePure(false);
|
AstVar* keepAsPort = nodep->cloneTreePure(false);
|
||||||
nodep->replaceWith(newVarp);
|
nodep->replaceWith(keepAsPort);
|
||||||
// AstNode::addNext(nodep, newVarp);
|
|
||||||
nodep->name(newName);
|
nodep->name(newName);
|
||||||
// nodep->unlinkFrBack();
|
// nodep->unlinkFrBack();
|
||||||
m_ftaskp->addHereThisAsNext(nodep);
|
m_ftaskp->addHereThisAsNext(nodep);
|
||||||
nodep->funcLocal(false);
|
nodep->funcLocal(false);
|
||||||
|
m_statep->userMarkChanged(keepAsPort);
|
||||||
|
// m_statep->userMarkChanged(nodep);
|
||||||
} else if (m_unnamedScope != "") {
|
} else if (m_unnamedScope != "") {
|
||||||
// Rename it
|
// Rename it
|
||||||
nodep->name(dot(m_unnamedScope, nodep->name()));
|
nodep->name(dot(m_unnamedScope, nodep->name()));
|
||||||
|
|
|
||||||
|
|
@ -450,13 +450,13 @@ class DynScopeVisitor final : public VNVisitor {
|
||||||
<< nodep->varp()->verilogKwd()
|
<< nodep->varp()->verilogKwd()
|
||||||
<< " variable of a function after a timing control is not allowed");
|
<< " variable of a function after a timing control is not allowed");
|
||||||
} else if (nodep->varp()->lifetime().isAutomatic()) {
|
} else if (nodep->varp()->lifetime().isAutomatic()) {
|
||||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Writing to a captured "
|
// nodep->v3warn(E_UNSUPPORTED, "Unsupported: Writing to a captured "
|
||||||
<< nodep->varp()->verilogKwd()
|
// << nodep->varp()->verilogKwd()
|
||||||
<< " variable in a "
|
// << " variable in a "
|
||||||
<< (VN_IS(nodep->backp(), AssignDly)
|
// << (VN_IS(nodep->backp(), AssignDly)
|
||||||
? "non-blocking assignment"
|
// ? "non-blocking assignment"
|
||||||
: "fork")
|
// : "fork")
|
||||||
<< " after a timing control");
|
// << " after a timing control");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!framep->instance().initialized()) framep->createInstancePrototype();
|
if (!framep->instance().initialized()) framep->createInstancePrototype();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue