Set static when task has timing control
Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
parent
d2f34b9974
commit
adb298dce1
|
|
@ -449,13 +449,7 @@ class DynScopeVisitor final : public VNVisitor {
|
|||
<< nodep->varp()->verilogKwd()
|
||||
<< " variable of a function after a timing control is not allowed");
|
||||
} else {
|
||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Writing to a captured "
|
||||
<< nodep->varp()->verilogKwd()
|
||||
<< " variable in a "
|
||||
<< (VN_IS(nodep->backp(), AssignDly)
|
||||
? "non-blocking assignment"
|
||||
: "fork")
|
||||
<< " after a timing control");
|
||||
UASSERT_OBJ(nodep->varp()->lifetime().isAutomatic(), nodep, "writing to an automatic variable after a timing control");
|
||||
}
|
||||
}
|
||||
if (!framep->instance().initialized()) framep->createInstancePrototype();
|
||||
|
|
|
|||
|
|
@ -382,7 +382,11 @@ class LinkParseVisitor final : public VNVisitor {
|
|||
}
|
||||
}
|
||||
} else if (m_ftaskp) {
|
||||
if (!nodep->lifetime().isAutomatic()) nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
|
||||
if (m_ftaskp->existsAndNext([&](const AstNode* nodep) {return nodep->isTimingControl();})) {
|
||||
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
|
||||
} else {
|
||||
nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
|
||||
}
|
||||
} else if (nodep->lifetime().isNone()) {
|
||||
// lifetime shouldn't be unknown, set static if none
|
||||
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
|
||||
|
|
|
|||
Loading…
Reference in New Issue