From 5ed882faf2d12535853f17922e7220f5c1368eb2 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 30 Sep 2022 23:41:35 -0400 Subject: [PATCH] Fix unused compiler warning when not VL_THREADED. --- include/verilated_trace_imp.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/verilated_trace_imp.h b/include/verilated_trace_imp.h index 0663986f1..90dcc2e70 100644 --- a/include/verilated_trace_imp.h +++ b/include/verilated_trace_imp.h @@ -551,15 +551,15 @@ template <> void VerilatedTrace::runOffloadedCallbacks( const std::vector& cbVec) { // Fall back on sequential execution - for (const CallbackRecord& cbr : cbVec) { #ifdef VL_THREADED + for (const CallbackRecord& cbr : cbVec) { Buffer* traceBufferp = getTraceBuffer(); cbr.m_dumpOffloadCb(cbr.m_userp, static_cast(traceBufferp)); commitTraceBuffer(traceBufferp); -#else - VL_FATAL_MT(__FILE__, __LINE__, "", "Unreachable"); -#endif } +#else + if (!cbVec.empty()) VL_FATAL_MT(__FILE__, __LINE__, "", "Unreachable"); +#endif } template <> @@ -586,7 +586,9 @@ void VerilatedTrace::dump(uint64_t timeui) VL_MT_SAFE_EXCLUD if (!preChangeDump()) return; } +#ifdef VL_THREADED uint32_t* bufferp = nullptr; +#endif if (offload()) { #ifdef VL_THREADED // Currently only incremental dumps run on the worker thread