Make vvp exit with FAILURE if $fatal is used to exit the simulation.
This commit is contained in:
parent
1a40a6f902
commit
0abf91ca4e
|
|
@ -2161,6 +2161,9 @@ static PLI_INT32 sys_severity_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
|
|||
free(dstr);
|
||||
|
||||
if (strncmp(name,"$fatal",6) == 0) {
|
||||
/* Set the exit code from vvp as an error code. */
|
||||
vpip_set_return_value(1);
|
||||
/* Now tell the simulator to finish. */
|
||||
vpi_control(vpiFinish, finish_number.value.integer);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ static PLI_INT32 sys_finish_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
vpip_set_return_value(0);
|
||||
|
||||
vpi_control(vpiFinish, diag_msg);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -630,7 +630,14 @@ extern DLLEXPORT void (*vlog_startup_routines[])(void);
|
|||
/* Format a scalar a la %v. The str points to a 4byte character
|
||||
buffer. The value must be a vpiStrengthVal. */
|
||||
extern void vpip_format_strength(char*str, s_vpi_value*value, unsigned bit);
|
||||
/* Set the return value to return from the vvp run time. This is
|
||||
usually 0 or 1. This is the exit code that the vvp process
|
||||
returns, and in distinct from the finish_number that is an
|
||||
argument to $fatal and other severity tasks. The $fatal and
|
||||
$finish system tasks bundled with iverilog use this function to
|
||||
tell vvp to exit SUCCESS or FAILURE. */
|
||||
extern void vpip_set_return_value(int value);
|
||||
|
||||
extern s_vpi_vecval vpip_calc_clog2(vpiHandle arg);
|
||||
extern void vpip_make_systf_system_defined(vpiHandle ref);
|
||||
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ void stop_handler(int rc)
|
|||
/* The user may be running in a non-interactive environment, so
|
||||
* they want $stop and <Control-C> to be the same as $finish. */
|
||||
if (stop_is_finish) {
|
||||
vpip_set_return_value(stop_is_finish_exit_code);
|
||||
vpip_set_return_value(stop_is_finish_exit_code);
|
||||
schedule_finish(0);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue