diff --git a/include/verilated_trace.h b/include/verilated_trace.h index a88ce6b50..622cb936e 100644 --- a/include/verilated_trace.h +++ b/include/verilated_trace.h @@ -146,23 +146,23 @@ private: , m_userp{userp} {} }; - uint32_t* m_sigs_oldvalp; // Old value store - EData* m_sigs_enabledp; // Bit vector of enabled codes (nullptr = all on) - uint64_t m_timeLastDump; // Last time we did a dump + uint32_t* m_sigs_oldvalp = nullptr; // Old value store + EData* m_sigs_enabledp = nullptr; // Bit vector of enabled codes (nullptr = all on) + uint64_t m_timeLastDump = 0; // Last time we did a dump std::vector m_sigs_enabledVec; // Staging for m_sigs_enabledp std::vector m_initCbs; // Routines to initialize traciong std::vector m_fullCbs; // Routines to perform full dump std::vector m_chgCbs; // Routines to perform incremental dump std::vector m_cleanupCbs; // Routines to call at the end of dump - bool m_fullDump; // Whether a full dump is required on the next call to 'dump' - uint32_t m_nextCode; // Next code number to assign - uint32_t m_numSignals; // Number of distinct signals - uint32_t m_maxBits; // Number of bits in the widest signal + bool m_fullDump = true; // Whether a full dump is required on the next call to 'dump' + uint32_t m_nextCode = 0; // Next code number to assign + uint32_t m_numSignals = 0; // Number of distinct signals + uint32_t m_maxBits = 0; // Number of bits in the widest signal std::vector m_namePrefixStack{""}; // Path prefixes to add to signal names std::vector> m_dumpvars; // dumpvar() entries - char m_scopeEscape; - double m_timeRes; // Time resolution (ns/ms etc) - double m_timeUnit; // Time units (ns/ms etc) + char m_scopeEscape = '.'; + double m_timeRes = 1e-9; // Time resolution (ns/ms etc) + double m_timeUnit = 1e-0; // Time units (ns/ms etc) void addCallbackRecord(std::vector& cbVec, CallbackRecord& cbRec) VL_MT_SAFE_EXCLUDES(m_mutex); @@ -178,17 +178,17 @@ private: #ifdef VL_TRACE_OFFLOAD // Number of total offload buffers that have been allocated - uint32_t m_numOffloadBuffers; + uint32_t m_numOffloadBuffers = 0; // Size of offload buffers - size_t m_offloadBufferSize; + size_t m_offloadBufferSize = 0; // Buffers handed to worker for processing VerilatedThreadQueue m_offloadBuffersToWorker; // Buffers returned from worker after processing VerilatedThreadQueue m_offloadBuffersFromWorker; // Write pointer into current buffer - uint32_t* m_offloadBufferWritep; + uint32_t* m_offloadBufferWritep = nullptr; // End of offload buffer - uint32_t* m_offloadBufferEndp; + uint32_t* m_offloadBufferEndp = nullptr; // The offload worker thread itself std::unique_ptr m_workerThread; diff --git a/include/verilated_trace_imp.h b/include/verilated_trace_imp.h index ed0503fcb..e62e40cab 100644 --- a/include/verilated_trace_imp.h +++ b/include/verilated_trace_imp.h @@ -275,24 +275,7 @@ template <> void VerilatedTrace::onExit(void* selfp) { //============================================================================= // VerilatedTrace -template <> -VerilatedTrace::VerilatedTrace() - : m_sigs_oldvalp{nullptr} - , m_sigs_enabledp{nullptr} - , m_timeLastDump{0} - , m_fullDump{true} - , m_nextCode{0} - , m_numSignals{0} - , m_maxBits{0} - , m_scopeEscape{'.'} - , m_timeRes{1e-9} - , m_timeUnit { - 1e-9 -} -#ifdef VL_TRACE_OFFLOAD -, m_numOffloadBuffers { 0 } -#endif -{ +template <> VerilatedTrace::VerilatedTrace() { set_time_unit(Verilated::threadContextp()->timeunitString()); set_time_resolution(Verilated::threadContextp()->timeprecisionString()); }