mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Move thread pool and execution profiler into the context. (#3477)
Fixes #3454
This commit is contained in:
+12
-12
@@ -445,17 +445,17 @@ void EmitCSyms::emitSymHdr() {
|
||||
}
|
||||
puts("bool __Vm_didInit = false;\n");
|
||||
|
||||
if (v3Global.opt.profExec()) {
|
||||
puts("\n// EXECUTION PROFILING\n");
|
||||
puts("VlExecutionProfiler __Vm_executionProfiler;\n");
|
||||
}
|
||||
|
||||
if (v3Global.opt.mtasks()) {
|
||||
puts("\n// MULTI-THREADING\n");
|
||||
puts("VlThreadPool* const __Vm_threadPoolp;\n");
|
||||
puts("bool __Vm_even_cycle = false;\n");
|
||||
}
|
||||
|
||||
if (v3Global.opt.profExec()) {
|
||||
puts("\n// EXECUTION PROFILING\n");
|
||||
puts("VlExecutionProfiler* const __Vm_executionProfilerp;\n");
|
||||
}
|
||||
|
||||
puts("\n// MODULE INSTANCE STATE\n");
|
||||
for (const auto& i : m_scopes) {
|
||||
const AstScope* const scopep = i.first;
|
||||
@@ -673,7 +673,6 @@ void EmitCSyms::emitSymImp() {
|
||||
puts("_vm_pgoProfiler.write(\"" + topClassName()
|
||||
+ "\", _vm_contextp__->profVltFilename());\n");
|
||||
}
|
||||
if (v3Global.opt.mtasks()) puts("delete __Vm_threadPoolp;\n");
|
||||
puts("}\n\n");
|
||||
|
||||
// Constructor
|
||||
@@ -705,12 +704,13 @@ void EmitCSyms::emitSymImp() {
|
||||
// Note we create N-1 threads in the thread pool. The thread
|
||||
// that calls eval() becomes the final Nth thread for the
|
||||
// duration of the eval call.
|
||||
puts(" , __Vm_threadPoolp{new VlThreadPool{_vm_contextp__, "
|
||||
+ cvtToStr(v3Global.opt.threads() - 1) + ", "
|
||||
+ (v3Global.opt.profExec()
|
||||
? "&__Vm_executionProfiler, &VlExecutionProfiler::startWorkerSetup"
|
||||
: "nullptr, nullptr")
|
||||
+ "}}\n");
|
||||
puts(" , __Vm_threadPoolp{static_cast<VlThreadPool*>(contextp->threadPoolp())}\n");
|
||||
}
|
||||
|
||||
if (v3Global.opt.profExec()) {
|
||||
puts(" , "
|
||||
"__Vm_executionProfilerp{static_cast<VlExecutionProfiler*>(contextp->"
|
||||
"enableExecutionProfiler(&VlExecutionProfiler::construct))}\n");
|
||||
}
|
||||
|
||||
puts(" // Setup module instances\n");
|
||||
|
||||
Reference in New Issue
Block a user