Internals: Fix misc internal coverage holes. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-06-04 19:49:39 -04:00
parent b88e1e6970
commit a433096d5a
7 changed files with 22 additions and 15 deletions
+13
View File
@@ -2254,11 +2254,24 @@ void Verilated::flushCb(VerilatedVoidCb cb) VL_MT_SAFE {
}
}
// When running internal code coverage (gcc --coverage, as opposed to
// verilator --coverage), dump coverage data to properly cover failing
// tests.
#ifdef VL_GCOV
extern "C" {
void __gcov_flush(); // gcc sources gcc/gcov-io.h has the prototype
}
void vl_gcov_flush() { __gcov_flush(); }
#else
void vl_gcov_flush() {}
#endif
void Verilated::flushCall() VL_MT_SAFE {
const VerilatedLockGuard lock(m_mutex);
if (s_flushCb) (*s_flushCb)();
fflush(stderr);
fflush(stdout);
vl_gcov_flush();
}
const char* Verilated::productName() VL_PURE { return VERILATOR_PRODUCT; }