From c37d1fd92530eaf1f7f41d0760ce27d1f0aedab2 Mon Sep 17 00:00:00 2001 From: Kamil Danecki Date: Fri, 20 Mar 2026 10:14:17 +0100 Subject: [PATCH] Revert "Set lifetime to static" This reverts commit 8dc3b2b1ded9326ea9ed5a7bdf2a40b893a7dcd0. --- src/V3Fork.cpp | 17 ++++++++--------- src/V3LinkParse.cpp | 6 +----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 2770589ad..2e40faa24 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -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(); diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index 727d60af4..4e238c75f 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -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);