Tests: To allow reuse of cpp files, allow to set the PLI filename.

Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
Stefan Wallentowitz 2019-09-19 18:46:45 -04:00 committed by Wilson Snyder
parent 8686ed9b00
commit 96725b3431

View File

@ -601,6 +601,7 @@ sub new {
} else {
$self->{top_shell_filename} = "$self->{obj_dir}/$self->{VM_PREFIX}__top.v";
}
$self->{pli_filename} ||= $self->{name}.".cpp";
return $self;
}
@ -993,7 +994,8 @@ sub compile {
if ($param{make_pli}) {
$self->oprint("Compile vpi\n") if $self->{verbose};
my @cmd = ('c++', @{$param{pli_flags}}, "-DIS_VPI", "$self->{t_dir}/$self->{name}.cpp");
my @cmd = ('c++', @{$param{pli_flags}}, "-DIS_VPI",
"$self->{t_dir}/$self->{pli_filename}");
$self->_run(logfile=>"$self->{obj_dir}/pli_compile.log",
fails=>$param{fails},
@ -1259,6 +1261,12 @@ sub get_default_vltmt_threads {
return $Vltmt_threads;
}
sub pli_filename {
my $self = (ref $_[0]? shift : $Self);
$self->{pli_filename} = shift if defined $_[0];
return $self->{pli_filename};
}
sub too_few_cores {
my $threads = ::calc_threads($Vltmt_threads);
return $threads < $Vltmt_threads;