Professional Documents
Culture Documents
MARTE A New Standard For Modeling and An
MARTE A New Standard For Modeling and An
Agenda
09:00 am to 10:15 am
Introduction to MDD for RT/E systems
MARTE foundations
10:15 am to 10:45 am: Break
10:45 am to 12:00 am
High-level modeling constructs
Detailed software and hardware platforms modeling
13:00 pm to 14:30 pm: Lunch
14:30 pm to 15:00 pm
Introduction to model-based RTE analysis
15:00 pm to 15:45 pm
Model-based schedulability analysis
15:45 pm to 16:15 pm: Break
16:15 pm to 17:00 pm
Model-based performance analysis
17:00 pm to 17:30 pm
Conclusions and perspectives about MARTE
/ MARTE Tutorial 2
Models in Traditional Engineering
Probably as old as engineering
/ MARTE Tutorial 3
What is a Model in MDD MDD For DRES 2004 (Brest, September 2004)
One definition
A reduced/abstract representation of some system that highlights the
properties of interest from a given viewpoint.
The viewpoint defines concern, scope and detail level of the model.
/ MARTE Tutorial 4
Why Model Driven Engineering is Needed?
To deal with complexity of systems development
Abstract a problem to focus on some particular points of interest
Î improve understandability of a problem
Possible set of nearly independent views of a model
Separation of concerns (e.g. “Aspect Oriented Modeling”)
Iterative modeling may be expressed at different level of fidelity
/ MARTE Tutorial 5
/ MARTE Tutorial 6
A Bit of Modern Software…
SC_MODULE(producer) SC_CTOR(consumer)
{ {
sc_outmaster<int> out1;
SC_SLAVE(accumulate, in1);
sc_in<bool> start; // kick-start
sum = 0; // initialize
void generate_data () };
{ SC_MODULE(top) // container
for(int i =0; i <10; i++) {
{
out1 =i ; //to invoke slave;}
} producer *A1;
SC_CTOR(producer) consumer *B1;
{ sc_link_mp<int> link1;
SC_METHOD(generate_data); SC_CTOR(top)
sensitive << start;}}; {
SC_MODULE(consumer)
A1 = new producer(“A1”);
{
sc_inslave<int> in1;
A1.out1(link1);
int sum; // state variable B1 = new consumer(“B1”);
void accumulate (){ B1.in1(link1);}};
sum += in1;
cout << “Sum = “ << sum << endl;}
(Extracted from B. Selic presentation during Summer School MDD For DRES 2004 (Brest, September 2004)
/ MARTE Tutorial 7
«sc_link_mp»
««sc_ctor»
sc_ctor»
sc_ctor» link1 ««sc_ctor»
sc_ctor»
sc_ctor»
producer
producer consumer
consumer
start
(Extracted from B. Selic presentation during Summer School MDD For DRES 2004 (Brest, September 2004)
/ MARTE Tutorial 8
Model Evolution: Refinement
void generate_data()
«sc_method»
«sc_method» producer {for (int i=0; i<10; i++)
producer {out1 = i;}}
producer out1
start
NotStarted
producer
start /generate_data( )
NotStarted Started
refine
start St1 St2
Started
/ MARTE Tutorial 9
SC_MODULE(producer) SC_MODULE(producer)
{sc_inslave<int> in1; {sc_inslave<int> in1;
int sum; // int sum; //
void accumulate (){ void accumulate (){
sum += in1; sum += in1;
cout << “Sum = “ << sum << cout << “Sum = “ << sum <<
endl;} endl;}
(Extracted from B. Selic presentation during Summer School MDD For DRES 2004 (Brest, September 2004)
/ MARTE Tutorial 10
The Remarkable Thing About Software
/ MARTE Tutorial 11
« reference »
« reference »
DSL (Domain Specific Language)
« profile » « profile »
UML profile for SoC UML profile MARTE
/ MARTE Tutorial 12
From UML 1.x to UML 2.0: Static Point of View
/ MARTE Tutorial 13
/ MARTE Tutorial 15
Minor extensions:
Shortcut for inheritance modeling.
Concepts of dependency group.
/ MARTE Tutorial 16
From UML 2.0 to SysML: Dynamic Point of View
New
/ MARTE Tutorial 17
/ MARTE Tutorial 18
Which Technics for Making an OMG DSL?
Meta-models (using MOF)
For heavyweight extension mechanisms
Ensures full manipulation of MMs
Add, remove meta-classes and relationships inbetween
Profiles
For lightweight extension mechanisms
Adaptation of existing meta-models without modifications!
E.g., Only possible to add constraints
May extend any standard MM of the OMG
E.g., UML profiles and CWM profiles
Extracted from UML superstructure doc.:
Profiles vs. meta-models "There is no simple answer for when you
It may depend on: should create a new metamodel and
Scope of the extensions when you instead should create a new
Tooling constraints profile."
Engineer level of experiment/education
…
/ MARTE Tutorial 19
Disadvantage
Constrained by UML metamodel
/ MARTE Tutorial 20
Main Goals for Making UML Profiles
Define a domain specific terminology
Define a domain specific notation
Define concrete syntax to specific elements
E.g., for action
Define semantics rule for:
Variation points
E.g., On BroadcastSignalAction, scope of target objects in Signal.
Ambiguous definition
New purpouse
Add usage constraints on the UML MM
e.g. for method point of view
E.g., to force behavior specification via protocol state-machine
Tag a model with additional information
e.g. for code generation purpose
E.g., for C++, «virtual», «inline»…
/ MARTE Tutorial 21
/ MARTE Tutorial 22
OMG Standardization Process
MARTE FTF: Comments due for 22 december 2007 !
WP no
?
yes
RFI no
?
yes
no
RFP ?
yes
Prop-1
… Prop ? no
Prop-n yes
Draft Adopted Specification: 16 July 2007
Revised Version
Final Adopted Specification Publication: 6 August 2007
Comments Due: 22 December 2007 FTF
/ MARTE Tutorial 27
SPT was the first OMG’s UML profile for Real-Time Systems:
Support for Schedulability Analysis with RMA-type techniques
Support for Performance Analysis with Queuing Theory and Petri Nets
A rich model for “metric” Time and Time Mechanisms
/ MARTE Tutorial 28
General Requirements of the MARTE RFP
Proposals shall support Modeling and Analysis of Real-Time
and Embedded (in short MARTE) systems including its
software and hardware aspects.
The Proposals will define a metamodel and its underlying UML
profile.
It shall be possible to use independently software and hardware
parts of the profile.
It shall comply with existing standards
It shall update the SPT profile 1.1
/ MARTE Tutorial 29
/ MARTE Tutorial 31
« metamodel »
Marte domain model
« refine »
« profile »
Marte profile UML2 metamodel
« reference »
/ MARTE Tutorial 32
MARTE Overview Foundations for RT/E systems
modeling and analysis:
Î CoreElements
Î NFPs
Î Time
Î Generic resource modeling
Î Generic component modeling
Î Allocation
/ MARTE Tutorial 33
Agenda
09:00 am to 10:15 am
Introduction to MDD for RT&E systems
MARTE foundations
10:15 am to 10:45 am: Break
10:45 am to 12:00 am
High-level modeling constructs
Detailed software and hardware platforms modeling
13:00 pm to 14:30 pm: Lunch
14:30 pm to 15:00 pm
Introduction to model-based RTE analysis
15:00 pm to 15:45 pm
Model-based schedulability analysis
15:45 pm to 16:15 pm: Break
16:15 pm to 17:00 pm
Model-based performance analysis
17:00 pm to 17:30 pm
Conclusions and perspectives about MARTE
/ MARTE Tutorial 34
Outlines of the MARTE Foundations
MARTE foundations
Define a set of basic concepts for MDD of RTES
Intended to be used as basic layer at OMG for future RTE related stds
Consists of five sub-profiles
/ MARTE Tutorial 35
/ MARTE Tutorial 36
Introduction to the MARTE’s NFPs Framework
UML lacks modeling capabilities for NFPs!!
Measures?
Value qualifiers?
UML Profile for NFPs
NFP Libraries?
Annotation mechanism?
/ MARTE Tutorial 37
Constraints
/ MARTE Tutorial 38
Annotating NFPs in Tagged Values
1) Declare NFP types
Define measurement units and
conversion parameters
Define NFP types with qualifiers
/ MARTE Tutorial 39
2) Declare NFPs
« import
rt »
Define classifiers and their
attributes using NFP types
Task
Such attributes are marked ClassifierModel
«nfp» deadline: NFP_Duration
as «nfp» exam
le
ple ...
/ MARTE Tutorial 40
Annotating NFPs in Constraints
1) Declare NFP types
Define measurement units and
conversion parameters
Define NFP types with qualifiers
2) Declare NFPs
« import »
Define classifiers and their
attributes using NFP types Processor
ClassifierModel
«nfp» utilization: NFP_Percentage
ple
exam «nfp» clockFreq: NFP_Frequency
...
/ MARTE Tutorial 41
Value Specification
Language (VSL)
/ MARTE Tutorial 42
Basic Textual Expressions in VSL
9 Extended Primitive Values
9 Extended Composite Values
9 Extended Expressions
/ MARTE Tutorial 43
MyClass
length: Long
priorityRange: IntegerInterval
position: IntegerVector
shape: IntegerMatrix
consumption: Power
arrival: ArrivalPattern
cl: MyClass
length = 212333
priorityRange = [0..2]
position= {2,3}
shape = {{2,3},{1,5}}
consumption = (-, exp=x*v1, unit= mW, source= calc)
arrival= periodic (period= 10, jitter= 0.1)
/ MARTE Tutorial 44
Examples of Time Expressions with VSL
Duration
constraint
Variable declaration
Variable declaration denoting a duration
denoting an instant (UML DurationObservation)
(UML Time Observation)
Bounded duration
interval constraint
Bounded instant
interval constraint
/ MARTE Tutorial 45
Foundations…
Reuse OCL constructs: grammar for values and expressions
Generic data type system: (based on ISO’s General-Purpose Datatypes)
VSL extends UML Simple Time model (occurrence index, jitters,...)
Formally defined by abstract and concrete syntaxes (grammar).
Flexibility: expression operators in model-specific libraries
/ MARTE Tutorial 46
Outlines of the MARTE Foundations
MARTE foundations
Define a set of basic concepts for MDD of RTES
Intended to be used as basic layer at OMG for future RTE related stds
Consists of five sub-profiles
/ MARTE Tutorial 47
/ MARTE Tutorial 48
Time Packages of MARTE
Defines literals used to
specify the way to interpret
Defines literals used to a time expression: either as
specify the discrete or a duration or as an instant.
dense nature of a time
value.
/ MARTE Tutorial 49
« clockType »
{ nature = dense, unitType = TimeUnitKind,
getTime = currentTime }
IdealClock
currentTime( ) : Real
/ MARTE Tutorial 51
« Clocks »
Clocks are instance specification of ClockTypes
Clocks properties are:
standard: TimeStandardKind [0..1]
unit: Unit [0..1]
type: ClockType [1]
Example
« clockType »
{ nature = dense, unitType = TimeUnitKind,
getTime = currentTime }
IdealClock
currentTime( ) : Real
/ MARTE Tutorial 52
Timed & Clock Constraints and TimedDomain
« TimedConstraint »
Imposes constraints on either instant values or duration values
associated with model elements bound to clocks.
Can be conveniently expressed in VSL
« ClockConstraint »
Imposes dependency between clocks
Refers to a set of clocks and possibly to other model elements
Described via an opaque expression using a dedicated language
E.g. CCSL (Clock Constraint Specification Language) defined in Annex C
« TimedDomain »
Namespace for:
Clock and ClockTypes user definitions
But also for ClockConstraints (see example later)
Model elements of the TimedDomain may refer to Clocks to express that
their behavior depends on time
/ MARTE Tutorial 53
« constraint »
« timedConstraint »
{ (t0[i+1] - t0[i]) > (100, ms) }
/ MARTE Tutorial 54
Example of TimedDomain with a ClockConstraint
« clockType »
{ nature = dense, unitType = TimeUnitKind,
getTime = currentTime }
IdealClock
currentTime( ): Real
/ MARTE Tutorial 55
« stereotype » « stereotype »
TimedInstantObservation TimedDurationObservation
obsKind:EventKind[0..1] obsKind:EventKind[0..2]
MARTE observations
on clarify which events is to
on
1 1 observe:
MARTE observations
have to reference a clock. « stereotype »
Clock
/ MARTE Tutorial 56
Examples of «TimedInstantObservation» and
«TimedDurationObservation»
/ MARTE Tutorial 57
Optional duration
Bound of repetitions
value between two
successive
occurrences
/ MARTE Tutorial 58
Example of «TimedProcessing» & «TimedEvent»
with Logical Time
« clockType » « enumeration » « clock »
{ nature = discrete, isLogical = true, CAMLogicalTimeUnitKind { unit = tick }
unitType = CAMLogicalTimeUnitKind, camClk:CAMClock
getTime = getCamPos } « unit » °CAM
CAMClock
getCamPos( ): Real
/ MARTE Tutorial 59
/ MARTE Tutorial 60
Outlines of the GRM package
Provides basic concepts for modeling a general (high-level)
platform for processing RTE applications
Includes the features for modeling processing platforms at different
level of details.
The level of granularity needed depends on the concern motivating the
description of the platform
E.g., the type of the platform, the type of the application, or the type of
analysis to be carried out on the model
Build in a bottom-up process to abstract finer-level platforms
Processing platform for design concern
See HRM and SRM
Processing platform for analysis concern
See GQAM-related ptf and further refinements for performance and
schedulability analysis
/ MARTE Tutorial 61
0..** 1..**
ResourceInstance
instance type
e
contextt 1
exeServicess 0..**
instance
e 1..**
ResourceServiceExecution
0..** type
/ MARTE Tutorial 62
Outlines of the MARTE Foundations
MARTE foundations
Define a set of basic concepts for MDD of RTES
Intended to be used as basic layer at OMG for future RTE related stds
Consists of five sub-profiles
/ MARTE Tutorial 63
/ MARTE Tutorial 64
A two step process for allocation modeling
Identify possible sources and targets of allocations
What can be
allocated, the logical
view: What can serve as a
Î behavior or target of an allocation,
structure the physical view:
Î a resource or a
service.
/ MARTE Tutorial 65
Application
SpeedController CarSpeed
RealTimeOperatingSystem
« schedulableResource » « storageResource »
OS_Task VirtualMemory
/ MARTE Tutorial 66
Allocation example (2)
Application
« app_allocated » « app_allocated »
SpeedController CarSpeed
RealTimeOperatingSystem
« schedulableResource, « storageResource,
ep_allocated » ep_allocated »
OS_Task VirtualMemory
/ MARTE Tutorial 67
Application
« app_allocated » « app_allocated »
SpeedController CarSpeed
«allocate» «allocate»
{kind=timeScheduling} {spatialDistribution}
RealTimeOperatingSystem
« schedulableResource, « storageResource,
ep_allocated » ep_allocated »
OS_Task VirtualMemory
/ MARTE Tutorial 68
Allocation example (4)
/ MARTE Tutorial 69
/ MARTE Tutorial 70
The Marte General Component Model
Defined within MARTE to support CBSE and to provide a common
denominator among various existing component models, which in
principle do not target exclusively the RTE domain
Main features
Mainly refined UML structured classes, on top of which a support for
SysML blocks has been added
But also compatible with a support for Lightweight-CCM, AADL and
EAST-ADL2, Spirit and Autosar
Shortcuts for UML2 modeling of components/composites diagrams
/ MARTE Tutorial 71
UML2 port
/ MARTE Tutorial 72
The MARTE GCM Sub-profile
/ MARTE Tutorial 73
/ MARTE Tutorial 74
Example with « MessagePort »
/ MARTE Tutorial 75
Agenda
09:00 am to 10:15 am
Introduction to MDD for RT/E systems
MARTE foundations
10:15 am to 10:45 am: Break
10:45 am to 12:00 am
High-level modeling constructs
Detailed software and hardware platforms modeling
13:00 pm to 14:30 pm: Lunch
14:30 pm to 15:00 pm
Introduction to model-based RTE analysis
15:00 pm to 15:45 pm
Model-based schedulability analysis
15:45 pm to 16:15 pm: Break
16:15 pm to 17:00 pm
Model-based performance analysis
17:00 pm to 17:30 pm
Conclusions and perspectives about MARTE
/ MARTE Tutorial 76
RTE Model of Computation & Communication
High-level modeling concepts where RT/E concerns are
embedded inside modeling artifacts (E.g., UML active/passive
objects)
Implicit semantics
Two families of concerns
Quantitative aspects
E.g. concurrency and behavior
Qualitative aspects as real-time feature
E.g. deadline or period
Package dependencies
/ MARTE Tutorial 77
« PpUnit »
Generalization of UML2 Passive Objects
Concurrency policy specified either locally or globally
Processing is either immediateRemote or deferred
/ MARTE Tutorial 78
Quantitative RT features modeling
« RealTimeFeature »
« RteConnector »
/ MARTE Tutorial 79
/ MARTE Tutorial 80
Dynamics aspects of « RtUnit » and « PpUnit »
Services specification
« metaclass »
UML2::BehavioralFeature
« enumeration »
SynchronisationKind
RtService « enumeration » « enumeration »
ConcurrencyKind ExecutionKind synchronous
isAtomic: Boolean [1] = false asynchronous
concPolicy: ConcurrencyKind reader deferred delayedSynchronous
exeKind: ExecutionKind writer remoteImmediate rendezVous
synchKind: SynchronizationKind parallel localImmediate other
/ MARTE Tutorial 81
isDynamic = false
« rtUnit » « rtUnit » isMain = false
isMain = true CruiseControler ObstacleDetector poolSize = 10
main = start poolPolicy = create
tgSpeed: Speed startDetection()
stopDetection()
«rtService» {exeKind=deferred} start()
«rtService» {exeKind=deferred} stop()
/ MARTE Tutorial 82
Usage examples of the RTEMoCC extensions (2)
occKind = aperiodic ()
sd CruiseControlStart
value = (tRef=t0, relDl=(10, ms), miss=(1, %, max))
:CruiseControl :Speedometer
start()
startAcquisition()
@t0
occKind = periodic (period=(10, ms), jitter=(2, us))
getSpeed() value = (tRef=t0, relDl=(10, ms), miss=(1, %, max))
/ MARTE Tutorial 83
priority=1
occKind = periodic (period=(10,ms), jitter=(2,us))
relDl=(4,ms)
«rtAction, rtf» tRef=t0
performComputation miss=(1, %, max)
syncKind=synchronous
/ MARTE Tutorial 84
Agenda
09:00 am to 10:15 am
Introduction to MDD for RT/E systems
MARTE foundations
10:15 am to 10:45 am: Break
10:45 am to 12:00 am
High-level modeling constructs
Detailed software and hardware platforms modeling
13:00 pm to 14:30 pm: Lunch
14:30 pm to 15:00 pm
Introduction to model-based RTE analysis
15:00 pm to 15:45 pm
Model-based schedulability analysis
15:45 pm to 16:15 pm: Break
16:15 pm to 17:00 pm
Model-based performance analysis
17:00 pm to 17:30 pm
Conclusions and perspectives about MARTE
/ MARTE Tutorial 85
/ MARTE Tutorial 86
What is the Software Resource Modeling Profile (SRM) ?
/ MARTE Tutorial 87
/ MARTE Tutorial 88
Main expected use cases of SRM
Describe execution
support API
Use
« extend » Model
API model
Transformation
Methodology
Software Designer Provider
« extend »
Code generation
/ MARTE Tutorial 89
/ MARTE Tutorial 90
What is supported by the SRM profile ?
Concurrent execution contexts: Hardware and software
• Schedulable Resource (~Task) resources brokering:
• Memory Partition (~Process) • Drivers
• Interrupt Resource • Memory management
GRM
• Alarm
SRM « import »
« import »
/ MARTE Tutorial 91
SRM::SW_Concurrency
SRM::SW_Interaction SRM::SW_Brokering
« MessageComResource » « NotificationResource »
« SharedDataResource » « SwMutualExclusionResource »
/ MARTE Tutorial 92
The OSEK/VDX case study
OSEK/VDX standard (http://www.osek-vdx.org)
Automotive industry a standard for an open-ended architecture
for distributed control units in vehicles
/ MARTE Tutorial 93
Main artifacts
Support for concurrent computing
Task
A task provides the framework for the execution of functions
Interrupt
Mechanism for processing asynchronous events
Alarm & Counter
Mechanisms for processing recurring events
Support for synchronizations of concurrent computing
Event
Mechanism for concurrent processing synchronization
Resource
Mechanism for mutual concurrent access exclusion
/ MARTE Tutorial 94
Focus on the OSEK/VDX Task definition
Semantic
An OSEK-VDX task provides the framework for computing application
functions. A scheduler will organize the sequence of task executions.
Example of properties
Priority: UINT32
Priority execution of the task
StackSize: UINT32
Stack size associated to the execution of the task
/ MARTE Tutorial 95
« import »
/ MARTE Tutorial 96
Details of «SwSchedulableResource»
Semantic (from MARTE::SRM::Concurrency package)
Resource which executes, periodically or not, concurrently to other concurrent resources
==> SRM artifacts for modeling OSEK-VDX Task!
Main features
Owns an entry point referencing the application code to execute
May be restricted to execute in a given address space (i.e. a memory partition)
Owns properties
E.g., Priority, Deadline, Period and StackSize
Provides services
E.g., activate, resume and suspend
/ MARTE Tutorial 97
/ MARTE Tutorial 98
SRM modelling facilities
How to model multiples candidates for the same semantic ?
Answer : All stereotype tags have multiple multiplicities. Thus, it is possible to
reference multiple candidates for the same tag.
Examples
Both name attributes and taskId parameter are task identifier
/ MARTE Tutorial 99
Is it possible to reference a feature even if the feature owner is not the stereotyped
element ?
Answer : Yes, there is no constraints on the feature owner
« SwSchedulableResource »
priorityElements = priority « interface »
activateService = activateTask() « swSchedulableResource » TaskService
Task
+activateTask()
- priority : Integer
GRM
SRM « import »
« import »
Describe execution
support API
Use
« extend » Model
API model
Transformation
Methodology
Software Designer Provider
« extend »
Code generation
Goal
A motion controller system for an
exploration autonomous mobile robot.
Robot features
Pioneer Robot (P3AT)
Four driving wheels
A camera
Eight sonar sensors, etc.
Design features of the robot controller
OSEK/VDX execution support
Simulation on Trampoline
(http://trampoline.rts-software.org/) Robot Simulator
Two periodic tasks http://playerstage.sourceforge.net/gazebo/gazebo.html
Data acquisition task
Get position data from sonar sensors
every 1 ms
trajectory computing task
Set new speed every 4 ms
Design process
A platform provider supplies the OSEK/VDX model library
Model library is described with the SRM Profile (as previously shown)
Step 2: Propose a multitask design using the OSEK model library artifact
Compute the 4
Terminate
motion
a mission
speed values
Template description
based on SRM profile
E.g. ACCELEO
Platform www.acceleo.org
Specific model
OSEK Compiler
using SRM
OIL File Generation
Executable file
« SwSchedulableResource »
BasicTask
Task acquisition{
« instanceOf » }
« instanceOf »
acquisition : BasicTask Task trajectoryController{
ACCELEO }
trajectoryController : BasicTask
Purpose
Assist user to port the multitask design to an ARINC-653 RTOS
ARINC 653 standard provides avionics application software with the set of
basic services to access the operating system and other system-specific
resources.
« SwSchedulableResource » « SwSchedulableResource »
BasicTask Process
« instanceOf » « instanceOf »
« instanceOf » « instanceOf »
acquisition : BasicTask ATL acquisition : Process
ATL
OSEK/VDX ARINC-653
HRM
Allocation
« include »
System Architect
High level HW
modeling
« extend »
Application
« include »
modeling
Specialized HW
Software developper modeling
HW designer
« include » « include »
Analysis
Detailed HW
modeling
Analyzer
How?
High level of abstraction
Architectural view of the HW platform
With key properties:
E.g., instruction set and memory size.
A formal view of usual block diagrams
For
High level description of existing and targeted HW platform
First steps of design of new HW architecture
By
System architects
Software developers
How?
Specialized HW description model
Nature of details depends on the point of view
Ex1 : autonomy analysis requires power consumption modeling
Ex2 : WCET analysis need details on processor speed,
communication bandwidth and memory organization…
For analysis purpose
By analyzers
How?
HRM is a detailed HW architecture design language
Level of details depends on the description accuracy
Ex1: Functional simulator of a processor only requires its instruction
set family
Ex2: Performance simulation need a fine description of processors
micro-architecture.
For
Model-based datasheets description
Simulation
generation of configurations for simulation tools
By
HW designers
« stereotype » « stereotype »
MARTE::GRM::Storage HwResource
« stereotype » « dataType »
HwMemory Timing
« stereotype » « stereotype »
MARTE::GRM::Storage HwResource
HRM usage
HRM stereotypes extends the main structural UML metaclasses
Classifier, Class
InstanceSpecification, Property
Association (HwMedia, HwBus…), Port (HwEndPoint)
« hwBus »
fsb : FSB
{frequency = 133Mhz,
wordWidth = 128bit}
« hwComponent »
« hwComponent »
CPU [4] « hwComponent »
DMA
{kind = Chip} FSB
{kind = Chip}
{kind = Channel}
« hwChannel »
fsb : FSB
position«= hwPowerSupply
[1,4], [2,2] »
« hwComponent » « hwComponent »
Battery
UL2 SDRAM
{kind = Other,
{kind = Unit} {kind = Card}
capacity = 40Wh}
« hwChip » « hwChip » « hwChip » « hwPowerSupply »
cpu2 : CPU cpu4 : CPU dma : DMA battery : Battery
position = [1,1], [3,3] position = [2,2], [3,3] position = [3,3], [3,3] position = [4,4], [3,3]
staticConsumption = 5W staticConsumption = 5W capacity = 10Wh
weight = 150g
Features
Super-scalar TriCore CPU
Superior real-time performance
Efficient interrupt handling
4 stage pipeline
DSP capabilities
150 MHz operational frequency
DEMO
(Papyrus)
Skyeye (www.skyeye.org/)
Support for ARM-like processors, most of memories and peripherals
Functional simulation
Enable to run only light sw applications (E.g., μLinux and ARMLinux)
GPL
SimpleScalar (www.simplescalar.com/)
Academic tool easy to extend
Performance simulation
Run C code
Agenda
09:00 am to 10:15 am
Introduction to MDD for RT/E systems
MARTE foundations
10:15 am to 10:45 am: Break
10:45 am to 12:00 am
High-level modeling constructs
Detailed software and hardware platforms modeling
13:00 pm to 14:30 pm: Lunch
14:30 pm to 15:00 pm
Introduction to model-based RTE analysis
15:00 pm to 15:45 pm
Model-based schedulability analysis
15:45 pm to 16:15 pm: Break
16:15 pm to 17:00 pm
Model-based performance analysis
17:00 pm to 17:30 pm
Conclusions and perspectives about MARTE
GQAM overview
Generic Quantitative Analysis Modeling (GQAM) expresses
foundation concepts and NFPs shared by different quantitative
analysis domains – e.g., schedulability and performance - that have
their own terminology, concepts and semantics
core GQAM concepts describe how the system behavior uses resources
over time
NFPs used in quantitative analysis techniques:
“input NFPs” - taken as input data
e.g., request or trigger arrival rates, execution demands, deadlines, QoS targets
“output NFPs” - computed as results
e.g., response times, deadline failures, resource utilizations, queue sizes
Different analysis goals:
Point evaluation of the output NFPs for a given operating point defined
by input NFPs
Search over the parameter space for feasible or optimal solutions
Sensitivity of some output results to some input parameters
Scalability analysis: how the system performs when the problem size or
the system size grow.
UML2 + Marte
Analysis specific
« profile »
framework
MARTE
UML2 editor Analysis model
Model
converter
Annotated model
Analysis tool
Results/Diagnostic
Results Analysis results
converter
Behavior/
Scenario
Steps
Physical
Resources Logical
Resources
Resource concepts
ResourcesPlatform - the top class in the GQAM_Resource package
represents a logical container for all the resources
The viewpoint of resources is based on the abstract Resource class
from the GRM package
common features include a scheduling discipline, multiplicity, services
From an analysis viewpoint, four types of resources are important:
ExecutionHost: a processor or other device that executes operations
specified in the model. It has a host role relative to the processes and
the Steps that execute on it.
CommunicationsHost: hardware links between devices, with the role of
host to the conveyance of a message.
SchedulableResource: a schedulable service like a process or thread
pool, which is a software resource managed by the OS.
CommunicationChannel : a middleware or protocol layer that conveys
messages.
There are also other concurrency resources, such as mutual
exclusion resources from the GRM chapter
e.g., critical section; semaphores and locks; a finite buffer pool; pool of
admission control tokens.
Workload
Steps
Scenario
« stereotype »
« enumeration » MARTE:: GRM:: Resource
MARTE_ Library::
MARTE_ DataTypes::
TransmModeKind
Simple « stereotype» « stereotype »
HalfDuplex MARTE:: GRM:: MARTE:: GRM::
FullDuplex ProcessingResource ConcurrencyResource
Physical
Logical
Resources
« stereotype »
resources
MARTE:: GRM::
« stereotype » SchedulableResource
GaExecHost « stereotype »
commTxOvh: NFP_ Duration GaCommHost
commRcvOvh: NFP_ Duration
cntxtSwT: NFP_ Duration capacity: NFP_ DataTxRate [*] « stereotype »
clockOvh: NFP_ Duration packetT: NFP_ Duration [*] GaCommChannel
schedPriRange: NFP_ Interval blockT: NFP_ Duration [*]
transmMode: TransmModeKind packetSize: NFP_ DataSize
memSize: NFP_ DataSize utilization: NFP_ Real [*]
utilization: NFP_ Real [*] utilization: NFP_ Real [*]
throughput: NFP_ Frequency [*] throughput: NFP_ Frequency [*]
MDD and UML have been broadly introduced and used in principle by the
software engineering community, and have reached a significant number of
practitioners and tool support.
To take benefit of this in the RTE domain, they need to be capable of supporting
the necessary (at least timing) verifications.
As well as the necessity to have the modeling elements to describe the platform,
the interacting environment and the timing requirements.
Critical sections
Effects of jitter
Periodic events with jitter have an arrival time which may be
early or late, within a bounded interval:
events arrive at to + nT +/- J
Low pri.
t t
Execution sequence for Execution sequence
two periodic tasks. with jitter.
Worst case is one preemption Worst case is two preemptions
Real-Time System
R
R R
a2
a5
a1
a4 a7
a3
a8 Network
CPU-1 a6
CPU-2
Transactions
Fork
Step Step (Multicast)
External Precedence
Event Relationship
(Action) Precedence
Relationship
Timing
Requirement
Shared Processing
Resources Resources
Usage Schedulable
Resource
Scheduling
Parameters
Event Event
Step
Event
Timing
Requirement Reference
Resources
« metaclass »
« metaclass » « metaclass » « metaclass » « metaclass » UML::CompositeStructures::
UML::Classes::Kernel:: UML::Classes::Kernel:: UML::Classes::Kernel:: UML::Interaction::Basic InternalStructures::
Property InstanceSpecification Classifier Interactions::Lifeline ConnectableElement
« stereotype»
Resource
resMult: Integer = 1
« stereotype » isProtected: Boolean
« stereotype »
CommunicationEndPoint isActive: Boolean StorageResource
« enumeration »
SchedPolicyKind SecondaryScheduler 1 GRM::ResourceTypes::
GRM::ResourceTypes::
EarliestDeadlineFirst host ComputingResource CommunicationMedia
FIFO dependentScheduler 0..1
FixedPriority
LeastLaxityFirst 1..* 0..*
virtualProcessingUnits schedulableResource GRM::ResourceTypes::
RoundRobin
TimeTableDriven DeviceResource
Undef SchedulableResource
Other * {isActive=True}
1 schedParams
GRM::ResourceTypes::
SchedulingParameters
ConcurrencyResource
« stereotype »
« stereotype » « stereotype » MutualExclusionResource
ComputingResource ProcessingResource
protectKind: ProtectProtocolKind=PriorityInheritance
processingUnits 0..* ceiling: Integer
host 0..1 otherProtectProtocol: String
isProtected:Boolean=true{IsReadOnly}
mainScheduler 0..1
* protectedSharedResources
« stereotype » scheduler
Scheduler
0..1
isPreemptible: Boolean = true
schedPolicy: SchedPolicyKind = FixedPriority host
otherSchedPolicy: String
schedule: OpaqueExpression
0..1
schedulabledResources 0..*
« stereotype »
SchedulableResource
« stereotype »
SecondaryScheduler schedparams: SchedParameters[0..*]
isActive:Boolean=true{IsReadOnly}
1. If the list usedResources is empty the list subUsages should not be empty and viceversa..
2. If the list usedResources has only one element, all the optional lists of attributes refer to this unique
Resource and at least one of them must be present.
3. If the list usedResources has more than one element, all of the optional lists of attributes that are
present, must have that number of elements, and they will be considered to match one to one.
4. If the list subUsages is not empty, and any of the optional lists of attributes is present, then more
than one annotation for the same resource and kind of usage may be expressed. In this case, if the
annotations have also the same source and statistical qualifiers they will be considered in conflict,
and hence the ResourceUsage inconsistent.
SAM Overview
SAM_Workload
« dataType » GQAM_Workload::
« choiceType » WorkloadBehavior SAM_Observers::
ArrivalPattern
TimingObserver
periodic: PeriodicPattern
aperiodic: AperiodicPattern Timing
workload 1..* *
sporadic: SporadicPattern
burst: BurstPattern EndToEndFlow 1
irregular: IrregularPattern
closed: ClosedPattern isSchedulable: NFP_Boolean
open: OpenPattern schedulabilitySlack: NFP_Real
endToEndTime: NFP_Duration
endToEndDeadline: NFP_Duration
GQAM_Workload::
WorkloadEvent 1..* 1
GQAM_Workload::
pattern: ArrivalPattern BehaviorScenario
inputStream effect
SAM_Workload: BehaviorScenario
« enumeration » NFP_Modeling::
ConstraintKind NFP_Annotation::
required NFP_Constraint
offered kind: ConstraintKind
contract
startObs
TimeModels:: GQAM_Observers:: « enumeration »
0..1 TimingObserver LaxityKind
TimedRelatedEntities::
TimedObservations:: endObs laxity: LaxityKind hard
TimedInstantObservation soft
0..1
undef
other
SchedulingObserver GQAM_Observers::
LatencyObserver
suspensions: NFP_Integer
blockingTime: NFP_Duration latency: NFP_Duration
overlaps: NFP_Integer missRatio: NFP_Real
utility: UtilityType
maxJitter: NFP_Duration
Example
ClassesView_TeleoperatedRobot DeploymentView_TeleoperatedRobot
« ppUnit »
DisplayData
displayData displayData
data: Integer [*]
« rtUnit » « rtUnit »
DisplayRefresher CommandInterpreter
updateDisplay () processEvent ()
updateGraphics () planTrajectory ()
« rtUnit » « rtUnit »
Reporter CommandManager Controller VME_Bus RobotArm
report () manage ()
servosData
servosData
« ppUnit » « rtUnit »
ServosData ServosController
servosData
Data: Integer [*] controlServos ()
get (): Data controlAlgorithms ()
set (D: Data) doControl ()
« workloadEvent »
ControlTrigg
{ periodic (period= (5, ms)) } «gaScenario»
{ respTime= ($r1, ms),
utilization= $u1,
execTime= ($e1, ms) }
Control
« workloadEvent »
ReportTrigg
{ periodic (period= (100, $pR, ms)) }
«gaScenario»
{ respTime= ($r2, ms),
utilization= $u2,
execTime= ($wcet1, max, ms) }
Report
« workloadEvent »
ReportTrigg
{ periodic (period= (1, s)) } «gaScenario»
{ respTime= ($r3, ms),
utilization= $u3,
execTime= ($e3, ms) }
Command
Platform
« gaResourcesPlatform »
TeleoperatedRobot_Platform
« schedulableResource »
« saExecHost »
«allocate» : DisplayRefresherTask
: Station
{ fp (priority= 22) }
« schedulableResource »
: MsjStatus
« saCommHost » «allocate» { fp (priority= 24) }
: CAN_Bus
{ transMode= Half-Duplex « schedulableResource »
speedFactor= ($prCAN) «allocate» : MsjCommand
blockT= (111, us, max, meas) { fp (priority= 24) }
packetT= (64, us, calc) }
« schedulableResource »
: ServosControllerTask
{ fp (priority= 30) }
«allocate»
« saExecHost » « schedulableResource »
: Controller : Reporter
{ speedFactor= (1.0) «allocate» { fp (priority= 24) }
clockOvh= (7, us, meas)
« schedulableResource »
cntxtSwT= (5, us, meas)
ISRswitchT= (2.5, us, meas) : CommandManager
schedPrioRange= ([0..30], determ)
«allocate» { fp (priority= 16) }
ISRPrioRange= ([31..31], determ) }
« schedulableResource »
«allocate»
: ControllerComm
{ fp (priority= 31) }
: VME_Bus
« scheduler »
« saExecHost » : RTOS_Scheduler
: RobotArm { schedPolicy= FixedPriority }
arriving departing
customers customers
Queue Server
Parameters
scheduling policy (FIFO, priority, etc.)
workload intensity - arrival process
e.g., Poisson arrival with rate 0.5/second
service demand per customer
e.g., exponential distribution with mean of 1.25 seconds
Performance measures
utilization = proportion of time the server is busy
residence time = average time spent at the service center by a customer,
both queueing and receiving service
queue length = average number of customers at the service center
throughput = rate at which customers pass through the service center.
15 15
Queue length
0.7
Utilization
0.6
0.5 10 10
0.4
0.3
5 5
0.2
0.1
0 0 0
0 0.2 0.4 0.6 0.8 0 0.2 0.4 0.6 0.8 0 0.2 0.4 0.6 0.8
CPU CPU
Terminals
Disk 2 Disk 2
LQN is a extension of QN
models both software tasks (rectangles)
clientE ClientT
and hardware devices (circles)
represents nested services (a server is Client
also a client to other servers)
software components have entries CPU
corresponding to different services
device
arcs represent service requests service1 service2 Appl
(synchronous and asynchronous)
multi-servers used to model components
with internal concurrency entries task Appl
What we get from the LQN solver: CPU
Service time (mean, variance) including
nested services
Waiting time Query1 Query2 DB
Throughput
Utilization
DB
Probability of missing a deadline
(obtained only by simulation) CPU
Disk1 Disk2
PWorkloadGenerator
« use »
GQAM_Workload ::
BehaviorScenario
« use » « use » « use »
GQAM_Workload ::
BehaviorScenario PRequestedService ExternalOperation
« use » « use » « use »
« use » « use »
« use »
GQAM_Workload ::
BehaviorScenario PRequestedService ExternalOperation
Behavior
Scenario
Steps
Communication Channel
A message between two objects is conveyed by some
mechanism:
if the objects are in the same execution thread (process), it is
conveyed by the language runtime
if the objects are in different execution threads (processes) in the
same node (ProcessingHost) it is conveyed by the operating
system
if the objects are on different nodes, it is conveyed by a system
layer named here CommChannel, which may be:
a middlware layer (CORBA connection, Java Remote Method
Invocation, web services connection, etc.)
a Message-Passing Interface connection in a grid
a socket or secure socket connection
a more complex infrastructure such as a publish-and-subscribe
system.
hardware-based conveyance
structured conveyance
Workload
Analysis
Context
Behavior Steps
Scenario
Observer
«commHost» «commHost»
internet: lan:
{blockingTime = (100,us)} {blockingTime = (10,us),
capacity = (100,Mb/s)}
«deploy»
«deploy» «deploy»
1:
«PaWorkloadEvent» 2:
{open (interArrT=(exp(17,ms))), «paStep»
«PaStep» «paCommStep»
{hostDemand = (4.5,ms)} {hostDemand = (12.4,ms),
rep = (1.3,-,mean),
msgSize = (2,KB)}
3:
4:
«paCommStep»
{msgSize = (50,KB)}
«PaCommStep»
{msgSize = (75,KB)}
[else] ref
Promotion2 <<PaStep {prob = 0.6}
1: getHomePage
<<GaWorkload Event>> {closed (population=Nusers),
extDelay=ThinkTime)}
<<PaStep>> {hostDemand = (1,ms), opt [if customer is logged in] <<PaStep>> {rep=0.2}
respT={((1,s,percent95),req),
((R,s,percent95),calc)}
2: getCustomerData
<<PaCommStep>> {msgSize=(2.9, KB)}
<<PaStep>>
{hostDemand = (2,ms)}
3:
<<PaStep>>
NewProducts
{behavDemand = newProduct,
behavCount = 1, blockT = (4,s)}
<<PaStep>>
<<PaStep>>
{probability = 0.9} {prob = 0.7}
<<PaStep>>
GetProductDetails
{blockT = (10,s),
behavDemand = getProductDetails,
behavCount = 1}
<<PaStep>>
{probability = 0.1}
<<PaStep>>
ShoppingCart
{blockT = (12,s),
behavDemand = ShoppingCart,
behavCount = 1}
<<PaStep>>
{probability = 0.3}
<<PaStep>>
Checkout
{blockT = (45,s),
behavCount = 1,
behavDemand = Checkout}
/ MARTE Tutorial 226
Example 2: Building Surveillance System
Two frequently executed scenarios are chosen for
performance analysis
Access
control
User
<<includes>>
Log entry/
exit
Manage
access rights
Manager
<<Pa Step>>
getBuf <<PaStep>>
{hostDemand = <<GaAcquireStep>>
(1.8,ms)} allocBuffer
{hostDemand = (0.5,ms), <<Pa Step>>
acqRes = bufferpool, storeImage
getImage resUnits = 1} <<Pa Step>>
{hostDemand =
storeDB
<<PaCommStep>> (2.5,ms), noSync}
{hostDemand =
{msgSize = (frameSize,bytes),
{((blocks*0.9), ms,mean),
repetitions = (frameSize/1500)} <<Pa Step>> (blocks*0.2),var)},
<<PaResPassStep>> freeBuf extOpDemand = writeBlock,
{passRes = bufferpool, {hostDemand =
passImage resUnits = 1} extOpCount = blocks}
(0.2,ms)}
<<Pa Step>>
<<GaReleaseStep>>
deallocBuffer cleanUp
{hostDemand = (0.5,ms),
relRes = bufferpool}
/ MARTE Tutorial 229
*HQHUDWHWKH/41PRGHOVWUXFWXUH
GHWHUPLQH/41VRIWZDUHWDVNVIURPKLJKOHYHOFRPSRQHQWV
GHWHUPLQH/41KDUGZDUHGHYLFHVIURPGHSOR\PHQWGLDJUDP
*HQHUDWH/41HQWULHVSKDVHVDFWLYLWLHVIURPVFHQDULRV
IRUHDFKVFHQDULRSURFHVVWKHDFWLYLW\ LQWHUDFWLRQ GLDJUDP V
PDWFKLQWHUFRPSRQHQWFRPPXQLFDWLRQVW\OHIURPSDWWHUQ
ZLWKPHVVDJHVEHWZHHQFRPSRQHQWVIURPWKHDFWLYLW\GLDJUDP
GLYLGH WKHDFWLYLW\GLDJUDPLQWRVXEJUDSKVFRUUHVSRQGLQJ
WRGLIIHUHQW/41HQWULHVSKDVHVDQGDFWLYLWLHV
FUHDWHWKHUHVSHFWLYH/41HOHPHQWV DQGFRPSXWHWKHLUSDUDPHWHUV
PHUJHWKH/41VXEPRGHOV FRUUHVSRQGLQJWRGLIIHUHQWVFHQDULRV
7UDYHUVHWKH/41JUDSKDQGZULWHRXWWH[WXDOPRGHOGHVFULSWLRQ
bufEntry
bufEntry alarm Alarm
Buffer
Buffer Dummy
[0,0]
(1, 0) (1, 0) (1, 0)
(forwarded) AlarmP
(0, 1)
Agenda
09:00 am to 10:15 am
Introduction to MDD for RT/E systems
MARTE foundations
10:15 am to 10:45 am: Break
10:45 am to 12:00 am
High-level modeling constructs
Detailed software and hardware platforms modeling
13:00 pm to 14:30 pm: Lunch
14:30 pm to 15:00 pm
Introduction to model-based RTE analysis
15:00 pm to 15:45 pm
Model-based schedulability analysis
15:45 pm to 16:15 pm: Break
16:15 pm to 17:00 pm
Model-based performance analysis
17:00 pm to 17:30 pm
Conclusions and perspectives about MARTE
Questions ?
www.martes.org
Workshop on model-based design and validation for RTES
Held in co,njunction with trhe Models 2007 conference
www.promarte.org
The MARTE web site
www.papyrusuml.org
On open source Eclipse plug-in for UML2 graphical modeling
MARTE implementation available end of July within the V1.7
relalease of the tool
Already available on:
https://speedy.supelec.fr/Papyrus/svn/Papyrus/extensions/MARTE/head/
Working on:
https://speedy.supelec.fr/Papyrus/svn/Papyrus/core/...