SIM_add_configuration — set configuration from Python
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_add_configuration(pre_conf_object_set_t *NOTNULL set,
const char *file);
import simics
simics.SIM_add_configuration(...)
This function creates objects from the parse objects in set and adds the initialized objects to the current configuration (creating one if necessary). When called from Python (which is the intended usage), the configuration set is a sequence (list or tuple) of pre_conf_object Python objects, or a dictionary of the form {<name> : <pre_conf_object>}.
The file argument is the name of the file that a configuration was read from, and should be set to None/NULL if not used.
The following examples are written in Python. As they do not map any devices in phys_mem, they will not work as stand-alone simulations.
Example when set is a sequence:
clock = pre_conf_object('timer', 'clock')
clock.freq_mhz = 20
space = pre_conf_object('phys_mem', 'memory-space')
space.queue = clock
SIM_add_configuration([clock, space], None)
Example when set is a dictionary:
objects = {}
objects['clock'] = pre_conf_object('timer', 'clock')
objects['clock'].freq_mhz = 20
objects['space'] = pre_conf_object('phys_mem', 'memory-space')
objects['space'].queue = objects['clock']
SIM_add_configuration(objects, None)
SimExc_General Thrown if Simics fails to initialize all objects.
Global Context
SIM_create_object, SIM_set_configuration, SIM_read_configuration
SIM_class_has_attribute — check if class implements attribute
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
bool
SIM_class_has_attribute(conf_class_t *NOTNULL cls, const char *NOTNULL attr);
import simics
simics.SIM_class_has_attribute(...)
Returns true if the class cls implements an attribute with the name attr.
Cell Context
SIM_create_object — create and initialize object
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
conf_object_t *
SIM_create_object(conf_class_t *NOTNULL cls, const char *name,
attr_value_t attrs);
import simics
simics.SIM_create_object(...)
Creates a new instance of the configuration class cls. name must consist of a letter followed by letters, digits or underscores (_). A unique name will be created if name is an empty string or nullptr. For backward compatibility, hyphens (-) are allowed instead of underscores but their use is deprecated.
The new object is initialized with attributes from attrs, which must be a list of (attribute-name, value) pairs, where each pair is a two-element list. All required attributes for the class cls must be present in attrs. In Python, attrs can be omitted (if no attributes are required), it can be normal lists: [['attribute1', value1], ['attribute2', value2]] or keyword arguments: attribute1=value1, attribute2=value2.
Attributes in ports of the cls class can be initialized by prefixing the attribute name with the port name, e.g. ['p.portname.attr', value].
The argument value may be modified, but the caller is still responsible for freeing it. Neither point applies when the function is called from Python.
The new object, or NULL on error (in which case an exception is raised).
SimExc_General Thrown if the name is not well-formed, if an object named name already exists, or if the initialisation failed.
Global Context
SIM_current_checkpoint_dir — directory of checkpoint being loaded
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
char *
SIM_current_checkpoint_dir();
import simics
simics.SIM_current_checkpoint_dir(...)
If called during the loading of a checkpoint, this function returns the checkpoint (bundle) directory. Otherwise, the return value is nullptr. The directory can be absolute or relative, and may be the empty string if the checkpoint directory is the current working directory.
Global Context
SIM_delete_objects, SIM_delete_object — delete a list of objects
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
int
SIM_delete_objects(attr_value_t val);
int
SIM_delete_object(conf_object_t *NOTNULL obj);
import simics
simics.SIM_delete_objects(...)
simics.SIM_delete_object(...)
Delete the list of objects val (or the single object obj) passed as argument, provided that no reference to these objects is left in the rest of the configuration. Descendant objects of an object being deleted will also be deleted.
Some specific objects in Simics, such as sim, are protected against deletion and will be ignored by this function.
If Simics finds references to the objects in the rest of the configuration, a warning will be printed and the operation will be aborted. Note that in this case, the deletion process has started and the objects may already have began their clean-up routines. The safest action at this point is to fix the dangling references and to try to delete the objects once again.
Events posted by the objects in cycle queues or step queues will be automatically removed. Hap callbacks and script branches waiting on deleted objects will be interrupted as well.
While removing the listed objects, SIM_delete_objects will call various callbacks (Core_Conf_Object_Pre_Delete and Core_Conf_Object_Delete haps, as well as pre_delete_instance and delete_instance for each object). Recursive calls to SIM_delete_objects are allowed during the pre-delete phase (Pre_Delete hap and pre_delete_instance callback), and the new objects will be added to the current list of objects to delete. Recursive calls after this stage will fail.
This limited recursion is meant to let objects that “own” other objects destroy them automatically if they themselves are to be deleted. This is used for example by the standard Simics components.
Note that for successful deletion of objects, each class should implement the proper deletion methods called by SIM_delete_objects. If the methods are not present, SIM_delete_objects will simply remove any reference to the object, but this may leave memory and resources unrecoverable.
Returns zero if successful. Throws an exception and returns non-zero otherwise.
SimExc_General Thrown if an error occurred or a reference to the objects is left in the rest of the configuration.
Global Context
The following line at the Simics prompt:
@SIM_delete_objects(list(SIM_object_iterator(None)))
will delete all unprotected objects in the configuration, leaving the Simics session empty.
SIM_delete_snapshot — delete a snapshot
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
snapshot_error_t
SIM_delete_snapshot(const char *name);
import simics
simics.SIM_delete_snapshot(...)
Deletes an in-memory snapshot.
Global Context
SIM_get_all_classes — get list of all loaded classes
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_value_t
SIM_get_all_classes();
import simics
simics.SIM_get_all_classes(...)
Return an unordered list of the names of all configuration classes loaded into simulation.
The Python function cli.global_cmds.list_classes can be used to get class names, by default including not-loaded classes.
List of class names.
Cell Context
SIM_get_all_objects — get list of all objects
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_value_t
SIM_get_all_objects();
import simics
simics.SIM_get_all_objects(...)
This function is deprecated and should not be used. Please use SIM_object_iterator instead.
Return a list of all configuration objects. The order is unspecified and may vary between calls to this function.
List of objects.
Cell Context
SIM_get_attribute, SIM_get_attribute_idx — get attribute
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_value_t
SIM_get_attribute(conf_object_t *NOTNULL obj, const char *NOTNULL name);
attr_value_t
SIM_get_attribute_idx(conf_object_t *NOTNULL obj, const char *NOTNULL name,
attr_value_t *NOTNULL index);
import simics
simics.SIM_get_attribute(...)
simics.SIM_get_attribute_idx(...)
Extracts the attribute specified by name parameter from obj. If an error occurs, an invalid value is returned. The _idx version of the function can be used to get a single entry in a list or data attribute. The attribute must support indexing for this to work.
The caller is as usual responsible for freeing the returned value by calling SIM_attr_free.
Attribute value. An attribute of Invalid type is returned if the attribute could not be read.
SimExc_AttrNotFound If the object did not have the specified attribute.
SimExc_AttrNotReadable If the attribute cannot be read.
SimExc_Type If the index has the wrong type.
SimExc_General If SIM_attribute_error or SIM_c_attribute_error was called inside the getter function.
Cell Context
SIM_get_attribute_attributes — get attribute flags
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_attr_t
SIM_get_attribute_attributes(conf_class_t *NOTNULL cls,
const char *NOTNULL attr);
import simics
simics.SIM_get_attribute_attributes(...)
Returns the attribute flags of the attr attribute of the class cls.
Cell Context
SIM_get_class_attribute, SIM_get_class_attribute_idx — get class attribute
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_value_t
SIM_get_class_attribute(conf_class_t *NOTNULL cls, const char *NOTNULL name);
attr_value_t
SIM_get_class_attribute_idx(conf_class_t *NOTNULL cls,
const char *NOTNULL name,
attr_value_t *NOTNULL index);
import simics
simics.SIM_get_class_attribute(...)
simics.SIM_get_class_attribute_idx(...)
Extracts the class attribute specified by name from the class cls. If an error occurs, an invalid value is returned. The _idx version of the function can be used to get a single entry in a list or data attribute. The attribute must support indexing for this to work.
The caller is as usual responsible for freeing the returned value by calling SIM_attr_free.
Attribute value. A value of Invalid type is returned if the attribute could not be read.
SimExc_AttrNotFound If the class did not have the specified attribute.
SimExc_AttrNotReadable If the attribute cannot not be read.
SimExc_Type If the index has the wrong type.
SimExc_General Other errors.
Global Context, unless the attribute documentation says otherwise.
SIM_get_object — get object
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
conf_object_t *
SIM_get_object(const char *NOTNULL name);
import simics
simics.SIM_get_object(...)
Returns the object with name name.
The function does an object look-up in the order; object ID, object name, and hierarchical location for all objects in the simulation. The function returns the first match from the look-up or nullptr if there was no object match.
The object ID is a unique name that never changes and is returned by the SIM_object_id function. The object name is the name of the object, used for instance when printing log messages and is returned by the SIM_object_name function. The hierarchical location is the absolute location of the object in the component hierarchy. The object name and the hierarchical location is the same.
Please note that in Python Simics objects are available directly as attributes of the conf module. For example, one can access the sim object like this:
conf.sim
Object, or nullptr if not found.
SimExc_General Thrown if the object can not be found.
Cell Context
SIM_object_name, SIM_object_id, SIM_object_parent, SIM_object_descendant
SIM_get_python_interface_type — get Python interface type
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
PyObject *
SIM_get_python_interface_type(const char *NOTNULL name);
import simics
simics.SIM_get_python_interface_type(...)
Returns the Python data type for the name interface, or nullptr if not available from Python.
If necessary, will try to load modules registering the Python translation for this interface.
SIM_get_snapshot_info — get information about a snapshot
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_value_t
SIM_get_snapshot_info(const char *NOTNULL name);
import simics
simics.SIM_get_snapshot_info(...)
Returns a dictionary of information about a snapshot. The currently defined keys in the dictionary are:
nil if there was no such snapshot, or if that snapshot has been deleted.Global Context
SIM_list_snapshots, SIM_take_snapshot, SIM_restore_snapshot, SIM_delete_snapshot
SIM_is_restoring_snapshot — check if a snapshot is currently being restored
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
bool
SIM_is_restoring_snapshot();
import simics
simics.SIM_is_restoring_snapshot(...)
Returns true if an in-memory snapshot is currently being restored.
Cell Context
SIM_list_snapshots — list snapshots
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
attr_value_t
SIM_list_snapshots();
import simics
simics.SIM_list_snapshots(...)
Returns a list of the names of the currently taken snapshots.
Global Context
SIM_take_snapshot, SIM_restore_snapshot, SIM_delete_snapshot, SIM_get_snapshot_info
SIM_object_class — get object class
#include <simics/device-api.h> // in C
// always available in DML
FORCE_INLINE conf_class_t *
SIM_object_class(const conf_object_t *NOTNULL obj);
import simics
simics.SIM_object_class(...)
Returns the class of an object.
Cell Context
SIM_object_descendant — return a descendant of the specified object
#include <simics/device-api.h> // in C
// always available in DML
conf_object_t *
SIM_object_descendant(conf_object_t *obj, const char *NOTNULL relname);
import simics
simics.SIM_object_descendant(...)
This function returns the descendant object of obj which has the relative name relname, or nullptr if no such object exists.
It is legal for the relative name to contain multiple components, like “device.p.RESET”.
If obj is nullptr, then the object lookup is performed relative the object hierarchy root.
If obj is instantiated at the same time as the descendant, then the function is guaranteed to succeed if called after the alloc_object phase of object initialization; i.e., it is safe for obj to invoke the function from its init_object method.
Object, or nullptr if the object has no hierarchical descendant with the specified relative name.
SIM_object_parent, SIM_register_port
Cell Context
SIM_object_is_processor — test if object is a processor
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
bool
SIM_object_is_processor(conf_object_t *NOTNULL obj);
import simics
simics.SIM_object_is_processor(...)
Returns non-zero if obj is a processor.
All contexts (including Threaded Context)
SIM_object_iterator — start object iteration
#include <simics/device-api.h> // in C
// always available in DML
object_iter_t
SIM_object_iterator(conf_object_t *obj);
import simics
simics.SIM_object_iterator(...)
The SIM_object_iterator function returns an iterator for the descendants of the object obj. If obj is nullptr, then the returned iterator will iterate over all objects in the configuration.
The iterator returns objects sorted by name, with parents before children.
Object iterator
Sample C code to find all objects implementing signal interface:
#include <simics/util/vect.h>
#include <simics/devs/signal.h>
...
VECT(conf_object_t *) v = VNULL;
object_iter_t it = SIM_object_iterator(nullptr);
conf_object_t *obj;
while ((obj = SIM_object_iterator_next(&it)) != nullptr) {
if (SIM_C_GET_INTERFACE(obj, signal) != nullptr)
VADD(v, obj);
}
... // any code using 'v' vector here
VFREE(v);
Sample Python code to find all objects implementing signal interface:
v = []
for obj in SIM_object_iterator(None):
if hasattr(obj.iface, simics.SIGNAL_INTERFACE):
v.append(obj)
The simics.SIGNAL_INTERFACE constant from the above example holds "signal" string. Such constants are available for some interfaces. One can safely use string literals instead.
SIM_object_iterator_next, SIM_shallow_object_iterator, SIM_object_iterator_for_class, SIM_object_iterator_for_interface
Cell Context
SIM_object_iterator_for_class — start class instance iteration
#include <simics/device-api.h> // in C
// always available in DML
object_iter_t
SIM_object_iterator_for_class(conf_class_t *cls);
import simics
simics.SIM_object_iterator_for_class(...)
The SIM_object_iterator_for_class function returns an iterator for the instances of the class cls. See SIM_object_iterator for examples on how to use the iterator.
Object iterator
SIM_object_iterator_next, SIM_object_iterator, SIM_object_iterator_for_interface
Cell Context
SIM_object_iterator_for_interface — start class instance iteration
#include <simics/device-api.h> // in C
// always available in DML
object_iter_t
SIM_object_iterator_for_interface(attr_value_t ifaces);
import simics
simics.SIM_object_iterator_for_interface(...)
The SIM_object_iterator_for_interface function returns an iterator for the objects that implement all interfaces in ifaces (i.e. all objects if ifaces is empty), which must be a list of strings of length at most 16. See SIM_object_iterator for examples on how to use the iterator.
Object iterator
SIM_object_iterator_next, SIM_object_iterator, SIM_object_iterator_for_class
SimExc_General Thrown if the ifaces argument does not conform to the above requirements.
Cell Context
SIM_object_iterator_next — get next object
#include <simics/device-api.h> // in C
// always available in DML
conf_object_t *
SIM_object_iterator_next(object_iter_t *iter);
The SIM_object_iterator_next function returns the next object from an iterator obtained from SIM_object_iterator or SIM_shallow_object_iterator. If there are no more objects in the sequence, then nullptr is returned.
It is illegal to call SIM_object_iterator_next using an iterator which has reached the end of its sequence.
Next object or nullptr.
SIM_object_iterator_next, SIM_object_iterator
Cell Context
SIM_object_parent — get object parent
#include <simics/device-api.h> // in C
// always available in DML
conf_object_t *
SIM_object_parent(conf_object_t *NOTNULL obj);
import simics
simics.SIM_object_parent(...)
Returns the hierarchical parent of the specified object.
Object, or nullptr if the object has no hierarchical parent.
SIM_object_descendant, SIM_port_object_parent
Cell Context
SIM_port_object_parent — get object parent
#include <simics/device-api.h> // in C
// always available in DML
conf_object_t *
SIM_port_object_parent(conf_object_t *NOTNULL obj);
import simics
simics.SIM_port_object_parent(...)
Returns the parent of the specified port object.
Object, or nullptr if the object is not a port object.
SIM_object_parent, SIM_object_descendant
Cell Context
SIM_printf_error, SIM_printf_error_vararg — print error message
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_printf_error(const char *format, ...);
// not available in DML
void
SIM_printf_error_vararg(const char *format, va_list ap);
import simics
simics.SIM_printf_error(...)
This can be used to print an error message during the simulation. It is analogous to log error messages, but for non-device code. I.e. it should be used for errors that prevents the simulation from continuing.
SIM_printf_warning, SIM_printf_warning_vararg — print warning message
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_printf_warning(const char *format, ...);
// not available in DML
void
SIM_printf_warning_vararg(const char *format, va_list ap);
import simics
simics.SIM_printf_warning(...)
This can be used to print a warning message during the simulation. It is analogous to log warning messages, but for non-device code. I.e. it should be used for problems that do not prevent the simulation from continuing.
SIM_read_configuration — read configuration
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_read_configuration(const char *NOTNULL file);
import simics
simics.SIM_read_configuration(...)
Read configuration from filename and create a machine accordingly.
SimExc_General Thrown if the file could not be opened, the machine was already initialized, or if an error in the configuration file was detected.
Global Context
SIM_register_context_handler — register mandatory interface and attribute for context handler objects
#include <simics/processor-api.h> // in C
import "simics/processor-api.dml"; // in DML
int
SIM_register_context_handler(conf_class_t *NOTNULL cls,
const context_handler_interface_t *NOTNULL iface);
import simics
simics.SIM_register_context_handler(...)
Register the cls class as a class for context handler objects. This includes registering the context_handler interface (iface), in addition to which SIM_register_context_handler registers a current_context attribute which will hold the current context.
The context_handler interface will be wrapped by standard functions so that standard context change behavior is taken care off automatically. This includes, among other things, making sure that the context is valid, and triggering the correct haps on context changes. Thus the context_handler implementation need only care about the effect of the change on the context_handler object itself (virtual breakpoints present in the context, cache flushing, etc.).
The return value is 0 if everything works, and non-zero if something fails. SIM_register_context_handler will return the error value provided by SIM_register_interface.
SimExc_General Thrown if the context_handler interface has already been registered for this class.
Global Context
SIM_restore_snapshot — restore a snapshot of the configuration state
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
snapshot_error_t
SIM_restore_snapshot(const char *name);
import simics
simics.SIM_restore_snapshot(...)
Restores the state of the configuration to a previously taken snapshot.
Global Context
SIM_set_attribute, SIM_set_attribute_idx — set attribute
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
set_error_t
SIM_set_attribute(conf_object_t *NOTNULL obj,
const char *NOTNULL name,
attr_value_t *NOTNULL value);
set_error_t
SIM_set_attribute_idx(conf_object_t *NOTNULL obj,
const char *NOTNULL name,
attr_value_t *NOTNULL index,
attr_value_t *NOTNULL value);
import simics
simics.SIM_set_attribute(...)
simics.SIM_set_attribute_idx(...)
Set the name attribute in obj to value.
The _idx version of the function can be used to get a single entry in a list or data attribute. For this to work, the attribute must support indexing.
After the call the value is still owned by the caller.
If the attribute setter function calls SIM_attribute_error or SIM_c_attribute_error and returns Sim_Set_Ok, it is treated like Sim_Set_Illegal_Value.
The return value is from the set_error_t enum, with Sim_Set_Ok indicating success.
SimExc_AttrNotFound If the object did not have the specified attribute
SimExc_AttrNotWritable if the attribute cannot not be written
SimExc_Type if the index has the wrong type, the value to be set does not match the type specified by the attribute or the setter function returned Sim_Set_Illegal_Type
SimExc_IllegalValue if the setter function returned Sim_Set_Illegal_Value
SimExc_Index if the setter function returned Sim_Set_Illegal_Index
SimExc_InterfaceNotFound if the setter function returned Sim_Set_Interface_Not_Found
SimExc_General if the setter function returned something else than Sim_Set_Ok, Sim_Set_Illegal_Type, Sim_Set_Illegal_Value, Sim_Set_Illegal_Index or Sim_Set_Interface_Not_Found.
Global Context in general; individual attributes may be less constrained.
SIM_set_class_attribute, SIM_set_class_attribute_idx — set class attribute
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
set_error_t
SIM_set_class_attribute(conf_class_t *NOTNULL cls,
const char *NOTNULL name,
attr_value_t *NOTNULL value);
set_error_t
SIM_set_class_attribute_idx(conf_class_t *NOTNULL cls,
const char *NOTNULL name,
attr_value_t *NOTNULL index,
attr_value_t *NOTNULL value);
import simics
simics.SIM_set_class_attribute(...)
simics.SIM_set_class_attribute_idx(...)
Set the name attribute in cls to value.
The _idx version of the function can be used to set a single entry in a list or data attribute. For this to work, the attribute must support indexing.
After the call the value is still owned by the caller.
The return value is from the set_error_t enum, with Sim_Set_Ok indicating success.
Global Context
SIM_set_configuration — set configuration from data
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_set_configuration(attr_value_t conf);
import simics
simics.SIM_set_configuration(...)
import configuration
configuration.OBJECT(name, objclass, **attrs)
class configuration.OBJ(name)
It is recommended that the
SIM_add_configurationfunction is used instead ofSIM_set_configuration.
This function is an alternative to reading the configuration from a file. A configuration is an attr_value_t which should have the following structure.
(("name", "class", ("attr_name", attr_val) ... ), ... )
That is a list of object specifiers containing name, class, and a list of attribute specifiers. An attribute specifier is a list of length 2 containing the attribute name and its value. SIM_set_configuration allows an easy way of parameterizing the configuration, especially if called from Python.
The argument value may be modified, but the caller is still responsible for freeing it. Neither point applies when the function is called from Python.
The following is a Python example:
from configuration import OBJ
from simics import SIM_set_configuration
SIM_set_configuration([
["cpu0", "x86",
["queue", OBJ("cpu0")],
["freq_mhz", 20],
["physical_memory", OBJ("phys_mem0")]],
["phys_mem0", "memory-space",
["map", [[0xa0000, OBJ("vga0"), 1, 0, 0x20000],
[0x00000, OBJ("mem0"), 0, 0x00000, 0xA0000],
[0xc0000, OBJ("mem0"), 0, 0xc0000, 0x8000],
[0xc8000, OBJ("setmem0"), 0, 0, 0x28000],
[0xf0000, OBJ("mem0"), 0, 0xf0000, 0x10000],
[0x100000, OBJ("mem0"), 0, 0x100000, 0x3ff00000],
[0xfee00000, OBJ("apic0"), 0, 0, 0x4000]]]],
... ])
SimExc_Attribute Thrown if malformed configuration list.
SimExc_General Thrown if Simics fails to initialize all objects.
Global Context
SIM_shallow_object_iterator — start object iteration
#include <simics/device-api.h> // in C
// always available in DML
object_iter_t
SIM_shallow_object_iterator(conf_object_t *obj);
import simics
simics.SIM_shallow_object_iterator(...)
The SIM_shallow_object_iterator function returns an iterator for the direct children of the object obj. If obj is nullptr, then the returned iterator will iterate over objects on the root level.
The iterator returns objects sorted by name.
Object iterator
SIM_object_iterator_next, SIM_object_iterator
Cell Context
SIM_take_snapshot — take snapshot of the current configuration
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
snapshot_error_t
SIM_take_snapshot(const char *name);
import simics
simics.SIM_take_snapshot(...)
Takes an in-memory snapshot of the state of all objects. Objects whose class_kind_t is equal to Sim_Class_Kind_Pseudo are not saved. This also holds for attributes (in all objects) of type Sim_Attr_Pseudo.
Global Context
SIM_restore_snapshot, SIM_delete_snapshot, SIM_list_snapshots
SIM_write_configuration_to_file — write configuration
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_write_configuration_to_file(const char *NOTNULL file, save_flags_t flags);
import simics
simics.SIM_write_configuration_to_file(...)
Saves all objects to filename. Objects whose class_kind_t is equal to Sim_Class_Kind_Session or Sim_Class_Kind_Pseudo are not saved. This also holds for attributes (in all objects) of type Sim_Attr_Pseudo.
The flags argument should be 0.
Global Context
SIM_write_persistent_state — save persistent state
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_write_persistent_state(const char *file, conf_object_t *root,
save_flags_t flags);
import simics
simics.SIM_write_persistent_state(...)
Saves the persistent state to a file. Persistent data typically includes disk images, NVRAM and flash memory contents and clock settings, i.e data that survives reboots. The Persistent state is saved as a standard simics configuration.
Global Context