diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp index 89b7fb86d..c442bbae7 100644 --- a/include/verilated_cov.cpp +++ b/include/verilated_cov.cpp @@ -357,9 +357,6 @@ public: void write(const char* filename) VL_MT_SAFE_EXCLUDES(m_mutex) { Verilated::quiesce(); const VerilatedLockGuard lock{m_mutex}; -#ifndef VM_COVERAGE - VL_FATAL_MT("", 0, "", "%Error: Called VerilatedCov::write when VM_COVERAGE disabled"); -#endif selftest(); std::ofstream os{filename}; diff --git a/include/verilated_cov.h b/include/verilated_cov.h index 4c3b1550d..4697c4f88 100644 --- a/include/verilated_cov.h +++ b/include/verilated_cov.h @@ -35,22 +35,6 @@ class VerilatedCovImp; -//============================================================================= -/// Conditionally compile statements only when doing coverage (when -/// VM_COVERAGE is defined) - -// clang-format off -#ifdef VM_COVERAGE -# define VL_IF_COVER(stmts) \ - do { stmts; } while (false) -#else -# define VL_IF_COVER(stmts) \ - do { \ - if (false) { stmts; } \ - } while (false) -#endif -// clang-format on - //============================================================================= /// Insert a item for coverage analysis. /// The first argument is a pointer to the count to be dumped. @@ -83,8 +67,11 @@ class VerilatedCovImp; /// } #define VL_COVER_INSERT(covcontextp, countp, ...) \ - VL_IF_COVER(covcontextp->_inserti(countp); covcontextp->_insertf(__FILE__, __LINE__); \ - covcontextp->_insertp("hier", name(), __VA_ARGS__)) + do { \ + covcontextp->_inserti(countp); \ + covcontextp->_insertf(__FILE__, __LINE__); \ + covcontextp->_insertp("hier", name(), __VA_ARGS__); \ + } while (false) //============================================================================= // Convert VL_COVER_INSERT value arguments to strings, is \internal