Internals: Vcd doesn't need code when registering. No functional change intended.
This commit is contained in:
parent
aac02acf92
commit
0ca0e07354
|
|
@ -167,10 +167,10 @@ public:
|
||||||
void fullArray(vluint32_t code, const vluint32_t* newval, int bits) {
|
void fullArray(vluint32_t code, const vluint32_t* newval, int bits) {
|
||||||
chgArray(code, newval, bits); }
|
chgArray(code, newval, bits); }
|
||||||
|
|
||||||
void declTriBit (vluint32_t code, const char* name, int arraynum);
|
void declTriBit(vluint32_t code, const char* name, int arraynum);
|
||||||
void declTriBus (vluint32_t code, const char* name, int arraynum, int msb, int lsb);
|
void declTriBus(vluint32_t code, const char* name, int arraynum, int msb, int lsb);
|
||||||
void declTriQuad (vluint32_t code, const char* name, int arraynum, int msb, int lsb);
|
void declTriQuad(vluint32_t code, const char* name, int arraynum, int msb, int lsb);
|
||||||
void declTriArray (vluint32_t code, const char* name, int arraynum, int msb, int lsb);
|
void declTriArray(vluint32_t code, const char* name, int arraynum, int msb, int lsb);
|
||||||
void fullTriBit(vluint32_t code, const vluint32_t newval, const vluint32_t newtri);
|
void fullTriBit(vluint32_t code, const vluint32_t newval, const vluint32_t newtri);
|
||||||
void fullTriBus(vluint32_t code, const vluint32_t newval, const vluint32_t newtri, int bits);
|
void fullTriBus(vluint32_t code, const vluint32_t newval, const vluint32_t newtri, int bits);
|
||||||
void fullTriQuad(vluint32_t code, const vluint64_t newval, const vluint32_t newtri, int bits);
|
void fullTriQuad(vluint32_t code, const vluint64_t newval, const vluint32_t newtri, int bits);
|
||||||
|
|
|
||||||
|
|
@ -100,12 +100,15 @@ protected:
|
||||||
VerilatedVcdCallback_t m_fullcb; ///< Full Dumping Callback function
|
VerilatedVcdCallback_t m_fullcb; ///< Full Dumping Callback function
|
||||||
VerilatedVcdCallback_t m_changecb; ///< Incremental Dumping Callback function
|
VerilatedVcdCallback_t m_changecb; ///< Incremental Dumping Callback function
|
||||||
void* m_userthis; ///< Fake "this" for caller
|
void* m_userthis; ///< Fake "this" for caller
|
||||||
vluint32_t m_code; ///< Starting code number
|
vluint32_t m_code; ///< Starting code number (set later by traceInit)
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
VerilatedVcdCallInfo(VerilatedVcdCallback_t icb, VerilatedVcdCallback_t fcb,
|
VerilatedVcdCallInfo(VerilatedVcdCallback_t icb, VerilatedVcdCallback_t fcb,
|
||||||
VerilatedVcdCallback_t changecb,
|
VerilatedVcdCallback_t changecb, void* ut)
|
||||||
void* ut, vluint32_t code)
|
: m_initcb(icb)
|
||||||
: m_initcb(icb), m_fullcb(fcb), m_changecb(changecb), m_userthis(ut), m_code(code) {}
|
, m_fullcb(fcb)
|
||||||
|
, m_changecb(changecb)
|
||||||
|
, m_userthis(ut)
|
||||||
|
, m_code(1) {}
|
||||||
~VerilatedVcdCallInfo() {}
|
~VerilatedVcdCallInfo() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -230,7 +233,7 @@ void VerilatedVcd::makeNameMap() {
|
||||||
deleteNameMap();
|
deleteNameMap();
|
||||||
m_nextCode = 1;
|
m_nextCode = 1;
|
||||||
m_namemapp = new NameMap;
|
m_namemapp = new NameMap;
|
||||||
for (vluint32_t ent = 0; ent< m_callbacks.size(); ent++) {
|
for (vluint32_t ent = 0; ent < m_callbacks.size(); ent++) {
|
||||||
VerilatedVcdCallInfo* cip = m_callbacks[ent];
|
VerilatedVcdCallInfo* cip = m_callbacks[ent];
|
||||||
cip->m_code = m_nextCode;
|
cip->m_code = m_nextCode;
|
||||||
(cip->m_initcb)(this, cip->m_userthis, cip->m_code);
|
(cip->m_initcb)(this, cip->m_userthis, cip->m_code);
|
||||||
|
|
@ -513,7 +516,7 @@ void VerilatedVcd::dumpHeader() {
|
||||||
|
|
||||||
printIndent(-1);
|
printIndent(-1);
|
||||||
printStr("$enddefinitions $end\n\n\n");
|
printStr("$enddefinitions $end\n\n\n");
|
||||||
assert(m_modDepth==0);
|
assert(m_modDepth == 0);
|
||||||
|
|
||||||
// Reclaim storage
|
// Reclaim storage
|
||||||
deleteNameMap();
|
deleteNameMap();
|
||||||
|
|
@ -658,19 +661,16 @@ void VerilatedVcd::fullFloat(vluint32_t code, const float newval) {
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// Callbacks
|
// Callbacks
|
||||||
|
|
||||||
void VerilatedVcd::addCallback(
|
void VerilatedVcd::addCallback(VerilatedVcdCallback_t initcb, VerilatedVcdCallback_t fullcb,
|
||||||
VerilatedVcdCallback_t initcb, VerilatedVcdCallback_t fullcb, VerilatedVcdCallback_t changecb,
|
VerilatedVcdCallback_t changecb, void* userthis) VL_MT_UNSAFE_ONE {
|
||||||
void* userthis) VL_MT_UNSAFE_ONE
|
|
||||||
{
|
|
||||||
m_assertOne.check();
|
m_assertOne.check();
|
||||||
if (VL_UNLIKELY(isOpen())) {
|
if (VL_UNLIKELY(isOpen())) {
|
||||||
std::string msg = std::string("Internal: ")+__FILE__+"::"+__FUNCTION__
|
std::string msg = std::string("Internal: ") + __FILE__ + "::" + __FUNCTION__
|
||||||
+" called with already open file";
|
+ " called with already open file";
|
||||||
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str());
|
||||||
}
|
}
|
||||||
VerilatedVcdCallInfo* vci
|
VerilatedVcdCallInfo* cip = new VerilatedVcdCallInfo(initcb, fullcb, changecb, userthis);
|
||||||
= new VerilatedVcdCallInfo(initcb, fullcb, changecb, userthis, m_nextCode);
|
m_callbacks.push_back(cip);
|
||||||
m_callbacks.push_back(vci);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
@ -680,7 +680,7 @@ void VerilatedVcd::dumpFull(vluint64_t timeui) {
|
||||||
m_assertOne.check();
|
m_assertOne.check();
|
||||||
dumpPrep(timeui);
|
dumpPrep(timeui);
|
||||||
Verilated::quiesce();
|
Verilated::quiesce();
|
||||||
for (vluint32_t ent = 0; ent< m_callbacks.size(); ent++) {
|
for (vluint32_t ent = 0; ent < m_callbacks.size(); ent++) {
|
||||||
VerilatedVcdCallInfo* cip = m_callbacks[ent];
|
VerilatedVcdCallInfo* cip = m_callbacks[ent];
|
||||||
(cip->m_fullcb)(this, cip->m_userthis, cip->m_code);
|
(cip->m_fullcb)(this, cip->m_userthis, cip->m_code);
|
||||||
}
|
}
|
||||||
|
|
@ -700,7 +700,7 @@ void VerilatedVcd::dump(vluint64_t timeui) {
|
||||||
}
|
}
|
||||||
dumpPrep(timeui);
|
dumpPrep(timeui);
|
||||||
Verilated::quiesce();
|
Verilated::quiesce();
|
||||||
for (vluint32_t ent = 0; ent< m_callbacks.size(); ++ent) {
|
for (vluint32_t ent = 0; ent < m_callbacks.size(); ++ent) {
|
||||||
VerilatedVcdCallInfo* cip = m_callbacks[ent];
|
VerilatedVcdCallInfo* cip = m_callbacks[ent];
|
||||||
(cip->m_changecb)(this, cip->m_userthis, cip->m_code);
|
(cip->m_changecb)(this, cip->m_userthis, cip->m_code);
|
||||||
}
|
}
|
||||||
|
|
@ -829,6 +829,7 @@ main() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//********************************************************************
|
//********************************************************************
|
||||||
|
// ;compile-command: "mkdir -p ../test_dir && cd ../test_dir && c++ -DVERILATED_VCD_TEST ../include/verilated_vcd_c.cpp -o verilated_vcd_c && ./verilated_vcd_c && cat test.vcd"
|
||||||
|
//
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// compile-command: "mkdir -p ../test_dir && cd ../test_dir && c++ -DVERILATED_VCD_TEST ../include/verilated_vcd_c.cpp -o verilated_vcd_c && ./verilated_vcd_c && cat test.vcd"
|
|
||||||
// End:
|
// End:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue