sim_exception_t — frontend exceptions
#include <simics/device-api.h> // in C
// always available in DML
typedef enum sim_exception {
SimExc_No_Exception,
SimExc_General,
SimExc_Lookup,
SimExc_Attribute,
SimExc_IOError,
SimExc_Index,
SimExc_Memory,
SimExc_InquiryOutsideMemory,
SimExc_InquiryUnhandled,
SimExc_Type,
SimExc_Break,
SimExc_PythonTranslation,
SimExc_License,
SimExc_IllegalValue,
SimExc_InterfaceNotFound,
SimExc_AttrNotFound,
SimExc_AttrNotReadable,
SimExc_AttrNotWritable
} sim_exception_t;
import simics
simics.SimExc_Break
simics.SimExc_Index
simics.SimExc_InquiryUnhandled
simics.SimExc_AttrNotFound
simics.SimExc_InquiryOutsideMemory
simics.SimExc_Lookup
simics.SimExc_General
simics.SimExc_IllegalValue
simics.SimExc_Type
simics.SimExc_PythonTranslation
simics.SimExc_Attribute
simics.SimExc_Memory
simics.Sim_Exceptions
simics.SimExc_License
simics.SimExc_No_Exception
simics.SimExc_Stop
simics.SimExc_AttrNotReadable
simics.SimExc_IOError
simics.SimExc_AttrNotWritable
simics.SimExc_InterfaceNotFound
Whenever an error occurs in a Simics API function, that function will raise an exception. An exception consists of an exception type and an error message.
Note that API users writing in C must use SIM_clear_exception() and SIM_last_error() since C does not support exceptions. In Python, the Simics API exceptions will trigger actual Python exceptions, which you can capture using try ... except.