UML Temps Réel
François Terrier, Sébastien Gérard
LETI (CEA - Technologies Avancées) DEIN CEA/Saclay F-91191 Gif sur Yvette Cedex France Phone: +33 1 69 08 62 59 ; Fax: +33 1 69 08 83 95 Francois.Terrier@cea.fr ; Sebastien.Gerard@cea.fr
UML Temps Rel Franois Terrier, Sbastien Grard LETI (CEA - - - PowerPoint PPT Presentation
UML Temps Rel Franois Terrier, Sbastien Grard LETI (CEA - Technologies Avances) DEIN CEA/Saclay F-91191 Gif sur Yvette Cedex France Phone: +33 1 69 08 62 59 ; Fax: +33 1 69 08 83 95 Francois.Terrier@cea.fr ; Sebastien.Gerard@cea.fr
LETI (CEA - Technologies Avancées) DEIN CEA/Saclay F-91191 Gif sur Yvette Cedex France Phone: +33 1 69 08 62 59 ; Fax: +33 1 69 08 83 95 Francois.Terrier@cea.fr ; Sebastien.Gerard@cea.fr
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
2 2 2 2
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
3 3 3 3
… Demand for software far exceeds the Nation's ability to produce it.
… The Nation depends on fragile software. … Technologies to build reliable and secure software are inadequate. … The diversity and sophistication of software systems are growing rapidly. … common activities of ordinary people are based on software. … The Nation is under-investing in fundamental software research.
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
4 4 4 4
$ Flexibility : each person will have a different car…
% Hardware cost & Integration cost
( Safety / security $ Independency between soft / hard
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
5 5 5 5
ECM BVA SUSP ABS/CDS BSI
Capteurs Capteurs
Passerelle ) Part du logiciel en &&& « très bon rapport en valeur ajoutée… » $ Problématique technique de système complexe
! 60 processeurs sur les modèles haut de gamme !
) L’électronique : 25% du coût d’une voiture d’ici 2005…
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
6 6 6 6
) high level modeling and component based development
) Idea integration of complementary/concurrent modeling notations proposed for OO methods
OOSE
(Jacobson et al.)
UML 0.9 UML 0.9
1996
etc. ROOM Catalysis
OMG OMG
UML 1.1 UML 1.1
UML 1.3 UML 1.3 UML 1.4 UML 1.4 UML 2.0 UML 2.0
Jun June e 1999 1999 End of End of 2000 2000 … … ROOM Classe-Relation Fusion HOOD etc... OMT Booch OOSE
End of 1990
OMT
(Rumbaugh et al.)
Booch
Unified Method Unified Method
0.8
1995
Rational Rational
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
7 7 7 7
! More or less advanced levels of integration of real time and object paradigms
control and command, production automaton, distributed systems, safety critical systems, telecom, high performance computing…
) Low level of automatic integration of the « good practices »
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
8 8 8 8
* ARTiSAN
ARTiSAN ARTiSAN ARTiSAN / Real Time Studio / Real Time Studio / Real Time Studio / Real Time Studio
* RT
RT RT RT-
UML / Rhapsody tool UML / Rhapsody tool UML / Rhapsody tool
* UML/SDL tools association
UML/SDL tools association UML/SDL tools association UML/SDL tools association
* UML
UML UML UML-
RT / ROSE RT / ROSE RT / ROSE-
RT RT RT tool tool tool tool
* The ACCORD/UML approach
The ACCORD/UML approach The ACCORD/UML approach The ACCORD/UML approach
* ARTiSAN
ARTiSAN ARTiSAN ARTiSAN / Real Time Studio / Real Time Studio / Real Time Studio / Real Time Studio
* RT
RT RT RT-
UML / Rhapsody tool UML / Rhapsody tool UML / Rhapsody tool
* UML/SDL tools association
UML/SDL tools association UML/SDL tools association UML/SDL tools association
* UML
UML UML UML-
RT / ROSE RT / ROSE RT / ROSE-
RT RT RT tool tool tool tool
* The ACCORD/UML approach
The ACCORD/UML approach The ACCORD/UML approach The ACCORD/UML approach
Menu
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
9 9 9 9
) Requirement Requirement Requirement Requirement modeling modeling modeling modeling
) Static Static Static Static structure structure structure structure
) Interaction Interaction Interaction Interaction
) Behavior Behavior Behavior Behavior view view view view
) Structure of Structure of Structure of Structure of material material material material implantation implantation implantation implantation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
10 10 10 10
Speed Regulator
use case
regulate speed start regulating stop regulating
« include »
actor
Regulator On/Off Motor SpeedSensor
environment system system border relation
RegulatorDisplay
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
11 11 11 11
« Interface » RegulatorDisplay
interface class
Regulator_S Regulator_S Regulator_S
tgSpeed: integer; maintanSpeed();
0..1 display
RegulatorDisplay
class
regLaw 0..*
RegulatingLaw Regulator
role arity association
Speed
sp 0..*
generalization
RegDisplay_I
composition compartment attributes compartment
implementing of interface
« Interface » RegulatorDisplay RegulatingLaw sp: Speed 0..1 Regulator
Active objects active objects
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
Memory space
anActiveObject
Messages
Attributes
code Messages ?
connection between messages connection between messages connection between messages processing and use of the processing resource are not defined processing and use of the processing resource are not defined processing and use of the processing resource are not defined processing and use of the processing resource are not defined
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
13 13 13 13 : :RegulatorlDisplay RegulatorlDisplay :Regulator :Regulator : :RegulatoingLaw RegulatoingLaw
Time + calculate() dtorque maintainSpeed() update(info)
response instance life line
sp getSpeed() :Speed :Speed
asynchronous message synchronous message
create() :Regulator :Regulator [speed>50] startRegulating()
create message guard on message
:Speed :Speed delete() :Regulator :Regulator stopRegulating() :Speed :Speed
deleting message active instance
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
14 14 14 14
A A A message = an action + an event message = an action + an event message = an action + an event message = an action + an event
* Point to point communication or
Point to point communication or Point to point communication or Point to point communication or possibility to possibility to possibility to possibility to have have have have a set of targets a set of targets a set of targets a set of targets
Operation call ( Operation call ( Operation call (CallAction CallAction CallAction CallAction + + + + CallEvent CallEvent CallEvent CallEvent) ) ) )
* Synchronous/asynchronous
Synchronous/asynchronous Synchronous/asynchronous Synchronous/asynchronous, i , i , i , input nput nput nput and output parameters and output parameters and output parameters and output parameters
Signal sending ( Signal sending ( Signal sending (SendAction SendAction SendAction SendAction + + + + SignalEvent SignalEvent SignalEvent SignalEvent) ) ) )
* Asynchronous communication, input parameters only
Asynchronous communication, input parameters only Asynchronous communication, input parameters only Asynchronous communication, input parameters only
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
15 15 15 15
) Transitions can have four triggering types of events (or none): Transitions can have four triggering types of events (or none): Transitions can have four triggering types of events (or none): Transitions can have four triggering types of events (or none):
* Object operation call:
Object operation call: Object operation call: Object operation call: “ “ “ “CallEvent CallEvent CallEvent CallEvent” ” ” ”
* Signal receipt:
Signal receipt: Signal receipt: Signal receipt: “ “ “ “SignalEvent SignalEvent SignalEvent SignalEvent” ” ” ”
* Condition becoming true:
Condition becoming true: Condition becoming true: Condition becoming true: “ “ “ “ChangeEvent ChangeEvent ChangeEvent ChangeEvent” ” ” ”
* Date occurrence:
Date occurrence: Date occurrence: Date occurrence: “ “ “ “TimeEvent TimeEvent TimeEvent TimeEvent” ” ” ”
messages
) Storing mechanisms and its extraction protocol has to be defined Storing mechanisms and its extraction protocol has to be defined Storing mechanisms and its extraction protocol has to be defined Storing mechanisms and its extraction protocol has to be defined (implemented) by developers (implemented) by developers (implemented) by developers (implemented) by developers
) Run To Completion (RTC) assumption Run To Completion (RTC) assumption Run To Completion (RTC) assumption Run To Completion (RTC) assumption ) No distinction between internal and external events No distinction between internal and external events No distinction between internal and external events No distinction between internal and external events
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
16 16 16 16
Off Off
OnOff [vitesse>30] / startRegulating(); ++speed;
state final state Initial state Event:
root state List of actions transition guard group transition Running Suspended
/maintainSpeed() suspend resume
On
composite state simple state completion transition
Regulator
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
17 17 17 17
Regulator Regulator regulating monitoring
Off
OnOff [vitesse>30] / startRegulating(); ++speed;
On no-developed composite state [error] OK damaged scan reset [¬ error] pseudo-state => Choice compound transition
S2 S21 S22 S1 S11 S12
join pseudo-state fork pseudo-state concurrent state concurrent states
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
18 18 18 18
Run-To-Completion:
Processor => Consumes selected event
– FIFO dequeuing (commonly used by OO tools)
Dispatcher => Selects and dequeues an event
incoming event
Queue => Saves incoming events
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
19 19 19 19
after(10 ms) / ‘action-list’ S1 S2 S2 S1
) TimeEvent TimeEvent TimeEvent TimeEvent
* after
⇒ relative moment in time
* when ⇒
absolute moment in time
after(10 ms)
A timer is set to fire 10ms later 10ms later, if no state change
/ ‘action-list’
) Specification is performed through implementation mechanisms Specification is performed through implementation mechanisms Specification is performed through implementation mechanisms Specification is performed through implementation mechanisms ) TimeEvent TimeEvent TimeEvent TimeEvent handled as other events handled as other events handled as other events handled as other events ⇒ ⇒ ⇒ ⇒ non non non non-
determinist determinist determinist
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
20 20 20 20
$
a : m_1
b : m_2
c : m_3
propagation delay
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
21 21 21 21
*
Must integrate proposals from all the submitters Must integrate proposals from all the submitters Must integrate proposals from all the submitters Must integrate proposals from all the submitters (« (« (« (« SDL SDL SDL SDL » domain consortium, Rational and other tool vendors) » domain consortium, Rational and other tool vendors) » domain consortium, Rational and other tool vendors) » domain consortium, Rational and other tool vendors)
*
Standard only on semantics not on notations… Standard only on semantics not on notations… Standard only on semantics not on notations… Standard only on semantics not on notations…
*
Several times postponed… Several times postponed… Several times postponed… Several times postponed…
*
Time semantics, scheduling and real Time semantics, scheduling and real Time semantics, scheduling and real Time semantics, scheduling and real-
time concepts at time concepts at time concepts at implementation level implementation level implementation level implementation level # a UML virtual machine… a UML virtual machine… a UML virtual machine… a UML virtual machine…
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
22 22 22 22
Meta Meta Model (M3) Model (M1) Objects (M0) Meta Model (M2) MOF UML
instanceOf instanceOf instanceOf instanceOf instanceOf instanceOf instanceOf instanceOf
myCar Car
instanceOf instanceOf
Entity
instanceOf
Class
instanceOf Standard profiles (M2) Specific user profiles (M2)
SDL? Real Time? SPE UML-RT
Application model Application implantation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
23 23 23 23
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
24 24 24 24
Specialization of a standard meta-model (e.g., UML) into a specific meta-model dedicated to a given application domain.
Fundamental meta-classes on which is based the profile
Stereotypes, tagged values, constraints added to the profile Clarification of « Semantics Variation Points »
e.g.:
Mr Dupont
« driver »
Mr Dupont
Système Train Control Circuite.g.:
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
25 25 25 25
RT qualitative properties RT quantitative properties
) UML UML UML UML-
RT (ROOM) & Rose RT (ROOM) & Rose RT (ROOM) & Rose-
RT RT RT ) RT RT RT RT-
UML & Rhapsody UML & Rhapsody UML & Rhapsody ) UML UML UML UML-
SDL & SDL & SDL & Telelogic Telelogic Telelogic Telelogic-
Tau Tau Tau Suite Suite Suite Suite ) ARTiSAN ARTiSAN ARTiSAN ARTiSAN & Real Time Studio & Real Time Studio & Real Time Studio & Real Time Studio
« Real-Time systems are those systems in which correctness of the system depends not only on the logical results of computations, but also on the time at which results are produced. » « Real-Time systems are those systems in which correctness of the system depends not only on the logical results of computations, but also on the time at which results are produced. » Time Concurrency Communication Behavior
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
26 26 26 26
) Communication between object of different tasks must be Communication between object of different tasks must be Communication between object of different tasks must be Communication between object of different tasks must be implemented by the user with low level concepts implemented by the user with low level concepts implemented by the user with low level concepts implemented by the user with low level concepts
) An implementing stage (assignment of the objects to tasks)
) A classical task model called the concurrent model
Actuator control Motor Actuator Control calculation Speedmeter control Channel1 Speedmeter PMH
) A classical UML modeling facilities
::Commande update read ::RegulatingLaw calculate * pRegLaw regLaw:Commande update() read() Actuator control Motor Actuator Control calculation Speedmeter control Channel1 Speedmeter PMH
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
27 27 27 27
! Rhapsody tool
ActuatorControl « reactive » RegControl SensorControl pRC 1 pAC 1 RegulatingLaw pAC 1 RegControlTask RegControl ActControlTask ActuatorControl
SpeedRegulator_Behavior
On
stopRegulating() / updateScreen(OFF);
Off
startRegulating()
/
targetSpeed = returnValue;
SpeedRegulator_Behavior
On
stopRegulating() / updateScreen(OFF);
Off
startRegulating()
/
targetSpeed = returnValue;
SensorControl
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
28 28 28 28
) Signals: parallel execution in thread of receiver object Signals: parallel execution in thread of receiver object Signals: parallel execution in thread of receiver object Signals: parallel execution in thread of receiver object ) Operation calls: execution in thread of sender object Operation calls: execution in thread of sender object Operation calls: execution in thread of sender object Operation calls: execution in thread of sender object
* Under control of the object state machine «
Under control of the object state machine « Under control of the object state machine « Under control of the object state machine « triggered op. call triggered op. call triggered op. call triggered op. call » » » »
* Without control of the object state machine…
Without control of the object state machine… Without control of the object state machine… Without control of the object state machine…
) Concurrency is only managed through RTC assumption Concurrency is only managed through RTC assumption Concurrency is only managed through RTC assumption Concurrency is only managed through RTC assumption ) Return value of operation call can be defined… Return value of operation call can be defined… Return value of operation call can be defined… Return value of operation call can be defined… under responsibility of the caller under responsibility of the caller under responsibility of the caller under responsibility of the caller
# Not on the event themselves… Not on the event themselves… Not on the event themselves… Not on the event themselves…
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
29 29 29 29
ActuatorControl RegControl
[cmd]
C1 SensorControl
[speed]
C2 ActuatorControl RegControl SensorControl pRC 1 pAC 1 RegulatingLaw pAC 1
Newtype RegulatingLaw Operators calculate : Speed, Speed -> TorqueVariation endnewtype:;
SpeedRegulator_Behavior
On
stopRegulating() / updateScreen(OFF);
Off
startRegulating()
/ targetSpeed = returnValue;
Stopped Running Stopped Running stopRegulating updateScreen(OFF) startRegulating targetSpeed = returnvalue
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
30 30 30 30
Timers, SDL priorities… Timers, SDL priorities… Timers, SDL priorities…
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
31 31 31 31
« capsule»
anEmitter : Emitter
State 1 State 2 portA.send (s
1) ;
Signal sending Communication port
« protocol » infoProto incoming
S1 Protocol
portA : infoProto portB : infoProto~
capsule link « capsule»
aReceiver : Receiver
Behaviour
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
32 32 32 32
At implementation level mapping with task priorities must be At implementation level mapping with task priorities must be At implementation level mapping with task priorities must be At implementation level mapping with task priorities must be managed by hand managed by hand managed by hand managed by hand
« capsule » anEmitter : Emitter « capsule » aReceiver : Receiver Etat 1 Etat 2 s1 / msg #reply(s 2 , 5); Etat 1 Etat 2
a : infoProto b : infoProto ~
s1
MyInfo info; pMsgReturn = portA . invoke(s 1) ; info=*(MyInfo*) pMsgReturn.data;
s2
5 « protocol » infoProto incoming
s1 s2
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
33 33 33 33
*
Two very different models (e.g., ARTiSAN, UML/SDL)
*
Behavior lies on operation and signal processing but with poor links to the usual object interface
*
Focus is made more on signal than on operations that leads to behavior specification mixing up control action at object level and processing actions at operation level
*
Output parameters often hard to manage
*
Specification of timers or of priorities
*
Implementation of real time constraints kept to the users
*
Sometimes difficulties to map model constraints on RT-OS # model / task priorities with OS priority management policies
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
34 34 34 34
) Continuity and “tracability” of the model is mandatory ) Availability of Model and application validation is critical
Providers
The system must…
Specification
Product
) They want also to be able to prototype/develop the systems
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
35 35 35 35
Structurel Fonctionnel Dynamique
Analyse Conception Implémentation
Prototypage Industrialisation Exploitation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
36 36 36 36
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
37 37 37 37
) Real Real Real Real-
Time Objects Time Objects Time Objects ) Signals … Signals … Signals … Signals …
) Model structuring Model structuring Model structuring Model structuring ) Behavior specification Behavior specification Behavior specification Behavior specification ) Signals using Signals using Signals using Signals using
) Design patterns dedicated to Signals, Real Design patterns dedicated to Signals, Real Design patterns dedicated to Signals, Real Design patterns dedicated to Signals, Real-
Time objects … Time objects … Time objects … ) Automatic code generation Automatic code generation Automatic code generation Automatic code generation
) Test cases automatic generation Test cases automatic generation Test cases automatic generation Test cases automatic generation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
38 38 38 38
coding rules ACCORD Model Application
Code generation
VxWorks
Application C++ Source Application Compilation & Link edition
kernel
virtual machine ACCORD Solaris 2.5 Windows-NT
ACCORD
method ACCORD Objecteering UML Requirements
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
39 39 39 39
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
40 40 40 40
... Extern interface
Memory space
code
Message processing & attribute access control
Operation calls
Operation calls
Signals
S i g n a l s
Attributes
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
41 41 41 41
Regulator Speed
<<RealTimeObject>> Speed RegulatingLaw
regLaw 0..* sp 0..* 0..1 display
RegulatorDisplay RegDisplay_I <<RealTimeObject>> Regulator
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
42 42 42 42
) Broadcasted to all objects declaring sensible Broadcasted to all objects declaring sensible Broadcasted to all objects declaring sensible Broadcasted to all objects declaring sensible ) sending sending sending sending ⇒ ⇒ ⇒ ⇒ unknown receivers unknown receivers unknown receivers unknown receivers ) reception reception reception reception ⇒ ⇒ ⇒ ⇒ unknown sender unknown sender unknown sender unknown sender
« Signal » OnOff
CarStarter
RegualtorDisplay « Signal » OnOff() Regualtor « Signal » OnOff() Speedometer « Signal » OnOff()
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
43 43 43 43
Diagramme de séquence Diagramme de séquence :Regulateur :Demarreur
MA_Reg()
Class Class diagram diagram Sequence diagram Sequence diagram :Regulateur
MA_Reg()
:Demarreur
MA_Reg()
« Signal » MA_Reg
OffCar OffCar
OffCar()
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
44 44 44 44
" Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts
) Real Real Real Real-
Time Objects Time Objects Time Objects ) Signals … Signals … Signals … Signals …
) Model structuring Model structuring Model structuring Model structuring ) Behavior specification Behavior specification Behavior specification Behavior specification ) Signals using Signals using Signals using Signals using " Mechanisms definition of Mechanisms definition of Mechanisms definition of Mechanisms definition of operatring
) Desing Desing Desing Desing patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real-
Time objects … Time objects … Time objects … ) Automatic code generation Automatic code generation Automatic code generation Automatic code generation
" Models analysis for validation Models analysis for validation Models analysis for validation Models analysis for validation
) Test cases automatic generation Test cases automatic generation Test cases automatic generation Test cases automatic generation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
45 45 45 45
Requirements
Dictionary
Train Control CircuitStatecharts
Train Control CircuitStatecharts Sequence diagram Use case Class Diagram Prototype Detailed analysis Preliminary analysis
SystèmeClass Diagram Sequence diagram
Système SystèmeRequirements
Dictionary
Train Control CircuitStatecharts
Train Control CircuitStatecharts Sequence diagram Use case Class Diagram Prototype Detailed analysis Preliminary analysis
SystèmeClass Diagram Sequence diagram
Régulateur Afficheur CapteurModèle d’interaction Modèle de comportement Modèle structurel
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
46 46 46 46
OnOffButton CarStarter
Accelerator
Brake Speedometer RegulatorDisplay MotorSystem
Speed regulating system
maintain speed stop regulating suspend regulating resume regulating start regulating Interactions from environnement to system
« passive » « passive » « passive »
Interactions from environnement to system
« active » « active » « active » « active »
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
47 47 47 47
Inputs specification: ⇒ ⇒ ⇒ ⇒ How to use the component Ouputs specification: ⇒ ⇒ ⇒ ⇒ What needs the component to run
Inside component modeling
Active Interface Passive Interface Signals Systeme
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
48 48 48 48
Passive Interface Signals
OnOffButton CarStarter Accelerator Brake Speedometer RegulatorDisplay MotorSystem
Speed regulating system
maintain speed stop regulating suspend regulating resume regulating start regulating
« passive » « passive » « passive » « active » « active » « active » « active »
Active Interface Systeme
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
49 49 49 49
Signals Systeme
Passive Interface
RegulatorDisplay Speedometer MotorSystem
Active Interface
OnOffButton Brake Accelerator CarStarter
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
50 50 50 50
" Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts
) Real Real Real Real-
Time Objects Time Objects Time Objects ) Signals … Signals … Signals … Signals …
) Model structuring Model structuring Model structuring Model structuring ) Behavior specification Behavior specification Behavior specification Behavior specification ) Signals using Signals using Signals using Signals using " Mechanisms definition of Mechanisms definition of Mechanisms definition of Mechanisms definition of operatring
) Desing Desing Desing Desing patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real-
Time objects … Time objects … Time objects … ) Automatic code generation Automatic code generation Automatic code generation Automatic code generation
" Models analysis for validation Models analysis for validation Models analysis for validation Models analysis for validation
) Test cases automatic generation Test cases automatic generation Test cases automatic generation Test cases automatic generation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
51 51 51 51
/display("ON");
tm(100)[spSens->readSp()>30] /carSp = spSens->readSp(); [carSp=<30]/display("OFF"); delta=k1*atan(targetSp-carSp); engine->cmdConf(delta);
Runs on OnOff signal receipt, if speed > 30 Stops on OnOff signal or if speed =< 30 Maintain speed (if > 30) with a period of 100 milliseconds Runs on OnOff signal receipt, if speed > 30 Stops on OnOff signal or if speed =< 30 Maintain speed (if > 30) with a period of 100 milliseconds
Logic Algorithmic
targetSp: int Regulator maintainSp() « Signal » OnOff()
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
52 52 52 52
targetSp: int Regulator maintainSp() « Signal » OnOff()
[spSens->readSp()>30] /display("OFF") OnOff /display("OFF") OnOff[spSens->readSp()>30] /display("OFF") /carSpeed = spSensor->readSpeed(); delta=k1*atan(targetSp-carSpeed); engine->cmdConf(deltaCouple); tm(100)[spSens->readSp()>30]
maintainSp() initReg() stopReg()
/initReg() /stopReg() /stopReg() /maintainSp()
maintainSp() Begin End
/ carSp = spSens->readSp(); delta=k1*atan(targetSp-carSp); engine->cmdConf(delta);
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
53 53 53 53
stopReg() maintainSp()
[spSens->readSp()>30] [spSens->readSp()>30]
initReg() Transition-protocole
targetSp: int Regulator maintainSp() « Signal » OnOff() initReg() stopReg()
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
54 54 54 54
/maintainSp() /stopReg() /initReg()
[spSens->readSp()>30]
OnOff() OnOff()
[spSens->readSp()>30] /stopReg()
[spSens->readSp()>30]
tm(100)
targetSp: int Regulator maintainSp() « Signal » OnOff() initReg() stopReg() « Signal » OnOff()
Trigger-Transition
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
55 55 55 55
S1 S2
‘call-event-name’ ‘(’param-list‘)’ ‘[’ guard ‘]’
S2 S1
‘event-name’ ‘(’param-list‘)’ ‘[’ guard ‘]’ / Called-operation-name ‘(’param- list‘)’
Trigger view (ACCORD/UML) = “What have the instances of this class to do”
Class
m1() S1 S2 m1()
Class structure Class behavior = control logic
Protocol view (UML ~standard) = “What may instances of this class do” Method view (~UML standard) = How processings are performed
e1 e2
actions… m1()
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
56 56 56 56
[1] The target of a SendAction is the instances set of the system that own a reception declaration towards the signal sent. self.target.body = “all” [2] Parameter direction of a SendAction has to be « in ». self.parameter # forAll( p | p.kind = # in )
[1] SignalEvent owns as many parameters as its associated signal owns attributes self.parameter # size = self.signal.allAttributes # size
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
57 57 57 57
* Output parameters create synchronization on their use
Output parameters create synchronization on their use Output parameters create synchronization on their use Output parameters create synchronization on their use
* Only input parameters
Only input parameters Only input parameters Only input parameters # signal attributes signal attributes signal attributes signal attributes
Server Object Message management Client Object X
Executing thread
Client Object Y
Message Request
Both concepts integration : message / request
) activity / task activity / task activity / task activity / task . message management message management message management message management ) executing thread executing thread executing thread executing thread . method associated to operation method associated to operation method associated to operation method associated to operation
) “needed”synchronization : output parameters “needed”synchronization : output parameters “needed”synchronization : output parameters “needed”synchronization : output parameters
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
59 59 59 59
O1 O2 Message sending towards O2 Service request towards O2
O2 deadline (d) ou priority (p)
⇒ ⇒ ⇒ property / constraint :
{RTF} {RTF} {WCET} {WCET}
) Constraint Constraint Constraint Constraint : : : : what wants the what wants the what wants the what wants the client client client client
⌦ {RTF} {RTF}
) Property Property Property Property : : : : what can what can what can what can do do do do the server the server the server the server
⌦ {WCET} {WCET}
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
60 60 60 60
) Use of timers for periodic processings ) No specification of deadline on reactions to events
/maintainSp() /stopReg() /initReg() OnOff()
[spSens->readSp()>30] /stopReg() [spSens->readSp()>30]
tm(100)
[spSens->readSp()>30]
OnOff()
targetSp: int Regulator maintainSp() « Signal » OnOff() initReg() stopReg()
{period=100} {deadline=50} :Starter
OnOff()
{deadline=50}
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
61 61 61 61
Regulator
Regulator
aRTF : RTF;
Cyclic behavior
Begin End {RTF=(DateRef, Period(500, ms))}
RTF on a message sending Periodic behavior {RTF=aRTF}
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
62 62 62 62
" Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts
) Real Real Real Real-
Time Objects Time Objects Time Objects ) Signals … Signals … Signals … Signals …
" Modeling rules introduction Modeling rules introduction Modeling rules introduction Modeling rules introduction
) Model structuring Model structuring Model structuring Model structuring ) Behavior specification Behavior specification Behavior specification Behavior specification ) Signals using Signals using Signals using Signals using
) Desing Desing Desing Desing patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real-
Time objects … Time objects … Time objects … ) Automatic code generation Automatic code generation Automatic code generation Automatic code generation " Models analysis for validation Models analysis for validation Models analysis for validation Models analysis for validation
) Test cases automatic generation Test cases automatic generation Test cases automatic generation Test cases automatic generation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
Modélisation du système Modélisation du système Transformation du modèle Transformation du modèle Codage automatique Codage automatique Exploitation Exploitation Modèle Modèle déduit Code déduit Méta-modèle
techniques d'implémentation mise en oeuvre du temps réel
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
64 64 64 64
Regulator
OffCar OffCar
CarStarter
<<signal>> OffCar
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
65 65 65 65
Target + handleSignals() {isAbstarct = true}
+ _Signal() + addToListOfTarget () + removeFromListOfTarget () + broadcast()
_OffCar
<<signal>> OffCar « derive » listOfTargets 0..*
Regulator
OffCar OffCar
CarStarter
<<signal>> OffCar
CarStarter
«use» Regulator
+ Recepteur () + ~Recepteur () + handleSignals()
«use»
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
66 66 66 66
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
67 67 67 67
create()
:Regulator _OffCar
addToListOfTargets(this) delete() removeFromListOfTargets(this)
:Regulator
sendOffCar() create() delete()
:Target
handleSignals(sig)
i=1..listOfTargets.size
:_OffCar
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
) synchroniser les accès aux ressources synchroniser les accès aux ressources synchroniser les accès aux ressources synchroniser les accès aux ressources encapsulées encapsulées encapsulées encapsulées par les objets par les objets par les objets par les objets ) gérer les contraintes d'échéance ou de priorité sur les traiteme gérer les contraintes d'échéance ou de priorité sur les traiteme gérer les contraintes d'échéance ou de priorité sur les traiteme gérer les contraintes d'échéance ou de priorité sur les traitements des messages nts des messages nts des messages nts des messages ) sélectionner le message à traiter et demander son traitement au sélectionner le message à traiter et demander son traitement au sélectionner le message à traiter et demander son traitement au sélectionner le message à traiter et demander son traitement au "système" "système" "système" "système"
) intégrer dans un unique modèle (objet) les aspects "structurels" intégrer dans un unique modèle (objet) les aspects "structurels" intégrer dans un unique modèle (objet) les aspects "structurels" intégrer dans un unique modèle (objet) les aspects "structurels" et "fonctionnels" et "fonctionnels" et "fonctionnels" et "fonctionnels"
) logiciel logiciel logiciel logiciel multi multi multi multi-
tâches avec/sans contraintes d'échéances/priorités conçu en tech tâches avec/sans contraintes d'échéances/priorités conçu en tech tâches avec/sans contraintes d'échéances/priorités conçu en tech. OO . OO . OO . OO ) tâches tâches tâches tâches applicatives applicatives applicatives applicatives dont les tps dont les tps dont les tps dont les tps d'exé d'exé d'exé d'exé sont grands / aux opérations systèmes sont grands / aux opérations systèmes sont grands / aux opérations systèmes sont grands / aux opérations systèmes ) machine cible avec système d'exploitation temps réel fournissant machine cible avec système d'exploitation temps réel fournissant machine cible avec système d'exploitation temps réel fournissant machine cible avec système d'exploitation temps réel fournissant du " du " du " du "multi multi multi multi-
threading threading threading" " " " (plusieurs tâches à commutation de contexte rapide fonctionnant dans un espace d'adresse commun)
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
69 69 69 69
Objet Serveur Objet Serveur
lost
{ignored}
IdService ListParams Real-time features
Gestion état Gestion concurrence
Ordonnanceur global
Objet Serveur Objet Serveur
exception
{rejected }
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
Real-Time Objects
Regulateur maintenir Compteur acquerir InterfaceBoutonMA emettreAppuiBoutonMA «RTO» «RTO» «thread» «thread» «RTO» «thread»
ACCORD Kernel Multitasking
Regulateur maintenir tacheMaintenir InterfaceBoutonMA emettreAppuiBoutonMA tacheEmettreAppuiBoutonMA Compteur acquerir tacheAcquerir Task create start Lock create take release MailBox ReplyBox Signal
ACCORD Virtual Machine Loop
Regulateur maintenir InterfaceBoutonMA gererAppuiBoutonMA Compteur acquerir Main
Specific Code Generation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
71 71 71 71
de message d’un objet temps réel.
O1 O2 Oi ML2 MLi ML1 ML1 ML2 MLi
P1
accès protégé (sémaphore associé).
et ordonnancées en fonction des contraintes temps réel exprimées dans le modèle.
4 Task creation :
... taskSpawn( "T1", priority, ..., maintain , ... ); ... void maintain () { ... }
2 Data declaration :
... double tgSpeed;
1 Data protection creation :
... SEM_ID semTgSpeed; semTgSpeed = semMCreate(...);
3 Writing access :
... void maintain () { semTake (semTgSpeed, WAIT_FOREVER ); if ( carSpeed > tgSpeed ) ... semGive (semTgSpeed ); }
1 Shared data access :
# the owning class have direct access # else, access via a special operation aReg.get_tgSpeed ()
double tgSpeed; Regulator
2 Data declaration and protection creation :
# Encapsulated in a class
3 Task creation :
# To declare the object as task server # To add operations to the object
" void maintain () { if ( carSpeed > get_tgSpeed () ) ... }
double get_tgSpeed(); double tgSpeed; « RealTimeObject » double tgSpeed; double get_tgSpeed(); maintain();
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
ReplyBox<T> Parameter<T> LocalController RequestQueue Request Thread mi MethodId InputValue<T>
(Any application type)
ConcurrencyConstraints Mutex GlobalController RealTimeObject ReqRTConstraint TimeVal Thread CondW ait V e irtual Machin (OS interface) rto lc
R T U se r O b j e c t
lc gc lct rc r rq rt cd mx tv mp
" Réalisation dépendante des classes utilisateur " Classes réutilisées par héritage " Vue orientée objets du système d'exploitation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
75 75 75 75
(always defined by the execution of an object operation) (always defined by the execution of an object operation) (always defined by the execution of an object operation) (always defined by the execution of an object operation)
* Associated, when possible, to operation properties like executio
Associated, when possible, to operation properties like executio Associated, when possible, to operation properties like executio Associated, when possible, to operation properties like execution times n times n times n times
) Event queue management based on message RT constraints Event queue management based on message RT constraints Event queue management based on message RT constraints Event queue management based on message RT constraints ) Concurrency management based on operation constraint declaration Concurrency management based on operation constraint declaration Concurrency management based on operation constraint declaration Concurrency management based on operation constraint declaration
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
76 76 76 76
" Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts Introduction of high level modeling concepts
) Real Real Real Real-
Time Objects Time Objects Time Objects ) Signals … Signals … Signals … Signals …
" Modeling rules introduction Modeling rules introduction Modeling rules introduction Modeling rules introduction
) Model structuring Model structuring Model structuring Model structuring ) Behavior specification Behavior specification Behavior specification Behavior specification ) Signals using Signals using Signals using Signals using
" Mechanisms definition of Mechanisms definition of Mechanisms definition of Mechanisms definition of operatring
) Desing Desing Desing Desing patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real patterns dedicated to Signals, Real-
Time objects … Time objects … Time objects … ) Automatic code generation Automatic code generation Automatic code generation Automatic code generation
) Test cases automatic generation Test cases automatic generation Test cases automatic generation Test cases automatic generation
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
77 77 77 77
MECEL INTRACOM
CEA UPPAAL Uppsala Model Checker OFFIS
CEA
Objecteering UML TAU Telelogic Rhapsody I-Logix
UML/Statecharts I-Logix UML/SDL Telelogic
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
78 78 78 78
Tests
Résolution de contraintes Editeur Simulateur Spécification Environnement Implémentation Calcul des comportements Tests Symboliques
Composition des automates Exécution symbolique
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
79 79 79 79
Product A C C O R D / U M L E n v i r
m e n t AGATHA
¬ (Vit < 100 ) ∧ ( dist < 200) (Reg = true) ∧ (Vit ≥ 50) … ¬ (Vit < 100 ) ∧ ( dist < 200) (Reg = true) ∧ (Vit ≥ 50) …
J1 = (Vit=120, dist=150) J2 = (Reg=true, Vit=55) … J1 = (Vit=120, dist=150) J2 = (Reg=true, Vit=55) …
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
80 80 80 80
Structural Model
C3 C1 C2
Interaction model
O1r O2 O3
Behavioral model Class Diagram Statechart Collaboration & Sequence Diagrams
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
81 81 81 81
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
82 82 82 82
UML active Object : myObject Incoming event instance De-queued event instance : Event to be processed UML Statechart representing the behavior of the Active Object Event queue
– UML state machines define an hypothetical machine that holds, de-queues and processes events instances – FIFO dequeuing (commonly used by Object Oriented tools)
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
83 83 83 83
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
84 84 84 84
UML active Object, myObject Incoming event instance De-queued event instance to process it Event queue UML state machine representing the behavior of the Active Object myObject ev Incoming event instance
ESTELLE module, myObject, corresponding to the UML Event Processor
Event to process
ESTELLE module, myObject_FIFO, corresponding to the UML Event Dispatcher ESTELLE state machine corresponding to the behavior of the Active Object
ev
myObject_FIFO myObject
Translated into Translated into Translated into Translated into
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
85 85 85 85
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
86 86 86 86
pong() pong()
State Init State
ping() ping()
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
87 87 87 87
pong() pong() ping() ping()
O2 enqueues pong O2 dequeues pong
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
88 88 88 88
) It can be used by non real It can be used by non real It can be used by non real It can be used by non real-
time specialists time specialists time specialists
) They can be changed without changing the structure of the models They can be changed without changing the structure of the models They can be changed without changing the structure of the models They can be changed without changing the structure of the models (nor in class, or sequence or state diagrams) (nor in class, or sequence or state diagrams) (nor in class, or sequence or state diagrams) (nor in class, or sequence or state diagrams)
) through simulation or formal analysis through simulation or formal analysis through simulation or formal analysis through simulation or formal analysis (execution model can be deduced from the specification) (execution model can be deduced from the specification) (execution model can be deduced from the specification) (execution model can be deduced from the specification)
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
89 89 89 89
Contrainte Temps-réel, Concurrence, Communication, Comportement
Support des notations dédiées, Règles de modélisation Génération de code TR mutli-tâches (C++ sous Solaris et VxWorks) Framework multi-tâches temps-réel
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
Liens outils existant (Rhapsody, TAU UML) ⇒ AIT-WOODDES ⇒ proposition OMG Relation modèles flots de données/synchrones ⇒ RNTL ACOTRIS Déploiement/distribution et lien Soft/Hard ⇒ DAPNIA (A. Shebli) Techniques de validation par le test d'une application UML
⇒ Thèses de
Thèses de Thèses de Thèses de Phan Phan Phan Phan Trung Trung Trung Trung Hiê Hiê Hiê Hiêú ú ú ú ( ( ( (Propr Propr Propr
. TR) et N. Rapin (composants) . TR) et N. Rapin (composants) . TR) et N. Rapin (composants)
Formalisation et génération de modèles d’implantation Définition d'une bibliothèque de patrons dédiés TR Intégration des contraintes liées aux systèmes critiques Liaison avec le Co-Design et les modèles continus
François Terrier, Sébastien Gérard 27-06-2000 NOTERE’2000
91 91 91 91
" AIT AIT AIT AIT-
WOODDES: WOODDES: WOODDES: « Workshop for Object Oriented Design and Development
http://wooddes.intranet.gr/project.htm " SIVOOES: SIVOOES: SIVOOES: SIVOOES: ECOOP’2000 workshop on « Specification, Implementation and
Validation of Object-oriented Embedded Systems »
http://www-dta.cea.fr/leti/UK/Pages/Tech_info/Sivooes.htm " UML’2000: UML’2000: UML’2000: UML’2000: http://www.cs.york.ac.uk/uml2000
Workshop on Formal Design Techniques for Real-Time UML
http://wooddes.intranet.gr/workshop.htm " Action Action Action Action semantics semantics semantics semantics: : : : AD/98-11-01, http://www.omg.org, http://uml.simware.com
http://people.ce.mediaone.net/weigert/actionsemantics/home.html
" ARTiSAN: http://www.artisansw.com " RT-UML (Rhapsody): http://www.ilogix.com " UML-SDL (UML TAU Suite): http://www.telelogic.com " UML-RT (ROSE-RT): http://www.rational.com " Objecteering: http://www.softeam.com