Contents
Last update:
Thursday, 06 Nov 2008, 10:26:39
Optimized for: Mozilla/5.0 MSIE/6.0+
Tutorials Printer friendly
version
Back to Contents
The tutorials show in a step-by-step manner how the different parts of the Times tool work allowing you to start quickly using the tool in your own projects.

Editing tutorial

This tutoral describes how to create a very simple system using the Times editor. It will help you understand the main concepts of the editor.

  • Creating an empty project

    Abstract: Create a new project, name it Simple, and then save the project to the file named empty.xml.

    1. Start the Times tool or, if you have it already started, save and close the current project and create a new one using menu File->New.

    2. Double click the edit box of the project attribute Name. The current name Project will be highlighted. Type in the new project name Simple.

    3. Use the menu File->Save As... to save your project. A standard file dialog will appear. Type in the filename empty, and click the Save button.

    4. Use the menu File->Exit to close the tool.

  • Adding and configuring tasks

    Abstract: Create two tasks as shown in the figure below and then set the deadline monotonic scheduling policy. Set the maximum of 2 task instances for the task1 and save the project as tasks.xml.



    Task Configurations and Scheduling Policy

    1. Use the menu File->Open to open the project file empty.xml.

    2. Right-click in the tasks table, below the table headings. A popup menu will appear, as in the figure below. Select the menu item Add task. A new task task1 will be created with its behavior set to controlled. See Editor chapter for more information about the task table.



      Adding a Task to The Task Table

    3. Left-click in the B column of the row for task1. This will bring up a drop-down menu with the task behaviors. Select P. This will set the behavior of the task1 to prediodic.



      Selecting Task Behavior

    4. Add another task named task2 to the task table. Set the task parameters as in the figure below.



      Task Configurations

    5. Select Deadline Monotonic in the scheduling policy drop-down box. The task priorities will be automatically assigned.



      The Tasks Tab

    6. Select the Tasks tab and then select task1 in the task table. The attributes of the selected task will appear in the panel below the task table. Double-click in the value column of the Max # of tasks row and type in 2. This will allow two instances of the task1 to be active at any time as maximum.



      Setting Maximum Number of Task Instances

    7. Use the menu File->Save As... to save the project to the file named tasks.xml.

    8. Use the menu File->Exit to close the tool.

  • Creating an automaton template

    Abstract: Create an automaton template p(const T), as in the figure below. Save the project as automaton.xml.



    The automaton template 'p(const T)'

    1. Use the menu File->Open to open the project file named tasks.xml.

    2. Right-click in the tabbed area. A popup menu will appear, select the menu item Add template. A new template, called Template1, will be added to the project.

    3. Go to the tab with the Template1. The template properties will appear below the task table. Change the template name to p and type in const T in the Parameters field.

    4. Below the template attributes there is an empty table of local declarations. Right-click below the table headings and select Add declaration in the popup menu. A clock named x1 with the initial value 0 will be added to the local declarations table.

    5. Right-click in the template drawing area, and select Create->Location in the popup menu. A new location named Location 1 will be created. Double-click below Location 1 to create Location 2. You can move locations on the drawing are as well as adjust location label position dragging them.

    6. Right-click on the Location 1 and select Location->Make initial in the pop-up menu. Location 1 will be marked as initial.

    7. Right-click on the Location 2 and select Arguments->Edit in the pop-up menu (or you can simply double click on the location instead). An inline editor will appear. Select task2 in the Task drop-down menu. This will associate the location with the task2 so that it will be released for execution every time an automaton reaches Location 2. Click outside the inline editor to close it or simply press Enter key.

    8. Right-click on the blue cross (port) on the lower border of the Location 1 and select Create transition in the popup menu (or simply double-click the port). Drag the transition end to the upper port of the Location2 and left-click on it once. A transition between Location1 and Location2 will be created.

    9. Right-click on the transition line and select Arguments->Edit in the popup menu. Type in x1 >= T in the Guard field.

    10. Create another transition, from Location 2 to Location 1. During dragging a transition end create two nails (turning points) in order to bend the transition line by left-clicking on the drawing area at their locations. Right-click on the newly created transition and select Arguments->Edit. Type in x1 := 0 in the Assign field.

    11. Use the menu File->Save As... to save the project in the file named automaton.xml.

    12. Use the menu File->Exit to close the tool.

  • Creating a process

    Abstract: Create a process named Process 1 as in the figure below. Save the project as process.xml.



    Your First Process

    1. Use the menu File->Open to open the project file automaton.xml.

    2. Click on the project tab Simple and double-click in its drawing area. A process Process1 will be created.

    3. Double-click on the Process 1 to open an inline editor. Select template named p in the Template drop-down menu and type in 7 in the Parameters field.

    4. Use the menu Run->Syntax checking to run system syntax checking procedure. A message should appear saying that the system is syntactically correct. If not, check whether you have performed all the steps as described in this tutorial. The error message dialog will describe the errors you have made and help you to locate them.

    5. Use the menu File->Save As... to save the project to the file named process.xml.

    6. Use the menu File->Exit to close the tool.

Simulation tutorial

This tutorial describes how a system is simulated in the Times simulator.

  1. Use the menu File->Open to open an example project named Controlled+Periodic.xml located in the subfolder Timestool/ examples/ SporadicPeriodic of the Times installation.

  2. Start the Times simulator using the menu Run->Simulator.



  3. The Times Simulator

  4. Simulation in step-by-step mode is performed manually. Select one of the enabled transitions and press the button to make one simulation step.
    Note: When selecting an enabled transition you can see the next predicted system state at the bottom of the Message Sequence Chart below the violet bar drawn with lighter colors.

  5. The random run simulation mode is activated by pressing the button. In this mode transitions are chosen randomly and the simulator continuously performs one simulation step after another. To stop simulation press the button.

  6. You can reset the simulatior to its initial state pressing the button. When there is a trace in the Message Sequence Chart you can move along it back and forth, observing the system internal state and variable values in all simulator views, using and buttons. The button sets the simulator to the end of the trace from where you can continue current simulation.
    Note: If you continue simulation somewhere from the middle of the existing trace, the tail of this trace will be erased.

  7. You can also navigate along the trace by clicking either on the Message Sequence Chart levels or on the Gantt Chart time points.

  8. In the Message Sequence Chart process states are hidden (replaced by a thin vertical line) if they have the same names as the name of a state since the last state change. To view the state names of all processes at a certain level of the chart move over the pointer to this level.

  9. You can switch back to the editor view preserving the state of the simulator by using the menu Window->Editor. In order to return to the simulation use menu Window->Simulator.
    Note: If you rerun the simulator from the editor via menu Run->Simulation, the state of previous simulation will be reset and the system being edited will be uploaded to the simulator again.

  10. You can close the simulator using menu File->Close Simulator.

Schedulability analysis tutorial

This tutorial describes how the schedulability analysis is performed in Times.

  1. Use the menu File->Open to open a project to be analysed named Controlled+Periodic.xml located in the subfolder Timestool/ examples/ SporadicPeriodic of the Times installation.

  2. Start the schedulability analysis using menu Run->Schedulability Analysis. A new window will pop up showing location of the server being used and an activity indicator. An answer SATISFIED or NOT SATISFIED is returned by the time analysis has been performed.



    Result of Schedulability Analysis

  3. In our case the answer is SATISFIED, which means that all the tasks in the system managed to meet their deadlines in all possible execution traces. In this case one can observe worst-case response time of each task, i.e. the lowest integer value greater or equal to the longest response time of a task. Press Show WCRT button to open a window containing those values.



    Worst Case Response Times

    Clearly, the WCRT value should be greater or equal than the execution time and less or equal the the deadline of a task.

Verification tutorial

This tutorial describes how model properties are verified in Times.

  1. Use the menu File->Open to open an example project named Controlled+Periodic.xml located in the subfolder Timestool/ examples/ SporadicPeriodic of the Times installation.

  2. Open the verification dialog using menu Run->Verification. In the dialog specify the property E<>(aver>5) secting it from a drop-down menu and press the OK button to start verification. The query syntax is given in the Languages chapter.



    Specifying a Property to Verify

  3. After verification is done you are provided with the result: SATISFIED, if the property holds, NOT SATISFIED if not and MAYBE SATISFIED if Over Approximation or Under Approximation is used (see Configuration chapter for information about configuring the verifier).

  4. If the property has not been satisfied and there is a counterexample, you can load the trace containing it into the simulator by pressing the Show trace button. The same holds for the traces generated while verifying "E<>" and "A[] not" properties.



  5. The Result of Property Checking

  6. You can start several verification processes simultaneously. Every verification process uses a separate connection to the verifier.

Code synthesis tutorial
This tutorial shows how to synthesise executable code from your models in Times.
  1. Use the menu File->Open to open an example project named Controlled+Periodic.xml located in the subfolder Timestool/ examples/ SporadicPeriodic of the Times installation.



  2. Generating Code from a Model

  3. Start the code generation using menu Run->Code synthesis. In the newly opened window you can see the names of the files that have been generated.

  4. See Configuration chapter for more information about setting up the code generator and Synthesis to learn how to compile and run the generated code.


Home | Download | Screenshots | Documentation | Case studies | Publications | DARTS team | Contact us

(C) 2007 DARTS, IT Dept, CS, Uppsala University, Sweden