Internals: Add const's. No functional change
This commit is contained in:
parent
a1a8f17617
commit
ac4690d74b
|
|
@ -221,7 +221,7 @@ private:
|
||||||
public:
|
public:
|
||||||
// PUBLIC METHODS
|
// PUBLIC METHODS
|
||||||
void clear() {
|
void clear() {
|
||||||
for (ItemList::iterator it=m_items.begin(); it!=m_items.end(); ++it) {
|
for (ItemList::const_iterator it=m_items.begin(); it!=m_items.end(); ++it) {
|
||||||
VerilatedCovImpItem* itemp = *(it);
|
VerilatedCovImpItem* itemp = *(it);
|
||||||
delete itemp;
|
delete itemp;
|
||||||
}
|
}
|
||||||
|
|
@ -244,7 +244,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void zero() {
|
void zero() {
|
||||||
for (ItemList::iterator it=m_items.begin(); it!=m_items.end(); ++it) {
|
for (ItemList::const_iterator it=m_items.begin(); it!=m_items.end(); ++it) {
|
||||||
(*it)->zero();
|
(*it)->zero();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -372,7 +372,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output body
|
// Output body
|
||||||
for (EventMap::iterator it=eventCounts.begin(); it!=eventCounts.end(); ++it) {
|
for (EventMap::const_iterator it=eventCounts.begin(); it!=eventCounts.end(); ++it) {
|
||||||
os<<"C '"<<std::dec;
|
os<<"C '"<<std::dec;
|
||||||
os<<it->first;
|
os<<it->first;
|
||||||
if (it->second.first != "") os<<keyValueFormatter(VL_CIK_HIER,it->second.first);
|
if (it->second.first != "") os<<keyValueFormatter(VL_CIK_HIER,it->second.first);
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public: // But only for verilated*.cpp
|
||||||
static void internalsDump() {
|
static void internalsDump() {
|
||||||
VL_PRINTF("internalsDump:\n");
|
VL_PRINTF("internalsDump:\n");
|
||||||
VL_PRINTF(" Argv:");
|
VL_PRINTF(" Argv:");
|
||||||
for (ArgVec::iterator it=s_s.m_argVec.begin(); it!=s_s.m_argVec.end(); ++it) {
|
for (ArgVec::const_iterator it=s_s.m_argVec.begin(); it!=s_s.m_argVec.end(); ++it) {
|
||||||
VL_PRINTF(" %s",it->c_str());
|
VL_PRINTF(" %s",it->c_str());
|
||||||
}
|
}
|
||||||
VL_PRINTF("\n");
|
VL_PRINTF("\n");
|
||||||
|
|
@ -109,7 +109,7 @@ public: // But only for verilated*.cpp
|
||||||
"%Error: Verilog called $test$plusargs or $value$plusargs without"
|
"%Error: Verilog called $test$plusargs or $value$plusargs without"
|
||||||
" testbench C first calling Verilated::commandArgs(argc,argv).");
|
" testbench C first calling Verilated::commandArgs(argc,argv).");
|
||||||
}
|
}
|
||||||
for (ArgVec::iterator it=s_s.m_argVec.begin(); it!=s_s.m_argVec.end(); ++it) {
|
for (ArgVec::const_iterator it=s_s.m_argVec.begin(); it!=s_s.m_argVec.end(); ++it) {
|
||||||
if ((*it)[0]=='+') {
|
if ((*it)[0]=='+') {
|
||||||
if (0==strncmp(prefixp, it->c_str()+1, len)) return *it;
|
if (0==strncmp(prefixp, it->c_str()+1, len)) return *it;
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ public: // But only for verilated*.cpp
|
||||||
else s_s.m_userMap.insert(it, std::make_pair(std::make_pair(scopep,userKey),userData));
|
else s_s.m_userMap.insert(it, std::make_pair(std::make_pair(scopep,userKey),userData));
|
||||||
}
|
}
|
||||||
static inline void* userFind(const void* scopep, void* userKey) {
|
static inline void* userFind(const void* scopep, void* userKey) {
|
||||||
UserMap::iterator it=s_s.m_userMap.find(std::make_pair(scopep,userKey));
|
UserMap::const_iterator it=s_s.m_userMap.find(std::make_pair(scopep,userKey));
|
||||||
if (VL_LIKELY(it != s_s.m_userMap.end())) return it->second;
|
if (VL_LIKELY(it != s_s.m_userMap.end())) return it->second;
|
||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -146,7 +146,7 @@ private:
|
||||||
}
|
}
|
||||||
static void userDump() {
|
static void userDump() {
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (UserMap::iterator it=s_s.m_userMap.begin(); it!=s_s.m_userMap.end(); ++it) {
|
for (UserMap::const_iterator it=s_s.m_userMap.begin(); it!=s_s.m_userMap.end(); ++it) {
|
||||||
if (first) { VL_PRINTF(" userDump:\n"); first=false; }
|
if (first) { VL_PRINTF(" userDump:\n"); first=false; }
|
||||||
VL_PRINTF(" DPI_USER_DATA scope %p key %p: %p\n",
|
VL_PRINTF(" DPI_USER_DATA scope %p key %p: %p\n",
|
||||||
it->first.first, it->first.second, it->second);
|
it->first.first, it->first.second, it->second);
|
||||||
|
|
@ -163,7 +163,7 @@ public: // But only for verilated*.cpp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static inline const VerilatedScope* scopeFind(const char* namep) {
|
static inline const VerilatedScope* scopeFind(const char* namep) {
|
||||||
VerilatedScopeNameMap::iterator it=s_s.m_nameMap.find(namep);
|
VerilatedScopeNameMap::const_iterator it=s_s.m_nameMap.find(namep);
|
||||||
if (VL_LIKELY(it != s_s.m_nameMap.end())) return it->second;
|
if (VL_LIKELY(it != s_s.m_nameMap.end())) return it->second;
|
||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +175,7 @@ public: // But only for verilated*.cpp
|
||||||
}
|
}
|
||||||
static void scopesDump() {
|
static void scopesDump() {
|
||||||
VL_PRINTF(" scopesDump:\n");
|
VL_PRINTF(" scopesDump:\n");
|
||||||
for (VerilatedScopeNameMap::iterator it=s_s.m_nameMap.begin(); it!=s_s.m_nameMap.end(); ++it) {
|
for (VerilatedScopeNameMap::const_iterator it=s_s.m_nameMap.begin(); it!=s_s.m_nameMap.end(); ++it) {
|
||||||
const VerilatedScope* scopep = it->second;
|
const VerilatedScope* scopep = it->second;
|
||||||
scopep->scopeDump();
|
scopep->scopeDump();
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +205,7 @@ public: // But only for verilated*.cpp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int exportFind(const char* namep) {
|
static int exportFind(const char* namep) {
|
||||||
ExportNameMap::iterator it=s_s.m_exportMap.find(namep);
|
ExportNameMap::const_iterator it=s_s.m_exportMap.find(namep);
|
||||||
if (VL_LIKELY(it != s_s.m_exportMap.end())) return it->second;
|
if (VL_LIKELY(it != s_s.m_exportMap.end())) return it->second;
|
||||||
std::string msg = (std::string("%Error: Testbench C called ")+namep
|
std::string msg = (std::string("%Error: Testbench C called ")+namep
|
||||||
+" but no such DPI export function name exists in ANY model");
|
+" but no such DPI export function name exists in ANY model");
|
||||||
|
|
@ -214,14 +214,14 @@ public: // But only for verilated*.cpp
|
||||||
}
|
}
|
||||||
static const char* exportName(int funcnum) {
|
static const char* exportName(int funcnum) {
|
||||||
// Slowpath; find name for given export; errors only so no map to reverse-map it
|
// Slowpath; find name for given export; errors only so no map to reverse-map it
|
||||||
for (ExportNameMap::iterator it=s_s.m_exportMap.begin(); it!=s_s.m_exportMap.end(); ++it) {
|
for (ExportNameMap::const_iterator it=s_s.m_exportMap.begin(); it!=s_s.m_exportMap.end(); ++it) {
|
||||||
if (it->second == funcnum) return it->first;
|
if (it->second == funcnum) return it->first;
|
||||||
}
|
}
|
||||||
return "*UNKNOWN*";
|
return "*UNKNOWN*";
|
||||||
}
|
}
|
||||||
static void exportsDump() {
|
static void exportsDump() {
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (ExportNameMap::iterator it=s_s.m_exportMap.begin(); it!=s_s.m_exportMap.end(); ++it) {
|
for (ExportNameMap::const_iterator it=s_s.m_exportMap.begin(); it!=s_s.m_exportMap.end(); ++it) {
|
||||||
if (first) { VL_PRINTF(" exportDump:\n"); first=false; }
|
if (first) { VL_PRINTF(" exportDump:\n"); first=false; }
|
||||||
VL_PRINTF(" DPI_EXPORT_NAME %05d: %s\n", it->second, it->first);
|
VL_PRINTF(" DPI_EXPORT_NAME %05d: %s\n", it->second, it->first);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,13 +200,13 @@ void VerilatedVcd::makeNameMap() {
|
||||||
// If no scope was specified, prefix everything with a "top"
|
// If no scope was specified, prefix everything with a "top"
|
||||||
// This comes from user instantiations with no name - IE Vtop("").
|
// This comes from user instantiations with no name - IE Vtop("").
|
||||||
bool nullScope = false;
|
bool nullScope = false;
|
||||||
for (NameMap::iterator it=m_namemapp->begin(); it!=m_namemapp->end(); ++it) {
|
for (NameMap::const_iterator it=m_namemapp->begin(); it!=m_namemapp->end(); ++it) {
|
||||||
const std::string& hiername = it->first;
|
const std::string& hiername = it->first;
|
||||||
if (hiername.size() >= 1 && hiername[0] == '\t') nullScope=true;
|
if (hiername.size() >= 1 && hiername[0] == '\t') nullScope=true;
|
||||||
}
|
}
|
||||||
if (nullScope) {
|
if (nullScope) {
|
||||||
NameMap* newmapp = new NameMap;
|
NameMap* newmapp = new NameMap;
|
||||||
for (NameMap::iterator it=m_namemapp->begin(); it!=m_namemapp->end(); ++it) {
|
for (NameMap::const_iterator it=m_namemapp->begin(); it!=m_namemapp->end(); ++it) {
|
||||||
const std::string& hiername = it->first;
|
const std::string& hiername = it->first;
|
||||||
const std::string& decl = it->second;
|
const std::string& decl = it->second;
|
||||||
std::string newname = std::string("top");
|
std::string newname = std::string("top");
|
||||||
|
|
@ -229,7 +229,7 @@ VerilatedVcd::~VerilatedVcd() {
|
||||||
if (m_sigs_oldvalp) { delete[] m_sigs_oldvalp; m_sigs_oldvalp=NULL; }
|
if (m_sigs_oldvalp) { delete[] m_sigs_oldvalp; m_sigs_oldvalp=NULL; }
|
||||||
deleteNameMap();
|
deleteNameMap();
|
||||||
if (m_filep && m_fileNewed) { delete m_filep; m_filep = NULL; }
|
if (m_filep && m_fileNewed) { delete m_filep; m_filep = NULL; }
|
||||||
for (CallbackVec::iterator it=m_callbacks.begin(); it!=m_callbacks.end(); ++it) {
|
for (CallbackVec::const_iterator it=m_callbacks.begin(); it!=m_callbacks.end(); ++it) {
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
m_callbacks.clear();
|
m_callbacks.clear();
|
||||||
|
|
@ -416,7 +416,7 @@ void VerilatedVcd::dumpHeader () {
|
||||||
|
|
||||||
// Print the signal names
|
// Print the signal names
|
||||||
const char* lastName = "";
|
const char* lastName = "";
|
||||||
for (NameMap::iterator it=m_namemapp->begin(); it!=m_namemapp->end(); ++it) {
|
for (NameMap::const_iterator it=m_namemapp->begin(); it!=m_namemapp->end(); ++it) {
|
||||||
const std::string& hiernamestr = it->first;
|
const std::string& hiernamestr = it->first;
|
||||||
const std::string& decl = it->second;
|
const std::string& decl = it->second;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ public:
|
||||||
|
|
||||||
class VerilatedVpioVarIter : public VerilatedVpio {
|
class VerilatedVpioVarIter : public VerilatedVpio {
|
||||||
const VerilatedScope* m_scopep;
|
const VerilatedScope* m_scopep;
|
||||||
VerilatedVarNameMap::iterator m_it;
|
VerilatedVarNameMap::const_iterator m_it;
|
||||||
bool m_started;
|
bool m_started;
|
||||||
public:
|
public:
|
||||||
explicit VerilatedVpioVarIter(const VerilatedScope* scopep)
|
explicit VerilatedVpioVarIter(const VerilatedScope* scopep)
|
||||||
|
|
@ -368,7 +368,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static QData cbNextDeadline() {
|
static QData cbNextDeadline() {
|
||||||
VpioTimedCbs::iterator it=s_s.m_timedCbs.begin();
|
VpioTimedCbs::const_iterator it=s_s.m_timedCbs.begin();
|
||||||
if (VL_LIKELY(it!=s_s.m_timedCbs.end())) {
|
if (VL_LIKELY(it!=s_s.m_timedCbs.end())) {
|
||||||
return it->first;
|
return it->first;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -412,7 +412,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (VpioVarSet::iterator it=update.begin(); it!=update.end(); ++it) {
|
for (VpioVarSet::const_iterator it=update.begin(); it!=update.end(); ++it) {
|
||||||
memcpy((*it)->prevDatap(), (*it)->varDatap(), (*it)->entSize());
|
memcpy((*it)->prevDatap(), (*it)->varDatap(), (*it)->entSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue