forked from github/verilator
Tests: Add --gdbbt, and abort on V3ERROR_NA in V3Ast
This commit is contained in:
parent
ba07dc1804
commit
08b63b4f01
@ -143,6 +143,15 @@ WDataOutP VL_ZERO_RESET_W(int obits, WDataOutP outwp) {
|
|||||||
return outwp;
|
return outwp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
// Debug
|
||||||
|
|
||||||
|
void _VL_DEBUG_PRINT_W(int lbits, WDataInP iwp) {
|
||||||
|
VL_PRINTF(" Data: w%d: ", lbits);
|
||||||
|
for (int i=VL_WORDS_I(lbits)-1; i>=0; i--) { VL_PRINTF("%08x ",iwp[i]); }
|
||||||
|
VL_PRINTF("\n");
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
// Slow math
|
// Slow math
|
||||||
|
|
||||||
|
@ -328,11 +328,7 @@ static inline IData VL_EXTENDSIGN_I(int lbits, IData lhs) { return (-((lhs)&(VL
|
|||||||
static inline QData VL_EXTENDSIGN_Q(int lbits, QData lhs) { return (-((lhs)&(VL_ULL(1)<<(lbits-1)))); }
|
static inline QData VL_EXTENDSIGN_Q(int lbits, QData lhs) { return (-((lhs)&(VL_ULL(1)<<(lbits-1)))); }
|
||||||
|
|
||||||
// Debugging prints
|
// Debugging prints
|
||||||
static inline void _VL_DEBUG_PRINT_W(int lbits, WDataInP iwp) {
|
void _VL_DEBUG_PRINT_W(int lbits, WDataInP iwp);
|
||||||
printf(" Data: w%d: ", lbits);
|
|
||||||
for (int i=VL_WORDS_I(lbits)-1; i>=0; i--) { printf("%08x ",iwp[i]); }
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// Pli macros
|
// Pli macros
|
||||||
|
@ -203,7 +203,7 @@ inline void v3errorEnd(ostringstream& sstr) { V3Error::v3errorEnd(sstr); }
|
|||||||
// For use in V3Ast static functions only
|
// For use in V3Ast static functions only
|
||||||
#define UASSERT_STATIC(condition,stmsg) { if (!(condition)) { cerr<<"Internal Error: "<<__FILE__<<":"<<dec<<__LINE__<<":"<<(stmsg)<<endl; abort(); } }
|
#define UASSERT_STATIC(condition,stmsg) { if (!(condition)) { cerr<<"Internal Error: "<<__FILE__<<":"<<dec<<__LINE__<<":"<<(stmsg)<<endl; abort(); } }
|
||||||
|
|
||||||
#define V3ERROR_NA v3error("Internal: Unexpected Call")
|
#define V3ERROR_NA { v3error("Internal: Unexpected Call"); v3fatalSrc("Unexpected Call"); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ my $opt_benchmark;
|
|||||||
my @opt_tests;
|
my @opt_tests;
|
||||||
my $opt_gdb;
|
my $opt_gdb;
|
||||||
my $opt_gdbbt;
|
my $opt_gdbbt;
|
||||||
|
my $opt_gdbsim;
|
||||||
my $opt_iv;
|
my $opt_iv;
|
||||||
my $opt_jobs = 1;
|
my $opt_jobs = 1;
|
||||||
my $opt_nc;
|
my $opt_nc;
|
||||||
@ -62,6 +63,7 @@ if (! GetOptions (
|
|||||||
"debug" => \&debug,
|
"debug" => \&debug,
|
||||||
"gdb!" => \$opt_gdb,
|
"gdb!" => \$opt_gdb,
|
||||||
"gdbbt!" => \$opt_gdbbt,
|
"gdbbt!" => \$opt_gdbbt,
|
||||||
|
"gdbsim!" => \$opt_gdbsim,
|
||||||
"help" => \&usage,
|
"help" => \&usage,
|
||||||
"iverilog!" => \$opt_iv,
|
"iverilog!" => \$opt_iv,
|
||||||
"j=i" => \$opt_jobs,
|
"j=i" => \$opt_jobs,
|
||||||
@ -531,7 +533,8 @@ sub execute {
|
|||||||
#&& (!$param{needs_v4} || -r "$ENV{VERILATOR_ROOT}/src/V3Gate.cpp")
|
#&& (!$param{needs_v4} || -r "$ENV{VERILATOR_ROOT}/src/V3Gate.cpp")
|
||||||
) {
|
) {
|
||||||
$self->_run(logfile=>"$self->{obj_dir}/vlt_sim.log",
|
$self->_run(logfile=>"$self->{obj_dir}/vlt_sim.log",
|
||||||
cmd=>["$self->{obj_dir}/$param{VM_PREFIX}",
|
cmd=>[(($opt_gdbsim ? "gdbrun ":"")
|
||||||
|
."$self->{obj_dir}/$param{VM_PREFIX}"),
|
||||||
@{$param{all_run_flags}},
|
@{$param{all_run_flags}},
|
||||||
],
|
],
|
||||||
%param,
|
%param,
|
||||||
@ -1143,13 +1146,17 @@ specifies the number of simulation cycles (for tests that support it).
|
|||||||
|
|
||||||
=item --gdb
|
=item --gdb
|
||||||
|
|
||||||
Run verilator under the debugger.
|
Run Verilator under the debugger.
|
||||||
|
|
||||||
=item --gdbbt
|
=item --gdbbt
|
||||||
|
|
||||||
Run verilator under the debugger, only to print backtrace information.
|
Run Verilator under the debugger, only to print backtrace information.
|
||||||
Requires --debug.
|
Requires --debug.
|
||||||
|
|
||||||
|
=item --gdbsim
|
||||||
|
|
||||||
|
Run Verilator generated executable under the debugger.
|
||||||
|
|
||||||
=item --help
|
=item --help
|
||||||
|
|
||||||
Displays this message and program version and exits.
|
Displays this message and program version and exits.
|
||||||
|
Loading…
Reference in New Issue
Block a user