When running with VERILATOR_ROOT, optionally find binaries under bin.
This commit is contained in:
parent
79ca7f3cb5
commit
d13e6c73db
2
Changes
2
Changes
|
|
@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||||
|
|
||||||
*** Suppress WIDTH warnings when adding/subtracting 1'b1.
|
*** Suppress WIDTH warnings when adding/subtracting 1'b1.
|
||||||
|
|
||||||
|
**** When running with VERILATOR_ROOT, optionally find binaries under bin.
|
||||||
|
|
||||||
* Verilator 3.805 2010/11/02
|
* Verilator 3.805 2010/11/02
|
||||||
|
|
||||||
**** Add warning when directory contains spaces, msg378. [Salman Sheikh]
|
**** Add warning when directory contains spaces, msg378. [Salman Sheikh]
|
||||||
|
|
|
||||||
|
|
@ -113,9 +113,20 @@ sub debug {
|
||||||
sub verilator_bin {
|
sub verilator_bin {
|
||||||
my $bin = "";
|
my $bin = "";
|
||||||
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
|
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
|
||||||
$bin .= $ENV{VERILATOR_ROOT}."/" if defined($ENV{VERILATOR_ROOT});
|
my $basename = ($ENV{VERILATOR_BIN}
|
||||||
$bin .= ($ENV{VERILATOR_BIN}
|
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
|
||||||
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
|
if (defined($ENV{VERILATOR_ROOT})) {
|
||||||
|
my $dir = $ENV{VERILATOR_ROOT}."/";
|
||||||
|
if (-x "$basename") {
|
||||||
|
$bin = $basename;
|
||||||
|
} elsif (-x "$dir/bin/$basename") { # From a "make install" into VERILATOR_ROOT
|
||||||
|
$bin = "$dir/bin/$basename";
|
||||||
|
} else {
|
||||||
|
$bin = "$dir/$basename"; # From pointing to kit directory
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$bin = $basename;
|
||||||
|
}
|
||||||
return $bin;
|
return $bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,6 +137,7 @@ sub verilator_bin {
|
||||||
sub run {
|
sub run {
|
||||||
# Run command, check errors
|
# Run command, check errors
|
||||||
my $command = shift;
|
my $command = shift;
|
||||||
|
$! = 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 = $?;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue