mirror of
https://github.com/verilator/verilator.git
synced 2025-01-04 05:37:48 +00:00
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.
|
||||
|
||||
**** When running with VERILATOR_ROOT, optionally find binaries under bin.
|
||||
|
||||
* Verilator 3.805 2010/11/02
|
||||
|
||||
**** Add warning when directory contains spaces, msg378. [Salman Sheikh]
|
||||
|
@ -113,9 +113,20 @@ sub debug {
|
||||
sub verilator_bin {
|
||||
my $bin = "";
|
||||
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
|
||||
$bin .= $ENV{VERILATOR_ROOT}."/" if defined($ENV{VERILATOR_ROOT});
|
||||
$bin .= ($ENV{VERILATOR_BIN}
|
||||
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
|
||||
my $basename = ($ENV{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;
|
||||
}
|
||||
|
||||
@ -126,6 +137,7 @@ sub verilator_bin {
|
||||
sub run {
|
||||
# Run command, check errors
|
||||
my $command = shift;
|
||||
$! = undef; # Cleanup -x
|
||||
print "\t$command\n" if $Debug>=3;
|
||||
system($command);
|
||||
my $status = $?;
|
||||
|
Loading…
Reference in New Issue
Block a user