Internals: Add some internal coverage exclusions etc. No functional change.

This commit is contained in:
Wilson Snyder 2022-10-03 10:57:37 -04:00
parent 2fc1746ef5
commit ced82cbac4
6 changed files with 8 additions and 4 deletions

View File

@ -329,8 +329,7 @@ CLANGTIDY_FLAGS = -config='' \
-header-filter='.*' \ -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' \ -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)) \ CLANGTIDY_DEP = $(subst .cpp,.cpp.tidy,$(CPPCHECK_CPP))
$(subst .cpp,.cpp.tidy,$(CPPCHECK_CPP))
CLANGTIDY_DEFS = -DVL_DEBUG=1 -DVL_THREADED=1 -DVL_CPPCHECK=1 CLANGTIDY_DEFS = -DVL_DEBUG=1 -DVL_THREADED=1 -DVL_CPPCHECK=1
clang-tidy: $(CLANGTIDY_DEP) clang-tidy: $(CLANGTIDY_DEP)

View File

@ -518,7 +518,7 @@ VerilatedCovContext* VerilatedContext::coveragep() VL_MT_SAFE {
if (VL_UNLIKELY(!m_coveragep)) { if (VL_UNLIKELY(!m_coveragep)) {
const VerilatedLockGuard lock{s_mutex}; const VerilatedLockGuard lock{s_mutex};
// cppcheck-suppress identicalInnerCondition // 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); m_coveragep.reset(new VerilatedCovImp);
} }
} }

View File

@ -84,6 +84,7 @@ private:
// clang-format off // clang-format off
// Formatting matches that of sc_trace.h // Formatting matches that of sc_trace.h
// LCOV_EXCL_START
#if (SYSTEMC_VERSION >= 20171012) #if (SYSTEMC_VERSION >= 20171012)
DECL_TRACE_METHOD_A( sc_event ) DECL_TRACE_METHOD_A( sc_event )
DECL_TRACE_METHOD_A( sc_time ) 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_bv_base )
DECL_TRACE_METHOD_A( sc_dt::sc_lv_base ) DECL_TRACE_METHOD_A( sc_dt::sc_lv_base )
// LCOV_EXCL_STOP
// clang-format on // clang-format on
#undef DECL_TRACE_METHOD_A #undef DECL_TRACE_METHOD_A

View File

@ -58,7 +58,7 @@ VlWorkerThread::~VlWorkerThread() {
m_cthread.join(); 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 // Deliberately empty, we use the address of this function as a magic number
} }

View File

@ -86,6 +86,7 @@ private:
// clang-format off // clang-format off
// Formatting matches that of sc_trace.h // Formatting matches that of sc_trace.h
// LCOV_EXCL_START
#if (SYSTEMC_VERSION >= 20171012) #if (SYSTEMC_VERSION >= 20171012)
DECL_TRACE_METHOD_A( sc_event ) DECL_TRACE_METHOD_A( sc_event )
DECL_TRACE_METHOD_A( sc_time ) 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_bv_base )
DECL_TRACE_METHOD_A( sc_dt::sc_lv_base ) DECL_TRACE_METHOD_A( sc_dt::sc_lv_base )
// LCOV_EXCL_STOP
// clang-format on // clang-format on
#undef DECL_TRACE_METHOD_A #undef DECL_TRACE_METHOD_A

View File

@ -964,6 +964,7 @@ def write_op_checks(filename):
backp = tailp = opp; backp = tailp = opp;
opp = {next}; opp = {next};
}} while (opp); }} while (opp);
if (headp && tailp) {{}} // Prevent unused
UASSERT_OBJ(headp->m_headtailp == tailp, headp, "Tail in headtailp is inconsistent"); UASSERT_OBJ(headp->m_headtailp == tailp, headp, "Tail in headtailp is inconsistent");
UASSERT_OBJ(tailp->m_headtailp == headp, tailp, "Head in headtailp is inconsistent"); UASSERT_OBJ(tailp->m_headtailp == headp, tailp, "Head in headtailp is inconsistent");
}} }}