mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix false error on new const assignment (#4098).
This commit is contained in:
parent
e3bdae77a0
commit
2ab34b5eeb
1
Changes
1
Changes
@ -39,6 +39,7 @@ Verilator 5.009 devel
|
||||
* Fix false LATCH warning on --assert 'unique else if' (#4033) ($4054). [Jesse Taube]
|
||||
* Fix characters from DEFENV literals for conda (#4035) (#4044). [Tim Snyder]
|
||||
* Fix interface generate begin (#4065). [Srinivasan Venkataramanan]
|
||||
* Fix false error on new const assignment (#4098). [Tudor Timi]
|
||||
* Fix false ENUMVALUE on expressions and arrays.
|
||||
* Fix unnecessary verilated_std.sv waivers in --waiver-output.
|
||||
|
||||
|
@ -5287,6 +5287,8 @@ private:
|
||||
// Function hasn't been widthed, so make it so.
|
||||
// Would use user1 etc, but V3Width called from too many places to spend a user
|
||||
nodep->doingWidth(true);
|
||||
VL_RESTORER(m_funcp);
|
||||
VL_RESTORER(m_ftaskp);
|
||||
m_ftaskp = nodep;
|
||||
// First width the function variable, as if is a recursive function we need data type
|
||||
if (nodep->fvarp()) userIterate(nodep->fvarp(), nullptr);
|
||||
@ -5306,8 +5308,6 @@ private:
|
||||
|
||||
nodep->didWidth(true);
|
||||
nodep->doingWidth(false);
|
||||
m_funcp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
if (nodep->dpiImport() && !nodep->dpiOpenParent() && markHasOpenArray(nodep)) {
|
||||
nodep->dpiOpenParentInc(); // Mark so V3Task will wait for a child to build calling
|
||||
// func
|
||||
|
@ -7,8 +7,13 @@
|
||||
class ClsNoArg;
|
||||
const int imembera; // Ok for new() to assign to a const
|
||||
function new();
|
||||
int other = other_func();
|
||||
imembera = 5;
|
||||
if (other != 6) $stop;
|
||||
endfunction : new
|
||||
function int other_func();
|
||||
return 6;
|
||||
endfunction
|
||||
endclass
|
||||
|
||||
class ClsArg;
|
||||
|
Loading…
Reference in New Issue
Block a user