Format: perltidy spacing cleanup. No functional change.
This commit is contained in:
parent
2a79e46c46
commit
c678e7ec3e
|
|
@ -34,11 +34,11 @@ my $opt_quiet_exit;
|
||||||
|
|
||||||
# No arguments can't do anything useful. Give help
|
# No arguments can't do anything useful. Give help
|
||||||
if ($#ARGV < 0) {
|
if ($#ARGV < 0) {
|
||||||
pod2usage(-exitstatus=>2, -verbose=>0);
|
pod2usage(-exitstatus => 2, -verbose => 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Insert debugging options up front
|
# Insert debugging options up front
|
||||||
push @ARGV, (split ' ',$ENV{VERILATOR_TEST_FLAGS}||"");
|
push @ARGV, (split ' ', $ENV{VERILATOR_TEST_FLAGS} || "");
|
||||||
|
|
||||||
# We sneak a look at the flags so we can do some pre-environment checks
|
# We sneak a look at the flags so we can do some pre-environment checks
|
||||||
# All flags will hit verilator...
|
# All flags will hit verilator...
|
||||||
|
|
@ -60,7 +60,7 @@ if (! GetOptions(
|
||||||
# Additional parameters
|
# Additional parameters
|
||||||
"<>" => sub {}, # Ignored
|
"<>" => sub {}, # Ignored
|
||||||
)) {
|
)) {
|
||||||
pod2usage(-exitstatus=>2, -verbose=>0);
|
pod2usage(-exitstatus => 2, -verbose => 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opt_gdbbt && !gdb_works()) {
|
if ($opt_gdbbt && !gdb_works()) {
|
||||||
|
|
@ -73,12 +73,12 @@ if ($opt_gdbbt && !gdb_works()) {
|
||||||
# Starting with that, escape all special chars for the shell;
|
# Starting with that, escape all special chars for the shell;
|
||||||
# The shell will undo the escapes and the verilator binary should
|
# The shell will undo the escapes and the verilator binary should
|
||||||
# then see exactly the contents of @Opt_Verilator_Sw.
|
# then see exactly the contents of @Opt_Verilator_Sw.
|
||||||
my @quoted_sw = map {sh_escape($_)} @Opt_Verilator_Sw;
|
my @quoted_sw = map { sh_escape($_) } @Opt_Verilator_Sw;
|
||||||
if ($opt_gdb) {
|
if ($opt_gdb) {
|
||||||
# Generic GDB interactive
|
# Generic GDB interactive
|
||||||
run (aslr_off()
|
run (aslr_off()
|
||||||
.($ENV{VERILATOR_GDB}||"gdb")
|
. ($ENV{VERILATOR_GDB} || "gdb")
|
||||||
." ".verilator_bin()
|
. " " . verilator_bin()
|
||||||
# Note, uncomment to set breakpoints before running:
|
# Note, uncomment to set breakpoints before running:
|
||||||
# ." -ex 'break main'"
|
# ." -ex 'break main'"
|
||||||
|
|
||||||
|
|
@ -87,42 +87,42 @@ if ($opt_gdb) {
|
||||||
# escapes as you would expect in a double-quoted string.
|
# escapes as you would expect in a double-quoted string.
|
||||||
# That's not true for a single-quoted string, where \'
|
# That's not true for a single-quoted string, where \'
|
||||||
# actually terminates the string -- not what we want!
|
# actually terminates the string -- not what we want!
|
||||||
." -ex \"run ".join(' ', @quoted_sw)."\""
|
. " -ex \"run " . join(' ', @quoted_sw) . "\""
|
||||||
." -ex 'set width 0'"
|
. " -ex 'set width 0'"
|
||||||
." -ex 'bt'");
|
. " -ex 'bt'");
|
||||||
} elsif ($opt_rr) {
|
} elsif ($opt_rr) {
|
||||||
# Record with rr
|
# Record with rr
|
||||||
run (aslr_off()
|
run (aslr_off()
|
||||||
."rr record ".verilator_bin()
|
. "rr record " . verilator_bin()
|
||||||
." ".join(' ', @quoted_sw));
|
. " " . join(' ', @quoted_sw));
|
||||||
} elsif ($opt_gdbbt && $Debug) {
|
} elsif ($opt_gdbbt && $Debug) {
|
||||||
# Run under GDB to get gdbbt
|
# Run under GDB to get gdbbt
|
||||||
run (aslr_off()
|
run (aslr_off()
|
||||||
."gdb"
|
. "gdb"
|
||||||
." ".verilator_bin()
|
. " " . verilator_bin()
|
||||||
." --batch --quiet --return-child-result"
|
. " --batch --quiet --return-child-result"
|
||||||
." -ex \"run ".join(' ', @quoted_sw)."\""
|
. " -ex \"run " . join(' ', @quoted_sw)."\""
|
||||||
." -ex 'set width 0'"
|
. " -ex 'set width 0'"
|
||||||
." -ex 'bt' -ex 'quit'");
|
. " -ex 'bt' -ex 'quit'");
|
||||||
} elsif ($Debug) {
|
} elsif ($Debug) {
|
||||||
# Debug
|
# Debug
|
||||||
run(aslr_off()
|
run(aslr_off()
|
||||||
.verilator_bin()." ".join(' ',@quoted_sw));
|
. verilator_bin() . " " . join(' ',@quoted_sw));
|
||||||
} else {
|
} else {
|
||||||
# Normal, non gdb
|
# Normal, non gdb
|
||||||
run(verilator_bin()." ".join(' ',@quoted_sw));
|
run(verilator_bin() . " " . join(' ',@quoted_sw));
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
sub usage {
|
sub usage {
|
||||||
pod2usage(-verbose=>2, -exitval=>0, -output=>\*STDOUT);
|
pod2usage(-verbose => 2, -exitval => 0, -output => \*STDOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub debug {
|
sub debug {
|
||||||
shift;
|
shift;
|
||||||
my $level = shift;
|
my $level = shift;
|
||||||
$Debug = $level||3;
|
$Debug = $level || 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
@ -169,7 +169,7 @@ sub gdb_works {
|
||||||
." -ex 'bt'"
|
." -ex 'bt'"
|
||||||
." -ex 'quit'");
|
." -ex 'quit'");
|
||||||
my $status = $?;
|
my $status = $?;
|
||||||
return $status==0;
|
return $status == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub aslr_off {
|
sub aslr_off {
|
||||||
|
|
@ -185,7 +185,7 @@ sub run {
|
||||||
# Run command, check errors
|
# Run command, check errors
|
||||||
my $command = shift;
|
my $command = shift;
|
||||||
$! = undef; # Cleanup -x
|
$! = undef; # Cleanup -x
|
||||||
print "\t$command\n" if $Debug>=3;
|
print "\t$command\n" if $Debug >= 3;
|
||||||
system($command);
|
system($command);
|
||||||
my $status = $?;
|
my $status = $?;
|
||||||
if ($status) {
|
if ($status) {
|
||||||
|
|
@ -193,7 +193,7 @@ sub run {
|
||||||
warn "%Error: verilator: Misinstalled, or VERILATOR_ROOT might need to be in environment\n";
|
warn "%Error: verilator: Misinstalled, or VERILATOR_ROOT might need to be in environment\n";
|
||||||
}
|
}
|
||||||
if ($Debug) { # For easy rerunning
|
if ($Debug) { # For easy rerunning
|
||||||
warn "%Error: export VERILATOR_ROOT=".($ENV{VERILATOR_ROOT}||"")."\n";
|
warn "%Error: export VERILATOR_ROOT=" . ($ENV{VERILATOR_ROOT} || "") . "\n";
|
||||||
warn "%Error: $command\n";
|
warn "%Error: $command\n";
|
||||||
}
|
}
|
||||||
if ($status & 127) {
|
if ($status & 127) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ $Debug = 0;
|
||||||
|
|
||||||
# No arguments can't do anything useful. Give help
|
# No arguments can't do anything useful. Give help
|
||||||
if ($#ARGV < 0) {
|
if ($#ARGV < 0) {
|
||||||
pod2usage(-exitstatus=>2, -verbose=>0);
|
pod2usage(-exitstatus => 2, -verbose => 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
# We sneak a look at the flags so we can do some pre-environment checks
|
# We sneak a look at the flags so we can do some pre-environment checks
|
||||||
|
|
@ -40,7 +40,7 @@ foreach my $sw (@ARGV) {
|
||||||
push @Opt_Verilator_Sw, $sw;
|
push @Opt_Verilator_Sw, $sw;
|
||||||
}
|
}
|
||||||
|
|
||||||
Getopt::Long::config("no_auto_abbrev","pass_through");
|
Getopt::Long::config("no_auto_abbrev", "pass_through");
|
||||||
if (! GetOptions (
|
if (! GetOptions (
|
||||||
# Major operating modes
|
# Major operating modes
|
||||||
"help" => \&usage,
|
"help" => \&usage,
|
||||||
|
|
@ -49,23 +49,23 @@ if (! GetOptions (
|
||||||
# Additional parameters
|
# Additional parameters
|
||||||
"<>" => sub {}, # Ignored
|
"<>" => sub {}, # Ignored
|
||||||
)) {
|
)) {
|
||||||
pod2usage(-exitstatus=>2, -verbose=>0);
|
pod2usage(-exitstatus => 2, -verbose => 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Normal, non gdb
|
# Normal, non gdb
|
||||||
run(verilator_coverage_bin()
|
run(verilator_coverage_bin()
|
||||||
." ".join(' ',@Opt_Verilator_Sw));
|
. " " . join(' ', @Opt_Verilator_Sw));
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
sub usage {
|
sub usage {
|
||||||
pod2usage(-verbose=>2, -exitval=>0, -output=>\*STDOUT);
|
pod2usage(-verbose => 2, -exitval => 0, -output => \*STDOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub debug {
|
sub debug {
|
||||||
shift;
|
shift;
|
||||||
my $level = shift;
|
my $level = shift;
|
||||||
$Debug = $level||3;
|
$Debug = $level || 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
@ -107,7 +107,7 @@ sub run {
|
||||||
# Run command, check errors
|
# Run command, check errors
|
||||||
my $command = shift;
|
my $command = shift;
|
||||||
$! = undef; # Cleanup -x
|
$! = undef; # Cleanup -x
|
||||||
print "\t$command\n" if $Debug>=3;
|
print "\t$command\n" if $Debug >= 3;
|
||||||
system($command);
|
system($command);
|
||||||
my $status = $?;
|
my $status = $?;
|
||||||
if ($status) {
|
if ($status) {
|
||||||
|
|
@ -115,11 +115,11 @@ sub run {
|
||||||
warn "%Error: verilator_coverage: Misinstalled, or VERILATOR_ROOT might need to be in environment\n";
|
warn "%Error: verilator_coverage: Misinstalled, or VERILATOR_ROOT might need to be in environment\n";
|
||||||
}
|
}
|
||||||
if ($Debug) { # For easy rerunning
|
if ($Debug) { # For easy rerunning
|
||||||
warn "%Error: export VERILATOR_ROOT=".($ENV{VERILATOR_ROOT}||"")."\n";
|
warn "%Error: export VERILATOR_ROOT=" . ($ENV{VERILATOR_ROOT} || "") . "\n";
|
||||||
warn "%Error: $command\n";
|
warn "%Error: $command\n";
|
||||||
}
|
}
|
||||||
if ($status & 127) {
|
if ($status & 127) {
|
||||||
if (($status & 127) == 8 || ($status & 127) == 11) { # SIGFPA or SIGSEGV
|
if (($status & 127) == 8 || ($status & 127) == 11) { # SIGFPA or SIGSEGV
|
||||||
warn "%Error: Verilator_coverage internal fault, sorry.\n" if !$Debug;
|
warn "%Error: Verilator_coverage internal fault, sorry.\n" if !$Debug;
|
||||||
} elsif (($status & 127) == 6) { # SIGABRT
|
} elsif (($status & 127) == 6) { # SIGABRT
|
||||||
warn "%Error: Verilator_coverage aborted.\n" if !$Debug;
|
warn "%Error: Verilator_coverage aborted.\n" if !$Debug;
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@
|
||||||
|
|
||||||
require 5.005;
|
require 5.005;
|
||||||
use warnings;
|
use warnings;
|
||||||
print "// DESCR"."IPTION: Generated by verilator_includer via makefile\n";
|
print "// DESCR" . "IPTION: Generated by verilator_includer via makefile\n";
|
||||||
foreach my $param (@ARGV) {
|
foreach my $param (@ARGV) {
|
||||||
if ($param =~ /^-D([^=]+)=(.*)/) {
|
if ($param =~ /^-D([^=]+)=(.*)/) {
|
||||||
print "#define $1 $2\n"
|
print "#define $1 $2\n";
|
||||||
} else {
|
} else {
|
||||||
print "#include \"$param\"\n"
|
print "#include \"$param\"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -24,7 +24,7 @@ file_grep_any(\@files, qr/dly__t__DOT__v1/i);
|
||||||
file_grep_any(\@files, qr/dly__t__DOT__v2/i);
|
file_grep_any(\@files, qr/dly__t__DOT__v2/i);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
check_finished=>1,
|
check_finished => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(1);
|
ok(1);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ if ($Self->{vlt_all}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
check_finished=>1,
|
check_finished => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(1);
|
ok(1);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ foreach my $file (
|
||||||
}
|
}
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
check_finished=>1,
|
check_finished => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(1);
|
ok(1);
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["-no-order-clock-delay"],
|
verilator_flags2 => ["-no-order-clock-delay"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["-Wno-UNOPTTHREADS", "--stats"],
|
verilator_flags2 => ["-Wno-UNOPTTHREADS", "--stats"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["-Wno-UNOPTTHREADS", "--stats", "--coverage", "--trace"],
|
verilator_flags2 => ["-Wno-UNOPTTHREADS", "--stats", "--coverage", "--trace"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["-Wno-UNOPTTHREADS", "--stats"],
|
verilator_flags2 => ["-Wno-UNOPTTHREADS", "--stats"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
v_flags2 => ["t/$Self->{name}.cpp"],
|
v_flags2 => ["t/$Self->{name}.cpp"],
|
||||||
verilator_flags2=>["-Wno-UNOPTTHREADS", "--stats"],
|
verilator_flags2 => ["-Wno-UNOPTTHREADS", "--stats"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["--stats"],
|
verilator_flags2 => ["--stats"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ if (!-r "$root/.git") {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files like stdint.h instead of cstdint: ",join(' ',sort keys %names));
|
error("Files like stdint.h instead of cstdint: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ sub formats {
|
||||||
$lnmatch or error("Check line number regexp is correct, no matches");
|
$lnmatch or error("Check line number regexp is correct, no matches");
|
||||||
if (keys %warns) {
|
if (keys %warns) {
|
||||||
# First warning lists everything as that's shown in the driver summary
|
# First warning lists everything as that's shown in the driver summary
|
||||||
error($summary." ",join(' ',sort keys %warns));
|
error($summary . " ", join(' ', sort keys %warns));
|
||||||
foreach my $file (sort keys %warns) {
|
foreach my $file (sort keys %warns) {
|
||||||
error($warns{$file});
|
error($warns{$file});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ if (!-r "$root/.git") {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $bfiles (@batch) {
|
foreach my $bfiles (@batch) {
|
||||||
my $cmd = "cd $root && grep -n -P '(FIX"."ME|BO"."ZO)' $bfiles | sort";
|
my $cmd = "cd $root && grep -n -P '(FIX" . "ME|BO" . "ZO)' $bfiles | sort";
|
||||||
my $grep = `$cmd`;
|
my $grep = `$cmd`;
|
||||||
if ($grep ne "") {
|
if ($grep ne "") {
|
||||||
print "$grep\n";
|
print "$grep\n";
|
||||||
|
|
@ -43,7 +43,7 @@ if (!-r "$root/.git") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scalar(%names) >= 1) {
|
if (scalar(%names) >= 1) {
|
||||||
error("Files with FIX"."MEs: ",join(' ',sort keys %names));
|
error("Files with FIX" . "MEs: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ sub inctree {
|
||||||
my $grep = `$cmd`;
|
my $grep = `$cmd`;
|
||||||
foreach my $line (split /\n/, $grep) {
|
foreach my $line (split /\n/, $grep) {
|
||||||
if ($line =~ /^(\S+):(\d+):#\s*include\s*(\S+)/) {
|
if ($line =~ /^(\S+):(\d+):#\s*include\s*(\S+)/) {
|
||||||
my $filename = $1; my $line = $2+0; my $inc = $3;
|
my $filename = $1; my $line = $2 + 0; my $inc = $3;
|
||||||
(my $base = $filename) =~ s!.*/(.*?)!$1!;
|
(my $base = $filename) =~ s!.*/(.*?)!$1!;
|
||||||
$inc =~ s/[<>"]//g;
|
$inc =~ s/[<>"]//g;
|
||||||
$Files{$base}{filename} = $filename;
|
$Files{$base}{filename} = $filename;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ if (!-r "$root/.git") {
|
||||||
skip("Not in a git repository");
|
skip("Not in a git repository");
|
||||||
} else {
|
} else {
|
||||||
my $cwd = getcwd();
|
my $cwd = getcwd();
|
||||||
my $destdir = "$cwd/".$Self->{obj_dir};
|
my $destdir = "$cwd/" . $Self->{obj_dir};
|
||||||
# Start clean
|
# Start clean
|
||||||
run(cmd => ["rm -rf $destdir && mkdir -p $destdir"],
|
run(cmd => ["rm -rf $destdir && mkdir -p $destdir"],
|
||||||
check_finished => 0);
|
check_finished => 0);
|
||||||
|
|
@ -48,7 +48,7 @@ if (!-r "$root/.git") {
|
||||||
push @files, $file;
|
push @files, $file;
|
||||||
}
|
}
|
||||||
if ($#files >= 0) {
|
if ($#files >= 0) {
|
||||||
error("Uninstall missed files: ",join(' ',@files));
|
error("Uninstall missed files: ", join(' ',@files));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ sub uint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files with uint32*_t instead of vluint32s: ",join(' ',sort keys %names));
|
error("Files with uint32*_t instead of vluint32s: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ sub printfll {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files with %ll instead of VL_PRI64: ",join(' ',sort keys %names));
|
error("Files with %ll instead of VL_PRI64: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ sub cstr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files with potential c_str() lifetime issue: ",join(' ',sort keys %names));
|
error("Files with potential c_str() lifetime issue: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@ sub vsnprintf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files with vsnprintf, use VL_VSNPRINTF: ",join(' ',sort keys %names));
|
error("Files with vsnprintf, use VL_VSNPRINTF: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +127,7 @@ sub final {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files with classes without final/VL_NOT_FINAL: ",join(' ',sort keys %names));
|
error("Files with classes without final/VL_NOT_FINAL: ", join(' ', sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,10 @@ if (!-r "$root/.git") {
|
||||||
$btab = 0;
|
$btab = 0;
|
||||||
print " File $file\n" if $Self->{verbose};
|
print " File $file\n" if $Self->{verbose};
|
||||||
}
|
}
|
||||||
elsif ($line =~ m!^@@ -?[0-9]+,?[0-9]* \+?([0-9]+)!) {
|
elsif ($line =~ m!^@@ -?[0-9]+,?[0-9]* \+?([0-9]+)!) {
|
||||||
$lineno = $1 - 1;
|
$lineno = $1 - 1;
|
||||||
}
|
}
|
||||||
elsif ($line =~ m!^ !) {
|
elsif ($line =~ m!^ !) {
|
||||||
++$lineno;
|
++$lineno;
|
||||||
if ($line =~ m!^[- ].*\t!) {
|
if ($line =~ m!^[- ].*\t!) {
|
||||||
print " Had tabs\n" if $Self->{verbose} && !$atab;
|
print " Had tabs\n" if $Self->{verbose} && !$atab;
|
||||||
|
|
@ -72,7 +72,7 @@ if (!-r "$root/.git") {
|
||||||
if ($len >= 100
|
if ($len >= 100
|
||||||
&& $file !~ $Tabs_Exempt_Re
|
&& $file !~ $Tabs_Exempt_Re
|
||||||
&& $file !~ $Wide_Exempt_Re) {
|
&& $file !~ $Wide_Exempt_Re) {
|
||||||
print" Wide $line\n" if $Self->{verbose};
|
print " Wide $line\n" if $Self->{verbose};
|
||||||
$summary = "File modification adds a new >100 column line:" if !$summary;
|
$summary = "File modification adds a new >100 column line:" if !$summary;
|
||||||
$warns{$file} = "File modification adds a new >100 column line: $file:$lineno";
|
$warns{$file} = "File modification adds a new >100 column line: $file:$lineno";
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,7 @@ if (!-r "$root/.git") {
|
||||||
}
|
}
|
||||||
if (keys %warns) {
|
if (keys %warns) {
|
||||||
# First warning lists everything as that's shown in the driver summary
|
# First warning lists everything as that's shown in the driver summary
|
||||||
error($summary." ",join(' ',sort keys %warns));
|
error($summary . " ", join(' ', sort keys %warns));
|
||||||
foreach my $file (sort keys %warns) {
|
foreach my $file (sort keys %warns) {
|
||||||
error($warns{$file});
|
error($warns{$file});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,16 +27,16 @@ if (!-r "$root/.git") {
|
||||||
next if $file =~ /nodist/;
|
next if $file =~ /nodist/;
|
||||||
if (_has_tabs("$root/$file")) {
|
if (_has_tabs("$root/$file")) {
|
||||||
$warns{$file} = "File not in git or .gitignore (with tabs): $file";
|
$warns{$file} = "File not in git or .gitignore (with tabs): $file";
|
||||||
$summary = "Files untracked in git or .gitignore (with tabs):"
|
$summary = "Files untracked in git or .gitignore (with tabs):";
|
||||||
} else {
|
} else {
|
||||||
$warns{$file} = "File not in git or .gitignore: $file";
|
$warns{$file} = "File not in git or .gitignore: $file";
|
||||||
$summary ||= "Files untracked in git or .gitignore:"
|
$summary ||= "Files untracked in git or .gitignore:";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %warns) {
|
if (keys %warns) {
|
||||||
# First warning lists everything as that's shown in the driver summary
|
# First warning lists everything as that's shown in the driver summary
|
||||||
error($summary." ",join(' ',sort keys %warns));
|
error($summary . " ", join(' ', sort keys %warns));
|
||||||
foreach my $file (sort keys %warns) {
|
foreach my $file (sort keys %warns) {
|
||||||
error($warns{$file});
|
error($warns{$file});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,10 @@ foreach my $file (sort keys %files) {
|
||||||
if (keys %warns) {
|
if (keys %warns) {
|
||||||
# First warning lists everything as that's shown in the driver summary
|
# First warning lists everything as that's shown in the driver summary
|
||||||
if ($ENV{HARNESS_UPDATE_GOLDEN}) {
|
if ($ENV{HARNESS_UPDATE_GOLDEN}) {
|
||||||
error("Updated files with whitespace errors: ",join(' ',sort keys %warns));
|
error("Updated files with whitespace errors: ", join(' ', sort keys %warns));
|
||||||
error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
||||||
} else {
|
} else {
|
||||||
error("Files have whitespace errors: ",join(' ',sort keys %warns));
|
error("Files have whitespace errors: ", join(' ', sort keys %warns));
|
||||||
error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
||||||
}
|
}
|
||||||
foreach my $file (sort keys %warns) {
|
foreach my $file (sort keys %warns) {
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@ compile(
|
||||||
my @files = glob($tmp_dir . "/*");
|
my @files = glob($tmp_dir . "/*");
|
||||||
|
|
||||||
error("Did not produce DPI header") if scalar(@files) == 0;
|
error("Did not produce DPI header") if scalar(@files) == 0;
|
||||||
error("Too many files created:".join(', ', @files)) if scalar(@files) > 1;
|
error("Too many files created:" . join(', ', @files)) if scalar(@files) > 1;
|
||||||
|
|
||||||
my $tmp_header = $files[0];
|
my $tmp_header = $files[0];
|
||||||
print("============".$tmp_header."\n");
|
print("============" . $tmp_header . "\n");
|
||||||
error("Unexpected file $tmp_header") unless $tmp_header =~ /__Dpi\.h$/;
|
error("Unexpected file $tmp_header") unless $tmp_header =~ /__Dpi\.h$/;
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ sub gen {
|
||||||
$fh->print("\n");
|
$fh->print("\n");
|
||||||
my $prev = "i";
|
my $prev = "i";
|
||||||
my $n = 9000;
|
my $n = 9000;
|
||||||
for (my $i=1; $i<$n; ++$i) {
|
for (my $i = 1; $i < $n; ++$i) {
|
||||||
$fh->printf(" wire [63:0] ass%04x = (sel == 16'h%04x) ? 64'h0 : $prev;\n", $i, $i);
|
$fh->printf(" wire [63:0] ass%04x = (sel == 16'h%04x) ? 64'h0 : $prev;\n", $i, $i);
|
||||||
$prev = sprintf("ass%04x", $i);
|
$prev = sprintf("ass%04x", $i);
|
||||||
}
|
}
|
||||||
|
|
@ -34,8 +34,8 @@ sub gen {
|
||||||
|
|
||||||
$fh->print("\n");
|
$fh->print("\n");
|
||||||
$fh->print(" always @ (posedge clk) begin\n");
|
$fh->print(" always @ (posedge clk) begin\n");
|
||||||
$fh->print(' $write("*-* All Finished *-*\n");',"\n");
|
$fh->print(' $write("*-* All Finished *-*\n");', "\n");
|
||||||
$fh->print(' $finish;',"\n");
|
$fh->print(' $finish;', "\n");
|
||||||
$fh->print(" end\n");
|
$fh->print(" end\n");
|
||||||
$fh->print("endmodule\n");
|
$fh->print("endmodule\n");
|
||||||
}
|
}
|
||||||
|
|
@ -45,8 +45,8 @@ top_filename("$Self->{obj_dir}/t_gate_chained.v");
|
||||||
gen($Self->{top_filename});
|
gen($Self->{top_filename});
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["--stats --x-assign fast --x-initial fast",
|
verilator_flags2 => ["--stats --x-assign fast --x-initial fast",
|
||||||
"-Wno-UNOPTTHREADS"],
|
"-Wno-UNOPTTHREADS"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ $Self->{sim_time} = $Self->{cycles} * 10 + 1000;
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
v_flags2 => ["+define+SIM_CYCLES=$Self->{cycles}",],
|
v_flags2 => ["+define+SIM_CYCLES=$Self->{cycles}",],
|
||||||
verilator_flags2=>["-Wno-UNOPTTHREADS", "--stats"],
|
verilator_flags2 => ["-Wno-UNOPTTHREADS", "--stats"],
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($Self->{vlt}) {
|
if ($Self->{vlt}) {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ sub preproc_check {
|
||||||
my $check = shift @Line_Checks;
|
my $check = shift @Line_Checks;
|
||||||
if (!$check) { error("$filename2:$.: Extra Line_Preproc_Check\n"); }
|
if (!$check) { error("$filename2:$.: Extra Line_Preproc_Check\n"); }
|
||||||
if ($linecmt != $check) { error("$filename2:$.: __LINE__ inserted $linecmt, exp=$check\n"); }
|
if ($linecmt != $check) { error("$filename2:$.: __LINE__ inserted $linecmt, exp=$check\n"); }
|
||||||
if ($lineno != $check) { error("$filename2:$.: __LINE__ on `line $lineno, exp=$check\n"); }
|
if ($lineno != $check) { error("$filename2:$.: __LINE__ on `line $lineno, exp=$check\n"); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fh->close;
|
$fh->close;
|
||||||
|
|
|
||||||
|
|
@ -34,18 +34,18 @@ sub gen {
|
||||||
$fh->print(" initial begin\n");
|
$fh->print(" initial begin\n");
|
||||||
|
|
||||||
my $n = 100;
|
my $n = 100;
|
||||||
for (my $i=1; $i<$n; ++$i) {
|
for (my $i = 1; $i < $n; ++$i) {
|
||||||
# If statement around the timing is important to make the code scheduling
|
# If statement around the timing is important to make the code scheduling
|
||||||
# mostly unpredictable
|
# mostly unpredictable
|
||||||
$fh->printf(" if (cnt == %d) begin\n", $i-1);
|
$fh->printf(" if (cnt == %d) begin\n", $i - 1);
|
||||||
$fh->printf(" #1; ++cnt; `MSG((\"[%0t] cnt?=${i}\", \$time));"
|
$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");
|
$fh->printf(" end\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$fh->print("\n");
|
$fh->print("\n");
|
||||||
$fh->print(' $write("*-* All Finished *-*\n");',"\n");
|
$fh->print(' $write("*-* All Finished *-*\n");', "\n");
|
||||||
$fh->print(' $finish;',"\n");
|
$fh->print(' $finish;', "\n");
|
||||||
$fh->print(" end\n");
|
$fh->print(" end\n");
|
||||||
$fh->print("endmodule\n");
|
$fh->print("endmodule\n");
|
||||||
}
|
}
|
||||||
|
|
@ -55,8 +55,8 @@ top_filename("$Self->{obj_dir}/t_timing_long.v");
|
||||||
gen($Self->{top_filename});
|
gen($Self->{top_filename});
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
#verilator_flags2=>["--exe --build --main --timing"], # Unsupported
|
# verilator_flags2 => ["--exe --build --main --timing"], # Unsupported
|
||||||
verilator_flags2=>["--exe --build --main -Wno-STMTDLY"],
|
verilator_flags2 => ["--exe --build --main -Wno-STMTDLY"],
|
||||||
verilator_make_cmake => 0,
|
verilator_make_cmake => 0,
|
||||||
verilator_make_gmake => 0,
|
verilator_make_gmake => 0,
|
||||||
make_main => 0,
|
make_main => 0,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ execute(
|
||||||
check_finished => 1,
|
check_finished => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
file_grep ("$Self->{obj_dir}/simx.vcd", qr/ PARAM /);
|
file_grep("$Self->{obj_dir}/simx.vcd", qr/ PARAM /);
|
||||||
|
|
||||||
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
|
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["-Wno-UNOPTFLAT"],
|
verilator_flags2 => ["-Wno-UNOPTFLAT"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute(
|
execute(
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2=>["-Wno-SYMRSVDWORD"],
|
verilator_flags2 => ["-Wno-SYMRSVDWORD"],
|
||||||
);
|
);
|
||||||
|
|
||||||
execute();
|
execute();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue