op_sim_error()
Abstract
Prints a specified error message, and optionally terminates the simulation.
Syntax
op_sim_error (gravity, line1, line2)
| Argument | Type | Description |
|---|---|---|
gravity |
OpT_Sim_Error_Gravity |
Severity of error (see Details section). |
line1 |
const char * |
First line of error message, or OPC_NIL. |
line2 |
const char * |
Second line of error message, or OPC_NIL. |
Return Type
void
No return value.
Example
op_sim_error (OPC_SIM_ERROR_WARNING, "Error message line 1", "message line 2");
The preceding statement produces output similar to the following:
|-----------------------------------------------------------------------------|
| <<< Warning >>> |
| Error message line 1 |
| message line 2 |
| T (0), EV (0), MOD (top.node_0.p_0), PROC (s52825 [st_0 enter execs]) |
|-----------------------------------------------------------------------------|
Details
The gravity argument must be one of:
OPC_SIM_ERROR_DIAGNOSTICOPC_SIM_ERROR_WARNINGOPC_SIM_ERROR_RECOVEROPC_SIM_ERROR_ABORT
If gravity is OPC_SIM_ERROR_ABORT, this KP will end the simulation (similar to calling op_sim_end()).
Purpose
Provides a mechanism for printing a diagnostic error, warning, recoverable error, or program abort message of up to two lines. Each message is accompanied by the simulation time, event, module, and process in which the error was generated.
Errors
- No errors are trapped.
Reference
- None