Add Verilated::internalsDump()
This commit is contained in:
parent
1bea845ceb
commit
ae6f5844da
|
|
@ -1075,6 +1075,10 @@ const char* Verilated::commandArgsPlusMatch(const char* prefixp) {
|
||||||
return VerilatedImp::argPlusMatch(prefixp).c_str();
|
return VerilatedImp::argPlusMatch(prefixp).c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Verilated::internalsDump() {
|
||||||
|
VerilatedImp::internalsDump();
|
||||||
|
}
|
||||||
|
|
||||||
void Verilated::scopesDump() {
|
void Verilated::scopesDump() {
|
||||||
VerilatedImp::scopesDump();
|
VerilatedImp::scopesDump();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,11 @@ public:
|
||||||
static const char* productName() { return VERILATOR_PRODUCT; }
|
static const char* productName() { return VERILATOR_PRODUCT; }
|
||||||
static const char* productVersion() { return VERILATOR_VERSION; }
|
static const char* productVersion() { return VERILATOR_VERSION; }
|
||||||
|
|
||||||
|
/// For debugging, print much of the Verilator internal state.
|
||||||
|
/// The output of this function may change in future
|
||||||
|
/// releases - contact the authors before production use.
|
||||||
|
static void internalsDump();
|
||||||
|
|
||||||
/// For debugging, print text list of all scope names with
|
/// For debugging, print text list of all scope names with
|
||||||
/// dpiImport/Export context. This function may change in future
|
/// dpiImport/Export context. This function may change in future
|
||||||
/// releases - contact the authors before production use.
|
/// releases - contact the authors before production use.
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,18 @@ public: // But only for verilated*.cpp
|
||||||
m_fdps[2] = stderr;
|
m_fdps[2] = stderr;
|
||||||
}
|
}
|
||||||
~VerilatedImp() {}
|
~VerilatedImp() {}
|
||||||
|
static void internalsDump() {
|
||||||
|
VL_PRINTF("internalsDump:\n");
|
||||||
|
VL_PRINTF(" Argv:");
|
||||||
|
for (ArgVec::iterator it=s_s.m_argVec.begin(); it!=s_s.m_argVec.end(); ++it) {
|
||||||
|
VL_PRINTF(" %s",it->c_str());
|
||||||
|
}
|
||||||
|
VL_PRINTF("\n");
|
||||||
|
VL_PRINTF(" Version: %s %s\n", Verilated::productName(), Verilated::productVersion());
|
||||||
|
scopesDump();
|
||||||
|
exportsDump();
|
||||||
|
userDump();
|
||||||
|
}
|
||||||
|
|
||||||
// METHODS - arguments
|
// METHODS - arguments
|
||||||
static void commandArgs(int argc, const char** argv) {
|
static void commandArgs(int argc, const char** argv) {
|
||||||
|
|
@ -129,6 +141,14 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static void userDump() {
|
||||||
|
bool first = true;
|
||||||
|
for (UserMap::iterator it=s_s.m_userMap.begin(); it!=s_s.m_userMap.end(); ++it) {
|
||||||
|
if (first) { VL_PRINTF(" userDump:\n"); first=false; }
|
||||||
|
VL_PRINTF(" DPI_USER_DATA scope %p key %p: %p\n",
|
||||||
|
it->first.first, it->first.second, it->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public: // But only for verilated*.cpp
|
public: // But only for verilated*.cpp
|
||||||
// METHODS - scope name
|
// METHODS - scope name
|
||||||
|
|
@ -150,7 +170,6 @@ public: // But only for verilated*.cpp
|
||||||
ScopeNameMap::iterator it=s_s.m_nameMap.find(scopep->name());
|
ScopeNameMap::iterator it=s_s.m_nameMap.find(scopep->name());
|
||||||
if (it != s_s.m_nameMap.end()) s_s.m_nameMap.erase(it);
|
if (it != s_s.m_nameMap.end()) s_s.m_nameMap.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scopesDump() {
|
static void scopesDump() {
|
||||||
VL_PRINTF(" scopesDump:\n");
|
VL_PRINTF(" scopesDump:\n");
|
||||||
for (ScopeNameMap::iterator it=s_s.m_nameMap.begin(); it!=s_s.m_nameMap.end(); ++it) {
|
for (ScopeNameMap::iterator it=s_s.m_nameMap.begin(); it!=s_s.m_nameMap.end(); ++it) {
|
||||||
|
|
@ -194,6 +213,13 @@ public: // But only for verilated*.cpp
|
||||||
}
|
}
|
||||||
return "*UNKNOWN*";
|
return "*UNKNOWN*";
|
||||||
}
|
}
|
||||||
|
static void exportsDump() {
|
||||||
|
bool first = true;
|
||||||
|
for (ExportNameMap::iterator it=s_s.m_exportMap.begin(); it!=s_s.m_exportMap.end(); ++it) {
|
||||||
|
if (first) { VL_PRINTF(" exportDump:\n"); first=false; }
|
||||||
|
VL_PRINTF(" DPI_EXPORT_NAME %05d: %s\n", it->second, it->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
// We don't free up m_exportMap until the end, because we can't be sure
|
// We don't free up m_exportMap until the end, because we can't be sure
|
||||||
// what other models are using the assigned funcnum's.
|
// what other models are using the assigned funcnum's.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ int dpix_run_tests() {
|
||||||
static int didDump = 0;
|
static int didDump = 0;
|
||||||
if (didDump++ == 0) {
|
if (didDump++ == 0) {
|
||||||
# ifdef TEST_VERBOSE
|
# ifdef TEST_VERBOSE
|
||||||
Verilated::scopesDump();
|
Verilated::internalsDump();
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue