From f407d442d44fe500012b8465ea2dba0adf1b9e63 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 27 May 2023 09:43:23 -0400 Subject: [PATCH] Commentary --- src/V3Branch.cpp | 6 ++++-- src/V3Delayed.cpp | 14 +++++++------- src/V3Localize.cpp | 8 ++++---- src/V3Name.cpp | 4 ++-- src/V3PairingHeap.h | 2 +- src/V3Premit.cpp | 8 ++++---- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/V3Branch.cpp b/src/V3Branch.cpp index 019f442c5..e84e041b5 100644 --- a/src/V3Branch.cpp +++ b/src/V3Branch.cpp @@ -45,10 +45,12 @@ private: // AstFTask::user1() -> int. Number of references const VNUser1InUse m_inuser1; - // STATE + // STATE - across all visitors + std::vector m_cfuncsp; // List of all tasks + + // STATE - for current visit position (use VL_RESTORER) int m_likely = false; // Excuses for branch likely taken int m_unlikely = false; // Excuses for branch likely not taken - std::vector m_cfuncsp; // List of all tasks // METHODS diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index c65ad784e..760026163 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -92,6 +92,13 @@ private: const VNUser4InUse m_inuser4; const VNUser5InUse m_inuser5; + // STATE - across all visitors + std::unordered_map m_scopeVecMap; // Next var number for each scope + std::set m_timingDomains; // Timing resume domains + using VarMap = std::map, AstVar*>; + VarMap m_modVarMap; // Table of new var names created under module + VDouble0 m_statSharedSet; // Statistic tracking + // STATE - for current visit position (use VL_RESTORER) AstActive* m_activep = nullptr; // Current activate const AstCFunc* m_cfuncp = nullptr; // Current public C Function @@ -103,13 +110,6 @@ private: bool m_inSuspendableOrFork = false; // True in suspendable processes and forks bool m_ignoreBlkAndNBlk = false; // Suppress delayed assignment BLKANDNBLK - // STATE - across all visitors - std::unordered_map m_scopeVecMap; // Next var number for each scope - std::set m_timingDomains; // Timing resume domains - using VarMap = std::map, AstVar*>; - VarMap m_modVarMap; // Table of new var names created under module - VDouble0 m_statSharedSet; // Statistic tracking - // METHODS const AstNode* containingAssignment(const AstNode* nodep) { diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index a47d9d173..586e8940e 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -57,14 +57,14 @@ private: AstUser4Allocator> m_references; - // STATE - for current visit position (use VL_RESTORER) - AstCFunc* m_cfuncp = nullptr; // Current active function - uint32_t m_nodeDepth = 0; // Node depth under m_cfuncp - // STATE - across all visitors std::vector m_varScopeps; // List of variables to consider for localization VDouble0 m_statLocVars; // Statistic tracking + // STATE - for current visit position (use VL_RESTORER) + AstCFunc* m_cfuncp = nullptr; // Current active function + uint32_t m_nodeDepth = 0; // Node depth under m_cfuncp + // METHODS bool isOptimizable(AstVarScope* nodep) { return !nodep->user1() || // Not marked as not optimizable, or ... diff --git a/src/V3Name.cpp b/src/V3Name.cpp index c6b9b6c68..cf4bec4f0 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -42,8 +42,8 @@ private: // AstVar::user1() -> bool. Set true if already processed const VNUser1InUse m_inuser1; - // STATE - const AstNodeModule* m_modp = nullptr; + // STATE - for current visit position (use VL_RESTORER) + const AstNodeModule* m_modp = nullptr; // Current module // METHODS void rename(AstNode* nodep, bool addPvt) { diff --git a/src/V3PairingHeap.h b/src/V3PairingHeap.h index 494b6da99..9e6bc041a 100644 --- a/src/V3PairingHeap.h +++ b/src/V3PairingHeap.h @@ -26,7 +26,7 @@ // Pairing heap (max-heap) with increase key and delete. // // While this is written as a generic data structure, it's interface and -// implementation is finely tuned for it's use by V3Parm_tition, and is critical +// implementation is finely tuned for use by V3Partition, and is critical // to Verilation performance, so be very careful changing anything or adding any // new operations that would impact either memory usage, or performance of the // existing operations. This data structure is fully deterministic, meaning diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 0e1dbdd4b..2a3d09db1 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -53,6 +53,10 @@ private: const VNUser1InUse m_inuser1; const VNUser2InUse m_inuser2; + // STATE - across all visitors + V3UniqueNames m_tempNames; // For generating unique temporary variable names + VDouble0 m_extractedToConstPool; // Statistic tracking + // STATE - for current visit position (use VL_RESTORER) AstCFunc* m_cfuncp = nullptr; // Current block AstNode* m_stmtp = nullptr; // Current statement @@ -61,10 +65,6 @@ private: AstTraceInc* m_inTracep = nullptr; // Inside while loop, special statement additions bool m_assignLhs = false; // Inside assignment lhs, don't breakup extracts - // STATE - across all visitors - V3UniqueNames m_tempNames; // For generating unique temporary variable names - VDouble0 m_extractedToConstPool; // Statistic tracking - // METHODS bool assignNoTemp(AstNodeAssign* nodep) { return (VN_IS(nodep->lhsp(), VarRef) && !AstVar::scVarRecurse(nodep->lhsp())