verilator/test_regress/t/t_wrapper_clone.pl
Yinan Xu b4b74d72f0
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.
2023-08-30 07:02:55 -04:00

26 lines
661 B
Perl
Executable File

#!/usr/bin/env perl
if (!$::Driver) { use strict; use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test module for prepareClone/atClone APIs
#
# This file ONLY is placed into the Public Domain, for any use,
# without warranty, 2023 by Yinan Xu.
# SPDX-License-Identifier: CC0-1.0
scenarios(vlt_all => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe $Self->{t_dir}/$Self->{name}.cpp",
"-cc"],
threads => $Self->{vltmt} ? 2 : 1,
);
execute(
check_finished => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;