synchronous_mode timing_model
API Reference Manual  /  5 Model-to-Simulator Interfaces  / 

temporal_state

Description
This interface is used in conjunction with object attributes to save an in-memory snapshot of the object state and to restore this state at a later point in time. Note that this interface is only used for reverse execution; it is not used for checkpointing to disk.

All functions in this interface are optional.

Object state not handled by the attributes can be saved through the save function. The return value is a pointer to state information. It should be noted that the state can be represented in an incremental manner as changes since the last call to save.

State information is released by the merge function. If the pointer returned by save represents incremental state changes, then the data in the killed argument should be appended to prev before the state pointed to be killed is released.

The function prepare_restore is called when a saved state is about to be loaded, before any attributes have been set.

The finish_restore function is invoked when all attributes have been set. The state argument is the pointer previously returned by save (or NULL if that function is not implemented). The passed state information should not be modified or released by this function.

SIM_INTERFACE(temporal_state) {
        lang_void *(*save)(conf_object_t *obj);
        void (*merge)(conf_object_t *obj, lang_void *prev, lang_void *killed);
        void (*prepare_restore)(conf_object_t *obj);
        void (*finish_restore)(conf_object_t *obj, lang_void *state);
};

#define TEMPORAL_STATE_INTERFACE "temporal_state"

Execution Context
Cell Context for all methods.

synchronous_mode timing_model