Internals: Cleanup V3Config. No functional change intended.
This commit is contained in:
parent
3d045c3aee
commit
bdfdc737a0
|
|
@ -44,13 +44,8 @@ public:
|
||||||
|
|
||||||
/// Update into maps from other
|
/// Update into maps from other
|
||||||
void update(const V3ConfigWildcardResolver& other) {
|
void update(const V3ConfigWildcardResolver& other) {
|
||||||
typename Map::const_iterator it;
|
for (const auto& itr : other.m_mapResolved) m_mapResolved[itr.first].update(itr.second);
|
||||||
for (it = other.m_mapResolved.begin(); it != other.m_mapResolved.end(); ++it) {
|
for (const auto& itr : other.m_mapWildcard) m_mapWildcard[itr.first].update(itr.second);
|
||||||
m_mapResolved[it->first].update(it->second);
|
|
||||||
}
|
|
||||||
for (it = other.m_mapWildcard.begin(); it != other.m_mapWildcard.end(); ++it) {
|
|
||||||
m_mapWildcard[it->first].update(it->second);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Access and create a (wildcard) entity
|
// Access and create a (wildcard) entity
|
||||||
|
|
@ -68,12 +63,12 @@ public:
|
||||||
// Cannot be resolved, create if matched
|
// Cannot be resolved, create if matched
|
||||||
|
|
||||||
// Update this entity with all matches in the wildcards
|
// Update this entity with all matches in the wildcards
|
||||||
for (it = m_mapWildcard.begin(); it != m_mapWildcard.end(); ++it) {
|
for (const auto& wildent : m_mapWildcard) {
|
||||||
if (VString::wildmatch(name, it->first)) {
|
if (VString::wildmatch(name, wildent.first)) {
|
||||||
if (!newp) {
|
if (!newp) {
|
||||||
newp = &m_mapResolved[name]; // Emplace and get pointer
|
newp = &m_mapResolved[name]; // Emplace and get pointer
|
||||||
}
|
}
|
||||||
newp->update(it->second);
|
newp->update(wildent.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newp;
|
return newp;
|
||||||
|
|
@ -198,8 +193,8 @@ public:
|
||||||
AstNode* const nodep = new AstPragma(modp->fileline(), type);
|
AstNode* const nodep = new AstPragma(modp->fileline(), type);
|
||||||
modp->addStmtp(nodep);
|
modp->addStmtp(nodep);
|
||||||
}
|
}
|
||||||
for (auto it = m_modPragmas.cbegin(); it != m_modPragmas.cend(); ++it) {
|
for (const auto& itr : m_modPragmas) {
|
||||||
AstNode* const nodep = new AstPragma(modp->fileline(), *it);
|
AstNode* const nodep = new AstPragma{modp->fileline(), itr};
|
||||||
modp->addStmtp(nodep);
|
modp->addStmtp(nodep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -354,13 +349,14 @@ class V3ConfigResolver final {
|
||||||
m_profileData; // Access to profile_data records
|
m_profileData; // Access to profile_data records
|
||||||
FileLine* m_profileFileLine = nullptr;
|
FileLine* m_profileFileLine = nullptr;
|
||||||
|
|
||||||
static V3ConfigResolver s_singleton; // Singleton (not via local static, as that's slow)
|
|
||||||
V3ConfigResolver() = default;
|
V3ConfigResolver() = default;
|
||||||
~V3ConfigResolver() = default;
|
~V3ConfigResolver() = default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static V3ConfigResolver& s() { return s_singleton; }
|
static V3ConfigResolver& s() {
|
||||||
|
static V3ConfigResolver s_singleton;
|
||||||
|
return s_singleton;
|
||||||
|
}
|
||||||
V3ConfigModuleResolver& modules() { return m_modules; }
|
V3ConfigModuleResolver& modules() { return m_modules; }
|
||||||
V3ConfigFileResolver& files() { return m_files; }
|
V3ConfigFileResolver& files() { return m_files; }
|
||||||
|
|
||||||
|
|
@ -379,8 +375,6 @@ public:
|
||||||
FileLine* getProfileDataFileLine() const { return m_profileFileLine; } // Maybe null
|
FileLine* getProfileDataFileLine() const { return m_profileFileLine; } // Maybe null
|
||||||
};
|
};
|
||||||
|
|
||||||
V3ConfigResolver V3ConfigResolver::s_singleton;
|
|
||||||
|
|
||||||
//######################################################################
|
//######################################################################
|
||||||
// V3Config
|
// V3Config
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,15 @@ public:
|
||||||
static void addModulePragma(const string& module, VPragmaType pragma);
|
static void addModulePragma(const string& module, VPragmaType pragma);
|
||||||
static void addProfileData(FileLine* fl, const string& model, const string& key,
|
static void addProfileData(FileLine* fl, const string& model, const string& key,
|
||||||
uint64_t cost);
|
uint64_t cost);
|
||||||
static void addWaiver(V3ErrorCode code, const string& filename, const string& message);
|
|
||||||
static void addVarAttr(FileLine* fl, const string& module, const string& ftask,
|
static void addVarAttr(FileLine* fl, const string& module, const string& ftask,
|
||||||
const string& signal, VAttrType type, AstSenTree* nodep);
|
const string& signal, VAttrType type, AstSenTree* nodep);
|
||||||
|
static void addWaiver(V3ErrorCode code, const string& filename, const string& message);
|
||||||
|
|
||||||
static void applyCase(AstCase* nodep);
|
static void applyCase(AstCase* nodep);
|
||||||
static void applyCoverageBlock(AstNodeModule* modulep, AstBegin* nodep);
|
static void applyCoverageBlock(AstNodeModule* modulep, AstBegin* nodep);
|
||||||
|
static void applyFTask(AstNodeModule* modulep, AstNodeFTask* ftaskp);
|
||||||
static void applyIgnores(FileLine* filelinep);
|
static void applyIgnores(FileLine* filelinep);
|
||||||
static void applyModule(AstNodeModule* modulep);
|
static void applyModule(AstNodeModule* modulep);
|
||||||
static void applyFTask(AstNodeModule* modulep, AstNodeFTask* ftaskp);
|
|
||||||
static void applyVarAttr(AstNodeModule* modulep, AstNodeFTask* ftaskp, AstVar* varp);
|
static void applyVarAttr(AstNodeModule* modulep, AstNodeFTask* ftaskp, AstVar* varp);
|
||||||
|
|
||||||
static uint64_t getProfileData(const string& model, const string& key);
|
static uint64_t getProfileData(const string& model, const string& key);
|
||||||
|
|
|
||||||
|
|
@ -6450,7 +6450,8 @@ colon<fl>: // Generic colon that isn't making a label (e.g.
|
||||||
|
|
||||||
vltItem:
|
vltItem:
|
||||||
|
|
||||||
vltOffFront { V3Config::addIgnore($1, false, "*", 0, 0); }
|
vltOffFront
|
||||||
|
{ V3Config::addIgnore($1, false, "*", 0, 0); }
|
||||||
| vltOffFront yVLT_D_FILE yaSTRING
|
| vltOffFront yVLT_D_FILE yaSTRING
|
||||||
{ V3Config::addIgnore($1, false, *$3, 0, 0); }
|
{ V3Config::addIgnore($1, false, *$3, 0, 0); }
|
||||||
| vltOffFront yVLT_D_FILE yaSTRING yVLT_D_LINES yaINTNUM
|
| vltOffFront yVLT_D_FILE yaSTRING yVLT_D_LINES yaINTNUM
|
||||||
|
|
@ -6463,7 +6464,8 @@ vltItem:
|
||||||
} else {
|
} else {
|
||||||
V3Config::addWaiver($1,*$3,*$5);
|
V3Config::addWaiver($1,*$3,*$5);
|
||||||
}}
|
}}
|
||||||
| vltOnFront { V3Config::addIgnore($1, true, "*", 0, 0); }
|
| vltOnFront
|
||||||
|
{ V3Config::addIgnore($1, true, "*", 0, 0); }
|
||||||
| vltOnFront yVLT_D_FILE yaSTRING
|
| vltOnFront yVLT_D_FILE yaSTRING
|
||||||
{ V3Config::addIgnore($1, true, *$3, 0, 0); }
|
{ V3Config::addIgnore($1, true, *$3, 0, 0); }
|
||||||
| vltOnFront yVLT_D_FILE yaSTRING yVLT_D_LINES yaINTNUM
|
| vltOnFront yVLT_D_FILE yaSTRING yVLT_D_LINES yaINTNUM
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue