Format: perltidy spacing cleanup. No functional change.

This commit is contained in:
Wilson Snyder 2021-09-08 18:45:25 -04:00
parent f67637144f
commit f1b8b1d99b
75 changed files with 236 additions and 239 deletions

View File

@ -46,7 +46,7 @@ foreach my $sw (@ARGV) {
push @Opt_Verilator_Sw, $sw;
}
Getopt::Long::config("no_auto_abbrev","pass_through");
Getopt::Long::config("no_auto_abbrev", "pass_through");
if (! GetOptions(
# Major operating modes
"help" => \&usage,
@ -106,11 +106,10 @@ if ($opt_gdb) {
. " -ex 'bt' -ex 'quit'");
} elsif ($Debug) {
# Debug
run(aslr_off()
. verilator_bin() . " " . join(' ',@quoted_sw));
run(aslr_off() . verilator_bin() . " " . join(' ', @quoted_sw));
} else {
# Normal, non gdb
run(verilator_bin() . " " . join(' ',@quoted_sw));
run(verilator_bin() . " " . join(' ', @quoted_sw));
}
#----------------------------------------------------------------------
@ -163,11 +162,11 @@ sub verilator_bin {
sub gdb_works {
$! = undef; # Cleanup -x
system("gdb /bin/echo"
." --batch-silent --quiet --return-child-result"
." -ex 'run -n'" # `echo -n`
." -ex 'set width 0'"
." -ex 'bt'"
." -ex 'quit'");
. " --batch-silent --quiet --return-child-result"
. " -ex 'run -n'" # `echo -n`
. " -ex 'set width 0'"
. " -ex 'bt'"
. " -ex 'quit'");
my $status = $?;
return $status == 0;
}
@ -201,13 +200,13 @@ sub run {
|| ($status & 127) == 8 # SIGFPA
|| ($status & 127) == 11) { # SIGSEGV
warn "%Error: Verilator internal fault, sorry. "
."Suggest trying --debug --gdbbt\n" if !$Debug;
. "Suggest trying --debug --gdbbt\n" if !$Debug;
} elsif (($status & 127) == 6) { # SIGABRT
warn "%Error: Verilator aborted. "
."Suggest trying --debug --gdbbt\n" if !$Debug;
. "Suggest trying --debug --gdbbt\n" if !$Debug;
} else {
warn "%Error: Verilator threw signal $status. "
."Suggest trying --debug --gdbbt\n" if !$Debug;
. "Suggest trying --debug --gdbbt\n" if !$Debug;
}
}
if (!$opt_quiet_exit && ($status != 256 || $Debug)) { # i.e. not normal exit(1)

View File

@ -380,7 +380,7 @@ sub one_test {
$self->{unsup_cnt}++;
} else {
$test->oprint("FAILED: $test->{errors}\n");
my $j = ($opt_jobs>1?" -j":"");
my $j = ($opt_jobs > 1 ? " -j" : "");
my $makecmd = $ENV{VERILATOR_MAKE} || "$ENV{MAKE}$j &&";
my $upperdir = (Cwd::getcwd() =~ /test_regress/
? 'test_regress/' : '');
@ -590,9 +590,9 @@ sub new {
.($self->{t_dir} !~ m!/test_regress! # Don't include standard dir, only site's
? " +incdir+$self->{t_dir} -y $self->{t_dir}" : "")
. " " . $define_opt . "TEST_OBJ_DIR=$self->{obj_dir}"
.($opt_verbose ? " " . $define_opt . "TEST_VERBOSE=1":"")
.($opt_benchmark ? " " . $define_opt . "TEST_BENCHMARK=$opt_benchmark":"")
.($opt_trace ? " " . $define_opt . "WAVES=1":"")
.($opt_verbose ? " " . $define_opt . "TEST_VERBOSE=1" : "")
.($opt_benchmark ? " " . $define_opt . "TEST_BENCHMARK=$opt_benchmark" : "")
.($opt_trace ? " " . $define_opt . "WAVES=1" : "")
))],
v_flags2 => [], # Overridden in some sim files
v_other_filenames => [], # After the filename so we can spec multiple files
@ -601,14 +601,14 @@ sub new {
. (($^O eq "darwin" )
? " -Wl,-undefined,dynamic_lookup"
: " -export-dynamic")
. ($opt_verbose ? " -DTEST_VERBOSE=1":"")
. ($opt_verbose ? " -DTEST_VERBOSE=1" : "")
. (cfg_with_m32() ? " -m32" : "")
. " -o $self->{obj_dir}/libvpi.so"],
tool_c_flags => [],
# ATSIM
atsim => 0,
atsim_define => 'ATSIM',
atsim_flags => [split(/\s+/,"-c +sv +define+ATSIM"),
atsim_flags => [split(/\s+/, "-c +sv +define+ATSIM"),
"+sv_dir+$self->{obj_dir}/.athdl_compile"],
atsim_flags2 => [], # Overridden in some sim files
atsim_run_flags => [],
@ -616,44 +616,44 @@ sub new {
ghdl => 0,
ghdl_define => 'GHDL',
ghdl_work_dir => "$self->{obj_dir}/ghdl_compile",
ghdl_flags => [($::Debug?"-v":""),
ghdl_flags => [($::Debug ? "-v" : ""),
"--workdir=$self->{obj_dir}/ghdl_compile", ],
ghdl_flags2 => [], # Overridden in some sim files
ghdl_run_flags => [],
# IV
iv => 0,
iv_define => 'IVERILOG',
iv_flags => [split(/\s+/,"+define+IVERILOG -g2012 -o $self->{obj_dir}/simiv")],
iv_flags => [split(/\s+/, "+define+IVERILOG -g2012 -o $self->{obj_dir}/simiv")],
iv_flags2 => [], # Overridden in some sim files
iv_pli => 0, # need to use pli
iv_run_flags => [],
# VCS
vcs => 0,
vcs_define => 'VCS',
vcs_flags => [split(/\s+/,"+vcs+lic+wait +cli -debug_access +define+VCS+1 -q -sverilog -CFLAGS '-DVCS' ")],
vcs_flags => [split(/\s+/, "+vcs+lic+wait +cli -debug_access +define+VCS+1 -q -sverilog -CFLAGS '-DVCS' ")],
vcs_flags2 => [], # Overridden in some sim files
vcs_run_flags => [split(/\s+/,"+vcs+lic_wait")],
vcs_run_flags => [split(/\s+/, "+vcs+lic_wait")],
# NC
nc => 0,
nc_define => 'NC',
nc_flags => [split(/\s+/,("+licqueue +nowarn+LIBNOU +define+NC=1 -q +assert +sv -c "
.($opt_trace ? " +access+r":"")))],
nc_flags => [split(/\s+/, ("+licqueue +nowarn+LIBNOU +define+NC=1 -q +assert +sv -c "
. ($opt_trace ? " +access+r" : "")))],
nc_flags2 => [], # Overridden in some sim files
nc_run_flags => [split(/\s+/,"+licqueue -q +assert +sv -R")],
nc_run_flags => [split(/\s+/, "+licqueue -q +assert +sv -R")],
# ModelSim
ms => 0,
ms_define => 'MS',
ms_flags => [split(/\s+/, ("-sv -work $self->{obj_dir}/work +define+MS=1 -ccflags \"-DMS=1\""))],
ms_flags2 => [], # Overridden in some sim files
ms_pli => 1, # need to use pli
ms_run_flags => [split(/\s+/,"-lib $self->{obj_dir}/work -c -do 'run -all;quit' ")],
ms_run_flags => [split(/\s+/, "-lib $self->{obj_dir}/work -c -do 'run -all;quit' ")],
# XSim
xsim => 0,
xsim_define => 'XSIM',
xsim_flags => [split(/\s+/,("--nolog --sv --define XSIM --work $self->{name}=$self->{obj_dir}/xsim"))],
xsim_flags => [split(/\s+/, ("--nolog --sv --define XSIM --work $self->{name}=$self->{obj_dir}/xsim"))],
xsim_flags2 => [], # Overridden in some sim files
xsim_run_flags => [split(/\s+/,("--nolog --runall --lib $self->{name}=$self->{obj_dir}/xsim"
.($opt_trace ? " --debug all":"")))],
xsim_run_flags => [split(/\s+/, ("--nolog --runall --lib $self->{name}=$self->{obj_dir}/xsim"
.($opt_trace ? " --debug all" : "")))],
xsim_run_flags2 => [], # Overridden in some sim files
# Verilator
vlt => 0,
@ -1040,7 +1040,7 @@ sub compile {
cmd=>[($ENV{VERILATOR_VCS} || "vcs"),
@{$param{vcs_flags}},
@{$param{vcs_flags2}},
($opt_verbose ? " -CFLAGS -DTEST_VERBOSE=1":""),
($opt_verbose ? " -CFLAGS -DTEST_VERBOSE=1" : ""),
@{$param{v_flags}},
@{$param{v_flags2}},
$param{top_filename},
@ -1194,7 +1194,7 @@ sub compile {
"VM_PREFIX=$self->{VM_PREFIX}",
"TEST_OBJ_DIR=$self->{obj_dir}",
"CPPFLAGS_DRIVER=-D" . uc($self->{name}),
($self->{verbose} ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1":""),
($self->{verbose} ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1" : ""),
($param{benchmark} ? "" : "OPT_FAST=-O0"),
($param{benchmark} ? "" : "OPT_GLOBAL=-O0"),
"$self->{VM_PREFIX}", # bypass default rule, as we don't need archive
@ -1207,7 +1207,7 @@ sub compile {
$self->_run(logfile => "$self->{obj_dir}/vlt_cmake_build.log",
cmd => ["cmake",
"--build", $self->{obj_dir},
($self->{verbose}?"--verbose":""),
($self->{verbose} ? "--verbose" : ""),
]);
}
}
@ -1572,6 +1572,7 @@ sub run {
my $self = (ref $_[0] ? shift : $Self);
$self->_run(@_);
}
sub _run {
my $self = (ref $_[0] ? shift : $Self);
my %param = (tee => 1,
@ -1803,7 +1804,7 @@ sub _make_main {
print $fh "extern int sc_main(int argc, char** argv);\n";
print $fh "int sc_main(int argc, char** argv) {\n";
print $fh " sc_signal<bool> fastclk;\n" if $self->{inputs}{fastclk};
print $fh " sc_signal<bool> clk;\n" if $self->{inputs}{clk};
print $fh " sc_signal<bool> clk;\n" if $self->{inputs}{clk};
print $fh " sc_set_time_resolution(1, $Self->{sc_time_resolution});\n";
print $fh " sc_time sim_time($self->{sim_time}, $Self->{sc_time_resolution});\n";
} else {
@ -1846,6 +1847,7 @@ sub _make_main {
$fh->print(" std::unique_ptr<VerilatedVcdSc> tfp{new VerilatedVcdSc};\n") if $self->{trace_format} eq 'vcd-sc';
$fh->print(" topp->trace(tfp.get(), 99);\n");
$fh->print(" tfp->open(\"" . $self->trace_filename . "\");\n");
if ($self->{trace} && !$self->sc) {
$fh->print(" if (tfp) tfp->dump(contextp->time());\n");
}
@ -2331,7 +2333,7 @@ sub _vcd_read {
push @hier, $hier[$#hier]->{$1};
$lasthier = $hier[$#hier];
} elsif ($line =~ /(\$var \S+\s+\d+\s+)\S+\s+(\S+)/) {
$hier[$#hier]->{$1.$2} ||= {};
$hier[$#hier]->{$1 . $2} ||= {};
$lasthier = $hier[$#hier];
} elsif ($line =~ /(\$attrbegin .* \$end)/) {
if ($lasthier) { $lasthier->{$1} ||= 1; }
@ -2347,6 +2349,7 @@ sub _vcd_read {
}
our $_Cxx_Version;
sub cxx_version {
$_Cxx_Version ||= `$ENV{MAKE} -C $ENV{VERILATOR_ROOT}/test_regress -f Makefile print-cxx-version`;
return $_Cxx_Version;
@ -2357,12 +2360,14 @@ sub cfg_with_threaded {
}
our $_Cfg_with_ccache;
sub cfg_with_ccache {
$_Cfg_with_ccache ||= `grep "OBJCACHE \?= ccache" "$ENV{VERILATOR_ROOT}/include/verilated.mk"` ne "";
return $_Cfg_with_ccache;
}
our $_Cfg_with_m32;
sub cfg_with_m32 {
$_Cfg_with_m32 ||= `grep "CXX.*=.*-m32" "$ENV{VERILATOR_ROOT}/include/verilated.mk"` ne "";
return $_Cfg_with_m32;
@ -2506,7 +2511,7 @@ sub file_sed {
sub extract {
my $self = (ref $_[0] ? shift : $Self);
my %param = (#in =>,
my %param = ( #in =>,
#out =>
regexp => qr/.*/,
lineno_adjust => -9999,
@ -2552,6 +2557,7 @@ sub extract {
$fhw->print(" :linenos:\n") if $lang && $#out > 0;
$fhw->print(" :emphasize-lines: ${emph}\n") if $emph;
$fhw->print("\n");
foreach my $line (@out) {
$fhw->print($line);
}
@ -2592,6 +2598,7 @@ sub new {
bless $self, $class;
return $self;
}
sub schedule {
my $self = shift;
my %params = (@_);
@ -2606,12 +2613,12 @@ sub schedule {
$params{run_on_finish}->($self);
return $self;
}
sub max_proc {}
sub sig_child {}
sub kill_tree_all {}
sub wait_all {}
sub ready {}
sub running {}
sub max_proc { }
sub sig_child { }
sub kill_tree_all { }
sub wait_all { }
sub ready { }
sub running { }
sub is_any_left { return 0; }
#######################################################################

View File

@ -14,7 +14,7 @@ $Self->{clean_command} = 'rm -rf ../examples/*/build ../examples/*/obj*';
my @examples = sort(glob("../examples/*"));
for my $example (@examples) {
run(cmd=>["$ENV{MAKE} -C $example"]);
run(cmd => ["$ENV{MAKE} -C $example"]);
}
ok(1);

View File

@ -33,7 +33,7 @@ if ($Self->{nc}) {
}
run(logfile => "$Self->{obj_dir}/${name}__nccover.log",
tee => 0,
cmd => [($ENV{VERILATOR_ICCR}||'iccr'),
cmd => [($ENV{VERILATOR_ICCR} || 'iccr'),
"-test ${name} ${cf}"]);
}

View File

@ -16,7 +16,7 @@ top_filename("t/t_gen_alw.v");
init_benchmarksim();
# As an example, compile and simulate the top file with varying optimization level
my @l_opt = (1,2,3);
my @l_opt = (1, 2, 3);
foreach my $l_opt (@l_opt) {
compile(
@ -29,7 +29,7 @@ foreach my $l_opt (@l_opt) {
);
}
my $fh = IO::File->new("<".benchmarksim_filename()) or error("Benchmark data file not found");
my $fh = IO::File->new("<" . benchmarksim_filename()) or error("Benchmark data file not found");
my $lines = 0;
while (defined(my $line = $fh->getline)) {
if ($line =~ /^#/) { next; }
@ -37,16 +37,17 @@ while (defined(my $line = $fh->getline)) {
error("Expected header but found $line") if $line ne "evals, time[s]\n";
} else {
my @data = grep {$_ != ""} ($line =~ /(\d*\.?\d*)/g);
error("Expected 2 tokens on line ".$lines." but got ".scalar(@data)) if scalar(@data) != 2;
error("Expected 2 tokens on line " . $lines . " but got " . scalar(@data)) if scalar(@data) != 2;
my $cycles = $data[0];
my $time = $data[1];
error("Invalid data on line ".$lines) if $cycles <= 0.0 || $time <= 0.0;
error("Invalid data on line " . $lines) if $cycles <= 0.0 || $time <= 0.0;
}
$lines += 1;
}
my $n_lines_expected = scalar(@l_opt) + 1;
error("Expected ".$n_lines_expected." lines but found ".$lines) if int($lines) != int($n_lines_expected);
error("Expected " . $n_lines_expected . " lines but found " . $lines)
if int($lines) != int($n_lines_expected);
1;
ok(1);

View File

@ -11,13 +11,13 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt => 1);
if (!$Self->cfg_with_ccache) {
skip("Requires configuring with ccache");
skip("Requires configuring with ccache");
}
top_filename("t_a1_first_cc.v");
# This test requires rebuilding the object files to check the ccache log
foreach my $filename (glob ("$Self->{obj_dir}/*.o")) {
foreach my $filename (glob("$Self->{obj_dir}/*.o")) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}

View File

@ -20,7 +20,7 @@ execute(
if ($Self->{vlt_all}) {
file_grep($Self->{stats}, qr/Optimizations, Gate assign merged\s+(\d+)/i, 28);
};
}
ok(1);
1;

View File

@ -12,8 +12,8 @@ scenarios(vlt_all => 1);
# This test makes randomly named .cpp/.h files, which tend to collect, so remove them first
foreach my $filename (glob ("$Self->{obj_dir}/*_PS*.cpp"
." $Self->{obj_dir}/*_PS*.h"
." $Self->{obj_dir}/*.d" )) {
. " $Self->{obj_dir}/*_PS*.h"
. " $Self->{obj_dir}/*.d" )) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}

View File

@ -12,8 +12,8 @@ scenarios(vlt_all => 1);
# This test makes randomly named .cpp/.h files, which tend to collect, so remove them first
foreach my $filename (glob ("$Self->{obj_dir}/*_PS*.cpp"
." $Self->{obj_dir}/*_PS*.h"
." $Self->{obj_dir}/*.d" )) {
. " $Self->{obj_dir}/*_PS*.h"
. " $Self->{obj_dir}/*.d" )) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}

View File

@ -12,8 +12,8 @@ scenarios(vlt_all => 1);
# This test makes randomly named .cpp/.h files, which tend to collect, so remove them first
foreach my $filename (glob ("$Self->{obj_dir}/*_PS*.cpp"
." $Self->{obj_dir}/*_PS*.h"
." $Self->{obj_dir}/*.d" )) {
. " $Self->{obj_dir}/*_PS*.h"
. " $Self->{obj_dir}/*.d")) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}

View File

@ -12,8 +12,8 @@ scenarios(vlt_all => 1);
# This test makes randomly named .cpp/.h files, which tend to collect, so remove them first
foreach my $filename (glob ("$Self->{obj_dir}/*_PS*.cpp"
." $Self->{obj_dir}/*_PS*.h"
." $Self->{obj_dir}/*.d" )) {
. " $Self->{obj_dir}/*_PS*.h"
. " $Self->{obj_dir}/*.d")) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}

View File

@ -12,8 +12,8 @@ scenarios(vlt_all => 1);
# This test makes randomly named .cpp/.h files, which tend to collect, so remove them first
foreach my $filename (glob ("$Self->{obj_dir}/*_PS*.cpp"
." $Self->{obj_dir}/*_PS*.h"
." $Self->{obj_dir}/*.d" )) {
. " $Self->{obj_dir}/*_PS*.h"
. " $Self->{obj_dir}/*.d")) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}

View File

@ -13,7 +13,7 @@ scenarios(simulator => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
vcs_flags2 => ['-assert'],
);

View File

@ -13,7 +13,7 @@ scenarios(vlt => 1);
compile(
v_flags2 => ["--coverage t/t_cover_lib_c.cpp"],
verilator_flags2 => ["--exe -Wall -Wno-DECLFILENAME"],
make_flags => 'CPPFLAGS_ADD=-DTEST_OBJ_DIR="'.$Self->{obj_dir}.'"',
make_flags => 'CPPFLAGS_ADD=-DTEST_OBJ_DIR="' . $Self->{obj_dir} . '"',
make_top_shell => 0,
make_main => 0,
);

View File

@ -15,7 +15,7 @@ top_filename("t/t_cover_lib.v");
compile(
v_flags2 => ["--coverage t/t_cover_lib_c.cpp"],
verilator_flags2 => ["--exe -Wall -Wno-DECLFILENAME"],
make_flags => 'CPPFLAGS_ADD=-DTEST_OBJ_DIR="'.$Self->{obj_dir}.'"',
make_flags => 'CPPFLAGS_ADD=-DTEST_OBJ_DIR="' . $Self->{obj_dir} . '"',
make_top_shell => 0,
make_main => 0,
);

View File

@ -24,7 +24,7 @@ execute(
# Check that the hierarchy doesn't include __PVT__
# Otherwise our coverage reports would look really ugly
if ($Self->{vlt_all}) {
file_grep($Self->{coverage_filename}, qr/(top\.t\.sub.*.cyc_eq_5)/)
file_grep($Self->{coverage_filename}, qr/(top\.t\.sub.*.cyc_eq_5)/);
}
ok(1);

View File

@ -21,6 +21,5 @@ if ($Self->{vlt_all}) {
file_grep($Self->{stats}, qr/Optimizations, Gate sigs deduped\s+(\d+)/i, 4);
}
ok(1);
1;

View File

@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(dist => 1);
run(cmd => ["cd $Self->{obj_dir} && $ENV{VERILATOR_ROOT}/bin/verilator_difftree"
." $Self->{t_dir}/t_difftree.a.tree $Self->{t_dir}/t_difftree.b.tree > diff.log"],
. " $Self->{t_dir}/t_difftree.a.tree $Self->{t_dir}/t_difftree.b.tree > diff.log"],
check_finished => 0);
files_identical("$Self->{obj_dir}/diff.log", $Self->{golden_filename}, 'logfile');

View File

@ -38,9 +38,9 @@ sub check {
print "Check: $author\n" if $Self->{verbose};
if (!$Contributors{$author}) {
error("Certify your contribution by sorted-inserting '$author' into docs/CONTRIBUTORS.\n"
." If '$author' is not your real name, please fix 'name=' in ~/.gitconfig\n"
." Also check your https://github.com account's Settings->Profile->Name\n"
." matches your ~/.gitconfig 'name='.\n");
. " If '$author' is not your real name, please fix 'name=' in ~/.gitconfig\n"
. " Also check your https://github.com account's Settings->Profile->Name\n"
. " matches your ~/.gitconfig 'name='.\n");
}
}
}

View File

@ -58,7 +58,7 @@ sub formats {
}
else {
#print "FF $file $line\n";
$warns{$file.":".$lineno} =
$warns{$file . ":" . $lineno} =
"Non-standard warning/error: $file:$lineno: $line";
}
}

View File

@ -48,7 +48,7 @@ if (!-r "$root/.git") {
push @files, $file;
}
if ($#files >= 0) {
error("Uninstall missed files: ", join(' ',@files));
error("Uninstall missed files: ", join(' ', @files));
}
}

View File

@ -14,8 +14,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1);
compile(
make_top_shell => 0,
make_main => 0,
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["-Wno-BLKANDNBLK -language 1800-2005 --exe $Self->{t_dir}/$Self->{name}.cpp"], );
execute(

View File

@ -13,7 +13,7 @@ scenarios(simulator => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -19,7 +19,7 @@ if (!$ENV{VERILATOR_TEST_RANDOM_FAILURE}) {
# Randomly fail to test driver.pl
my ($ign, $t) = Time::HiRes::gettimeofday();
if ($t % 2) {
error("random failure ".$t);
error("random failure " . $t);
}
else {
ok(1);

View File

@ -29,9 +29,9 @@ mkdir $child_dir;
run(logfile => "${child_dir}/vlt_gcc.log",
cmd => ["cd ${child_dir} && ",
$ENV{MAKE}, "-f".getcwd()."/Makefile_obj",
"CPPFLAGS_DRIVER=-D".uc($self->{name}),
($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1":""),
$ENV{MAKE}, "-f" . getcwd() . "/Makefile_obj",
"CPPFLAGS_DRIVER=-D" . uc($self->{name}),
($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1" : ""),
"VM_PREFIX=$self->{VM_PREFIX}_child",
"V$self->{name}_child__ALL.a", # bypass default rule, make archive
($param{make_flags}||""),

View File

@ -22,17 +22,17 @@ sub gen {
$fh->print(" input clk;\n");
$fh->print(" input i;\n");
$fh->print(" output logic o;\n");
for (my $i=0; $i<($n+1); ++$i) {
for (my $i = 0; $i < ($n + 1); ++$i) {
$fh->print(" logic r$i;\n");
}
$fh->print(" always @ (posedge clk) begin\n");
$fh->print(" r0 <= i;\n");
for (my $i=1; $i<$n; ++$i) {
$fh->print(" r".($i+1)." <= r$i;\n");
for (my $i = 1; $i < $n; ++$i) {
$fh->print(" r" . ($i+1) . " <= r$i;\n");
}
$fh->print(" o <= r$n;\n");
$fh->print(' $write("*-* All Finished *-*\n");',"\n");
$fh->print(' $finish;',"\n");
$fh->print(' $write("*-* All Finished *-*\n");', "\n");
$fh->print(' $finish;', "\n");
$fh->print(" end\n");
$fh->print("endmodule\n");
}

View File

@ -8,7 +8,6 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(simulator => 1);
top_filename("t/t_flag_make_cmake.v");

View File

@ -29,13 +29,13 @@ while (1) {
run(logfile => "$Self->{obj_dir}/vlt_gcc.log",
tee => $self->{verbose},
cmd=>[$ENV{MAKE},
"-C ".$Self->{obj_dir},
"-C " . $Self->{obj_dir},
"-f $Self->{VM_PREFIX}.mk",
"-j 4",
"VM_PREFIX=$Self->{VM_PREFIX}",
"TEST_OBJ_DIR=$Self->{obj_dir}",
"CPPFLAGS_DRIVER=-D".uc($Self->{name}),
($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1":""),
($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1" : ""),
"OPT_FAST=-O2",
"OPT_SLOW=-O0",
"OPT_GLOBAL=-Os",
@ -86,7 +86,7 @@ sub check_cpp {
printf " File %6d %s\n", $size, $filename if $Self->{verbose};
my $fh = IO::File->new("<$filename") or error("$! $filenme");
my @funcs;
while (defined (my $line = $fh->getline)) {
while (defined(my $line = $fh->getline)) {
if ($line =~ /^(void|IData)\s+(.*::.*)/) {
my $func = $2;
$func =~ s/\(.*$//;
@ -103,19 +103,19 @@ sub check_cpp {
}
}
if ($#funcs > 0) {
error("Split had multiple functions in $filename\n\t".join("\n\t",@funcs));
error("Split had multiple functions in $filename\n\t" . join("\n\t", @funcs));
}
}
sub check_gcc_flags {
my $filename = shift;
my $fh = IO::File->new("<$filename") or error("$! $filenme");
while (defined (my $line = $fh->getline)) {
while (defined(my $line = $fh->getline)) {
chomp $line;
print ":log: $line\n" if $Self->{verbose};
if ($line =~ /$Self->{VM_PREFIX}\S*\.cpp/) {
my $filetype = ($line =~ /Slow|Syms/) ? "slow":"fast";
my $opt = ($line !~ /-O2/) ? "slow":"fast";
my $filetype = ($line =~ /Slow|Syms/) ? "slow" : "fast";
my $opt = ($line !~ /-O2/) ? "slow" : "fast";
print "$filetype, $opt, $line\n" if $Self->{verbose};
if ($filetype ne $opt) {
error("${filetype} file compiled as if was ${opt}: $line");

View File

@ -22,7 +22,6 @@ sub check_evals {
$got >= 3 or error("Too few _eval functions found: $got");
}
scenarios(vlt_all => 1);
compile(

View File

@ -31,13 +31,13 @@ while (1) {
run(logfile => "$Self->{obj_dir}/vlt_gcc.log",
tee => $self->{verbose},
cmd=>[$ENV{MAKE},
"-C ".$Self->{obj_dir},
"-C " . $Self->{obj_dir},
"-f $Self->{VM_PREFIX}.mk",
"-j 4",
"VM_PREFIX=$Self->{VM_PREFIX}",
"TEST_OBJ_DIR=$Self->{obj_dir}",
"CPPFLAGS_DRIVER=-D".uc($Self->{name}),
($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1":""),
($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1" : ""),
"OPT_FAST=-O2",
"OPT_SLOW=-O0",
($param{make_flags}||""),
@ -79,7 +79,7 @@ sub check_all_file {
sub check_gcc_flags {
my $filename = shift;
my $fh = IO::File->new("<$filename") or error("$! $filenme");
while (defined (my $line = $fh->getline)) {
while (defined(my $line = $fh->getline)) {
chomp $line;
print ":log: $line\n" if $Self->{verbose};
if ($line =~ /\.cpp/ && $line =~ qr/-O0/) {

View File

@ -13,13 +13,13 @@ scenarios(vlt => 1);
my $m32 = $Self->cfg_with_m32 ? "-m32" : "";
run(cmd => ["cd $Self->{obj_dir}"
." && $ENV{CXX} $m32 -c ../../t/t_flag_ldflags_a.cpp"
." && ar -cr t_flag_ldflags_a.a t_flag_ldflags_a.o"
." && ranlib t_flag_ldflags_a.a "],
. " && $ENV{CXX} $m32 -c ../../t/t_flag_ldflags_a.cpp"
. " && ar -cr t_flag_ldflags_a.a t_flag_ldflags_a.o"
. " && ranlib t_flag_ldflags_a.a "],
check_finished => 0);
run(cmd => ["cd $Self->{obj_dir}"
." && $ENV{CXX} $m32 -fPIC -c ../../t/t_flag_ldflags_so.cpp"
." && $ENV{CXX} $m32 -shared -o t_flag_ldflags_so.so -lc t_flag_ldflags_so.o"],
. " && $ENV{CXX} $m32 -fPIC -c ../../t/t_flag_ldflags_so.cpp"
. " && $ENV{CXX} $m32 -shared -o t_flag_ldflags_so.so -lc t_flag_ldflags_so.o"],
check_finished => 0);
compile(
@ -34,12 +34,12 @@ compile(
# On OS X, LD_LIBRARY_PATH is ignored, so set rpath of the exe to find the .so
if ($^O eq "darwin") {
run(cmd => ["cd $Self->{obj_dir}"
." && install_name_tool -add_rpath \@executable_path/."
." $Self->{VM_PREFIX}"],
. " && install_name_tool -add_rpath \@executable_path/."
. " $Self->{VM_PREFIX}"],
check_finished => 0);
run(cmd => ["cd $Self->{obj_dir}"
." && install_name_tool -change t_flag_ldflags_so.so"
." \@rpath/t_flag_ldflags_so.so $Self->{VM_PREFIX}"],
. " && install_name_tool -change t_flag_ldflags_so.so"
. " \@rpath/t_flag_ldflags_so.so $Self->{VM_PREFIX}"],
check_finished => 0);
}

View File

@ -8,7 +8,6 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(simulator => 1);
compile(
@ -19,7 +18,7 @@ compile(
if (!$Self->have_cmake) {
skip("cmake is not installed");
} else {
my $cmakecache = $Self->{obj_dir}."/CMakeCache.txt";
my $cmakecache = $Self->{obj_dir} . "/CMakeCache.txt";
if (! -e $cmakecache) {
error("$cmakecache does not exist.")
}

View File

@ -8,7 +8,6 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(simulator => 1);
top_filename("t/t_flag_make_cmake.v");

View File

@ -15,9 +15,9 @@ scenarios(vlt => 1);
print "NOTE: use --debugi, as --debug in driver turns off skip-identical\n";
my $outfile = "$Self->{obj_dir}/V".$Self->{name}.".cpp";
my $outfile = "$Self->{obj_dir}/V" . $Self->{name} . ".cpp";
my @oldstats = stat($outfile);
print "Old mtime=",$oldstats[9],"\n";
print "Old mtime=", $oldstats[9], "\n";
$oldstats[9] or error("No output file found: $outfile\n");
sleep(2); # Or else it might take < 1 second to compile and see no diff.
@ -26,7 +26,7 @@ scenarios(vlt => 1);
compile();
my @newstats = stat($outfile);
print "New mtime=",$newstats[9],"\n";
print "New mtime=", $newstats[9], "\n";
($oldstats[9] == $newstats[9])
or error("--skip-identical was ignored -- recompiled\n");

View File

@ -8,7 +8,6 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(simulator => 1);
top_filename("t/t_flag_make_cmake.v");
@ -52,7 +51,7 @@ compile( # Don't call cmake nor gmake from driver.pl. Just build here
);
# The previous run must not verilated, only build is expected.
if ( -e $Self->{obj_dir} . '/Vt_flag_verilate_990_final.tree' ) {
if (-e $Self->{obj_dir} . '/Vt_flag_verilate_990_final.tree') {
$Self->error('Unexpectedly verilated.');
}
@ -60,6 +59,5 @@ execute(
check_finished => 1,
);
ok(1);
1;

View File

@ -21,14 +21,14 @@ execute(
# We expect all loops should be unrolled by verilator,
# none of the loop variables should exist in the output:
for my $file (glob_all("$Self->{obj_dir}/$Self->{VM_PREFIX}*.cpp")) {
file_grep_not($file, qr/index_/);
file_grep_not($file, qr/index_/);
}
# Further, we expect that all logic within the loop should
# have been evaluated inside the compiler. So there should be
# no references to 'sum' in the .cpp.
for my $file (glob_all("$Self->{obj_dir}/$Self->{VM_PREFIX}*.cpp")) {
file_grep_not($file, qr/sum/);
file_grep_not($file, qr/sum/);
}
ok(1);

View File

@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(dist => 1);
run(cmd => ["cd $Self->{obj_dir} && $ENV{VERILATOR_ROOT}/bin/verilator_gantt"
." $Self->{t_dir}/t_gantt_io.dat > gantt.log"],
. " $Self->{t_dir}/t_gantt_io.dat > gantt.log"],
check_finished => 0);
files_identical("$Self->{obj_dir}/gantt.log", $Self->{golden_filename});

View File

@ -14,7 +14,7 @@ use vars qw($Self);
scenarios(simulator => 1);
my $width = 64*($ENV{VERILATOR_TEST_WIDTH}||4);
my $width = 64 * ($ENV{VERILATOR_TEST_WIDTH} || 4);
my $vars = 64;
$Self->{cycles} = ($Self->{benchmark} ? 1_000_000 : 100);
@ -34,15 +34,15 @@ sub gen {
my %tree;
my $fanin = 8;
my $stages = int(log($vars)/log($fanin)+0.99999)+1;
my $stages = int(log($vars) / log($fanin) + 0.99999) + 1;
my $result = 0;
for (my $n=0; $n<$vars; $n++) {
$result += ($n||1);
for (my $n = 0; $n < $vars; $n++) {
$result += ($n || 1);
$tree{0}{$n}{$n} = 1;
my $nl = $n;
for (my $stage=1; $stage<$stages; $stage++) {
for (my $stage=1; $stage < $stages; $stage++) {
my $lastn = $nl;
$nl = int($nl/$fanin);
$nl = int($nl / $fanin);
$tree{$stage}{$nl}{$lastn} = 1;
}
}
@ -50,9 +50,9 @@ sub gen {
$fh->print("\n");
my $workingset = 0;
foreach my $stage (sort {$a<=>$b} keys %tree) {
foreach my $n (sort {$a<=>$b} keys %{$tree{$stage}}) {
$fh->print( " reg [".($width-1).":0] v${stage}_${n};\n");
foreach my $stage (sort { $a <=> $b} keys %tree) {
foreach my $n (sort { $a <=> $b} keys %{$tree{$stage}}) {
$fh->print( " reg [" . ($width - 1) . ":0] v${stage}_${n};\n");
$workingset += int($width/8 + 7);
}
}
@ -62,7 +62,7 @@ sub gen {
$fh->print(" cyc <= cyc + 1;\n");
$fh->print("`ifdef TEST_VERBOSE\n");
$fh->print(" \$write(\"[%0t] rst=%0x v0_0=%0x v1_0=%0x result=%0x\\n\""
.", \$time, reset, v0_0, v1_0, v".($stages-1)."_0);\n");
.", \$time, reset, v0_0, v1_0, v" . ($stages - 1) . "_0);\n");
$fh->print("`endif\n");
$fh->print(" if (cyc==0) begin\n");
$fh->print(" reset <= 1;\n");
@ -74,19 +74,19 @@ sub gen {
$fh->print(" `define SIM_CYCLES 99\n");
$fh->print("`endif\n");
$fh->print(" else if (cyc==`SIM_CYCLES) begin\n");
$fh->print(" if (v".($stages-1)."_0 != ${width}'d${result}) \$stop;\n");
$fh->print(" if (v" . ($stages - 1) . "_0 != ${width}'d${result}) \$stop;\n");
$fh->print(" \$write(\"VARS=${vars} WIDTH=${width}"
." WORKINGSET=".(int($workingset/1024))."KB\\n\");\n");
$fh->print(' $write("*-* All Finished *-*\n");',"\n");
$fh->print(' $finish;',"\n");
." WORKINGSET=" . (int($workingset / 1024)) . "KB\\n\");\n");
$fh->print(' $write("*-* All Finished *-*\n");', "\n");
$fh->print(' $finish;', "\n");
$fh->print(" end\n");
$fh->print(" end\n");
$fh->print("\n");
for (my $n=0; $n<$vars; $n++) {
$fh->print(" always @ (posedge clk)"
." v0_${n} <= reset ? ${width}'d".(${n}||1)." : v0_"
.((int($n/$fanin)*$fanin) + (($n+1) % $fanin)).";\n");
. " v0_${n} <= reset ? ${width}'d" . (${n} || 1) . " : v0_"
. ((int($n / $fanin) * $fanin) + (($n + 1) % $fanin)) . ";\n");
}
foreach my $stage (sort {$a<=>$b} keys %tree) {
@ -94,10 +94,10 @@ sub gen {
$fh->print("\n");
foreach my $n (sort {$a<=>$b} keys %{$tree{$stage}}) {
$fh->print(" always @ (posedge clk)"
." v${stage}_${n} <=");
. " v${stage}_${n} <=");
my $op = "";
foreach my $ni (sort {$a<=>$b} keys %{$tree{$stage}{$n}}) {
$fh->print($op." v".(${stage}-1)."_${ni}");
$fh->print($op . " v" . (${stage} - 1) . "_${ni}");
$op = " +";
}
$fh->print(";\n");

View File

@ -29,7 +29,7 @@ if (!$Self->have_cmake) {
run(logfile => "$Self->{obj_dir}/run.log",
cmd => ['cd "' . $Self->{obj_dir} . '" && ./t_hier_block_cmake', '.']
);
my $target_dir = $Self->{obj_dir} .'/CMakeFiles/t_hier_block_cmake.dir/Vt_hier_block.dir/';
my $target_dir = $Self->{obj_dir} . '/CMakeFiles/t_hier_block_cmake.dir/Vt_hier_block.dir/';
file_grep($target_dir . 'Vsub0/sub0.sv', /^module\s+(\S+)\s+/, "sub0");
file_grep($target_dir . 'Vsub1/sub1.sv', /^module\s+(\S+)\s+/, "sub1");
file_grep($target_dir . 'Vsub2/sub2.sv', /^module\s+(\S+)\s+/, "sub2");

View File

@ -15,6 +15,5 @@ lint(
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -15,6 +15,5 @@ lint(
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1);
compile(
verilator_flags2=>["-Wno-IMPLICIT"],
verilator_flags2 => ["-Wno-IMPLICIT"],
);
execute(

View File

@ -31,9 +31,9 @@ sub checkRelativeRefs {
}
if ($found_relative != $expect_relative) {
error("$file " .
($found_relative ? "has" : "does not have") .
" relative variable references.");
error("$file "
. ($found_relative ? "has" : "does not have")
. " relative variable references.");
}
}
}

View File

@ -18,7 +18,7 @@ execute(
);
for my $file (glob_all("$Self->{obj_dir}/$Self->{VM_PREFIX}___024root*.cpp")) {
file_grep_not($file, qr/rstn_r/);
file_grep_not($file, qr/rstn_r/);
}
ok(1);

View File

@ -18,7 +18,7 @@ execute(
);
for my $file (glob_all("$Self->{obj_dir}/$Self->{VM_PREFIX}___024root*.cpp")) {
file_grep_not($file, qr/rstn_r/);
file_grep_not($file, qr/rstn_r/);
}
ok(1);

View File

@ -13,7 +13,7 @@ scenarios(vlt_all => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -13,7 +13,7 @@ scenarios(vlt_all => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -13,7 +13,7 @@ scenarios(vlt_all => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -13,7 +13,7 @@ scenarios(vlt_all => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -13,7 +13,7 @@ scenarios(vlt_all => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -13,7 +13,7 @@ scenarios(simulator => 1);
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe","$Self->{t_dir}/$Self->{name}.cpp"],
verilator_flags2 => ["--exe", "$Self->{t_dir}/$Self->{name}.cpp"],
);
execute(

View File

@ -49,7 +49,7 @@ for cmd in sys.stdin:
pos = newpos + 1
# sys.stderr.write("Line count: %d\n" % lineno)
wholefile = ''.join(prefixes) + wholefile
wholefile = '' . join(prefixes) + wholefile
print("Content-Length: " + str(len(wholefile)) + "\n" + wholefile)
sys.stdout.flush()

View File

@ -14,8 +14,8 @@ scenarios(vlt_all => 1);
# This test makes randomly named .cpp/.h files, which tend to collect, so remove them first
foreach my $filename (glob ("$Self->{obj_dir}/*_PS*.cpp"
." $Self->{obj_dir}/*_PS*.h"
." $Self->{obj_dir}/*.d" )) {
. " $Self->{obj_dir}/*_PS*.h"
. " $Self->{obj_dir}/*.d")) {
print "rm $filename\n" if $Self->{verbose};
unlink $filename;
}
@ -40,9 +40,9 @@ file_grep_not("$Self->{obj_dir}/$Self->{VM_PREFIX}__idmap.xml", qr/to="PS/);
if ($Self->{vlt_all}) {
# Check for secret in any outputs
my $any;
foreach my $filename (glob $Self->{obj_dir}."/*.[ch]*") {
foreach my $filename (glob $Self->{obj_dir} . "/*.[ch]*") {
if ($filename =~ /secret/i) {
$Self->error("Secret found in a filename: ".$filename);
$Self->error("Secret found in a filename: " . $filename);
}
file_grep_not($filename, qr/secret/i);
$any = 1;

View File

@ -18,8 +18,8 @@ sub gen {
my $filename = shift;
my $fh = IO::File->new(">$filename");
for (my $copy=0; $copy<32; ++$copy) {
for (my $i=0; $i<=255; ++$i) {
for (my $copy = 0; $copy < 32; ++$copy) {
for (my $i = 0; $i <= 255; ++$i) {
$fh->print(chr($i));
}
}

View File

@ -20,7 +20,7 @@ compile(
if ($Self->cxx_version =~ /clang/) {
skip("Known clang bug");
#Here: if (VL_UNLIKELY(VL_NEQ_W(12, __Vtemp1, vlSymsp->TOP__t.__PVT__str)))
} else{
} else {
execute(
check_finished => 1,
);

View File

@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vltmt => 1);
if ($Self->cfg_with_m32) {
skip("Does not work with -m32 (resource unavailable)");
skip("Does not work with -m32 (resource unavailable)");
}
compile(

View File

@ -39,7 +39,7 @@ sub gen {
# mostly unpredictable
$fh->printf(" if (cnt == %d) begin\n", $i - 1);
$fh->printf(" #1; ++cnt; `MSG((\"[%0t] cnt?=${i}\", \$time));"
." if (cnt != %d) \$stop;\n", $i);
. " if (cnt != %d) \$stop;\n", $i);
$fh->printf(" end\n");
}

View File

@ -21,7 +21,7 @@ execute(
);
system("cat $Self->{obj_dir}/simpart_0000.vcd "
." $Self->{obj_dir}/simpart_0000_cat*.vcd > $Self->{obj_dir}/simall.vcd");
. " $Self->{obj_dir}/simpart_0000_cat*.vcd > $Self->{obj_dir}/simall.vcd");
vcd_identical("$Self->{obj_dir}/simall.vcd",
$Self->{golden_filename});

View File

@ -18,17 +18,17 @@ execute(
check_finished => 1,
);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
vcd_identical ("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
ok(1);
1;

View File

@ -23,15 +23,15 @@ execute(
check_finished => 1,
);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});

View File

@ -23,15 +23,15 @@ execute(
check_finished => 1,
);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});

View File

@ -20,17 +20,17 @@ execute(
check_finished => 1,
);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep_not ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep_not ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep_not("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep_not("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
vcd_identical ("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
ok(1);
1;

View File

@ -21,17 +21,17 @@ execute(
check_finished => 1,
);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_strp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_arrp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arrp_strp /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\[/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\[/);
vcd_identical ("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
ok(1);
1;

View File

@ -21,10 +21,10 @@ execute(
);
if ($Self->{vlt_all}) {
file_grep ("$Self->{obj_dir}/V$Self->{name}__Trace__0__Slow.cpp", qr/c_trace_on\"/x);
file_grep_not ("$Self->{obj_dir}/V$Self->{name}__Trace__0__Slow.cpp", qr/_trace_off\"/x);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x);
file_grep_not ("$Self->{obj_dir}/simx.vcd", qr/inside_sub/x);
file_grep("$Self->{obj_dir}/V$Self->{name}__Trace__0__Slow.cpp", qr/c_trace_on\"/x);
file_grep_not("$Self->{obj_dir}/V$Self->{name}__Trace__0__Slow.cpp", qr/_trace_off\"/x);
file_grep("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x);
file_grep_not("$Self->{obj_dir}/simx.vcd", qr/inside_sub/x);
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
}

View File

@ -26,7 +26,7 @@ else {
if ($Self->{vlt_all}) {
# Note more checks in _cc.pl
file_grep ("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x);
file_grep("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x);
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
}

View File

@ -23,12 +23,12 @@ sub gen {
$fh->print("// Generated by t_unicode.pl\n");
$fh->print("module t;\n");
$fh->print(" // Chinese "
.chr(0xe8).chr(0xaf).chr(0x84).chr(0xe8).chr(0xae).chr(0xba) # Comment
."\n");
. chr(0xe8) . chr(0xaf) . chr(0x84) . chr(0xe8) . chr(0xae) . chr(0xba) # Comment
. "\n");
$fh->print(" initial begin\n");
$fh->print(" \$write(\"Hello "
.chr(0xe4).chr(0xb8).chr(0x96).chr(0xe7).chr(0x95).chr(0x8c) # World
."\\n\");\n");
. chr(0xe4) . chr(0xb8) . chr(0x96) . chr(0xe7) . chr(0x95) . chr(0x8c) # World
. "\\n\");\n");
$fh->print(" \$write(\"*-* All Finished *-*\\n\");\n");
$fh->print(" \$finish;\n");
$fh->print(" end\n");

View File

@ -20,13 +20,12 @@ execute(
);
if ($Self->{vlt_all}) {
file_grep ("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x);
file_grep("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x);
my $sig = quotemeta("bra[ket]slash/dash-colon:9");
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ $sig/);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ other\.cyc /);
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ module mod\.with_dot /);
vcd_identical ("$Self->{obj_dir}/simx.vcd",
$Self->{golden_filename});
file_grep("$Self->{obj_dir}/simx.vcd", qr/ $sig/);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ other\.cyc /);
file_grep("$Self->{obj_dir}/simx.vcd", qr/ module mod\.with_dot /);
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
}
ok(1);

View File

@ -55,7 +55,7 @@ foreach my $file (sort keys %hit) {
&& $file !~ /_fst/
&& $file !~ /_heavy/
&& ($file !~ /_thread/ || $Self->cfg_with_threaded)) {
error("Include file not covered by t_verilated_all test: ",$file);
error("Include file not covered by t_verilated_all test: ", $file);
}
}

View File

@ -21,8 +21,8 @@ compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe --vpi"
." --public-flat-rw --prefix Vt_vpi_get --no-l2name"
." $Self->{t_dir}/t_vpi_get.cpp"],
. " --public-flat-rw --prefix Vt_vpi_get --no-l2name"
. " $Self->{t_dir}/t_vpi_get.cpp"],
make_pli => 1,
iv_flags2 => ["-g2005-sv -D USE_VPI_NOT_DPI"],
v_flags2 => ["+define+USE_VPI_NOT_DPI"],

View File

@ -19,7 +19,7 @@ lint(
);
if (-e $waiver_filename) {
error("Waiver file generated, not expected..");
error("Waiver file generated, not expected");
}
ok(1);

View File

@ -13,8 +13,8 @@ scenarios(vlt_all => 1);
top_filename("t/t_x_assign.v");
compile(
make_top_shell => 0,
make_main => 0,
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--x-assign 0 --exe $Self->{t_dir}/t_x_assign.cpp"],
);

View File

@ -13,8 +13,8 @@ scenarios(vlt_all => 1);
top_filename("t/t_x_assign.v");
compile(
make_top_shell => 0,
make_main => 0,
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--x-assign 1 --exe $Self->{t_dir}/t_x_assign.cpp"],
);

View File

@ -13,8 +13,8 @@ scenarios(vlt_all => 1);
top_filename("t/t_x_assign.v");
compile(
make_top_shell => 0,
make_main => 0,
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--x-assign unique --exe $Self->{t_dir}/t_x_assign.cpp"],
);

View File

@ -13,8 +13,8 @@ scenarios(vlt_all => 1);
top_filename("t/t_x_assign.v");
compile(
make_top_shell => 0,
make_main => 0,
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--x-assign unique --exe $Self->{t_dir}/t_x_assign.cpp"],
);

View File

@ -29,9 +29,9 @@ file_grep("$out_filename", qr/<constpool /x);
file_grep("$out_filename", qr/<inititem /x);
file_grep("$out_filename", qr/<if /x);
file_grep("$out_filename", qr/<while /x);
file_grep("$out_filename", qr/<begin>/x); # for <if> and <while>
file_grep("$out_filename", qr/ signed=/x); # for <basicdtype>
file_grep("$out_filename", qr/ func=/x); # for <ccall>
file_grep("$out_filename", qr/<begin>/x); # for <if> and <while>
file_grep("$out_filename", qr/ signed=/x); # for <basicdtype>
file_grep("$out_filename", qr/ func=/x); # for <ccall>
ok(1);
1;