From ced82cbac41f1f75265a47c8b7e68312914db5ba Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 3 Oct 2022 10:57:37 -0400 Subject: [PATCH] Internals: Add some internal coverage exclusions etc. No functional change. --- Makefile.in | 3 +-- include/verilated_cov.cpp | 2 +- include/verilated_fst_sc.h | 2 ++ include/verilated_threads.cpp | 2 +- include/verilated_vcd_sc.h | 2 ++ src/astgen | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index a32d04619..a8dd0a7fa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -329,8 +329,7 @@ CLANGTIDY_FLAGS = -config='' \ -header-filter='.*' \ -checks='-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-init-variables,-cppcoreguidelines-avoid-goto,-modernize-avoid-c-arrays,-readability-magic-numbers,-readability-simplify-boolean-expr,-cppcoreguidelines-macro-usage' \ -CLANGTIDY_DEP = $(subst .h,.h.tidy,$(CPPCHECK_H)) \ - $(subst .cpp,.cpp.tidy,$(CPPCHECK_CPP)) +CLANGTIDY_DEP = $(subst .cpp,.cpp.tidy,$(CPPCHECK_CPP)) CLANGTIDY_DEFS = -DVL_DEBUG=1 -DVL_THREADED=1 -DVL_CPPCHECK=1 clang-tidy: $(CLANGTIDY_DEP) diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp index 3932afef6..89b7fb86d 100644 --- a/include/verilated_cov.cpp +++ b/include/verilated_cov.cpp @@ -518,7 +518,7 @@ VerilatedCovContext* VerilatedContext::coveragep() VL_MT_SAFE { if (VL_UNLIKELY(!m_coveragep)) { const VerilatedLockGuard lock{s_mutex}; // cppcheck-suppress identicalInnerCondition - if (VL_LIKELY(!m_coveragep)) { // Not redundant, prevents race + if (VL_LIKELY(!m_coveragep)) { // LCOV_EXCL_LINE // Not redundant, prevents race m_coveragep.reset(new VerilatedCovImp); } } diff --git a/include/verilated_fst_sc.h b/include/verilated_fst_sc.h index f5aaa305c..a34d72d0b 100644 --- a/include/verilated_fst_sc.h +++ b/include/verilated_fst_sc.h @@ -84,6 +84,7 @@ private: // clang-format off // Formatting matches that of sc_trace.h + // LCOV_EXCL_START #if (SYSTEMC_VERSION >= 20171012) DECL_TRACE_METHOD_A( sc_event ) DECL_TRACE_METHOD_A( sc_time ) @@ -118,6 +119,7 @@ private: DECL_TRACE_METHOD_A( sc_dt::sc_bv_base ) DECL_TRACE_METHOD_A( sc_dt::sc_lv_base ) + // LCOV_EXCL_STOP // clang-format on #undef DECL_TRACE_METHOD_A diff --git a/include/verilated_threads.cpp b/include/verilated_threads.cpp index 9d6bdedc9..40adba4bc 100644 --- a/include/verilated_threads.cpp +++ b/include/verilated_threads.cpp @@ -58,7 +58,7 @@ VlWorkerThread::~VlWorkerThread() { m_cthread.join(); } -static void shutdownTask(void*, bool) { +static void shutdownTask(void*, bool) { // LCOV_EXCL_LINE // Deliberately empty, we use the address of this function as a magic number } diff --git a/include/verilated_vcd_sc.h b/include/verilated_vcd_sc.h index c0ba6e528..ad8de7133 100644 --- a/include/verilated_vcd_sc.h +++ b/include/verilated_vcd_sc.h @@ -86,6 +86,7 @@ private: // clang-format off // Formatting matches that of sc_trace.h + // LCOV_EXCL_START #if (SYSTEMC_VERSION >= 20171012) DECL_TRACE_METHOD_A( sc_event ) DECL_TRACE_METHOD_A( sc_time ) @@ -120,6 +121,7 @@ private: DECL_TRACE_METHOD_A( sc_dt::sc_bv_base ) DECL_TRACE_METHOD_A( sc_dt::sc_lv_base ) + // LCOV_EXCL_STOP // clang-format on #undef DECL_TRACE_METHOD_A diff --git a/src/astgen b/src/astgen index 1816ae88a..f0883dd08 100755 --- a/src/astgen +++ b/src/astgen @@ -964,6 +964,7 @@ def write_op_checks(filename): backp = tailp = opp; opp = {next}; }} while (opp); + if (headp && tailp) {{}} // Prevent unused UASSERT_OBJ(headp->m_headtailp == tailp, headp, "Tail in headtailp is inconsistent"); UASSERT_OBJ(tailp->m_headtailp == headp, tailp, "Head in headtailp is inconsistent"); }}