diff --git a/Changes b/Changes index e41bc37bd..d2707bbec 100644 --- a/Changes +++ b/Changes @@ -29,6 +29,7 @@ Verilator 5.015 devel * Fix nested assignments on the LHS (#4435). [Ryszard Rozak, Antmicro Ltd] * Fix false MULTITOP on bound interfaces (#4438). [Alex Solomatnikov] * Fix internal error on real conversion (#4447). [vdhotre-ventana] +* Fix lifetime unknown error on enum.name (#4448). [jwoutersymatra] Verilator 5.014 2023-08-06 diff --git a/src/V3Width.cpp b/src/V3Width.cpp index d5333b6f7..a279cf416 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -7203,6 +7203,7 @@ private: "__Venumtab_" + VString::downcase(attrType.ascii()) + cvtToStr(m_dtTables++), vardtypep}; + varp->lifetime(VLifetime::STATIC); varp->isConst(true); varp->isStatic(true); varp->valuep(initp); diff --git a/test_regress/t/t_fork_join_none_class_cap.v b/test_regress/t/t_fork_join_none_class_cap.v index 8f5fda807..36ba60f03 100644 --- a/test_regress/t/t_fork_join_none_class_cap.v +++ b/test_regress/t/t_fork_join_none_class_cap.v @@ -6,14 +6,17 @@ event evt1; +typedef enum {ENUM_VALUE} enum_t; + class Foo; int m_member; + enum_t m_en; task do_something(); fork #20 begin m_member++; - $display("this's m_member: ", m_member); + $display("this's m_member: %0d m_en: %s", m_member, m_en.name()); if (m_member != 3) $stop; ->evt1; @@ -29,7 +32,7 @@ class Foo; fork begin foo.m_member++; - $display("foo's m_member: %d", foo.m_member); + $display("foo's m_member: %0d m_en: %s", foo.m_member, foo.m_en.name()); if (foo.m_member != 2) $stop; end