Revert "Set lifetime to static"

This reverts commit 8dc3b2b1ded9326ea9ed5a7bdf2a40b893a7dcd0.
This commit is contained in:
Kamil Danecki 2026-03-20 10:14:17 +01:00
parent 4bb3c55f06
commit c37d1fd925
2 changed files with 9 additions and 14 deletions

View File

@ -434,7 +434,6 @@ class DynScopeVisitor final : public VNVisitor {
void visit(AstVarRef* nodep) override {
ForkDynScopeFrame* const framep = frameOf(nodep->varp());
if (!framep) return;
// UINFO(0, "IS AUTO " << nodep->varp()->lifetime());
if (needsDynScope(nodep)) {
bool isEvent = false;
if (AstBasicDType* const dtypep = VN_CAST(nodep->dtypep()->skipRefp(), BasicDType)) {
@ -449,14 +448,14 @@ class DynScopeVisitor final : public VNVisitor {
"Writing to an "
<< nodep->varp()->verilogKwd()
<< " variable of a function after a timing control is not allowed");
} else if (nodep->varp()->lifetime().isAutomatic()) {
// 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");
} 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");
}
}
if (!framep->instance().initialized()) framep->createInstancePrototype();

View File

@ -382,11 +382,7 @@ class LinkParseVisitor final : public VNVisitor {
}
}
} else if (m_ftaskp) {
if (m_ftaskp->lifetime().isStatic()) {
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
} else {
if (!nodep->lifetime().isAutomatic()) nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
}
if (!nodep->lifetime().isAutomatic()) nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
} else if (nodep->lifetime().isNone()) {
// lifetime shouldn't be unknown, set static if none
nodep->lifetime(VLifetime::STATIC_IMPLICIT);