Add warning about setting lifetime to static

Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
Kamil Danecki 2026-03-31 12:27:37 +02:00
parent 1e581ba5fa
commit e36564ff73
2 changed files with 2 additions and 1 deletions

View File

@ -389,6 +389,7 @@ class LinkParseVisitor final : public VNVisitor {
// Variables in static tasks with timing control can be used after the task has ended
// with use of join..fork_none, so they need to be static
if (m_ftaskp->lifetime().isStatic() && m_hasTimingControl) {
nodep->v3warn(IMPLICITSTATIC, "Variable's lifetime implicitly set to static because in static task with timing control.");
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
} else {
nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);

View File

@ -11,7 +11,7 @@ import vltest_bootstrap
test.scenarios('simulator')
test.compile(verilator_flags2=["--binary"])
test.compile(verilator_flags2=["--binary", "-Wno-implicitstatic"])
test.execute()