Add --quiet-exit, bug1436.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
parent
16997d153f
commit
d0fbdfac07
2
Changes
2
Changes
|
|
@ -4,6 +4,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||||
|
|
||||||
* Verilator 4.015 devel
|
* Verilator 4.015 devel
|
||||||
|
|
||||||
|
*** Add --quiet-exit, bug1436. [Todd Strader]
|
||||||
|
|
||||||
**** Support VerilatedFstC set_time_unit, bug1433. [Pieter Kapsenberg]
|
**** Support VerilatedFstC set_time_unit, bug1433. [Pieter Kapsenberg]
|
||||||
|
|
||||||
**** Fix sign-compare warning in verilated.cpp, bug1437. [Sergey Kvachonok]
|
**** Fix sign-compare warning in verilated.cpp, bug1437. [Sergey Kvachonok]
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ autoflush STDERR 1;
|
||||||
$Debug = 0;
|
$Debug = 0;
|
||||||
my $opt_gdb;
|
my $opt_gdb;
|
||||||
my $opt_gdbbt;
|
my $opt_gdbbt;
|
||||||
|
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) {
|
||||||
|
|
@ -66,6 +67,7 @@ if (! GetOptions(
|
||||||
# Switches
|
# Switches
|
||||||
"gdb!" => \$opt_gdb,
|
"gdb!" => \$opt_gdb,
|
||||||
"gdbbt!" => \$opt_gdbbt,
|
"gdbbt!" => \$opt_gdbbt,
|
||||||
|
"quiet-exit!" => \$opt_quiet_exit,
|
||||||
# Additional parameters
|
# Additional parameters
|
||||||
"<>" => sub {}, # Ignored
|
"<>" => sub {}, # Ignored
|
||||||
)) {
|
)) {
|
||||||
|
|
@ -195,9 +197,16 @@ sub run {
|
||||||
warn "%Error: Verilator threw signal $status. Consider trying --debug --gdbbt\n" if !$Debug;
|
warn "%Error: Verilator threw signal $status. Consider trying --debug --gdbbt\n" if !$Debug;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($opt_quiet_exit) {
|
||||||
|
# Same return code as die
|
||||||
|
exit $! if $!; # errno
|
||||||
|
exit $? >> 8 if $? >> 8; # child exit status
|
||||||
|
exit 255; # last resort
|
||||||
|
} else {
|
||||||
die "%Error: Command Failed $command\n";
|
die "%Error: Command Failed $command\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub sh_escape {
|
sub sh_escape {
|
||||||
my ($arg) = @_;
|
my ($arg) = @_;
|
||||||
|
|
@ -346,6 +355,7 @@ detailed descriptions in L</"VERILATION ARGUMENTS"> for more information.
|
||||||
--private Debugging; see docs
|
--private Debugging; see docs
|
||||||
--public Debugging; see docs
|
--public Debugging; see docs
|
||||||
-pvalue+<name>=<value> Overwrite toplevel parameter
|
-pvalue+<name>=<value> Overwrite toplevel parameter
|
||||||
|
--quiet-exit Don't print the command on failure
|
||||||
--relative-includes Resolve includes relative to current file
|
--relative-includes Resolve includes relative to current file
|
||||||
--no-relative-cfuncs Disallow 'this->' in generated functions
|
--no-relative-cfuncs Disallow 'this->' in generated functions
|
||||||
--report-unoptflat Extra diagnostics for UNOPTFLAT
|
--report-unoptflat Extra diagnostics for UNOPTFLAT
|
||||||
|
|
@ -1157,6 +1167,10 @@ inlining. This will also turn off inlining as if all modules had a
|
||||||
Overwrites the given parameter(s) of the toplevel module. See -G for a
|
Overwrites the given parameter(s) of the toplevel module. See -G for a
|
||||||
detailed description.
|
detailed description.
|
||||||
|
|
||||||
|
=item --quiet-exit
|
||||||
|
|
||||||
|
When exiting due to an error, do not display the "Command Failed" message.
|
||||||
|
|
||||||
=item --relative-includes
|
=item --relative-includes
|
||||||
|
|
||||||
When a file references an include file, resolve the filename relative to
|
When a file references an include file, resolve the filename relative to
|
||||||
|
|
|
||||||
|
|
@ -1014,6 +1014,9 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||||
else if ( !strcmp (sw, "-gdbbt")) {
|
else if ( !strcmp (sw, "-gdbbt")) {
|
||||||
// Used only in perl shell
|
// Used only in perl shell
|
||||||
}
|
}
|
||||||
|
else if ( !strcmp (sw, "-quiet-exit")) {
|
||||||
|
// Used only in perl shell
|
||||||
|
}
|
||||||
else if ( !strcmp (sw, "-mod-prefix") && (i+1)<argc ) {
|
else if ( !strcmp (sw, "-mod-prefix") && (i+1)<argc ) {
|
||||||
shift; m_modPrefix = argv[i];
|
shift; m_modPrefix = argv[i];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||||
|
#
|
||||||
|
# Copyright 2019 by Todd Strader. This program is free software; you can
|
||||||
|
# redistribute it and/or modify it under the terms of either the GNU
|
||||||
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
# Version 2.0.
|
||||||
|
|
||||||
|
scenarios(vlt => 1);
|
||||||
|
|
||||||
|
top_filename("t/t_file_does_not_exist.v");
|
||||||
|
|
||||||
|
# Tests for the error message and then the absence of the
|
||||||
|
# "Command Failed" line
|
||||||
|
compile(
|
||||||
|
v_flags2 => ["--quiet-exit"],
|
||||||
|
fails => 1,
|
||||||
|
expect =>
|
||||||
|
'%Error: Exiting due to \d+ error\(s\)
|
||||||
|
((?!Command Failed).)*$',
|
||||||
|
);
|
||||||
|
|
||||||
|
ok(1);
|
||||||
|
1;
|
||||||
Loading…
Reference in New Issue