Running a simulation

Now that the behaviour blocks have C code associated with them, it is time to run the simulation. To do this in VCC, you must create an analysis session as follows:

  1. Ensure that the behaviour that you want to run is selected in the library tree view on the LHS of the VCC window.
  2. Click file/new..., select the Analysis tab and choose Analysis. Accept the default paths for the analysis session by clicking OK.
  3. Double right-click in the library tree view and choose refresh. Analysis1 should now appear, so select it by left clicking once.
  4. Now click file/save analysis session and then open the analysis by double left-clicking on Analysis1.
Double analysis
The double analysis session

VCC provides many useful debugging features, including breakpoints and textual displays. We'll add a textual display to see which messages are sent out of the double block. To do this, select the double block's out port and click Analysis/Insert Textual Display. The analysis is now ready to run and should look like the screen shot on the right.

To compile the simulation, click analysis/initialize. Choose OK and Yes to accept the default simulation end time and to save changes to the analysis session. Once done is displayed in the bottom part of the window, you can run the simulation by clicking analysis/Go/continue.

The simulation will now run and '328' will be displayed in the textual display. This shows that the double block works correctly as it outputs twice the value that it receives from integer_source.

Next...