diff --git a/include/verilated_dpi.cpp b/include/verilated_dpi.cpp index 7f68e1bad..a9c1b3aed 100644 --- a/include/verilated_dpi.cpp +++ b/include/verilated_dpi.cpp @@ -181,7 +181,7 @@ void svPutPartselLogic(svLogicVecVal* dp, const svLogicVecVal s, int lbit, int w //====================================================================== // Open array internals -static const VerilatedDpiOpenVar* _vl_openhandle_varp(const svOpenArrayHandle h) { +static const VerilatedDpiOpenVar* _vl_openhandle_varp(const svOpenArrayHandle h) VL_MT_SAFE { if (VL_UNLIKELY(!h)) { VL_FATAL_MT(__FILE__, __LINE__, "", "%%Error: DPI svOpenArrayHandle function called with nullptr handle"); @@ -223,7 +223,7 @@ int svSizeOfArray(const svOpenArrayHandle h) { // Open array access internals static void* _vl_sv_adjusted_datap(const VerilatedDpiOpenVar* varp, int nargs, int indx1, - int indx2, int indx3) { + int indx2, int indx3) VL_MT_SAFE { void* datap = varp->datap(); if (VL_UNLIKELY(nargs != varp->udims())) { VL_SVDPI_WARN_("%%Warning: DPI svOpenArrayHandle function called on" diff --git a/include/verilated_sym_props.h b/include/verilated_sym_props.h index c62d59faa..03228467f 100644 --- a/include/verilated_sym_props.h +++ b/include/verilated_sym_props.h @@ -53,14 +53,14 @@ public: : m_left{left} , m_right{right} {} ~VerilatedRange() = default; - int left() const { return m_left; } - int right() const { return m_right; } - int low() const { return (m_left < m_right) ? m_left : m_right; } - int high() const { return (m_left > m_right) ? m_left : m_right; } - int elements() const { + int left() const VL_PURE { return m_left; } + int right() const VL_PURE { return m_right; } + int low() const VL_PURE { return (m_left < m_right) ? m_left : m_right; } + int high() const VL_PURE { return (m_left > m_right) ? m_left : m_right; } + int elements() const VL_PURE { return (VL_LIKELY(m_left >= m_right) ? (m_left - m_right + 1) : (m_right - m_left + 1)); } - int increment() const { return (m_left >= m_right) ? 1 : -1; } + int increment() const VL_PURE { return (m_left >= m_right) ? 1 : -1; } }; //===========================================================================