IBM
Contents Index Previous Next



Use of the SDL Target Tester


Differences between SDL Simulator and SDL Target Tester

The difference compared to the SDL Simulator is that the generated SDL system is running on a target hardware and is sending messages to the host system on which the SDL Target Tester's host part is running.

In this Cmicro tutorial, the SDL Target Tester's host part is running on the host as well as the generated SDL system (target).

Figure 183 : Communication links between the processes

Restrictions in this Tutorial

It is possible to use all the features supported by Cmicro (e.g. signal priorities, error checks, tester) except the preemptive Cmicro Kernel. This is due to the concept behind Cmicro which is designed for small targets on a stand-alone hardware (bare integration).

Background Information

Testing the Pager System

Running the SDL Target Tester

The SDL Target Tester could be started automatically from the Targeting Expert or by:

After it has been started the following steps have to be done (in the given order)

  1. Start the communication with the executable by pushing the button StartGateway in the Communication group or with the menu Execute > StartGateway.
  2. Go back to the Targeting Expert and select the menu entry
    Tutorial > Start target (Windows) or respectively
    Tutorial > Start target (UNIX)

Hint:

The menu Tutorial is a configurable menu not available if working on other SDL systems. Please refer to Configurable Menus for more information on how to create your own menu entries.

Note:

In Windows the target application is started in a separate command prompt window.

On UNIX the target application is started in a separate xterm.

  1. Now the communication between SDL Target Tester and target is established. The SDL Target Tester displays the message Start with "Go Forever". The corresponding button is located in the Execute group. Press the button.

    All messages of the target application are displayed in the UNIX shell or DOS command prompt where it was started. The pager will display its start-up message which was implemented in xInitEnv().
  2. You can "receive" messages by pressing the keys 0, 1, 2, 3, 4 and scroll with the keys r and l. To delete a message press d.
    See "xInEnv()" on page 280 on how the environment was implemented.
  3. The pager displays the last received message, the number of the current message and the total number of received messages. Now you can scroll, delete and receive new messages. If you receive a new message while the maximum amount of messages(3) is reached, the pager saves the message temporary and displays the warning:
    Memory full, please free memory to get new messages
    for about 2 seconds.
  4. Press the d key on your keyboard, the last message is then deleted and the received message is displayed.

Note:

To exit the target application press CTRL+C on the keyboard.

SDL Target Tester Commands

The SDL Target Tester has button groups. Each button represents a Tester command. You can use the buttons or the command line at the bottom of the Tester to enter a command. If you enter help in the command line you will see a list of SDL Target Tester commands.

In the following some Tester commands are explained briefly. For more information, see The SDL Target Tester.

Tracing the SDL System -> MSC Editor

Similar to the SDL Simulator GUI it is possible to generate MSC traces while testing the system with the SDL Target Tester.

Tracing the SDL System -> SDL Editor

It is possible to trace the target system with the SDL Editor.

The MSC trace and SDL trace functions are powerful tools for understanding the system.

Target Information

To get more information about target configuration, you must open the Configuration Group in the button area of the SDL Target Tester and press Target to get the current target configuration.

To get information about the kernel, you have to open the Examine Group. If you press Queue you will get information about the current state of the internal queue of your system. You will see the peak hold and the amount of signals of your current system. By pressing the other buttons in the Examine Group, you will get more information of the running system.

Memory

With the ?memory command you can see how the current memory state is.

  1. Start the Pager system as described in Running the SDL Target Tester.
  2. Type ?memory (the short command ?m can also be used) on the command line. You can check the memory pool size, the current memory fill and so on.

Now we will see how the memory is handled in the Pager system. Notice that the current amount of blocks in pool is four and the peak hold is five.

  1. Switch to the target application and press a key (1-4) to get a message.
  2. Go back to the Target Tester and execute the ?m command again. This time you can see that two more blocks are allocated. If you delete the last message the memory should be freed again and show four blocks.
Breakpoints and Queues

To debug the system you can use the Breakpoints button group. You can set a breakpoint on a signal input or a process state. If a breakpoint was reached you can continue the system with the button Continue.

  1. Restart the target as described in Running the SDL Target Tester.
  2. Expand the Breakpoints group and select Break input.
  3. Now you can choose a process ID. In this example we take the Keypad ID.
  4. A signal ID list is shown afterwards, select the delete signal.
  5. Breakpoint on input is set is shown in the text area now, switch to the target application window and insert some messages first, then press d. Nothing happens.
  6. Switch to the Tester again. Now you can use the ?memory command or look how the Queue looks like (?queue).
  7. Press Continue after you have examined the system state.

As the system will be halted every time the signal delete is to be consumed in process Keypad, it is probably useful to delete the breakpoint(s) by entering the command BA.


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