mirror of
https://github.com/Minres/RISCV-VP.git
synced 2026-03-21 03:41:32 +00:00
changes error reporting and exit value to properly communicate issues
This commit is contained in:
@@ -148,16 +148,17 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
if(auto res = setjmp(abrt)) {
|
if(auto res = setjmp(abrt)) {
|
||||||
switch(res) {
|
switch(res) {
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
case SIGQUIT:
|
case SIGQUIT:
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
case SIGUSR1:
|
case SIGUSR1:
|
||||||
case SIGUSR2:
|
case SIGUSR2:
|
||||||
SCCINFO() << "Simulation stopped with signal " << res << ".";
|
sc_core::sc_stop();
|
||||||
break;
|
SCCINFO() << "Simulation stopped with signal " << sigabbrev_np(res) << ".";
|
||||||
default:
|
break;
|
||||||
SCCERR() << "Simulation aborted with signal " << res << "!";
|
default:
|
||||||
|
SCCERR() << "Simulation aborted with signal " << sigabbrev_np(res) << "!";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
@@ -171,5 +172,5 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return sc_core::sc_report_handler::get_count(SC_ERROR) + sc_core::sc_report_handler::get_count(SC_WARNING);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user