Previous - Up - Next

3.9   Connects

A connect object is a container for a reference to an arbitrary Simics configuration object. An attribute with the same name as the connect, that can be assigned a value of type "Simics object", is added to the Simics configuration class generated from the device model. A connect is thus similar to a simple attribute object.

Typically, the connected object is expected to implement one or more particular Simics-interfaces, such as simple_interrupt (see the Simics Reference Manual for details).

Initialization of the connect (i.e., setting the object reference) is typically done from outside the device, usually in a Simics configuration file. As for attributes, the parameter configuration controls whether the value must be initialized when the object is created, and whether it is automatically saved when a checkpoint is created; see Section 5.1.8.

3.9.1   Interfaces

In order to use the Simics interfaces that a connected object implements, they must be declared within the connect. This is done through interface objects, which name the expected interfaces and may also specify additional properties.

An important property of an interface object is whether or not a connected object is required to implement the interface. This can be controlled through the interface parameter required, which is true by default; see Section 5.1.9. Attempting to connect an object that does not fulfill the requirement will cause a runtime error.

By default, the C type of the Simics interface corresponding to a particular interface object is assumed to be the name of the object itself with the string "_interface_t" appended. (The C type is typically a typedef:ed name for a struct containing function pointers). This can be changed by specifying an explicit c_type parameter in the interface object.

The following is an example of a connect with two interfaces, one of which is not required:

    connect plugin {
      interface serial_device;
      interface rs232_device { parameter required = false; }

Previous - Up - Next