6 - MSC
SDL-RT integrates the Message Sequence Chart dynamic view. On such a diagram, time flows from top to bottom. Lifelines represent SDL-RT agents or semaphores and key SDL-RT events are represented. The diagram put up front the sequence in which the events occur.
In the case of embedded C++ it is possible to use a lifeline to represent an object. In that case the type is object and the name should be <object name>:<class name>
6.1 - Agent instance
An agent instance starts with an agent instance head followed by an instance axis and ends with an instance tail or an instance stop as shown in the diagrams below.
The type of the agent can be specified on top of the head symbol and the name of the agent is written in the instance head symbol. The instance tail symbol means the agent lives after the diagram. The instance stop symbol means the agent no longer exist after the symbol.
When an agent creates another agent a dashed arrow goes from the parent agent to the child agent.Example:
6.2 - Semaphore representation
A semaphore representation is made of a semaphore head, a lifeline, and a semaphore end or tail. The symbols are the same as for a process except for the head of the semaphore.
6.3 - Semaphore manipulations
Several cases are to be considered with semaphore manipulations. A process makes an attempt to take a semaphore, its attempt can be successful or unsuccessful, if successful the semaphore might still be available (counting semaphore) or become unavailable. During the time the semaphore is unavailable, its lifeline gets thicker until it is released.
The manipulation symbols are the following:
6.4 - Message exchange
A message symbol is a simple arrow with its name and optional parameters next to it. The arrow can be horizontal meaning the message arrived instantly to the receiver or the arrow can go down to show the message arrived after a certain time or after another event. A message can not go up !
When the sender and the receiver are represented on the diagram the arrow is connected to their instances. If the sender is missing it is replaced by a white circle, if the receiver is missing it is replaced by a black circle.The name of the sender or the receiver can optionally be written next to the circle.
A message is considered received by an agent when it is read from the agent's message queue; not when it arrives in the message queue !
6.5 - Synchronous calls
This representation is used when using embedded C++ to show method calls on an object. Object can be represented by lifelines. Synchronous calls are shown with an arrow to the instance representing the object. While the object has the focus its lifeline becomes a black rectangle and the agent lifeline becomes a white rectangle. That means the execution flow has been transferred to the object. When the method returns a dashed arrow return to the method caller.
6.6 - State
A lifeline represents a process and depending on its internal state a process reacts differently to the same message. It is interesting to represent a process state on its lifeline. It is also interesting to represent a global state for information. In that case the state symbol covers the concerned instances. In both cases the same symbol is used.
6.7 - Timers
Two symbols are available for each timer action depending if the beginning and the end of the timer are connected or not. The timer name is by the cross and timeout value is optional. When specified the timeout value unit is not specified; it is usually RTOS tick counts.
6.8 - Time interval
To specify a time interval between two events the following symbol is used.
Time constraint syntax is the following:
- absolute time is expressed with an @ up front the time value,
- relative time is expressed with nothing up front its value,
- time interval is expressed between square brackets,
- time unit is RTOS specific -usually tick counts- unless specified (s, ms, Ás).
Note it is possible to use time constraint on a single MSC reference.
Absolute time can also be specified with the following symbol:
Table 1: Examples of time constraint expressions Expression Meaning 1.3ms takes 1.3 ms to do
6.9 - Coregion
Coregion is used whenever the sequence of events does not matter. Events in a coregion can happen in any order. The coregion symbol replaces the lifeline instance.
6.10 - MSC reference
MSC reference allows to refer to another MSC. The resulting MSC is smaller and more legible.
A reference concerns the connected instances. An instance is connected if its lifeline disappears in the symbol. An instance is not connected if it goes over the reference symbol.Example:
6.11 - Text symbol
The text symbol contains data or variable declarations if needed in the MSC.
6.12 - Comment
As its name states...
6.13 - Action
An action symbol contains a set of instructions in C code. The syntax is the one of C language.Examples:
6.14 - High-level MSC (HMSC)
High level MSC diagram is a synthetic view of how MSCs relate to each other. It is only a few symbols: start, stop, alternative, parallel, state or condition, and MSC reference.
The SDL-RT HMSC starts with the start symbol and ends with the stop symbol. The parallel symbol means the following connected path will be executed in parallel. The Alternative symbol means one and only one of the connected path is executed. Whenever two paths meet again the path separator symbol is to be repeated. That means if a parallel symbol is used that creates two different paths, the parallel symbol should be used when the path merge back.
Symbols are connected with lines or arrows if clearer. A symbol is entered by its upper level edge and leaved by any other edge.Example: