In this exercise, we inspect the text SDL file produced by the KLOCwork MSC to SDL Synthesizer.
system SynthesizedModel;
signal ANSWER;
signal QUESTION;
block SynthesizedModel_block;
signalroute R1
from S to A with ANSWER;
from A to S with QUESTION;
process S referenced;
process A referenced;
endblock SynthesizedModel_block;
endsystem SynthesizedModel;
process S;
signalset QUESTION;
start;
nextstate START_1;
state START_1;
input QUESTION;
output ANSWER via R1;
nextstate START_1;
save *;
endprocess;
process A;
signalset ANSWER;
start;
join START_1;
state ASK_0;
input ANSWER;
join START_1;
save *;
connection START_1:
output QUESTION via R1;
nextstate ASK_0;
endprocess;
The synthesized SDL file is fully SDL-compliant. It contains a complete definition of the structure, behavior and data definitions required for the executable state machine specification corresponding to our example.
The corresponding graphical representations of the SDL model are shown and explained below.
Structure of the SDL specification
The structural part of the SDL specification consists of a hierarchy of a block and processes as well as some communication infrastructure. The synthesized SDL model contains the system SynthesizedModel that contains a block SynthesizedModel_block and some signal definitions. In our example, we have two signals: question and answer – named after the messages in MSC Ask.
The block SynthesizedModel_block contains processes A and S that correspond to the instances in MSC Ask. The block also describes a signal route between these processes. It conveys signal question from process A to process S and signal answer in the reverse direction.
Behavior of the SDL specification
The behavioral part of the SDL specification contains state machine descriptions for processes A and S.
The state machine for the process S contains a single state start_1. The start transition of S enters this state. Process S waits in state start_1 for an input signal question. When the signal question arrives, the process outputs the signal answer to process A and returns to the same state to wait for the next instance of the question signal.
The state machine for process A contains a single state ask_0 and a labeled transition start_1. The start transition is a join to the labeled transition start_1 where the process outputs the signal question to the process S and then waits for the signal answer in the state ask_0. When the signal answer arrives, process A repeats all its actions by joining into transition start_1.
All states contain the save * construct that allows processes to save all signals except those that are handled in this state.
The behavior of both processes corresponds to the behavior of the instances described in the input scenario model.