diff --git a/include/verilated.cpp b/include/verilated.cpp index 122f56943..e9d84974c 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -2465,7 +2465,11 @@ void Verilated::endOfThreadMTaskGuts(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAF VerilatedThreadMsgQueue::flush(evalMsgQp); } -void Verilated::endOfEvalGuts(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE { +void Verilated::endOfEval(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE { + // It doesn't work to set endOfEvalReqd on the threadpool thread + // and then check it on the eval thread since it's thread local. + // It should be ok to call into endOfEvalGuts, it returns immediately + // if there are no transactions. VL_DEBUG_IF(VL_DBG_MSGF("End-of-eval cleanup\n");); evalMsgQp->process(); } diff --git a/include/verilated.h b/include/verilated.h index ac43160ed..badf3d82d 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -583,19 +583,12 @@ public: if (VL_UNLIKELY(t_s.t_endOfEvalReqd)) endOfThreadMTaskGuts(evalMsgQp); } /// Internal: Called at end of eval loop - static void endOfEval(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE { - // It doesn't work to set endOfEvalReqd on the threadpool thread - // and then check it on the eval thread since it's thread local. - // It should be ok to call into endOfEvalGuts, it returns immediately - // if there are no transactions. - endOfEvalGuts(evalMsgQp); - } + static void endOfEval(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE; #endif private: #ifdef VL_THREADED static void endOfThreadMTaskGuts(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE; - static void endOfEvalGuts(VerilatedEvalMsgQueue* evalMsgQp) VL_MT_SAFE; #endif }; diff --git a/include/verilated_imp.h b/include/verilated_imp.h index 9287cf26e..e9f343a16 100644 --- a/include/verilated_imp.h +++ b/include/verilated_imp.h @@ -417,7 +417,7 @@ public: // But only for verilated*.cpp const VerilatedLockGuard lock(s_s.v.m_hierMapMutex); VerilatedHierarchyMap& map = s_s.v.m_hierMap; if (map.find(fromp) == map.end()) return; - VerilatedScopeVector& scopes = map[fromp]; + auto& scopes = map[fromp]; const auto it = find(scopes.begin(), scopes.end(), top); if (it != scopes.end()) scopes.erase(it); } diff --git a/include/verilated_syms.h b/include/verilated_syms.h index 295bcc1b8..191ad5014 100644 --- a/include/verilated_syms.h +++ b/include/verilated_syms.h @@ -43,6 +43,7 @@ struct VerilatedCStrCmp { }; /// Map of sorted scope names to find associated scope class +// This is a class instead of typedef/using to allow forward declaration in verilated.h class VerilatedScopeNameMap final : public std::map { public: @@ -51,16 +52,17 @@ public: }; /// Map of sorted variable names to find associated variable class +// This is a class instead of typedef/using to allow forward declaration in verilated.h class VerilatedVarNameMap final : public std::map { public: VerilatedVarNameMap() = default; ~VerilatedVarNameMap() = default; }; -typedef std::vector VerilatedScopeVector; - +/// Map of parent scope to vector of children scopes +// This is a class instead of typedef/using to allow forward declaration in verilated.h class VerilatedHierarchyMap final - : public std::unordered_map { + : public std::unordered_map> { public: VerilatedHierarchyMap() = default; ~VerilatedHierarchyMap() = default;