Commentary

This commit is contained in:
Wilson Snyder 2023-05-27 09:43:23 -04:00
parent 7f12ad9d91
commit f407d442d4
6 changed files with 22 additions and 20 deletions

View File

@ -45,10 +45,12 @@ private:
// AstFTask::user1() -> int. Number of references // AstFTask::user1() -> int. Number of references
const VNUser1InUse m_inuser1; const VNUser1InUse m_inuser1;
// STATE // STATE - across all visitors
std::vector<AstCFunc*> 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_likely = false; // Excuses for branch likely taken
int m_unlikely = false; // Excuses for branch likely not taken int m_unlikely = false; // Excuses for branch likely not taken
std::vector<AstCFunc*> m_cfuncsp; // List of all tasks
// METHODS // METHODS

View File

@ -92,6 +92,13 @@ private:
const VNUser4InUse m_inuser4; const VNUser4InUse m_inuser4;
const VNUser5InUse m_inuser5; const VNUser5InUse m_inuser5;
// STATE - across all visitors
std::unordered_map<const AstVarScope*, int> m_scopeVecMap; // Next var number for each scope
std::set<AstSenTree*> m_timingDomains; // Timing resume domains
using VarMap = std::map<const std::pair<AstNodeModule*, std::string>, 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) // STATE - for current visit position (use VL_RESTORER)
AstActive* m_activep = nullptr; // Current activate AstActive* m_activep = nullptr; // Current activate
const AstCFunc* m_cfuncp = nullptr; // Current public C Function 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_inSuspendableOrFork = false; // True in suspendable processes and forks
bool m_ignoreBlkAndNBlk = false; // Suppress delayed assignment BLKANDNBLK bool m_ignoreBlkAndNBlk = false; // Suppress delayed assignment BLKANDNBLK
// STATE - across all visitors
std::unordered_map<const AstVarScope*, int> m_scopeVecMap; // Next var number for each scope
std::set<AstSenTree*> m_timingDomains; // Timing resume domains
using VarMap = std::map<const std::pair<AstNodeModule*, std::string>, AstVar*>;
VarMap m_modVarMap; // Table of new var names created under module
VDouble0 m_statSharedSet; // Statistic tracking
// METHODS // METHODS
const AstNode* containingAssignment(const AstNode* nodep) { const AstNode* containingAssignment(const AstNode* nodep) {

View File

@ -57,14 +57,14 @@ private:
AstUser4Allocator<AstCFunc, std::unordered_multimap<const AstVarScope*, AstVarRef*>> AstUser4Allocator<AstCFunc, std::unordered_multimap<const AstVarScope*, AstVarRef*>>
m_references; 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 // STATE - across all visitors
std::vector<AstVarScope*> m_varScopeps; // List of variables to consider for localization std::vector<AstVarScope*> m_varScopeps; // List of variables to consider for localization
VDouble0 m_statLocVars; // Statistic tracking 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 // METHODS
bool isOptimizable(AstVarScope* nodep) { bool isOptimizable(AstVarScope* nodep) {
return !nodep->user1() || // Not marked as not optimizable, or ... return !nodep->user1() || // Not marked as not optimizable, or ...

View File

@ -42,8 +42,8 @@ private:
// AstVar::user1() -> bool. Set true if already processed // AstVar::user1() -> bool. Set true if already processed
const VNUser1InUse m_inuser1; const VNUser1InUse m_inuser1;
// STATE // STATE - for current visit position (use VL_RESTORER)
const AstNodeModule* m_modp = nullptr; const AstNodeModule* m_modp = nullptr; // Current module
// METHODS // METHODS
void rename(AstNode* nodep, bool addPvt) { void rename(AstNode* nodep, bool addPvt) {

View File

@ -26,7 +26,7 @@
// Pairing heap (max-heap) with increase key and delete. // Pairing heap (max-heap) with increase key and delete.
// //
// While this is written as a generic data structure, it's interface and // 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 // to Verilation performance, so be very careful changing anything or adding any
// new operations that would impact either memory usage, or performance of the // new operations that would impact either memory usage, or performance of the
// existing operations. This data structure is fully deterministic, meaning // existing operations. This data structure is fully deterministic, meaning

View File

@ -53,6 +53,10 @@ private:
const VNUser1InUse m_inuser1; const VNUser1InUse m_inuser1;
const VNUser2InUse m_inuser2; 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) // STATE - for current visit position (use VL_RESTORER)
AstCFunc* m_cfuncp = nullptr; // Current block AstCFunc* m_cfuncp = nullptr; // Current block
AstNode* m_stmtp = nullptr; // Current statement AstNode* m_stmtp = nullptr; // Current statement
@ -61,10 +65,6 @@ private:
AstTraceInc* m_inTracep = nullptr; // Inside while loop, special statement additions AstTraceInc* m_inTracep = nullptr; // Inside while loop, special statement additions
bool m_assignLhs = false; // Inside assignment lhs, don't breakup extracts 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 // METHODS
bool assignNoTemp(AstNodeAssign* nodep) { bool assignNoTemp(AstNodeAssign* nodep) {
return (VN_IS(nodep->lhsp(), VarRef) && !AstVar::scVarRecurse(nodep->lhsp()) return (VN_IS(nodep->lhsp(), VarRef) && !AstVar::scVarRecurse(nodep->lhsp())