diff --git a/include/verilated.h b/include/verilated.h index 81c174774..f64de2226 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -248,7 +248,7 @@ protected: public: /// Returns the VerilatedContext this model is instantiated under /// Used to get to e.g. simulation time via contextp()->time() - VerilatedContext* contextp() const { return &m_context; } + VerilatedContext* contextp() const VL_MT_SAFE { return &m_context; } /// Returns the hierarchical name of this module instance. virtual const char* hierName() const = 0; /// Returns the name of this model (the name of the generated model class). @@ -718,7 +718,7 @@ public: lastContextp(contextp); } /// Return the VerilatedContext for the current thread - static VerilatedContext* threadContextp() { + static VerilatedContext* threadContextp() VL_MT_SAFE { if (VL_UNLIKELY(!t_s.t_contextp)) t_s.t_contextp = lastContextp(); return t_s.t_contextp; } diff --git a/include/verilated_imp.h b/include/verilated_imp.h index 5684da3c5..e70fffd3b 100644 --- a/include/verilated_imp.h +++ b/include/verilated_imp.h @@ -441,7 +441,7 @@ protected: friend class Verilated; // MEMBERS - static VerilatedImpData& s() { // Singleton + static VerilatedImpData& s() VL_MT_SAFE { // Singleton static VerilatedImpData s_s; return s_s; } diff --git a/include/verilated_vcd_c.h b/include/verilated_vcd_c.h index 64469d430..94361115b 100644 --- a/include/verilated_vcd_c.h +++ b/include/verilated_vcd_c.h @@ -123,7 +123,7 @@ public: // ACCESSORS // Set size in bytes after which new file should be created. - void rolloverSize(uint64_t size) { m_rolloverSize = size; } + void rolloverSize(uint64_t size) VL_MT_SAFE { m_rolloverSize = size; } // METHODS - All must be thread safe // Open the file; call isOpen() to see if errors diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index 2fb4ecdba..f8640c64d 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -67,7 +67,7 @@ class VerilatedVpio VL_NOT_FINAL { // CONSTANTS // Magic value stored in front of object to detect double free etc // Must be odd, as aligned pointer can never be odd - static constexpr uint32_t activeMagic() { return 0xfeed100f; } + static constexpr uint32_t activeMagic() VL_PURE { return 0xfeed100f; } // MEM MANGLEMENT // Internal note: Globals may multi-construct, see verilated.cpp top.