Previous - Up - Next

12.5   Various Component Features

The following additional "good to know" information about components is provided to help the programmer gain a better understanding of components rather than as coding guidelines.

12.5.1   Checkpointing

Most of the state in a component is usually checkpointed via the attributes used to configure it. There are also separate attributes that are only used for checkpointing, discussed in sections 12.3.1 and 12.4.3.

Things to checkpoint include state calculated or received during the connection phase, since it may be needed to support later reconfiguration for hotplugging components.

All information about connectors and connections is checkpointed automatically by the component base class.

12.5.2   Automatic Queue Assignment

All configuration objects in Simics that handle time in some way need a queue attribute set. The queue is an object implementing an event queue, also called time queue, needed for the time to advance. All objects that have the same queue are said to be part of the same time domain. The only objects that can be currently used as queues are processors and objects of the class clock.

The component system automatically sets the queue attribute for all objects at instantiation time, based on the component hierarchy. To override the automatic queue assignment, for example on multi-processor boards where each processor should be its own queue, simply assign the queue attribute when adding the pre-configuration objects.

12.5.3   Automatic Recorder Assignment

Devices that handle input such as serial and network devices, keyboards and mice, usually implement a connection to a recorder object. All their input passes through the recorder so that it may record the input to the file and later replay the same input from the file.

The component system automatically creates a recorder and connects it to all input devices that have a recorder attribute. A component can override this automatic assignment by setting the recorder attribute itself for its objects.

12.5.4   Inheritance

Since components are written as classes in object-oriented Python, it is easy to create new components that are similar to existing ones by using inheritance. Instead of basing the component on the component_object base class, another component class can be used. The new component class can, for example, modify the connector list, override the methods for adding object and connection information in the parent class. Several south bridge components supported by Simics are all based on the same south_bridge_component class, that in turn is based on a class supplying legacy PC devices.

Previous - Up - Next