Internals: Rename threadsInModel()

This commit is contained in:
Wilson Snyder 2024-03-30 11:13:14 -04:00
parent 39ee522f92
commit e390d6779d
2 changed files with 5 additions and 5 deletions

View File

@ -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 '"

View File

@ -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<VerilatedVirtualBase> 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<const VerilatedContextImp*>(this);
}
// Internal: Model and thread setup
void addModel(VerilatedModel*);
VerilatedVirtualBase* threadPoolp();
void prepareClone();
VerilatedVirtualBase* threadPoolpOnClone();