diff --git a/include/verilated.h b/include/verilated.h index a39eab78c..226ec1007 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -131,7 +131,8 @@ class VL_SCOPED_CAPABILITY VerilatedLockGuard { private: VerilatedMutex& m_mutexr; public: - VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) : m_mutexr(mutexr) { + explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) + : m_mutexr(mutexr) { m_mutexr.lock(); } ~VerilatedLockGuard() VL_RELEASE() { @@ -144,8 +145,9 @@ class VL_SCOPED_CAPABILITY VerilatedLockGuard { // Empty classes to avoid #ifdefs everywhere class VerilatedMutex {}; class VerilatedLockGuard { + VL_UNCOPYABLE(VerilatedLockGuard); public: - VerilatedLockGuard(VerilatedMutex&) {} + explicit VerilatedLockGuard(VerilatedMutex&) {} ~VerilatedLockGuard() {} }; #endif // VL_THREADED @@ -164,11 +166,11 @@ public: // METHODS /// Check that the current thread ID is the same as the construction thread ID void check() VL_MT_UNSAFE_ONE { - // Memoize results in local thread, to prevent slow get_id() call - VL_THREAD_LOCAL bool t_okThread = (m_threadid == VL_THREAD_ID()); - if (!VL_LIKELY(t_okThread)) { - fatal_different(); - } + // Memoize results in local thread, to prevent slow get_id() call + VL_THREAD_LOCAL bool t_okThread = (m_threadid == VL_THREAD_ID()); + if (!VL_LIKELY(t_okThread)) { + fatal_different(); + } } static void fatal_different() VL_MT_SAFE; #else // !VL_THREADED || !VL_DEBUG diff --git a/include/verilated_imp.h b/include/verilated_imp.h index c37a06399..013e48a1c 100644 --- a/include/verilated_imp.h +++ b/include/verilated_imp.h @@ -199,7 +199,8 @@ class VerilatedImp { public: // But only for verilated*.cpp // CONSTRUCTORS - VerilatedImp() : m_argVecLoaded(false), m_exportNext(0) { + VerilatedImp() + : m_argVecLoaded(false), m_exportNext(0), m_spawned(false), m_numThreads(0) { m_fdps.resize(3); m_fdps[0] = stdin; m_fdps[1] = stdout; diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index e649f9bc0..5d6458465 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -1738,8 +1738,8 @@ void vpi_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, // time processing void vpi_get_time(vpiHandle object, p_vpi_time time_p) { - // cppcheck-suppress nullPointer VerilatedVpiImp::assertOneCheck(); + // cppcheck-suppress nullPointer if (VL_UNLIKELY(!time_p)) { _VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_get_time with NULL value pointer"); return; diff --git a/src/V3Order.cpp b/src/V3Order.cpp index c2be91d01..1e1b765ed 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -518,15 +518,6 @@ private: return varVxp; } - bool isClkAssign(AstNodeAssign* nodep) { - if (AstVarRef* varrefp = nodep->lhsp()->castVarRef()) { - if (varrefp->varp()->attrClocker() == AstVarAttrClocker::CLOCKER_YES) { - return true; - } - } - return false; - } - void process(); void processCircular(); typedef deque VertexVec; diff --git a/src/V3ParseImp.h b/src/V3ParseImp.h index 8fd75af31..20f9eec85 100644 --- a/src/V3ParseImp.h +++ b/src/V3ParseImp.h @@ -223,7 +223,7 @@ public: m_ahead = false; m_curBisonVal.token = 0; m_prevBisonVal.token = 0; - // m_aheadVal not used as m_ahead = false + // m_aheadVal not used as m_ahead = false, and not all compilers support initing it m_tagNodep = NULL; } ~V3ParseImp();