Add Model Instances

The next step is to create the model instances of required primitives and modules of the system by dragging them from the Tree View into the system. The empty system MyAdderSystem should be open in the Model Editor window and appear as a grey square.

Continue as follows:

  1. Go to the Tree View window.
  2. Expand the tree to My LibrariesFirst StepsMySubLibrary and select the module MyAdderModule that we have built in Build a Module.
  3. Drag and drop this module into the system Model Editor Window.

The next step is to add sources to your system. Sources are models that do not have input ports, but one or more output ports at which they generate signals or events. Proceed as follows:

  1. Expand the tree to MLD LibrariesSDF DomainSources and select the SawGen primitive in the list.
  2. Drag and drop this primitive into the system Model Editor Window. You need two sources, so drag the SawGen primitive into the window again or use the [ctrl] key with left mouseclick combination while dragging the first model instance in the Model Editor Window. Place the two primitives so that their output port is near the input ports of the model instance MyAdderModule.

It is not possible to run a simulation unless the output of the system is processed by a sink primitive. The Sinks library contains a collection of primitives that do exactly that. There are a number of ways to deal with output data resulting from a simulation. The data can be:

Expand the tree to MLD LibrariesSDF DomainSinks. Search for a primitive called Xgraph and drag and drop it into the system Model Editor Window. You now have all the elements needed for the system. The next phase is to connect the model instances.