mirror of
https://github.com/verilator/verilator.git
synced 2026-09-06 08:57:23 +02:00
Internals: Fix misc internal coverage holes. No functional change intended.
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user