Driver: Fix preproc running in parallel random fails

This commit is contained in:
Wilson Snyder 2009-06-12 09:50:27 -04:00
parent 46fb5a852f
commit 82844a5591
3 changed files with 9 additions and 9 deletions

View File

@ -9,13 +9,13 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
top_filename("t/t_math_synmul.v"); top_filename("t/t_math_synmul.v");
my $cycles = $Self->{benchmark}||0; $Self->{cycles} = $Self->{benchmark}||0;
$cycles = 100 if $cycles<100; $Self->{cycles} = 100 if $Self->{cycles}<100;
$Self->{sim_time} = $cycles*100; $Self->{sim_time} = $Self->{cycles}*100;
compile ( compile (
v_flags2 => ["+define+SIM_CYCLES=${cycles}"], v_flags2 => ["+define+SIM_CYCLES=$Self->{cycles}"],
); );
execute ( execute (

View File

@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Lesser General Public License Version 3 or the Perl Artistic License # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
$golden_out ||= "t/$Self->{name}.out"; $Self->{golden_out} ||= "t/$Self->{name}.out";
my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp"; my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp";
if (!$Self->{v3}) { if (!$Self->{v3}) {
@ -19,7 +19,7 @@ if (!$Self->{v3}) {
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );
ok(preproc_check($Self->{top_filename}, $stdout_filename) ok(preproc_check($Self->{top_filename}, $stdout_filename)
&& files_identical($stdout_filename, $golden_out)); && files_identical($stdout_filename, $Self->{golden_out}));
} }
sub preproc_check { sub preproc_check {

View File

@ -12,7 +12,7 @@ top_filename("$Self->{obj_dir}/$Self->{name}.v");
# Rather then having to maintain a new .v and .out, simply add returns # Rather then having to maintain a new .v and .out, simply add returns
# to all lines of the existing t_preproc test. # to all lines of the existing t_preproc test.
$golden_out ||= "$Self->{obj_dir}/$Self->{name}.out"; $Self->{golden_out} = "$Self->{obj_dir}/$Self->{name}.out";
{ {
my $wholefile = file_contents("$Self->{t_dir}/t_preproc.v"); my $wholefile = file_contents("$Self->{t_dir}/t_preproc.v");
@ -22,9 +22,9 @@ $golden_out ||= "$Self->{obj_dir}/$Self->{name}.out";
{ {
my $wholefile = file_contents("$Self->{t_dir}/t_preproc.out"); my $wholefile = file_contents("$Self->{t_dir}/t_preproc.out");
$wholefile =~ s!t/t_preproc.v!$Self->{obj_dir}/t_preproc_dos.v!og; # Fix `line's $wholefile =~ s!t/t_preproc.v!$Self->{obj_dir}/t_preproc_dos.v!og; # Fix `line's
write_wholefile($golden_out, $wholefile); write_wholefile($Self->{golden_out}, $wholefile);
} }
require 't/t_preproc.pl'; do 't/t_preproc.pl';
1; 1;