This section lists Simics API functions that a processor model may need to use beyond what is described in other parts of this document. Simics API SIM_register_clock is described in API Reference Manual.
bool VT_check_async_events(void);
The Simics platform will check for asynchronous events between invocations
of the run method in the execute
. If significant
time passes between such invocations, which will typically be the case
unless there are multiple simulated CPUs that are switched between, then the
implementor of execute
needs to either call this method or
exit pre-maturely from run to allow asynchronous events to be
handled. If neither is performed, then interactive performance will suffer
as user input would be waiting significant time before being processed.
If only the async event state is requested, the faster VT_async_events_pending should be used instead.
void VT_new_code_block(void *start, size_t len);
void VT_set_object_clock(conf_object_t *NOTNULL obj, conf_object_t *clock);
An object that is itself a clock needs to call this function to initialize
the clock coupling to itself. The call to initialize the coupling should be
made from the init method registered for the class in its
class_info_t
(or init_object if registered using
class_data_t
).
void VT_clock_frequency_about_to_change(conf_object_t *obj);
void VT_clock_frequency_change(conf_object_t *obj, uint64 cycles_per_second);
void VT_stop_event_processing(conf_object_t *clock);
In the future, the simulation framework may keep track of this thus relieving the clock from the duty of having to call this method.