ESD Model
An ESD model has two important functions.
- It specifies the other simulator for a cosimulation and the specific source model for the external system to use.
- It specifies the esys interfaces.
An ESD model has several basic attributes. The “name” attribute specifies a name for the model. The “simulator” attribute lets you specify a simulation description (.sd) file that defines how to build the cosimulation. Also, the model can contain comments that provide information about the ESD model and the model that the other simulator implements during the cosimulation. The remaining ESD model attributes deal with model interfaces.
For more information, see:
- “External System Reference” on page 147 for details about ESD model attributes
- “Cosimulation” on page 391 for a description of the simulation description file
Esys Interfaces
An esys interface is the mechanism by which Modeler and another simulator exchange data during a cosimulation. With the exception of vector interfaces, described in the next section, an esys interface can contain one value only. This value can be any of the data types that Modeler allows (most of the standard C/C++ data types), which you can specify using the esys interface’s “type” attribute. The value remains on the esys interface until it is overwritten by a new value.
In addition to a data type, esys interfaces have “name” and “direction” attributes. The direction specifies how data flows through the interface:
- Modeler to Cosim – the esys interface sends data from Modeler to the external code
- Cosim to Modeler – the esys interface receives data from the external code
- Bidirectional – the esys interface sends and receives data
- Not connected – the esys interface is defined, but not used
The esys module’s process model controls how Modeler reads data from and writes data to esys interfaces. Chapter 5 “External System Package” on page 1 gives Riverbed Modeler users control over when and how Modeler reads and writes data using esys interfaces.
An esys interface can represent a variety of items, depending on the nature of your cosimulation. In some cases, an esys interface might map to some physical aspect of the system you are modeling, such as a pin on a microchip. In other cases, the esys interfaces might not map to any specific element of the modeled system, instead serving purely as a means of communication for the cosimulation. The model designer must know the esys interface’s role for both Modeler and the other simulator.
Vector Interfaces
A vector interface is essentially an array of esys interfaces grouped under a common name. Each element of a vector interface can hold one value. Therefore, you could use a vector interface to pass multiple values to the external code at the same time, provided that the external code is set up to receive values this way. Note that, although you can change the values in individual elements, Modeler treats all the values held in a vector interface as one unit, sending and receiving all of them whenever the values change.
You can control the number of elements in a vector interface with the “dimension” attribute. The “dimension” attribute of non-vector interfaces has a value of 0. By changing this to n, you create a vector interface with n elements. Note that a vector interface is a special type of esys interface, so general comments about esys interfaces also apply to vector interfaces unless otherwise stated.