diff --git a/Changes b/Changes index 84526c0c1..2d790d658 100644 --- a/Changes +++ b/Changes @@ -21,6 +21,7 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix memory leak in VerilatedVcd dumps, bug1222 partial. [Shareef Jalloq] +**** Fix unnecessary Vdly variables, bug1224 partial. [John Coiner] * Verilator 3.912 2017-09-23 diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index c0c200f0b..b3c9ed451 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -77,7 +77,6 @@ private: // AstVarScope::user4p() -> AstAlwaysPost*. Post block for this variable // AstVarScope::user5() -> VarUsage. Tracks delayed vs non-delayed usage // AstVar::user2() -> bool. Set true if already made warning - // AstVar::user4() -> int. Vector number, for assignment creation // AstVarRef::user2() -> bool. Set true if already processed // AstAlwaysPost::user2() -> ActActive*. Points to activity block of signal (valid when AstAlwaysPost::user4p is valid) // AstAlwaysPost::user4() -> AstIf*. Last IF (__Vdlyvset__) created under this AlwaysPost @@ -102,7 +101,8 @@ private: typedef std::map,AstVar*> VarMap; VarMap m_modVarMap; // Table of new var names created under module V3Double0 m_statSharedSet;// Statistic tracking - + typedef std::map ScopeVecMap; + ScopeVecMap m_scopeVecMap; // Next var number for each scope // METHODS static int debug() { @@ -211,7 +211,7 @@ private: if (!varrefp->varScopep()) varrefp->v3fatalSrc("Var didn't get varscoped in V3Scope.cpp"); varrefp->unlinkFrBack(); AstVar* oldvarp = varrefp->varp(); - int modVecNum = oldvarp->user4(); oldvarp->user4(modVecNum+1); + int modVecNum = m_scopeVecMap[varrefp->varScopep()]++; // deque dimreadps; // Read value for each dimension of assignment for (unsigned dimension=0; dimension