Internals: Fix some VL_MT metacomments.

This commit is contained in:
Wilson Snyder 2022-11-28 07:08:34 -05:00
parent 6349e76abd
commit 4452a9b10f
5 changed files with 14 additions and 14 deletions

View File

@ -279,7 +279,7 @@ void VL_PRINTF_MT(const char* formatp, ...) VL_MT_SAFE {
//=========================================================================== //===========================================================================
// Random -- Mostly called at init time, so not inline. // Random -- Mostly called at init time, so not inline.
static uint32_t vl_sys_rand32() VL_MT_UNSAFE { static uint32_t vl_sys_rand32() VL_MT_SAFE {
// Return random 32-bits using system library. // Return random 32-bits using system library.
// Used only to construct seed for Verilator's PNRG. // Used only to construct seed for Verilator's PNRG.
static VerilatedMutex s_mutex; static VerilatedMutex s_mutex;

View File

@ -275,7 +275,7 @@ private:
public: public:
explicit VerilatedModule(const char* namep); // Create module with given hierarchy name explicit VerilatedModule(const char* namep); // Create module with given hierarchy name
~VerilatedModule(); ~VerilatedModule();
const char* name() const { return m_namep; } ///< Return name of module const char* name() const VL_MT_SAFE_POSTINIT { return m_namep; } ///< Return name of module
}; };
//========================================================================= //=========================================================================
@ -533,8 +533,8 @@ public:
// METHODS - public but for internal use only // METHODS - public but for internal use only
// Internal: access to implementation class // Internal: access to implementation class
VerilatedContextImp* impp() { return reinterpret_cast<VerilatedContextImp*>(this); } VerilatedContextImp* impp() VL_MT_SAFE { return reinterpret_cast<VerilatedContextImp*>(this); }
const VerilatedContextImp* impp() const { const VerilatedContextImp* impp() const VL_MT_SAFE {
return reinterpret_cast<const VerilatedContextImp*>(this); return reinterpret_cast<const VerilatedContextImp*>(this);
} }
@ -617,10 +617,10 @@ public: // But internals only - called from VerilatedModule's
void varInsert(int finalize, const char* namep, void* datap, bool isParam, void varInsert(int finalize, const char* namep, void* datap, bool isParam,
VerilatedVarType vltype, int vlflags, int dims, ...) VL_MT_UNSAFE; VerilatedVarType vltype, int vlflags, int dims, ...) VL_MT_UNSAFE;
// ACCESSORS // ACCESSORS
const char* name() const { return m_namep; } const char* name() const VL_MT_SAFE_POSTINIT { return m_namep; }
const char* identifier() const { return m_identifierp; } const char* identifier() const VL_MT_SAFE_POSTINIT { return m_identifierp; }
int8_t timeunit() const { return m_timeunit; } int8_t timeunit() const VL_MT_SAFE_POSTINIT { return m_timeunit; }
VerilatedSyms* symsp() const { return m_symsp; } VerilatedSyms* symsp() const VL_MT_SAFE_POSTINIT { return m_symsp; }
VerilatedVar* varFind(const char* namep) const VL_MT_SAFE_POSTINIT; VerilatedVar* varFind(const char* namep) const VL_MT_SAFE_POSTINIT;
VerilatedVarNameMap* varsp() const VL_MT_SAFE_POSTINIT { return m_varsp; } VerilatedVarNameMap* varsp() const VL_MT_SAFE_POSTINIT { return m_varsp; }
void scopeDump() const; void scopeDump() const;

View File

@ -152,7 +152,7 @@ protected:
// METHODS // METHODS
// Internal: access to implementation class // Internal: access to implementation class
VerilatedCovImp* impp() { return reinterpret_cast<VerilatedCovImp*>(this); } VerilatedCovImp* impp() VL_MT_SAFE { return reinterpret_cast<VerilatedCovImp*>(this); }
}; };
//============================================================================= //=============================================================================

View File

@ -259,20 +259,20 @@ extern void _vl_debug_print_w(int lbits, WDataInP const iwp);
#if defined(SYSTEMC_VERSION) #if defined(SYSTEMC_VERSION)
/// Return current simulation time /// Return current simulation time
// Already defined: extern sc_time sc_time_stamp(); // Already defined: extern sc_time sc_time_stamp();
inline uint64_t vl_time_stamp64() { return sc_time_stamp().value(); } inline uint64_t vl_time_stamp64() VL_MT_SAFE { return sc_time_stamp().value(); }
#else // Non-SystemC #else // Non-SystemC
# if !defined(VL_TIME_CONTEXT) && !defined(VL_NO_LEGACY) # if !defined(VL_TIME_CONTEXT) && !defined(VL_NO_LEGACY)
# ifdef VL_TIME_STAMP64 # ifdef VL_TIME_STAMP64
// vl_time_stamp64() may be optionally defined by the user to return time. // vl_time_stamp64() may be optionally defined by the user to return time.
// On MSVC++ weak symbols are not supported so must be declared, or define // On MSVC++ weak symbols are not supported so must be declared, or define
// VL_TIME_CONTEXT. // VL_TIME_CONTEXT.
extern uint64_t vl_time_stamp64() VL_ATTR_WEAK; extern uint64_t vl_time_stamp64() VL_ATTR_WEAK VL_MT_SAFE;
# else # else
// sc_time_stamp() may be optionally defined by the user to return time. // sc_time_stamp() may be optionally defined by the user to return time.
// On MSVC++ weak symbols are not supported so must be declared, or define // On MSVC++ weak symbols are not supported so must be declared, or define
// VL_TIME_CONTEXT. // VL_TIME_CONTEXT.
extern double sc_time_stamp() VL_ATTR_WEAK; // Verilator 4.032 and newer extern double sc_time_stamp() VL_ATTR_WEAK VL_MT_SAFE; // Verilator 4.032 and newer
inline uint64_t vl_time_stamp64() { inline uint64_t vl_time_stamp64() VL_MT_SAFE {
// clang9.0.1 requires & although we really do want the weak symbol value // clang9.0.1 requires & although we really do want the weak symbol value
// cppcheck-suppress duplicateValueTernary // cppcheck-suppress duplicateValueTernary
return VL_LIKELY(&sc_time_stamp) ? static_cast<uint64_t>(sc_time_stamp()) : 0; return VL_LIKELY(&sc_time_stamp) ? static_cast<uint64_t>(sc_time_stamp()) : 0;

View File

@ -226,7 +226,7 @@ class VerilatedContextImp final : VerilatedContext {
// Number incrementing on each reseed, 0=illegal // Number incrementing on each reseed, 0=illegal
int s_randSeedEpoch = 1; // Reads ok, wish had a VL_WRITE_GUARDED_BY(s_randMutex) int s_randSeedEpoch = 1; // Reads ok, wish had a VL_WRITE_GUARDED_BY(s_randMutex)
}; };
static Statics& s() { static Statics& s() VL_MT_SAFE {
static Statics s_s; static Statics s_s;
return s_s; return s_s;
} }