Add prepareClone and atClone APIs for Verilated models (#3503) (#4444)

This API is used if the user copies the process using `fork`
and similar OS-level mechanisms. The `at_clone` member function
ensures that all model-allocated resources are re-allocated, such
that the copied child process/model can simulate correctly.

A typical allocated resource is the thread pool, which every model
has its own pool.
This commit is contained in:
Yinan Xu
2023-08-30 07:02:55 -04:00
committed by GitHub
parent ca6ab584d0
commit b4b74d72f0
10 changed files with 232 additions and 1 deletions
+1 -1
View File
@@ -468,7 +468,7 @@ void EmitCSyms::emitSymHdr() {
if (v3Global.opt.mtasks()) {
puts("\n// MULTI-THREADING\n");
puts("VlThreadPool* const __Vm_threadPoolp;\n");
puts("VlThreadPool* __Vm_threadPoolp;\n");
puts("bool __Vm_even_cycle__ico = false;\n");
puts("bool __Vm_even_cycle__act = false;\n");
puts("bool __Vm_even_cycle__nba = false;\n");