Specification & Description - University of Oulu · 521265A Telecommunication Software Ch5 – SDL...

26
521265A Telecommunication Software Ch5 – SDL 521265A Telecommunication Software Ch5 – SDL V. SDL Dept. Electrical & Information Engineering, Computer Engineering Lab 5-1 Dr. Junzhao Sun Dept. Electrical & Information Engineering, Computer Engineering Lab 5-1 Dr. Junzhao Sun 521265A Telecommunication Software Ch5 – SDL 521265A Telecommunication Software Ch5 – SDL Specification & Description Language (SDL) - Part I Dept. Electrical & Information Engineering, Computer Engineering Lab 5-2 Dr. Junzhao Sun Dept. Electrical & Information Engineering, Computer Engineering Lab 5-2 Dr. Junzhao Sun 521265A Telecommunication Software Ch5 – SDL 521265A Telecommunication Software Ch5 – SDL Outline Introduction to SDL Purpose & Application K SDL f t Key SDL features SDL grammar SDL history Static SDL Components Description of the System Structure C t fS t Bl k dP Dept. Electrical & Information Engineering, Computer Engineering Lab 5-3 Dr. Junzhao Sun Dept. Electrical & Information Engineering, Computer Engineering Lab 5-3 Dr. Junzhao Sun Concepts of System, Block and Process Communication Paths: Channels, Signals 521265A Telecommunication Software Ch5 – SDL 521265A Telecommunication Software Ch5 – SDL Why SDL exists ? The purpose of SDL is to be a language for unambiguous specification and description of the structure , behaviour and data of telecommunications systems. The terms specification and description are used with the following meaning: a specification of a system is the description of its required behaviour a description of a system is the description of its actual behaviour that is its Dept. Electrical & Information Engineering, Computer Engineering Lab 5-4 Dr. Junzhao Sun Dept. Electrical & Information Engineering, Computer Engineering Lab 5-4 Dr. Junzhao Sun a description of a system is the description of its actual behaviour, that is its implementation

Transcript of Specification & Description - University of Oulu · 521265A Telecommunication Software Ch5 – SDL...

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

V. SDL

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-1 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-1 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Specification & DescriptionLanguage (SDL) - Part I

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-2 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-2 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Outline

Introduction to SDL Purpose & ApplicationK SDL f tKey SDL featuresSDL grammarSDL history

Static SDL ComponentsDescription of the System StructureC t f S t Bl k d P

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-3 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-3 Dr. Junzhao Sun

Concepts of System, Block and ProcessCommunication Paths: Channels, Signals

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Why SDL exists ?

The purpose of SDL is to be a language for unambiguousspecification and description of the structure, behaviour and datap p ,of telecommunications systems.

The terms specification and description are used with the following meaning:

a specification of a system is the description of its required behaviour a description of a system is the description of its actual behaviour that is its

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-4 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-4 Dr. Junzhao Sun

a description of a system is the description of its actual behaviour, that is its implementation

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Where SDL may be used ?

SDL may be used for producingSpecification and Design of diverse applications: aerospace, automotive control electronics medical systemscontrol, electronics, medical systems, Telecommunications Standards and Design for (examples):

Call & Connection Processing,Maintenance and fault treatment (for example alarms, automatic fault clearance, routine tests) in general telecommunications systems,Intelligent Network (IN) products,Mobile handsets and base stations,Satellite protocols

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-5 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-5 Dr. Junzhao Sun

Satellite protocols,

Increasingly used to generate product code directly with help of tools like ObjectGeode, Tau/SDT, Cinderella

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

System & Environment

The SDL specification defines how S t t t t i thSystems reacts to events in the Environment which are communicated by Signals sent to the SystemThe only form of communication of an SDL system to environment is via Signals

SDL System

signals

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-6 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-6 Dr. Junzhao Sun

via Signals

ENVIRONMENT

g

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Overview - Process

System Instancesignals

ProcessInstance

ProcessInstance

g

signals

signals

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-7 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-7 Dr. Junzhao Sun

A process is an agent that contains an extended finite state machine, and may contain other processes.A System is composed of a number of communicating process instances

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Overview - Process Diagramsprocess ATM

TIMER tCash := CashDelay, tCard := CardDelay;SYNONYM CashDelay Duration = 30.0, CardDelay Duration = 30.0;DCL accountNumber AccountNumber_T,cardPIN, userPIN PIN T,

w _PIN

PIN id(userPIN)

Code_OK

Withdraw al_rq(amount)cardPIN, userPIN PIN_T,

amount Natural;

EjectCard

Ready

CardInserted_id(accountNumber,

_ ( )

userPIN=cardPIN

TRUE

Writeln('Enter amount')

FALSE

Writeln('Wrong code')

(amount)

'amount OK'

'yes'

EjectCard

'no'

Writeln('Wrong amount')

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-8 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-8 Dr. Junzhao Sun

( ,cardPIN)

Writeln('Enter passw ord')

w _PIN

Code_OK EjectCard

Ready

TakeCash_rq(amount)

SET(tCash)

AmountOK

EjectCard

Ready

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Overview - Blocks

Block System (or another block)

Block

Large number of process without structure leads to loss of

ProcessInstance

ProcessInstance

signal routesBlock

channels

Block

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-9 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-9 Dr. Junzhao Sun

Large number of process without structure leads to loss of overviewBlocks are used to define a system structureSignal routes transfer signal immediately while channels may be delaying

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Key SDL Features (1 of 2)

StructureConcerned with the composition of blocks and process agents. SDL i t t d ith t k th t i t d t d tSDL is structured either to make the system easier to understand or to reflect the structure (required or as realised) of a system. Structure is a strongly related to interfaces.

BehaviorConcerns the sending and receiving of signals and the interpretation of transitions within agents. The dynamic interpretation of agents and signals communication is the

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-10 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-10 Dr. Junzhao Sun

The dynamic interpretation of agents and signals communication is the base of the semantics of SDL.

DataData used to store information.The data stored in signals and processes is used to make decisions within processes.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Key SDL Features (2 of 2)Interfaces

Concerned with signals and the communication paths for signals.Communication is asynchronous: when a signal is sent from one agentCommunication is asynchronous: when a signal is sent from one agent there may be a delay before it reaches its destination and the signal may be queued at the destination.Communication is constrained to the paths in the structure. The behaviour of the system is characterised by the communication on external interfaces.

Types

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-11 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-11 Dr. Junzhao Sun

Classes can be be used to define general cases of entities (such as agents, signals and data). Instances are based on the types, filling in parameters where they are used.A type can also inherit from another type of the same kind, add and (where permitted) change properties.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Representations

SDL has two representation formsSDL-GR - graphical representationSDL GR graphical representationSDL-PR - textual, phrase representation

SDL-PR is conceived as for easily processed by computers - common interchange format (CIF)SDL-GR is used as a human interface

SDL-GR has some textual elements which are identical to SDL-PR (this is to

SDL-GR SDL-PR

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-12 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-12 Dr. Junzhao Sun

which are identical to SDL PR (this is to allow specification of data and signals)

Z.106 recommendation defines CIF with purpose of preserving all graphical information

CommonSyntax

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL History (1)

1976 Orange Book SDL Basic graphical language

1980 Yellow Book SDL Process semantics defined

1984 Red Book SDLStructure, data added. Definition more rigorous.Start of tools. User guide.

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-13 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-13 Dr. Junzhao Sun

1988 Blue Book SDL (SDL-88)Effective tools. Syntax well defined - formal definition. Language much as 1984.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL History (2)

1992 White Book SDL-92Object SDL. Types for blocks, processes, services with inheritance and parameterisationparameterisation.Methodology guidelines.

1995 SDL with ASN.1 (Z.105) 1996 Addendum 1 to SDL-92

Language stable. Some relaxation of rules. SDL+ Methodology. T l ff SDL 92 f t

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-14 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-14 Dr. Junzhao Sun

Tools offer SDL-92 features.

1999 SDL-2000Object modeling support.Improved implementation support. Data model revised

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL ITU Recommendations

The ITU-T Specification and Description Language (SDL) is defined by the following ITU-T Recommendation publications

Z 100 (11/99) S ifi ti d d i ti l (SDL) i l diZ.100 (11/99) Specification and description language (SDL) including various annexes and appendicesZ.105 (11/99) SDL combined with ASN.1modules;Z.107 (11/99) SDL with embedded ASN.1;Z.109 (11/99) SDL combined with UML.

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-15 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-15 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Comment Exampleprocedure EjectCard

Writeln('Take your card')

TakeCard_rq

SET(tCard) This is a comment

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-16 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-16 Dr. Junzhao Sun

SET(tCard) This is a comment

CardEjected

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Static & Dynamic SDL

SDL has a static component, and a dynamic component.The Static component describes/specifies system structure

Functional decomposition to sub-entitiesHow they are connectedWhat signals they use to communicate

The Dynamic component describes/specifies system operation -behavior

SDL Transitions, Transitions Actions

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-17 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-17 Dr. Junzhao Sun

Communications Birth, Life and Death of Processes

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Static SDL

System is the highest level of abstractionA system can be composed of 1 or more y pblocksA block can be composed of processesand blocksProcesses are finite state machines, and define dynamic behavior

SystemBlock

Process

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-18 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-18 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Static SDL Terms

agent The term agent is used to denote a system, block or process that g y pcontains one or more extended finite state machines.

systemA system is the outermost agent that communicates with the environment.

blockA block is an agent that contains one or more concurrent blocks or

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-19 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-19 Dr. Junzhao Sun

processes and may also contain an extended finite state machine that owns and handles data within the block

processA process is an agent that contains an extended finite state machine, and may contain other processes.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

System, Block, and Process

SystemCollection of concurrently-running blocksBl k i t th h li it h lBlocks communicate through explicit channelsRepresents distributed, communicating computers

BlockCollection of concurrently-running processes or collection of blocksBlocks communicate through explicit channelsRepresents a single processor

P

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-20 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-20 Dr. Junzhao Sun

ProcessExtended finite-state machineCommunicate between each other and with environment using signalsProcesses have explicit and variable defined implicit state

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

System Decomposition

When dealing with large and complex systems it is best to decompose down to the manageable size functional components: BLOCKs (“Divide and Rule”)BLOCKs (“Divide and Rule”)

Follow natural subdivisions: BLOCKs may correspond to actual software/hardware modules

Minimise interfaces between BLOCKs in terms of the number and

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-21 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-21 Dr. Junzhao Sun

volume of signals being exchanged

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Structuring of the System Description

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-22 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-22 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Decomposition Rules:No Limit in number of Block levels

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-23 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-23 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Decomposition Rules: Blocks and Process cannot share a level

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-24 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-24 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Communications

Processes, blocks, and systems communicate through signalsconveyed through channels

Signal is a message corresponding to an event, e.g.,RingHangUpDial

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-25 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-25 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Communication Related SDL Terms

signal: The primary means of communication is by signals that are output by the sending agent and input by the receiving agent.

stimulus: A stimulus is an event that can cause an agent that is in a state to enter a transition.

h l

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-26 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-26 Dr. Junzhao Sun

channel: A channel is a communication path between agents.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Text Symbol

Text Symbol is used to group various textual declarationsIt can be located on any type of diagram

Concrete graphical grammar

<text symbol> ::=

package defs

/* Signals betw een users * (internal) */SIGNAL connReq, connFree, connBusy, connEstablish, connEnd;

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-27 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-27 Dr. Junzhao Sun

/* Signals from a user (ENV) */SIGNAL of fHook, onHook, num (num_t);

Text Box Example

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

System Diagram

Topmost level of abstraction - system levelHas a name specified by SYSTEM keywordComposed of a number of BLOCKsBLOCKs communicate via CHANNELsTextual Descriptions/Definitions

Signal DescriptionsChannel DescriptionsData Type Descriptions

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-28 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-28 Dr. Junzhao Sun

Data Type DescriptionsBlock Descriptions

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Example System Diagram

SYSTEM s

Signal Descriptionsin text symbol

SIGNAL S1, S2, S3,S4,S5 ;

B1

B1

C1 [S1,S2]

C4 [S5]

C2 [S3]

C3 [S4]

Signal Lists

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-29 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-29 Dr. Junzhao Sun

BlocksChannelsFrame symbol -boundary betweensystem and environment

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Signal

Pure signals have no valueRingHHangup

Valued signals also convey datadial(digit)SDL’s type system for values fairly complex

Signals may include the address of the process that sent themThis is useful for distinguishing among multiple instances of a single

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-30 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-30 Dr. Junzhao Sun

processEach process may correspond to, say, a different call in progress, Which call just hung up?

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Signals

Signals are the actual messages sent between entitiesSignals must be defined before they can be used:<signal specification> ::= signal <signal name> [(<sort name>{,<sort

name>}*)] {, <signal name> [(<sort name>{,<sort name>}*)]}*;

Example:

SIGNAL

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-31 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-31 Dr. Junzhao Sun

SIGNALdoc (CHARSTRING), conf,ind (MsgTyp), req (MsgTyp);

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Signals with parameters

Signals can have parameters known as a sortlistThe signal specification identifies the name of the signal type and the sorts of the parameters to be carried by the signal

Example: signal Status(Boolean);

When signals are specified to be carried on certain channels, only signal names are requiredWhen signals are actually generated in the process, the actual parameters must be given

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-32 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-32 Dr. Junzhao Sun

Example:

Status(True)

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Signal Lists

A signal lists may be used as shorthand for a list of signal identifiers

system localExchange

/* Signals from a user (ENV) */SIGNAL offHook, onHook, num (num_t);

SIGNALLIST userSigs = offHook, onHook, num;

/* Signals to a user (ENV) */SIGNAL (t )

Example:

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-33 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-33 Dr. Junzhao Sun

SIGNAL dialTone, ringTone, busyTone, shortBusyTone, connectTone, msg (CharString);

SIGNALLIST tones = dialTone, ringTone, busyTone, shortBusyTone, connectTone;

userCh

(tones),msg(userSigs)

localExchange

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Channel

Signals travel between blocks and processes through channels

Channel: point-to-point connection that defines which signals may travel along it

A signal may traverse many channels before reaching its destination

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-34 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-34 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Channel

CHANNEL is connected between Blocks or Block and the Environment.

C1 [S1,S2]U i di ti l d l i

May be uni- or bi-directionalIt may have an identifier (C1) and may have list of all signals it cariesIt is an FIFO queue which may introduce an variable delay

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-35 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-35 Dr. Junzhao Sun

[ , ]

C2[S1,S2] [S3,S4]

Uni-directional delayingChannel

Bi-directional delayingChannel

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Non-Delaying Channels

Non delaying channels do not introduce any delay in transmission of signals

C1 [S1,S2]

C2[S1,S2] [S3,S4]

Uni-directional non-delayingChannel

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-36 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-36 Dr. Junzhao Sun

[ , ] [ , ]Bi-directional non-delayingChannel

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Block Diagram

Has a name specified by BLOCK keywordContains a number of ProcessesMay also possibly contain other BLOCKs (but not mixed with Processes)Processes communicate via Signal Routes, which connect to other Processes or to Channels external to the BlockTextual Descriptions/Definitions

Signal Descriptions for signals local to the BLOCK

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-37 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-37 Dr. Junzhao Sun

Signal Descriptions for signals local to the BLOCKSignal Route DescriptionsData Type DescriptionsProcess Descriptions

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Example Block Diagram

Signal Routes

Process

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-38 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-38 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Signal Route

SIGNALROUTE: provide a signal path between processessimilar to CHANNELs except there is no delay involved

Can be bi-directional or unidirectionalContains a signal list, constraining what signals can sent through it.In SDL2000 Signal-Route concept is obsolete. Signal Routes are replaced by non-delaying Channels

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-39 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-39 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

PROCESS

PROCESS specifies dynamic behaviourProcess represents a communicating extended finite state machine.

h h f i t SIGNALeach have a queue for input SIGNALsmay output SIGNALsmay be created with Formal PARameters and valid input SIGNALSETit reacts to stimuli, represented in SDL by signal inputs.stimulus normally triggers a series of actions such as data handling, signal sending, etc. A sequence of actions is described in a transition.

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-40 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-40 Dr. Junzhao Sun

PROCESS diagram is a Finite State Machine (FSM) description

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Process

Each process has own memory block and unique addressAdditionally each one has unlimited FIFO buffer, which stores input signalsEach process is either waiting or performing state transitionTransition is started by signal read from FIFO bufferDuring the transition variables can be updated and signal can be sentProcesses can be defined as blocks

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-41 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-41 Dr. Junzhao Sun

Processes can be defined as blocksSystem can consist of layered blocks, but on the lowest level behavior is always described with processesBlocks communicate with channels that consist of signal routes between processes, which in turn contain signals

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Example Process DiagramPAGE 2(3)

PROCESS TYPE Gamefpar play PId odd

T1 Probe

Set(Now +1ms,T1)

Win to player

count := count +1

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-42 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-42 Dr. Junzhao Sun

even

count := count +1

odd

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Process States

At a particular state,

A signal is removed from the queueIf a transition defined for the signal in current state,

Run the transitionTransmit signalsUpdate internal variablesChoose a next state

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-43 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-43 Dr. Junzhao Sun

If no transition defined for the signal in current state,Discard the signalLeave the state unchanged

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Packages & Libraries

Since SDL 92 reusable components may be defined as types and placed into libraries called packagesThis allow the common type specifications to be used in more then a single systemPackage is defined specifying the package clause followed by the <package name>A system specification imports an external type specification defined in a package with the use clause.

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-44 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-44 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Package Example

package defs

/* Signals from a user (ENV) */

system localExchange

USE defs;

userCh

(tones),msg(userSigs)

localExchange

SIGNAL offHook, onHook, num (num_t);

SIGNALLIST userSigs = offHook, onHook, num;

/* Signals to a user (ENV) */SIGNAL dialTone, ringTone, busyTone, shortBusyTone, connectTone,

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-45 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-45 Dr. Junzhao Sun

msg (CharString);

SIGNALLIST tones = dialTone, ringTone, busyTone, shortBusyTone, connectTone;

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Definition, Type & Instance

Definitions introduce named entities, which are either types or instances with with some context

parameters bound is

implied types. A definition of a typedefines all properties associated with that type.A type may be instantiated in any number of instances. An instance of a particular type has all the properties defined for that type.

f

typeinstantiates as

specializes as

parameterizedtype

with all context parametersbound isparameterizes

as

specifies

specifies

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-46 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-46 Dr. Junzhao Sun

An instance is defined either directly or by the instantiation of a type. An example of an instance is a system instance, which can be defined by a system definition, or is an instantiation of a system type.

Implied type

definition instance

p

definition

specifies

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL Entity Visibility Rules

Entities are Packages, agents (system, blocks, processes), agent types, channels, signals timers interfaces data types variables sorts signal lists;signals, timers, interfaces, data types, variables, sorts, signal lists;

Possible Scope Units areAgent diagrams (System, Block, Process), Data Type Definitions, Package diagrams, task areas, interface definitions ...

The Entity is visible in the scope unit ifis defined in a scope unitthe scope unit is specialisation and the entity is visible in base type

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-47 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-47 Dr. Junzhao Sun

the scope unit is specialisation and the entity is visible in base typethe scope unit has a “package use clause” of a package where entity is definedthe scope unit contains an <interface definition> where entity is definedthe entity is visible in the scope unit that defines that scope unit

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Additional Structural Concepts in SDL

A tree diagram can be constructed to illustrate the hierarchy of the entire SYSTEM .Macros can be used to repeat a definition or a structure. They are defined using the MACRODEFINITION syntax .Paramaterised types exist using the generator constructGates

A gate represents a connection point for communication with an agent type, and when the type is instantiated it determines the connection of the agent i t ith th i t

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-48 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-48 Dr. Junzhao Sun

instance with other instances

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

ATM Example - System Diagram

system ATM

use bank_lib; /* This model corresponds to an AutomatedTeller Machine (ATM). Banking transactionsare performed by means of cash cardare performed by means of cash card.This ATM allow s cash w ithdraw al only.Withdraw als must be authorized by theconsortium, and in case of success, mustbe reported to the consortium. */

Consortium ce_ui Customer

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-49 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-49 Dr. Junzhao Sun

r_accept,go_ATM,

stop_ATM

q_accept,wdrok

display_wait,print,cash,eject,

go_ATM,stop_ATM

card,entry,cashtaken,quit

card,entry,cashtaken,quit

Central UI

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

ATM Example - Central Block Diagramblock Central

go ATM card

Consortium

ce_ui

co_spv

go_ATM,stop_ATM

q_accept,wdrok

spv_tr

tr_end

stop_tr

spv_ui

card

go_ATM,stop_ATM

tr_ui

display_wait,print, cash,

eject

Supervisor(1,1)

Tr (0,1):Transaction

spv

ui

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-50 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-50 Dr. Junzhao Sun

co_tr r_accept

_entry,cashtaken,quit

Transaction

cns

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

ATM Example - UI Block Diagramblock UI

ce_ui Customerce_ui0

display_wait,print

card,entry

cu_ui

card,entry,

Eco_UI

UI (1,1):Eco_UIcent cust

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-51 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-51 Dr. Junzhao Sun

print,cash,eject,

go_ATM,stop_ATM

entry,cashtaken,quit

ycashtaken,quit

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

ATM Example - Hierarchy Diagram

ATM

Pr Declaration Pr Declaration Central

Supervisor Tr

UI

Eco_UI UI

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-52 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-52 Dr. Junzhao Sun

Pr Declaration

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

ATM Example - Package Bank_libpackage bank_lib

/* This SDL components librarycontains SDL block and processtypes w hich are useful todevelop banking systems. */

/* Types used by the Transaction Process */newtype CashCardstruct id Integer; expirDate Integer; pssw d Charstring;operators

checkCard: CashCard > Boolean;

/* This package contains:- ASN.1 declarations (QuestConso, RespConso)mixed into SDL declarations- Process types (Transaction, Basic_ATM_UI)- Virtual transitions (in Transaction)- Axioms (New type CashCard)*/ checkCard: CashCard -> Boolean;

checkPssw d: CashCard, Charstring -> Boolean;operator checkCard; fpar cc CashCard; returns res Boolean; start; task res := (cc!expirDate > 9701) and (cc!id /= 0); return;endoperator;operator checkPssw d; fpar cc CashCard, cpw Charstring; returns res Boolean; start; task res := (cc!pssw d = cpw ); return;endoperator;endnewtype ;

QuestConso::= sequence {

/* This implements asimplif ied bankingtransaction. */

/* Signals received by theTransaction Process Type */signalentry (Charstring),cashtaken,quit,r_accept (RespConso),stop_tr;

/* Signals sent by theTransaction Process Type */signaldisplay_w ait (Charstring),print (Charstring),cash (Charstring),eject,tr_end,q accept (QuestConso)

/

Transaction

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-53 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-53 Dr. Junzhao Sun

q { cardData CashCard, amount Charstring};

RespConso ::= sequence { cardData CashCard, accept Boolean, amount Charstring optional};

q_accept (QuestConso),w drok (CashCard, Charstring);

/* Additional signals forBasic_ATM_UI */signalcard (CashCard),go_ATM,stop_ATM;

/* This implements abasic terminalinteracting w ith thecustomer. */Basic_ATM_UI

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Static SDL - Summary

Structure of the system is hierarchically defined using System, Block and Process diagrams connected via channels (signal routes)routes)Channels carry Signals which convey information (stimulus) between agents (Environment, System, Blocks, Processes)The ultimate goal of the SDL is to specify overall behavior of the system - but this is not done on the system levelThe system is defined by behavior of its constituent

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-54 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-54 Dr. Junzhao Sun

blocks/processes

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Specification & DescriptionLanguage (SDL) - Part II

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-55 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-55 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Outline

Dynamic SDL ComponentS I O P T k D i i P dState, Input, Output, Process, Task, Decision, Procedure …Data in SDLInheritanceBlock and Process Sets

Examples

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-56 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-56 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Dynamic Behavior

A PROCESS exists in a state, waiting for an input (event).When an input occurs, the logic beneath the current state, and the current input executes. Any tasks in the path are executed.Any outputs listed are sent.The state machine will end up in either a new state, or return to the same state.The process then waits for next input (event)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-57 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-57 Dr. Junzhao Sun

The process then waits for next input (event)

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Implementing Input Queues

Each process has a single input queue from which it consumes signals

Signals waiting to be consumed

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-58 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-58 Dr. Junzhao Sun

Process

co su ed

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Communication between process instances

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-59 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-59 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

process calling 1/5

wait_for_connection

connectTone onHook T1

Process Diagram Example

reset (T1)

connectToneVIA uG

connected

reset (T1)

connEndTO

otherPid

busyToneVIA uG

connEnd TOotherPid

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-60 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-60 Dr. Junzhao Sun

Connected

idleset ( NOW

+ T_10sec, T2)

wait_for_onHook

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Process Diagram Components

STATEs: point in PROCESS where input queue is state_a

being monitored for arrived SIGNALs subsequent state transition may or may not have a NEXTSTATE

INPUT: indicates that the subsequent state transition should be executed if the SIGNAL matching the INPUT arrives sig_a

state_a

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-61 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-61 Dr. Junzhao Sun

INPUTs may specify SIGNALs and values within those SIGNALsInputs can also specify timer expiry

OUTPUT: specifies the sending of a SIGNAL to another PROCESS

sig_c

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

One Very Simple FSM (VS-FSM)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-62 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-62 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

VS-FSM Process Diagram

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-63 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-63 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Some Additional Process Diagram Components

TASK: description of operations on variables or do_something p pspecial operations

The text within the TASK body can contain assign statements.

DECISION: tests a condition to determine subsequent PROCESS flow

make_decision

yes no

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-64 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-64 Dr. Junzhao Sun

JOIN: equivalent to GOTO. A

A

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

process calling 2/5

wait_for_num

T1 num(toNum) onHook

Process Diagram Example

busyToneVIA uG

wait_for_onHook

reset (T1)

getUserPid (toNum, otherPid)

otherPid = NULL

True False

reset (T1)

A1

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-65 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-65 Dr. Junzhao Sun

msg ('Sorry,wrong number')

wait_for_onHook

wait_for_connRepl

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

More Process Diagram Components ...

SAVE: specifies that the consumption of a SIGNAL be delayed until subsequent SIGNALs have been

dsig c consumed the effect is that the SAVEd SIGNAL is not consumed until the next STATEno transition follows a SAVEthe SAVEd SIGNAL is put at the end of the queue and is processed after other SIGNALs arrive

START: used to describe behaviour on creation as well

sig_c

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-66 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-66 Dr. Junzhao Sun

START: used to describe behaviour on creation as well as indicating initial state

Similar shape to state only with semi-circular sides

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Implementing the Save Operator

Signals at the beginning of the queue in the current state’s save set are ignored

Idle

Process C

A

C

Idle

C A B

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-67 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-67 Dr. Junzhao Sun

A

A

BSignals in the state’s save set

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Procedure

PROCEDURE: similar to a subroutine allow reuse of SDL code sections

d i f SDL d i tireduce size of SDL descriptionscan pass parameters by value (IN) or by reference (IN/OUT)

sigA

ProcB(SENDER)

PROCEDURE ProcBfpar player PId;

Gameid to player

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-68 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-68 Dr. Junzhao Sun

stateC

(SENDER)

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Priority & Internal Inputs

Priority inputs are inputs that are given priority in a y p p g p ystateIf several signals exist in the input queue for a given state, the signals defined as priority are consumed before others (in order of their arrival)

sig_a

Internal Input/Outputs signals are used for signalssig a

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-69 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-69 Dr. Junzhao Sun

Internal Input/Outputs signals are used for signals sent/received within a same FSM or SW componentThere is no formal definition when they should be used.

sig_a

sig_c

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Shorthands - All Other Input/Save

The input with an asterisk covers all possible

The Save with an asterisk covers all possible signals which are not explicitly defined for this

*The input with an asterisk covers all possible input signals which are not explicitly defined for this state in other input or save constructs

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-70 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-70 Dr. Junzhao Sun

signals which are not explicitly defined for this state in other input or save constructs*

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Shorthands - Same State

When next state is same as current process star_dash_combination

* state the “dash” symbol may be used instead of state name.This is particularly useful in combination with * (any state)

*

SendAlarm

Alarm

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-71 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-71 Dr. Junzhao Sun

-

-

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Shorthands Example

process Star_Input

Idle

Input1 *

Online

Input2 *

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-72 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-72 Dr. Junzhao Sun

Online - Idle -

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

SDL diagrams can contain variablesVariables are declared using the DCL statement

Specification of Data in SDL

Variables are declared using the DCL statement in a text box.Variables can set in a task box and read in decisionsA data type is called a sort in SDL

d l 1 2 I

DCL numthings INTEGER;

StateA

SigA

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-73 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-73 Dr. Junzhao Sun

dcl x1, x2 Integer;dcl st Boolean := true;dcl cases Array;

numthings = numthings +1;

numthings > 7

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Predefined Sorts (types) in SDL

INTEGER signed integer NATURAL positive integer REAL real, float CHARACTER 1 character CHARSTRING string of characters BOOLEAN True or False TIME absolute time, date (syntype of REAL) DURATION TIME i TIME ( t f REAL)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-74 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-74 Dr. Junzhao Sun

DURATION a TIME minus a TIME (syntype of REAL) PID to identify a process instance

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Operators on Predefined Sorts

Operations = and /= are defined for all sorts

INTEGER -, +, *, /, >, <, >=, <=, Float, Mod (modulo), Rem (remainder)

REAL -, +, *, /, >, <, >=, <=, Fix NATURAL Like INTEGER CHARACTER >,<,>=,<=, Chr, Num CHARSTRING Mkstring Length First Last // Substring

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-75 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-75 Dr. Junzhao Sun

CHARSTRING Mkstring, Length, First, Last , //, Substring, Extract!, Modify!

BOOLEAN True, False, NOT, AND, OR, XOR, => (logical implication)

PID Self, Sender, Offspring, Parent

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Structural Sorts (1/2)

Structuresnewtype OwnStructure struct

fi ld1 I tfield1 Integer;field2 Charstring;

endnewtype OwnStructure;x = (. 7, ’Examplevalue’ .) x!field1

Arraynewtype Table

Array(Character Charstring)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-76 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-76 Dr. Junzhao Sun

Array(Character, Charstring)endnewtype Table;

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Structural Sorts (2/2)

Setnewtype Set

P t(I t )Powerset(Integer)adding operators

take : Set -> Integer;endnewtype Set;

incl, in, delEnum

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-77 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-77 Dr. Junzhao Sun

newtype PaivanHerkkuliterals geisha, marabou, sininen, brejk;operators ordering; valinta: PaivanHerkku -> Integer;

endnewtype PaivanHerkku;

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Other Sorts

Renamed sortssyntype Thousand = Int constants 0:1000;

d t Th dendsyntype Thousand;

Renaming always creates new sort that cannot be used instead of old oneSynonyms (constants)

synonym pi real = 3.14159;

Synonyms are used e.g. to define length of timer

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-78 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-78 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Data in SDL

REVEAL/VIEW variables: share a variable’s value between PROCESSes

i bl ’ l i t d t b th th ’ lvariable’s value is guaranteed to be the same as the owner’s value

EXPORT/IMPORT: share a copy of a variable’s value between PROCESSes

variable’s value is not guaranteed to be the same as the owner’s value. Owner has to explicitly export the variable when it wants a value to be updated

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-79 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-79 Dr. Junzhao Sun

updated

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Creating new Data Types

New data types can be defined in SDL.An example data definition is shown belowAn example data definition is shown below

newtype even literals 0; operators

plusee: even, even -> even; plusoo: odd, odd -> even;

axioms l ( 0)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-80 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-80 Dr. Junzhao Sun

plusee(a,0) == a; plusee(a,b) == plusee(b,a); plusoo(a,b) == plusoo(b,a);

endnewtype even; /* even "numbers" with plus–depends on odd */

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

New Data types can inherit from other data types in SDLnewtype bit inherits Boolean

literals 1 = True, 0 = False;

Data Types and Inheritance

True, False are renamed operators ("not", "and", "or") adding operators

Exor: bit,bit -> bit; axioms

Exor(a,b) == (a and (not b)) or ((not a) and b)); endnewtype bit;

to 1 & 0

Operators that are perserved

From this point new items are defined

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-81 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-81 Dr. Junzhao Sun

Most SDL protocol specifications used ASN.1 to describe data.Z.105 describes how SDL and ASN.1 can be used together.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Specification of Timers in SDL

Timer is an object capable of generating an input signal and placing this signal to the input Timer T7;SET(NOW p g p g g pqueue of the process. Signal is generated on the expiry of pre-set time.SET(NOW+20ms,T7): sets a T7 timeout in 20ms time.RESET(T7): cancels the specified timeout.

Timer T7;SET(NOW+20ms,T7)

T7 SigA

WaitForTimer

RESET(T7)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-82 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-82 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

IdleTimer T;

Timer must be declared like a variable

TChoice

set (now+10, T) ‘Where’s my money?’

When timer expires, it sends a signal to the process

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-83 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-83 Dr. Junzhao Sun

IdleTimer is set to go off at a particular time

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Implementing Timers

In effect, a timer creates a process that feeds a “timeout” signal to the process

Ti

Timeout

Remove

Consumed

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-84 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-84 Dr. Junzhao Sun

Process

TimerProcess

Set,Reset

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Dynamic ProcessesProcesses can be created and destroyed in SDLEach process has a unique process id. The self expression returns the process id of the current p pprocess.Processes are created within a SDL process using the CREATE symbol. The Create body contains the type of the process to createThe offspring symbol returns the process id of the last process created by the process

ProcessA

offspring> 0

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-85 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-85 Dr. Junzhao Sun

last process created by the process.The PROCESS that is created must be in the same block as the process that creates it.The Stop symbol is used within the SDL PROCESS to signify that the process stops.

yes no

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Dynamic Processes

Dynamically created processes become part of an instance set.The instance set in the block diagram contains two variables, the number initial process instances and the maximum number of instances.

CallHandler(0,63)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-86 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-86 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Process Sets

The following Describes a set of Identical ProcessesInitially there are no members of the setCan be up to 7 members in the set

BLOCK ExampleProcessSet

bidders (0, 7)S1[***,***,****]C1

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-87 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-87 Dr. Junzhao Sun

S2[***,***,****]

C2 Bidder

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Block Sets

The following Describes a set of Identical BlocksInitially there is one member of the setThere is no limit to the number of members in the set

SYSTEM ExampleBlockSet

bidders (1,)C1[***,***,****]

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-88 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-88 Dr. Junzhao Sun

C2[***,***,****]

Bidder

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Formal Parameters

Dynamic processes can have data passed into them at creation time using Formal ParametersSimilar to C++ constructor

PROCESS TYPE Proc1fpar player PId;numtries Integer

Gameid to playerProc1

(offspring,3)

sig1PROCESS Proc2

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-89 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-89 Dr. Junzhao Sun

IdleIdle

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Addressing SignalsThe destination of an output can be defined in a number of ways:Implicit when only one destination is possibleImplicit when only one destination is possibleAn explicit destination can be named using the keyword to X, where X is of type Pid.

SELF, giving the address of the process itself SENDER, giving the address of the process from which the last consumed signal has been sent; OFFSPRING giving the address of the process that has been most

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-90 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-90 Dr. Junzhao Sun

OFFSPRING, giving the address of the process that has been most recently created by the process; and PARENT, giving the address of the creating process.

sig_csig_cto X

Implicit Addressing Explicit Addressing

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Addressing Signals

The term “via” can be used followed by a signal route or channel This means it can be sent to all processsig c or channel. This means it can be sent to all process attached to a particular channel or signal route(multicasting).

Or it can be sent everywhere it possibly can using the “via all” qualifier (broadcasting).

sig_cvia G3

sig_cvia all

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-91 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-91 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Daemon Game Example

The Z.100 standard partially defines an example of SDL in the form of a game called DaemonGame. A modified version is described here. The game consists of a quickly oscillating state machine, oscillating between odd and even.At random intervals the player queries the state machine. If the machine is in the odd state the player winsIf the machine is in the even state the player looses

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-92 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-92 Dr. Junzhao Sun

If the machine is in the even state the player looses.

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

System Diagram

SYSTEM Daemongame

SIGNAL

NewGame, Gameid,

NewGame,Probe,Result,Endgame,Gameid,Win,Lose,Score(Integer); Gameserver.in Gameserver.out

Game

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-93 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-93 Dr. Junzhao Sun

Probe,Result,Endgame

Win,Lose,Score

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Block Diagram

BLOCK Game

game (0, 7)Game

Monitor

R4[Gameover]

[NewGame] Probe,R3 Gameid

signalGameover(Pid);

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-94 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-94 Dr. Junzhao Sun

[NewGame]

R1

Result,Endgame

R2

R3 Gameid,Win,Lose,Score

Gameserver.in Gameserver.out

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

PAGE 1( 3)PROCESS TYPE Gamefpar play PId

dcl count Integer := 0;/* counter to keep track of score */Timer T1;

Gameid to player

Set(Now +1ms T1)

T1

Set(Now

Probe

even

+1ms,T1)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-95 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-95 Dr. Junzhao Sun

Set(Now +1ms,T1)

odd

Lose to player

count := count -1

even

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

PAGE 2(3)PROCESS TYPE Gamefpar play PId odd

T1 Probe

Set(Now +1ms,T1)

Win to player

count := count +1

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-96 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-96 Dr. Junzhao Sun

even

count := count +1

odd

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

PAGE 3(3)PROCESS TYPE Gamefpar play PId

*

Result Endgame

Score(count)to player Gameover

(player)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-97 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-97 Dr. Junzhao Sun

-

(p aye )

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Transition Table

State Input Task Output NextState

even T1 Set(Now+1ms T1) oddeven T1 Set(Now+1ms T1) odd

even Probe count := count -1 Lose to player even

odd T1 Set(Now +1ms T1) even

odd Probe STOP Win to player odd

odd Result Score(count) to player odd

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-98 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-98 Dr. Junzhao Sun

odd Endgame Gameover(player) STOP

even Result Score(count) to player even

even Endgame Gameover(player) STOP

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Notes on Example

SDL is case insensitiveOne Block Diagram for each Block in System DiagramOne Process Diagram for each Process in Block DiagramOnly Signals listed on SignalRoute used in Process Diagram* State used to represent any state- NextState means return to the previous state (i.e. no state change)

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-99 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-99 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

Notes on Example

To transition out of state requires inputProcess Diagrams are of type PROCESS TYPE rather than PROCESS because they are part of a Process SetGameover message always sent to Monitor so no need for explicit destination addressLose, Score, Win GameId require explicit destination addressGameId passed in as a formal parameter, like a C++ constructor.

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-100 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-100 Dr. Junzhao Sun

521265A Telecommunication Software Ch5 – SDL521265A Telecommunication Software Ch5 – SDL

References

Oleg Chistokhvalov, http://www.it.lut.fi/kurssit/05-06/Ti5315800/Slides/Lecture_7/lecture7.html

Dept. Electrical & Information Engineering, Computer Engineering Lab 5-101 Dr. Junzhao SunDept. Electrical & Information Engineering, Computer Engineering Lab 5-101 Dr. Junzhao Sun