Callbacks Notifiers
API Reference Manual  /  Device API  /  Device API Functions  / 

Errors and Exceptions

SIM_clear_exception

Name

SIM_clear_exception — clear pending exception

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

sim_exception_t
SIM_clear_exception();

Description

Clears the currently pending frontend exception and returns the value of it.

Return Value

Returns the exception that was pending before the call, or SimExc_No_Exception.

Execution Context

Cell Context

See Also

SIM_get_pending_exception, SIM_last_error

SIM_describe_pseudo_exception

Name

SIM_describe_pseudo_exception — return pseudo exception description

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

const char *
SIM_describe_pseudo_exception(exception_type_t ex);

Python

import simics

simics.SIM_describe_pseudo_exception(...)

Description

This function returns a descriptive string for the specified exception_type_t.

Return Value

Exception description, or an error message if input is not a known pseudo-exception.

Execution Context

Global Context

See Also

exception_type_t

SIM_get_pending_exception

Name

SIM_get_pending_exception — get current pending exception

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

sim_exception_t
SIM_get_pending_exception();

Description

This function returns the exception type of the current pending exception, or SimExc_No_Exception if none available.

Execution Context

Cell Context

See Also

SIM_clear_exception, SIM_last_error

SIM_last_error

Name

SIM_last_error — get error message from last frontend exception

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

const char *
SIM_last_error();

Python

import simics

simics.SIM_last_error(...)

Description

Returns the error message associated with the most recently raised frontend exception, even if that exception has been cleared.

The returned string is only valid until the next use of the Simics API in the same thread.

Execution Context

Cell Context

See Also

SIM_clear_exception, SIM_get_pending_exception

Callbacks Notifiers