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.
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.
- 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 .
- Double click the edit box of the project attribute
Name .
The current name Project will be highlighted.
Type in the new project name Simple.
- 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.
- 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
|
- Use the menu
File->Open to open the project
file empty.xml.
- 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
|
- 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
|
- Add another task named task2 to the task table.
Set the task parameters as in the figure below.
Task Configurations
|
- Select
Deadline Monotonic in the scheduling
policy drop-down box. The task priorities will be automatically
assigned.
The Tasks Tab
|
- 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
|
- Use the menu
File->Save As... to save
the project to the file named tasks.xml.
- 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)'
|
- Use the menu
File->Open
to open the project file named tasks.xml.
- 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.
- 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.
- 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.
- 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.
- Right-click on the Location 1 and select
Location->Make initial in the pop-up menu.
Location 1 will be marked as initial.
- 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.
- 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.
- Right-click on the transition line and select
Arguments->Edit in the popup menu.
Type in x1 >= T in the Guard field.
- 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.
- Use the menu
File->Save As... to save
the project in the file named automaton.xml.
- 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
|
- Use the menu
File->Open
to open the project file automaton.xml.
- Click on the project tab Simple and
double-click in its drawing area. A process Process1
will be created.
- 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.
- 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.
- Use the menu
File->Save As... to save
the project to the file named process.xml.
- Use the menu
File->Exit to close the tool.
This tutorial describes how a system is simulated in the Times simulator.
- 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.
- Start the Times simulator using the menu
Run->Simulator .
The Times Simulator
|
- 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.
- 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.
- 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.
- You can also navigate along the trace by clicking either on the Message Sequence Chart
levels or on the Gantt Chart time points.
- 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.
- 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.
- You can close the simulator using menu
File->Close Simulator .
Schedulability analysis tutorial
This tutorial describes how the schedulability analysis is performed in
Times.
- 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.
- 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
|
- 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.
This tutorial describes how model properties are verified in
Times.
- 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.
- 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
|
- 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).
- 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.
The Result of Property Checking
|
- 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.
- 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.
Generating Code from a Model
|
- 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.
- See Configuration chapter for more
information about setting up the code generator and Synthesis
to learn how to compile and run the generated code.
|