[#73220] add clearing data after dumping it to output file
This commit is contained in:
parent
cf838ae96f
commit
f39e5e708f
|
|
@ -224,7 +224,6 @@ void VerilatedSaif::closeErr() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VerilatedSaif::close() VL_MT_SAFE_EXCLUDES(m_mutex) {
|
void VerilatedSaif::close() VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
assert(m_time > 0);
|
|
||||||
printStr("(DURATION ");
|
printStr("(DURATION ");
|
||||||
printStr(std::to_string(m_time).c_str());
|
printStr(std::to_string(m_time).c_str());
|
||||||
printStr(")\n");
|
printStr(")\n");
|
||||||
|
|
@ -237,6 +236,8 @@ void VerilatedSaif::close() VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
|
|
||||||
printStr(")\n"); // SAIFILE
|
printStr(")\n"); // SAIFILE
|
||||||
|
|
||||||
|
clearCurrentlyCollectedData();
|
||||||
|
|
||||||
// This function is on the flush() call path
|
// This function is on the flush() call path
|
||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
if (!isOpen()) return;
|
if (!isOpen()) return;
|
||||||
|
|
@ -318,6 +319,16 @@ void VerilatedSaif::recursivelyPrintScopes(uint32_t scopeIndex) {
|
||||||
printStr(")\n"); // INSTANCE
|
printStr(")\n"); // INSTANCE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VerilatedSaif::clearCurrentlyCollectedData()
|
||||||
|
{
|
||||||
|
m_currentScope = -1;
|
||||||
|
m_scopes.clear();
|
||||||
|
m_topScopes.clear();
|
||||||
|
m_activity.clear();
|
||||||
|
m_activityArena.clear();
|
||||||
|
m_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void VerilatedSaif::flush() VL_MT_SAFE_EXCLUDES(m_mutex) {
|
void VerilatedSaif::flush() VL_MT_SAFE_EXCLUDES(m_mutex) {
|
||||||
const VerilatedLockGuard lock{m_mutex};
|
const VerilatedLockGuard lock{m_mutex};
|
||||||
Super::flushBase();
|
Super::flushBase();
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,8 @@ private:
|
||||||
size_t m_maxSignalBytes = 0; // Upper bound on number of bytes a single signal can generate
|
size_t m_maxSignalBytes = 0; // Upper bound on number of bytes a single signal can generate
|
||||||
uint64_t m_wroteBytes = 0; // Number of bytes written to this file
|
uint64_t m_wroteBytes = 0; // Number of bytes written to this file
|
||||||
|
|
||||||
|
void clearCurrentlyCollectedData();
|
||||||
|
|
||||||
int32_t m_currentScope{-1};
|
int32_t m_currentScope{-1};
|
||||||
std::vector<SaifScope> m_scopes{};
|
std::vector<SaifScope> m_scopes{};
|
||||||
std::vector<uint32_t> m_topScopes{};
|
std::vector<uint32_t> m_topScopes{};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue