From e390d6779d2e8b3cd55e9c58c63a809a32ec051b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 30 Mar 2024 11:13:14 -0400 Subject: [PATCH] Internals: Rename threadsInModel() --- include/verilated.cpp | 4 ++-- include/verilated.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 3f6598cb7..3b6393edd 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -2584,7 +2584,7 @@ void VerilatedContext::printStatsSummary() VL_MT_UNSAFE { simtime.c_str(), walltime, simtimePerf.c_str()); const double modelMB = VlOs::memUsageBytes() / 1024.0 / 1024.0; VL_PRINTF("- Verilator: cpu %0.3f s on %d threads; alloced %0.0f MB\n", cputime, - modelThreads(), modelMB); + threadsInModels(), modelMB); } void VerilatedContext::quiet(bool flag) VL_MT_SAFE { const VerilatedLockGuard lock{m_mutex}; @@ -2666,7 +2666,7 @@ void VerilatedContext::addModel(VerilatedModel* modelp) { } threadPoolp(); // Ensure thread pool is created, so m_threads cannot change any more - m_modelThreads += modelp->threads(); + m_threadsInModels += modelp->threads(); if (VL_UNLIKELY(modelp->threads() > m_threads)) { std::ostringstream msg; msg << "VerilatedContext has " << m_threads << " threads but model '" diff --git a/include/verilated.h b/include/verilated.h index a31a90bb6..54ceedacf 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -409,7 +409,7 @@ protected: // Number of threads to use for simulation (size of m_threadPool + 1 for main thread) unsigned m_threads = std::thread::hardware_concurrency(); // Number of threads in added models - unsigned m_modelThreads = 0; + unsigned m_threadsInModels = 0; // The thread pool shared by all models added to this context std::unique_ptr m_threadPool; // The execution profiler shared by all models added to this context @@ -561,7 +561,7 @@ public: /// Get number of threads used for simulation (including the main thread) unsigned threads() const { return m_threads; } /// Get number of threads in added models (for statistical use only) - unsigned modelThreads() const { return m_modelThreads; } + unsigned threadsInModels() const { return m_threadsInModels; } /// Set number of threads used for simulation (including the main thread) /// Can only be called before the thread pool is created (before first model is added). void threads(unsigned n); @@ -589,8 +589,8 @@ public: return reinterpret_cast(this); } + // Internal: Model and thread setup void addModel(VerilatedModel*); - VerilatedVirtualBase* threadPoolp(); void prepareClone(); VerilatedVirtualBase* threadPoolpOnClone();