Set lifetime to static

Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
Kamil Danecki 2026-03-06 20:46:38 +01:00
parent 6873dc2f63
commit add4ec6e80
2 changed files with 8 additions and 2 deletions

View File

@ -434,6 +434,7 @@ 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)) {
@ -448,7 +449,7 @@ class DynScopeVisitor final : public VNVisitor {
"Writing to an "
<< nodep->varp()->verilogKwd()
<< " variable of a function after a timing control is not allowed");
} else {
} else if (nodep->varp()->lifetime().isAutomatic()) {
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Writing to a captured "
<< nodep->varp()->verilogKwd()
<< " variable in a "

View File

@ -382,7 +382,12 @@ class LinkParseVisitor final : public VNVisitor {
}
}
} else if (m_ftaskp) {
if (!nodep->lifetime().isAutomatic()) nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
UINFO(0, "TASK LIFE " << m_ftaskp->lifetime());
if (m_ftaskp->lifetime().isStatic()) {
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
} else {
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);