forked from github/verilator
Add Verilated::scopesDump(), for debugging.
This commit is contained in:
parent
097f3590ae
commit
735871d501
@ -915,6 +915,10 @@ void Verilated::commandArgs(int argc, const char** argv) {
|
|||||||
VerilatedImp::commandArgs(argc,argv);
|
VerilatedImp::commandArgs(argc,argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Verilated::scopesDump() {
|
||||||
|
VerilatedImp::scopesDump();
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
// VerilatedModule:: Methods
|
// VerilatedModule:: Methods
|
||||||
|
|
||||||
|
@ -186,10 +186,16 @@ public:
|
|||||||
/// Enable/disable assertions
|
/// Enable/disable assertions
|
||||||
static void assertOn(bool flag) { s_assertOn=flag; }
|
static void assertOn(bool flag) { s_assertOn=flag; }
|
||||||
static bool assertOn() { return s_assertOn; }
|
static bool assertOn() { return s_assertOn; }
|
||||||
|
|
||||||
/// Record command line arguments, for retrieval by $test$plusargs/$value$plusargs
|
/// Record command line arguments, for retrieval by $test$plusargs/$value$plusargs
|
||||||
static void commandArgs(int argc, const char** argv);
|
static void commandArgs(int argc, const char** argv);
|
||||||
static void commandArgs(int argc, char** argv) { commandArgs(argc,(const char**)argv); }
|
static void commandArgs(int argc, char** argv) { commandArgs(argc,(const char**)argv); }
|
||||||
|
|
||||||
|
/// For debugging, print text list of all scope names with
|
||||||
|
/// dpiImport/Export context. This function may change in future
|
||||||
|
/// releases - contact the authors before production use.
|
||||||
|
static void scopesDump();
|
||||||
|
|
||||||
// METHODS - INTERNAL USE ONLY
|
// METHODS - INTERNAL USE ONLY
|
||||||
// Internal: Create a new module name by concatenating two strings
|
// Internal: Create a new module name by concatenating two strings
|
||||||
static const char* catName(const char* n1, const char* n2); // Returns new'ed data
|
static const char* catName(const char* n1, const char* n2); // Returns new'ed data
|
||||||
|
@ -137,7 +137,15 @@ 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() {
|
||||||
|
VL_PRINTF("scopesDump:\n");
|
||||||
|
for (ScopeNameMap::iterator it=s_s.m_nameMap.begin();
|
||||||
|
it!=s_s.m_nameMap.end(); ++it) {
|
||||||
|
const VerilatedScope* scopep = it->second;
|
||||||
|
VL_PRINTF(" %s\n", scopep->name());
|
||||||
|
}
|
||||||
|
VL_PRINTF("\n");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // Guard
|
#endif // Guard
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VERILATOR
|
||||||
|
# include "verilated.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
@ -50,6 +54,13 @@ int dpic_line() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef VERILATOR
|
||||||
|
static int didDump = 0;
|
||||||
|
if (didDump++ == 0) {
|
||||||
|
Verilated::scopesDump();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char* scopenamep = svGetNameFromScope(scope);
|
const char* scopenamep = svGetNameFromScope(scope);
|
||||||
if (!scopenamep) {
|
if (!scopenamep) {
|
||||||
printf("%%Warning: svGetNameFromScope failed\n");
|
printf("%%Warning: svGetNameFromScope failed\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user