IBM
Contents Index Previous Next



Generating and Starting a Simulator


There are two ways to generate and start a simulator:

In the following, the more complex way will be described first, to give a full understanding of the process. The quick way is described in Quick Start of a Simulator.

Generating a Simulator

A Simulator for an SDL system, or a part of an SDL system, consists of the C code generated by the SDL to C compiler together with a predefined run-time kernel. To start a Simulator, it is thus necessary to first generate an executable simulator. This is performed in the Organizer.

To generate an executable simulator:

  1. Select a system, block, or process diagram in the Organizer.
  2. Select Make from the Generate menu. The Make dialog is opened.
  3. Turn on the options Analyze & generate code and Makefile.
  4. From the Standard kernel option menu, select Simulation.
  5. If you need to check the Analyzer options, click the Analyze Options button. In the dialog, set the options and click the Set button. For more information about these options, see Analyzing Using Customized Options.
  6. Click the Make button.
    On UNIX, a simulator for the system is now generated in the current directory with the name <system>_xxx.sct (the _xxx suffix is platform specific).
    In Windows, a simulator for the system is now generated in the current directory with the name <system>_xxx.exe (the _xxx suffix is kernel and compiler specific).
    The Status Bar of the Organizer reports the progress of the generation; the last message should be "Compiler done."
  7. Open the Organizer Log window from the Tools menu and check that no errors occurred and that a simulator was generated.

Starting a Simulator

An executable simulator can be run in two different modes; graphical mode and stand-alone mode (textual mode).

Graphical Mode

In graphical mode, the Simulator takes advantage of the graphical user interface and integration mechanism of the SDL Suite. A separate graphical user interface, the Simulator UI, is started, giving access to the monitor system through the use of menus, command buttons, etc.

To start a simulator in graphical mode:

  1. Select SDL > Simulator UI from the Organizer's Tools menu. The graphical user interface of the Simulator is opened (see The Graphical Interface).
  2. Select Open from the Simulator UI's File menu. A File Selection Dialog is opened.
    • Alternatively, click the Open quick button in the tool bar.
  3. In the dialog, select an executable simulator and click OK.

A welcome message is printed in the text area of the Simulator UI. The monitor system is now ready to accept commands. Please see Supplying Values of External Synonyms for some additional information that may affect the start-up.

Stand-Alone Mode (Textual Mode)

In stand-alone mode, the Simulator uses the input and output devices currently defined on your computer, which provide a textual, command line based user interface. A very limited graphical support is provided when running the Simulator in this mode.

To start a simulator in stand-alone mode, the generated simulator is executed directly from the OS prompt, e.g.

csh% ./system_sma.sct

A welcome message is printed on the terminal:

Welcome to SDL SIMULATOR. Simulating system <system>

Command :

The monitor system is now ready to accept commands. Please see Supplying Values of External Synonyms for some additional information that may affect the start-up.

Note:

On UNIX, before a simulator can be run in stand-alone mode, you must execute a command file from the operating system prompt. The file is called telelogic.sou or telelogic.profile and is located in the binary directory that is included in your $path variable.
For csh-compatible shells: source <bin dir>/telelogic.sou
For sh-compatible shells: . <bin dir>/telelogic.profile

Quick Start of a Simulator

A simulator can also be generated and automatically started in graphical mode in one single step.

To quick start a simulator, click the Simulate quick button in the Organizer's tool bar. The following things happen:

Restarting a Simulator

An executing simulator can be restarted from the beginning to reset its state completely:

Supplying Values of External Synonyms

The SDL system for the simulator may contain external synonyms that do not have a corresponding macro definition (see External Synonyms). In that case, you will be asked to supply the values of these synonyms, either by selecting a file with synonym definitions, or by entering each synonym value from the keyboard.

In stand-alone mode, the following prompt appears:

External synonym file :

Enter the name of a file containing synonym definitions, or press <Return> to be prompted for each synonym value.

In graphical mode, a file selection dialog is opened. Either select a file (*.syn) containing synonym definitions, or press Cancel to be prompted for each value in a separate dialog. In this dialog, the name and type of the synonym is shown together with an input text field. You can now do the following:

If a synonym file is selected in the file selection dialog, this file is also used when the simulation is restarted. (If you want to use another synonym file you have to set-synonym-file simulator UI command.)

If you set the environment variable SDTEXTSYNFILE to a file before starting the SDL Suite, this file will automatically be used. If SDTEXTSYNFILE is set to "[[" all synonyms are given "null" values.

Note that the simulator lists all external synonyms that have been given values in another way than from a synonym file. This is done to make it easy to cut and paste information to a synonym file, for future use. An example:

The following external synonyms were not found in 
synonym file
/home/lat/simulator.syn:

myThirdSynonym (integer) 

The syntax of a synonym file is described in Reading Values at Program Start up.

Actions on Simulator Start-up

When a simulator is started, the static process instances in the system are created, but their initial transitions are not executed.

If a file called siminit.com exists in the current directory an implicit Include-File command will be done on this file at startup.


http://www.ibm.com/rational
Contents Index Previous Next