mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Internals: Fix some VL_MT metacomments.
This commit is contained in:
parent
6349e76abd
commit
4452a9b10f
@ -279,7 +279,7 @@ void VL_PRINTF_MT(const char* formatp, ...) VL_MT_SAFE {
|
||||
//===========================================================================
|
||||
// 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.
|
||||
// Used only to construct seed for Verilator's PNRG.
|
||||
static VerilatedMutex s_mutex;
|
||||
|
@ -275,7 +275,7 @@ private:
|
||||
public:
|
||||
explicit VerilatedModule(const char* namep); // Create module with given hierarchy name
|
||||
~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
|
||||
|
||||
// Internal: access to implementation class
|
||||
VerilatedContextImp* impp() { return reinterpret_cast<VerilatedContextImp*>(this); }
|
||||
const VerilatedContextImp* impp() const {
|
||||
VerilatedContextImp* impp() VL_MT_SAFE { return reinterpret_cast<VerilatedContextImp*>(this); }
|
||||
const VerilatedContextImp* impp() const VL_MT_SAFE {
|
||||
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,
|
||||
VerilatedVarType vltype, int vlflags, int dims, ...) VL_MT_UNSAFE;
|
||||
// ACCESSORS
|
||||
const char* name() const { return m_namep; }
|
||||
const char* identifier() const { return m_identifierp; }
|
||||
int8_t timeunit() const { return m_timeunit; }
|
||||
VerilatedSyms* symsp() const { return m_symsp; }
|
||||
const char* name() const VL_MT_SAFE_POSTINIT { return m_namep; }
|
||||
const char* identifier() const VL_MT_SAFE_POSTINIT { return m_identifierp; }
|
||||
int8_t timeunit() const VL_MT_SAFE_POSTINIT { return m_timeunit; }
|
||||
VerilatedSyms* symsp() const VL_MT_SAFE_POSTINIT { return m_symsp; }
|
||||
VerilatedVar* varFind(const char* namep) const VL_MT_SAFE_POSTINIT;
|
||||
VerilatedVarNameMap* varsp() const VL_MT_SAFE_POSTINIT { return m_varsp; }
|
||||
void scopeDump() const;
|
||||
|
@ -152,7 +152,7 @@ protected:
|
||||
|
||||
// METHODS
|
||||
// Internal: access to implementation class
|
||||
VerilatedCovImp* impp() { return reinterpret_cast<VerilatedCovImp*>(this); }
|
||||
VerilatedCovImp* impp() VL_MT_SAFE { return reinterpret_cast<VerilatedCovImp*>(this); }
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
|
@ -259,20 +259,20 @@ extern void _vl_debug_print_w(int lbits, WDataInP const iwp);
|
||||
#if defined(SYSTEMC_VERSION)
|
||||
/// Return current simulation time
|
||||
// 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
|
||||
# if !defined(VL_TIME_CONTEXT) && !defined(VL_NO_LEGACY)
|
||||
# ifdef VL_TIME_STAMP64
|
||||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// VL_TIME_CONTEXT.
|
||||
extern double sc_time_stamp() VL_ATTR_WEAK; // Verilator 4.032 and newer
|
||||
inline uint64_t vl_time_stamp64() {
|
||||
extern double sc_time_stamp() VL_ATTR_WEAK VL_MT_SAFE; // Verilator 4.032 and newer
|
||||
inline uint64_t vl_time_stamp64() VL_MT_SAFE {
|
||||
// clang9.0.1 requires & although we really do want the weak symbol value
|
||||
// cppcheck-suppress duplicateValueTernary
|
||||
return VL_LIKELY(&sc_time_stamp) ? static_cast<uint64_t>(sc_time_stamp()) : 0;
|
||||
|
@ -226,7 +226,7 @@ class VerilatedContextImp final : VerilatedContext {
|
||||
// Number incrementing on each reseed, 0=illegal
|
||||
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;
|
||||
return s_s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user