218
AADL Tutorial AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL) www.aadl.info Pyrrhus Software Enduring Solutions Bruce Lewis Joyce L Tokar Army AMCOM SED Pyrrhus Software Redstone Arsenal, AL Phoenix, AZ [email protected] [email protected] 256-876-3224 480-951-1019

The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 1

The SAE Architecture Analysis & Design

Language(AADL)

www.aadl.info

Pyrrhus SoftwareEnduring Solutions

Bruce Lewis Joyce L TokarArmy AMCOM SED Pyrrhus SoftwareRedstone Arsenal, AL Phoenix, [email protected] [email protected] 480-951-1019

Page 2: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 2

Tutorial Objectives

• Provide an overview of the SAE AADL Standard.

• Introduce architecture-based development concepts.

• Provide a summary of AADL capabilities.

• Demonstrate the benefits of AADL in real-time systems design.

• Provide an overview of the AADL development environment.

Page 3: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 3

Tutorial Outline

• Background & Introduction• Introduction to AADL• AADL in Use• AADL Development Environment• Benefits of AADL

Page 4: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 4

The SAE AADL Standard

• Sponsored bySociety of Automotive Engineers (SAE)

• Avionics Systems Division (ASD)o Embedded Systems (AS2)

» Avionics Architecture Description Language Subcommittee (AS2C)

» Bruce Lewis -- Chairman» [email protected]

• StatusRequirements document SAE ARD 5296

• Balloted and approved in 2000.Standard document SAE AS 5506

• Balloted and approved 2004.• Contact

http://www.aadl.info email: [email protected]

Page 5: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 5

SAE AS-2C ADL Subcommittee• Key Players:

Bruce Lewis (AMCOM): Chair, technology userSteve Vestal (Honeywell): MetaH originator, co-authorPeter Feiler (SEI): Secretary, main author, editor, technology userEd Colbert (USC): AADL & UML MappingJoyce Tokar (Pyrrhus Software): Programming Language Annex, co-editor

• Members:Boeing, Rockwell, Honeywell, Lockheed Martin, Raytheon, Smith Industries, Airbus, Axlog, Dassault, EADS , Canadair, High Integrity SystemsNAVAir, Open Systems JTF, British MOD, US ArmyEuropean Space Agency

• Coordination with:NATO, ESA, COTRE, OMG-UML

Page 6: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 6

Architecture & Analysis Design LanguageAADL

• Specification ofReal-timeEmbeddedFault-tolerantSecurely partitionedModal & dynamically configurable

• Software task and communication architectures• Bound to

Distributed multiple processor hardware architectures• Fields of application

Avionics, Aerospace, Automotive, Autonomous systems, …

Page 7: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 7

Fields of Application

• Automotives• Avionics• Robotics

• Fixed sampling and processing rates• Variable sampling and processing rates• Stochastic event and processing rates

• Known operational modes and configurations• Large-scale system integration

Page 8: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 8

MetaH - A Precursor to AADL1991 DARPA DSSA program begins1992 Partitioned PFP target (Tartan MAR/i960MC)1994 Multi-processor target (VME i960MC)1995 Slack stealing scheduler1998 Portable Ada 95 and POSIX middleware configurations1999 Hybrid automata verification of core middleware modules

Numerous evaluation and demonstration projects, e.g.Missile G&C reference architecture, demos, others (AMCOM SED)Hybrid automata formal verification (AFOSR, Honeywell)Missile defense (Boeing)Fighter guidance SW fault tolerance (DARPA, CMU, Lockheed-Martin)Incremental Upgrade of Legacy Systems (AFRL, Boeing, Honeywell)Comanche study (AMCOM, Comanche PO, Boeing, Honeywell)Tactical Mobile Robotics (DARPA, Honeywell, Georgia Tech)Advanced Intercept Technology CWE (BMDO, MaxTech)Adaptive Computer Systems (DARPA, Honeywell)Avionics System Performance Management (AFRL, Honeywell)Ada Software Integrated Development/Verification (AFRL, Honeywell)FMS reference architecture (Honeywell)JSF vehicle control (Honeywell)IFMU reengineering (Honeywell)

Page 9: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 9

MetaH Case Study at AMCOM

• Missile Application reengineeredMissile on-board software and 6DOF environment simulation executing on dual i80960MC, Tartan Ada, VME BoardsBuilt to Generic Missile Reference ArchitectureSpecified in MetaH, 12 to 16 concurrent processesMetaH reduced total re-engineering cost 40% on first project it was used on. Missile prime estimated savings at 66%.

• Missile Application ported to a new execution environment

Multiple ports to single and dual processor implementationsNew processors (Pentium and PowerPC), compilers, O/SFirst time executable, flew correctly on each target environmentPorts took a few weeks rather than 10 months.

Page 10: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 10

AMCOM Effort Saved Using MetaH

Review 3-DOF Trans-late

6-DOF RT-6DOF

Trans-form

Test6DOF

RT-Missile

BuildDebug

Debug Re-target

MetaH

Current

TraditionalApproach

UsingMetaH0

1000

2000

3000

4000

5000

6000

7000

8000

Man H

ours

Total project savings 50%, re-target savings 90%

Benefit During Application Rewrite

Benefit During Platform Retarget

Page 11: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 11

ExtensibleReal-time

Dependable

Architecture Description Languages

Research ADLs• MetaH

Real-time, modal, system familyAnalysis & generationRMA based scheduling

• Rapide, Wright, ..Behavioral validation

• ADL InterchangeACME, xADLADML (MCC/Open Group, TOGAF)

Industrial Strength• HOOD/STOOD• SDL• UML 2.0, UML-RT

Basis

Extension

Influence

Enhancements

Alignment

Page 12: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 12

Typical Software Development Process

Requirements Analysis Design Implementation Integration

manual, paper intensive, error prone, resistant to change

Page 13: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 13

Model-Based System Engineering

RequirementsAnalysis

Design, Analysis and Implementation

System Integration

Predictable System Rapid Integration Upgradeability

Explicit ArchitectureEngineering ModelsUse of AADL

Model-Based & Architecture-Driven

Page 14: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 14

Model the Architecture,

Abstract & Precise

Ambulatory

InformationFusion

Supply ChainMechanized

Sensor& SignalProcessing

System Construction• Executive generation • System Integration

Devices Memory Bus Processor

Model-Based System Engineering

AutomaticTargetRecognition

Guidance& Control

SoS Analysis• Schedulability• Performance• Reliability• Fault Tolerance• Dynamic Configurability

HTTPSDBGPS RTOS

Execution Platform

. . . . . . . . . .

Application Software

Domain Specific

Components & Subsystems

Performance-Critical Architecture ModelApplication System & Execution Platform

Software Systems Engineer

Page 15: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 15

Tutorial Outline

• Background & Introduction• Introduction to AADL• AADL in Use• AADL Development Environment• Benefits of AADL

Page 16: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 16

What is Software Architecture?• Architecture is the fundamental organization of a

system as embodied inits components,their relationships to each other and the environment,the principles governing its design and evolution.

• The software architecture of a program or computing system is

the structure or structural arrangements of its composite software elements,the externally visible properties of those elements,the relationships among them.

Architecture is the foundation of good software system engineering

Page 17: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 17

What is an Architecture Description Language

(ADL)?• The architecture of a system defines its high-

level structure and exposes its gross organization as a collection of interacting components.

• An Architecture Description Language (ADL) focuses on the high-level structure of the overall application rather than on the implementation details of any specific component.

• ADLs and their accompanying toolsets support architecture-based development, formal modeling, and analysis of architectural specifications.

Page 18: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 18

Common Foundation of ADLs• Components represent the primary (computational)

elements and data stores of a system. • AADL Components:

Software Components:• Data, subprogram, thread, thread groups process.

Execution Environment Components:• Memory, bus, device, processor

Composite Components:• System

• AADL Component Interfaces:Shared DataPorts

• Data ports, event ports, event data ports.Subprogram Parameters

Page 19: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 19

Common Foundation of ADLs

• Connectors represent interactions among components.

• Connectors in AADL:Subprogram Call SequenceConnections• Port connections, access connections

Flows

Page 20: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 20

Common Foundation of ADLs

• Systems represent configurations of components and connectors.

• Systems in AADL:PackagesSystems

Page 21: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 21

Common Foundation of ADLs

• Properties represent semantic information about a system and its components that goes beyond structure.

• AADL supplies:Predefined PropertiesUser-defined Property Sets

Page 22: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 22

Common Foundation of ADLs

• Constraints represent claims about an architectural design that should remain true even as it evolves over time.

• Constraints in AADL:Hybrid automata assertionsProperty value constraintsAnnexes

Page 23: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 23

Common Foundation of ADLs

• Styles represent families of related systems.• Styles in AADL:

Multiple implementationsRefinementPackagesProperty setsAnnexes

Page 24: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 24

Common Foundation of ADLs• Components• Connectors• Systems

• Properties• Constraints• Styles

Page 25: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 25

Focus Of SAE AADL• Component View

Model of system composition & hierarchy.Well-defined component interfaces.

• Concurrency & Interaction ViewTime ordering of data, messages, and events.Dynamic operational behavior.Explicit interaction paths & protocols.

• Execution viewExecution platform as resources.Binding of application software.Specification & analysis of runtime properties

• timeliness, throughput, reliability, graceful degradation, …

Page 26: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 26

The AADL in a Nutshell

ApplicationThread, Process,

SystemExecution Platform

Execution engineMemory, Bus

Device

ComponentsSpecifications

Variant implementationsPorts

ConnectionsDomain data objects

Behaviors

Performance-Critical Layering & CompositionSystem Architecture

Implementation

OPENGov usage rights.Industry AADL

standard.

HARDWARE INDEPENDENT

No implementation specified in SW API.

REUSABLEVery portable.

Function/non-functional requirements.

Ideal isolation from hardware.

GENERICModular,

scalable, system “block diagram”with semantics

EXTENSIBLE/SCALABLE

Multi-processor/multi-process, easily add/change

and see effects. User defined domain specific functions..

FORMAL, RICH SEMANTICS

Models can span high-level system to detailed

interfaces

FLEXIBLESystem spec used to

change implementation.

Interface with any standard or application

REAL-TIMEUser specifies timing

requirements, analyzers available, concurrency handled

automatically!

VERIFIABLEStrong support for predictable

real-time architectures exhibiting high-reliability

USABLE AND AVAILABLEApproach/formalism is SIMPLE/UNIFORM,

PRACTICAL, and EASY TO USE, LEARN, AND

INTERFACE WITH OTHER APPROACHES!

OBJECT-ORIENTED

Clearly defined object, messaging,

properties, decomposition

RELIABILITY,SAFETY,

SECURITY SUPPORT

User specifies requirements;

analyzers available

HARDWAREMODELING AND BINDINGS FULLY SUPPORTED BY AADL(auxiliary to

the SW API)

Page 27: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 27

The SAE AADL Standard• Provides a standard & precise way to describe the

architecture of embedded computer systems.• Provides a standard way to describe components,

assemblies of components, and interfaces to components.

• Describes how components are composed together to form complete system architectures.

• Describes the runtime semantics and thread scheduling protocols.

• Describes the mechanisms to exchange control and data between components.

• Describes dynamic run-time configurations.

Page 28: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 28

AADL Concepts Overview• Hierarchically composed & interconnected

components: system.• Application system components: thread, thread group,

process, data, and subprogram.• Execution platform components: processor, memory,

bus, and device.• Interaction in terms of directional flow via ports,

call/return, and data sharing.• Flow of signals/state (data), control (event & time

triggered), and messages (event data) across multiple components.

• Dynamic behavior in terms of statically known alternate task & communication configurations (modes).

• Core AADL and Annex extensions.

Page 29: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 29

Graphical & Textual Notation

system Data_Acquisition features

speed_data: in data port metric_speed;GPS_data: in data port position_carthesian;user_input_data: in data port user_input;s_control_data: out data port state_control;

end Data_Acquisition;

speed_data

userinputdata

GPS_data

Data_Acquisition

s_control_data

data type of port

data port

Page 30: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 30

AADL Components• Composite Components

System• Software Components

DataSubprogramThreadThread GroupProcess

• Execution Platform Components

MemoryDeviceBusProcessor

Page 31: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 31

AADL Components

• Component Type -- specifies the interface to the component.

• Component Implementation -- zero or more specifications of the component’s internal representation.

Page 32: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 32

System Components

• Specifies a well-formed interface.

• All external interaction points defined as features.

• Multiple implementations per component type.

• Properties as specified component characteristics.

• Components organized in nested hierarchy.

• Component interaction declarations must follow system hierarchy.

Page 33: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 33

System

• Hierarchical composition.• Execution platform and application software

components.• Data and bus sharable across system

hierarchy.

System

Features: port, subprogram Provides: data access, bus accessRequires: bus access, data access

Subcomponents: process, system, memory, processor, bus, device, and dataConnections: yesModes: yes

Page 34: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 34

Device

• Physical component interfacing with environment.• Interacts with application components via port

connections.• Connects physically to processors via bus.• May have associated software executes on

connected processor.• Examples

sensors and actuatorsstandalone systems such as a GPS

device

Features: port, subprogramRequires: bus access

Connections: noModes: yes

Page 35: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 35

AADL Interfaces & Connections• Ports

Data portsEvent Data portsEvent ports

• ConnectionsImmediateDelayed

Page 36: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 36

AADL Interfaces & Connections

• Port Groups• Connections

Page 37: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 37

AADL Interfaces & Connections

• SubprogramsLocalServer

• Subprogram callsLocalRemote

Page 38: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 38

Shared Data & Bus Access

• Component requires access

• Component provides access

Page 39: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 39

AADL Properties• Predefined property

sets• User defined property

sets

Page 40: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 40

Process P1

Application Component Hierarchy

Thread T1 Thread T2 Thread T3 Thread T4

System S1

Process P3

System S2

System App

Process P2Thread T5 Thread T6

Two ways of graphically visualizing component hierarchy

Page 41: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 41

3 Ways to Interact: AADL Component Interaction

Flight Mgr

WarningsAnnunciations

MFD Pilot

MFD Copilot

data

1553

Weapons Mgr

Unidirectional data & event flow

Synchronous call/return(not shown)

Managed shared data access: only two threads have access

Page 42: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 42

Application System & Execution Platform

Flight Mgr

WarningsAnnunciations

MFD Pilot

MFD Copilotdata

1553

Weapons Mgr

CoPilot Display

Display Processor

Pilot Display

Display Processor

High speed network

MissionProcessor

1553 bus

Application system binding to execution platform

Page 43: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 43

AADL and Scheduling

• AADL provides precise dispatch & communication semantics via hybrid automata.

• AADL task & communication abstraction does not prescribe scheduling protocols

Cyclic executive can be supported.• Specific scheduling protocols may require additional

properties.• Predefined properties support rate-monotonic fixed

priority preemptive scheduling.

This scheduling protocol is analyzable, requires small runtime footprint,

provides flexible runtime architecture.

Page 44: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 44

AADL Threads

• ThreadsPeriodic -- execute at given time intervals.Aperiodic -- are triggered by an event or remote procedure call.Sporadic -- paced to limit execution rate.Background -- run when there is available processor time.

Page 45: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 45

Suspended

Initialized Thread

Inactive

UninitializedThread

Active

DeactivateComplete:

ActiveInNewMode:

Terminate:

Terminated Thread

Dispatch:

Complete:

Fault:Recovered:

InitializeComplete:

ActiveInInitMode:InactiveInInitMode:

InactiveInNewMode:

ActivateComplete:

FinalizeComplete:Thread State with Source Code Execution

Initialize

Activate

Deactivate

Finalize

Compute

Recover

Thread State

Repaired:

ActiveMember of

current mode

InactiveNot member of current mode

Application Source EntrypointsApplication as Plug-in

Thread States

Page 46: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 46

PackageThread T1

Server Thread T2

Process Prc1

System Subsystem1

SP1

SP2SP3

RSP1

Data1:Pos

Process Prc2

Thread T3Data1:

PosThread T1

Data1

Data1:Pos

System System1

Thread T2E1

E1

E1

Typed and constrained data streams

Thread Dispatch Protocols

PeriodicAperiodicSporadicBackground

Immediate and delayed communication

Shared data

DirectionalData, event, message portsQueued and unqueued xfer

Call/ReturnLocal subprogram

Client/server subprogram

Shared AccessPersistent, shareable

dataAccess coordination

Task & Interaction Architecture

Page 47: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 47

Thread• Is a schedulable unit executing on a processor

under a scheduling protocol.• Is dispatched based on time or arrival of events.• Executes within the protected address space of a

process.• Interacts with other threads through port

connections, remote subprogram calls, and shared data access.

• Can be logically organized into thread groups.

Features:port, server subprogram Requires: data accessProvides: data access

Subcomponents: DataConnections: noModes: yes

Remote service calls

Thread

Page 48: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 48

Faults and Modes• AADL provides a fault handling framework with

precisely defined actions.• AADL supports runtime changes to task &

communication configurations.• AADL defines timing semantics for task coordination

on mode switching.• AADL supports specification of mode transition

actions.• System initialization & termination are explicitly

modeled.

Page 49: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 49

PackageThread T1

Server Thread T2

Process Prc1

System Subsystem1

SP1

SP2SP3

RSP1

Data1:Pos

Process Prc2

Thread T3Data1:

PosThread T1

Data1

Data1:Pos

System System1

Thread T2E1

E1

E1Shared data

Initial Mode A: Prc1, Prc2;Mode B: Prc1, Prc3; Process Prc3

Initial Mode A: T1, T2, T3;Mode B: T1, T2;

E1 A

E1 A

E1 A

Application Source Internal ModeConditional code

Mode as Alternative Configuration

Hierarchical Modes

Page 50: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 50

A Mode Example

system implementation Main.Example isA: system Foo.Bar;B: system Oof.Rab;C_sub1, C_sub2: system; D_sub1, D_sub2: system; Mode1: initial mode (A, B, C_sub1, C_sub2);Mode2: mode (A, B, D_sub1, D_sub2);

behaviorsmode Mode1 –[ A.Switch_To_D ]-> Mode2;mode Mode2 –[ A.Switch_To_C ]-> Mode1;

end Main.Example;

Page 51: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 51

Behavior Modeling

• Core FeaturesOperational modes Runtime reconfigurationEnd-to-end flows

• Language ExtensionsInteraction behavior • Port interaction pattern of component• Interaction protocol of connectionError models & reliability analysis

State reachability

Flow traceability

Protocol verification

Model checking

Page 52: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 52

System Safety EngineeringCapture the results of

• Hazard analysis• Component failure modes & effects analysis

Specify and analyze• Fault trees• Markov models• Partition isolation/event independence

Integration of system safety with architectural design• Enables cross-checking between models• Insures safety models and design architecture are consistent

• Reduces specification and verification effort

Supported by Error Model Annex

Page 53: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 53

Process Prc1

System Subsystem1

Thread T3

System System1

Process Prc2

Thread T3

Processor PC1

System LinuxBox

Memory

System LinuxNet

Processor PC2

Memory

Bus

Processors, buses, memory, and devices as Virtual Machines

Threads as logical unit of concurrency

System & Execution Platforms

Page 54: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 54

Satellite_sys: system

Satellite_SW: system Satellite_plant: platform

Satellite_bus: bus

Satellite: device

Satellite_mem: memory

linuxbox1: platform pentium

linuxbox2: platform pentium

guidance: process control: process

decide: thread

act: thread

observe: thread

Satellite_plant.pentium

Satellite_SW.guidance.observe=> Satellite_plant.linuxbox2

Satellite_SW.Control => Satellite_plant.linuxbox1

linuxbox3: platform PPC

Satellite_plant.linuxbox2

Binding Systems to Execution Platforms

Page 55: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 55

Extensibility • Core standard plus optional annexes• Add values for predeclared standard

properties.• Addition of properties.• Component classifier libraries.• Extension of component declarations.• Refinement of subcomponent declarations.• Modeling of source code data type

inheritance.

Page 56: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 56

CT1CT

CT2

CT11

CT12

I1 I2I1 I2 I3

Component type

Component type extension

Component implementation

Component implementation extension

Component type (interface)Component implementationsSubcomponents (hierarchy)Component instance

Component Classifier Refinement

PortsConnectionsModesPropertiesBehavior

Extensible Components

Page 57: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 57

Extending an AADL Component

Page 58: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 58

Extending AADL

• Component Types have multiple implementations families.

• Component extension and refinement.• Packages.• Property Sets.• Annex Subclauses.• AADL Standard Annexes.

Page 59: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 59

Component Evolution

• Partially complete component type and implementation.

• Multiple implementations for a component type.

• Extension & refinementComponent templates to be completed.Variations and extensions in interface (component type).Variations and extensions in implementations.

Page 60: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 60

Large-Scale Development

• Component type and implementation declarations in packages

Name scope for component types.Grouping into manageable units.Nested package naming.Qualified naming to manage name conflicts.

• Supports independent development of subsystems.

• Supports large-scale system of system development.

Page 61: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 61

AADL Language Extensions

• Core standard plus optional annexes.• Examples

Error ModelARINC 653BehaviorConstraint sublanguage

• Annex as documentNew properties through property setsAnnex-specific subclauses expressed in an annex-specific sublanguage

Page 62: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 62

Summary of AADL Capabilities• AADL abstractions separate application domain

concerns from runtime architecture concerns.• AADL combines predictable task execution with

deterministic communication.• AADL is effective for embedded, real-time, high-

dependability, software-intensive application systems.• AADL supports predictable system analysis and

deployment through model-based system engineering. • AADL component & communication semantics facilitate

the dialogue between application and software experts.• AADL provides an extensible basis for a wide range of

embedded systems analyses.• AADL builds on 13 years of DARPA investment +

experiments.

Page 63: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 63

Tutorial Outline

• Background & Introduction• Introduction to AADL• AADL in Use• AADL Development Environment• Benefits of AADL

Page 64: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 64

What Is Involved In Using The AADL?

• Specify software & hardware system architectures.

• Specify component interfaces and implementation properties.

• Analyze system timing, reliability, partition isolation.

• Tool-supported software and system integration.

• Verify source code compliance & middleware behavior.

Model and analyze early and throughout product life cycle

Page 65: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 65

AADL Analysis & Design Methodology• Here we use the AADL as analysis & design

methodology on an existing system• AADL employs

Components with precisely defined semantics.Explicit interactions.Decomposition.Separation of concerns.

• Pattern-based architecture analysis approachUses design patterns in analysis.Identifies systemic problems early.Enables the right choices with confidence. Provides analysis-based decisions.

Page 66: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 66

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 67: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 67

Avionics Systems• Embedded avionics system designs are evolving to

Integrated systems from federated ones.Predictable preemptive scheduling.Extensible system architectures.

• There are distinct perspectives in the designControl and domain engineers.Application software engineers.System software engineers.

• In the remainder of this tutorial we considerA representative avionics system.Design within the context of the AADL.The distinct perspectives involved.Issues associated with the evolution of avionics systems.

Page 68: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 68

Avionics System Example

• Reflects current design approaches includingTime and space partitioningShared memory & port communicationCyclic executive & preemptive schedulingDeterministic communication Distributed system with legacy hardwareFault tolerance and reconfigurationEfficient execution and footprint

Focus on performance-critical system properties

Page 69: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 69

Sample Avionics System Hardware Configuration

Pilot Multifunction

Display1

Pilot Multifunction

Display2

CoPilot Multifunction

Display1

CoPilot Multifunction

Display2

Display Processor

Display Processor

Display Processor

Display Processor

MissionProcessor

MissionProcessor

MissionProcessor

High speed network

1553 bus

Auto-Pilot GPS Nav Radio

1553 bus

High speed network

Redundant network and bus

Redundant network and bus

Does not have access to the 1553 buses

Page 70: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 70

A Typical Context Diagram

Page 71: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 71

Avionics Software Component Layers

Display Manager

Warning AnnunciationManager

FlightManager

FlightDirector

Page ContentManager

SituationAwareness

WeaponsManager

Comm.Manager

1553 Access

• logical interface to 1553 • hides the fact that some

processors do not have direct access to 1553 bus

Indirect information flow

Page 72: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 72

Typical Software to Hardware Mapping

High speed bus

1553 bus

DM

WAM

PCM

DM

WAM

DM

WAM

PCM

DM

WAM

FM FMFD

WM WMSA

FDSA CM

CM1553

High speed bus

1553 bus

CM

1553

Page 73: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 73

Observations: Hidden Information• Multiple instances as separate components.• Both dual and quad redundancy.• Grouping of redundant instances.• Documented in text.• Difficult to understand and analyze.

Page 74: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 74

Avionics System Context Diagram

Nav Radio

AvionicsSystem

GPS

Pilot Multifunction

Display1

CoPilot Multifunction

Display2

CoPilot Multifunction

Display1

Pilot Multifunction

Display2

Port groupAggregate connection

Auto-Pilot

Page 75: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 75

Avionics System

Flight Manager Context Diagram

FlightDirector

Warning AnnunciationManager

Page ContentManager

GPSNav RadioAuto-Pilot

Flight Manager

Display Manager

WeaponsManager

Comm.Manager

SituationAwareness

Page 76: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 76

Perspectives on Devices• Hardware Engineer

Device is part of physical system

• Application developerDevice functionality is part of the application software

• Control EngineerDevice represents the plant being controlled

Application

Physical Hardware

Processor

Device

Bus

Application System

FM Device(Driver)

FD

Execution Platform

Bus

Processor

Control System

FM PlantAP

Controlled EnvironmentSensor

Actuator

Page 77: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 77

Flight Manager: Principal Functionality

Navigation Sensor

Processing

Integrated Navigation

Guidance Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz

20Hz

5Hz

2Hz

From otherPartitions

Periodic I/O20Hz

To otherPartitions

Shared Data Area

Nav Radio20Hz

Processing functionsProcessing functions

Auxiliary service

Subsystem ?= CSCI ?= Partition

Page 78: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 78

Preemptive Scheduling & Data Flow

• Preemptive scheduling & shared variables• Data flow patterns• Threads and port connections in AADL• Efficient and correct implementations

Modernizing an embedded real-time systemFrom cyclic executive to preemptive schedulingFrom shared variables to port communication

Page 79: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 79

Shared data area

Switch clock mod HyperperiodCase 20Hz:

call PIOcall NSPcall GP

Case 2*20Hz: -- 10Hzcall PIOcall NSPcall INcall GP

Case 3*20Hz:. . .

Case 4*20Hz: -- 5Hz

A Cyclic Executive Implementation

Navigation Sensor

Processing

Integrated Navigation

Guidance Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz

20Hz

5Hz

2Hz

From otherPartitions

Periodic I/O20Hz

To otherPartitions

Simple mapping to a cyclic callout implementation

1

2

3

4

5

6

Page 80: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 80

Preemptive Scheduling and Port Communication

• Towards Rate-Monotonic SchedulingFixed priority preemptive scheduling based on rate-monotonic analysis (RMA)Better resource utilization, more extensible architecture

• Towards port connectionsShared variable communication: efficiency and legacyFrom shared variables to data port connections

• Example: flight manager• Scheduling and communication in a partition

Page 81: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 81

Benefit of Preemptive Scheduling

• Thread A: 20Hz 20ms• Thread B: 10Hz 11ms• Thread C: 20Hz 20ms• Not schedulable with cyclic executive

Timeline

Thread AThread C

Thread B

T0 T50

Timeline

Thread AThread C

Thread B

T0 T50

Thread AThread C

Using RMA guarantees deadlines are met

• Schedulable with – preemption– correct priority (EDF, RMA)

Page 82: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 82

A Naïve Thread-based Design

Navigation Sensor

Processing

Integrated Navigation

Guidance Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz

20Hz

5Hz

2Hz

From other Partitions

Dec

reas

ing

Prio

rity

Periodic I/O20Hz

To otherPartitions

• Fixed-priority threads

•Priority assignment by developer

Pr 1

Pr 2

Pr 3

Pr 4

Pr 6

Pr 9

Shared data area

Page 83: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 83

Design Decisions Taken• Shared variable communication within partition

Achieve efficient resource utilizationAccommodate legacy code

• Preemptive fixed-priority thread scheduling Used Schedulability analysis (RMA) to confirm schedulabilityBenefit of more flexible system and efficient resource usage

• Priority assignment for precedence ordering to achieve desired flow

Needed because of shared data area

• Periodic I/O Port data to shared data area (support legacy code)Deterministic communicationOutput packaging of time consistent data set

Page 84: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 84

Impact of Decisions• Rate-Monotonic scheduling analysis (RMA)

Priority inversion by 10Hz thread

• 10Hz thread (IN) may prevent lower priority 20Hz from running if IN’s deadline > .05 sec

Assume IN pre-period deadline of .05 sec or less

• 10Hz thread preemption: shared data inconsistency and non-deterministic sampling

Atomic shared data read/write operations assures data consistencypre-period deadline of .05sec assures determinism

• .05 sec pre-period deadline for 10HzThreads must complete at .05 sec Deadline monotonic scheduling analysis

Effectively cyclic executive

Promoted by AADL

Expressed in AADL

Page 85: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 85

Observations on Scheduling• Situation: Preemptive scheduling and shared data• Communication via shared data for efficiency• Precedence ordering to achieve desired flow• Priority assignment to achieve precedence ordering• Causes priority inversion• Requires pre-period deadline• Leads to cyclic executive like scheduling behavior at

expense of preemptive scheduling overhead

Timeline

Thread NSPThread IN

Thread GP

T0 T100 T150T50 T200

Thread NSP

Thread GP

Thread NSPThread IN

Thread GP

Thread NSP

Thread GP

Page 86: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 86

Consistent Communication of State

• Situation: Communication by shared variables• Issue: preemptive scheduling introduces concurrency• Read/write of consistent data values• Deterministic read/write order

Page 87: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 87

Need for Atomic Read/Write

Timeline

Thread GP

Thread IN

T0 T50

• Thread C updates state in multiple write operations• Thread A preempts thread C while write is in progress• Techniques for atomic read/write

Hardware supportedLockingTemporary non-preemption

Thread GP

Finish write

Read

Write

T100

Thread IN is preempted

Page 88: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 88

Deterministic State Communication• Write & read (send & receive) performed by application• Variation in actual write & read time• Preemption & completion time affect receiver sampling• Example:

Thread A -> thread BThread A twice rate of thread BThread C preemption adds to variation

• Desired sampling pattern 2X: n, n+2, n+4 (2,2,2,…)• Worst-case sampling pattern: n, n+1, n+4 (1,3,…)

Timeline

Thread NSP

Thread INThread NavRadio

Page 89: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 89

State Communication in AADL

• AADL precisely specifies the time of data transfer

• AADL semantics assure consistent and deterministic state communication

• Implementation may require double buffering• Requires runtime system support

Page 90: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 90

Preemptive Scheduling & Data Flow

• Preemptive scheduling & shared variables• Data flow patterns• Threads and port connections in AADL• Efficient and correct implementations

Modernizing an embedded real-time systemFrom cyclic executive to preemptive schedulingFrom shared variables to port communication

Page 91: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 91

Intended Data Flow

Navigation Sensor

Processing

Integrated Navigation

Guidance Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz

20Hz

5Hz

2Hz

From other Partitions

Dec

reas

ing

Prio

rity

Periodic I/O20Hz

To otherPartitions

Implemented via shared dataAchieved via precedence ordering

Shared data area

Page 92: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 92

Observations on Data Flow• Data flow described in text and tables.• Phase delayed data flow hidden in text.• Output phase delay embedded in periodic I/O thread.• Application component code contains communication

mechanism decision.

Page 93: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 93

Shared Data Area Detailing

Navigation Sensor

Processing

Integrated Navigation

Guidance Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz

20Hz

5Hz

2Hz

From other Partitions

Periodic I/O20Hz

To otherPartitions

NS data

GP data

FP data

Fuel data

FPC data

IN data

NSP data

Page 94: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 94

Observations on Data Detailing• More explicit documentation of information flow is

needed in this example • Periodic I/O as focal point

Loss of cross-partition flow information

• It is important to explicitly document the flow of data and control information.

• Towards thread interface specification• Explicit documentation of all interaction points• Data vs. Message Communication Choice

State vs. state changeControl system signal stream -> data ports

Page 95: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 95

Preemptive Scheduling & Data Flow

• Preemptive scheduling & shared variables• Data flow patterns• Threads and port connections in AADL• Efficient and correct implementations

Modernizing an embedded real-time systemFrom cyclic executive to preemptive schedulingFrom shared variables to port communication

Page 96: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 96

A Control System Example

K2S

Used for iterative/recurrence functions(e.g. integrators, filters)

6

K1 K2s+

-

K1

Discretization of time continuous function

S

X

Delayed communication

Xi+1 : = K2S(Si+1,Xi)

Page 97: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 97

Observations: Control Processing• AADL supports mid-frame communication & single

sample delay • Application component developer specifies

communication timing in terms of application domain• AADL analysis identifies mid-frame communication

cycles• AADL determines schedulability of implementation• Opens dialogue between application developers and

software system engineer

Page 98: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 98

Ports and Connections

• Port (flow of data and control)data (state)event-data (queued)event (queuing possible)

data portout

in

in out

Event port

Event data port

loop_control user_display

Data type checking on connected ports.Checking of data value & stream characteristics.

: in data boat_speed: out data boat_speed

Page 99: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 99

Immediate Data Connections

• Immediate data connections initiated when source thread completesstart of receiving thread execution is delayed until completion of the sending threaddata transfer occurs only when the dispatch for both the sending and the receiving threads are logically simultaneous

• Effect of immediate communicationall threads see input from same sample periodconstrain order of execution and communication

• Restrictions: No cycles

Connection (immediate)

Page 100: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 100

Immediate Communication

Timeline

read_data read_datacontrol control

Ti,10Hz Ti+1,10Hz

read_data control

10Hz 10Hz

(deadline = period)

Vertical leveling does not imply different priorities.

Data available to control thread transmission is initiated when

read_data thread completes

Page 101: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 101

Delayed Connections-Periodic Threads

• For delayed data connections data transmission is initiated at the deadline of the connection source thread data is available at the destination port at the next dispatch of the destination thread

• Value: controlled communication delaysallow feed-back loops break connection cyclerecipient samples at its dispatch rate and time

Connection (delayed)

Page 102: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 102

Delayed Communication

Timeline

outputcontrol control

Ti,10Hz Ti+1,10Hz

control output

10Hz 10Hz

(deadline = period)

Data available to thread Transfer initiated at the deadline of the source thread

output

Buffered result

Page 103: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 103

Flight Manager in AADL

Navigation Sensor

Processing

Integrated Navigation Guidance

Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz 20Hz

5Hz

2Hz

From Partitions

To Partitions

Fuel Flow

Guidance

Nav sensor data

Nav signal data

FP data

Performance data

Nav dataNav sensor

data

Nav data

FP data

Phase delay of Periodic I/O

Page 104: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 104

End-To-End Flow Specification

Navigation Sensor

Processing

Integrated Navigation Guidance

Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz 20Hz

5Hz

2Hz

From Partitions

To Partitions

Fuel Flow

Guidance

Nav sensor data

Nav signal data

FP data

Performance data

Nav data

Nav sensor data

Nav data

FP data

Phase delay of Periodic I/O

Page 105: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 105

Observations on Use of AADL• Explicit interface specification for all threads.• Named and typed ports with flow constraints

supports flow consistency checking.• Focus on data flow, not task priority assignment:

Flow expressed through data ports & connections,No shared data object used.

• Explicit specification of communication timing through delayed connection.

• Specification of thread dispatch characteristics.

Page 106: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 106

Deterministic Communication in AADL

• AADL semantics assure communication determinism

In terms of dispatch & deadline.• Implementation considerations

Mutual exclusive port variable access,Double buffering as appropriate,AADL runtime system responsible for dispatch & communication.

Page 107: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 107

Sampling & Immediate Connections

AADL assures • Deterministic sampling • Single buffer solution

read_data control

10Hz 20Hz

Timeline

read_data read_datacontrol control

Ti,10Hz, 20Hz Ti+2,20HzTi+1,20Hz

Ti+1,10Hz

control

Read every value twiceImmediate connection affects execution order

Old data value

Page 108: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 108

Sampling & Delayed Connections

Delayed vs. immediate• Both are deterministic• They differ in amount of latency

read_data control

10Hz 20Hz

Timeline

read_data read_data

control control

Ti,10Hz, 20Hz Ti+2,20HzTi+1,20Hz

Ti+1,10Hz

control

Read every value twice

Delayed connection requires double buffering

control

Old data value

Page 109: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 109

Up and Down Sampling• S-C: overlapping lifespan – xfer at Controller rate• C-A: overlapping lifespan – xfer at Actuator rate

Sensor20Hz Controller

10Hz

Actuator20Hz

Timeline

Sensor Sensor

Controller

Actuator

Controller

Actuator

Ti,20Hz Ti+1,20Hz

Controller

Read-only A in port: 3 buffersRefresh A in port: 4 buffers

No C in out port: plus 1 buffer

Actuator

SensorPreempted

Page 110: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 110

Connection Sequences• What is the effect of combining immediate & delayed

connections?

• S20Hz -> C10Hz -> A20Hz

• S20Hz ->> C10Hz -> A20Hz

• S20Hz -> C10Hz ->> A20Hz

• S20Hz ->> C10Hz ->> A20Hz

S;C;A @ S;A: CD20Hz 0 pd

S|A @ S|(C;A): CD20Hz 1 pd

(S;C) | A @ S|A : CD10Hz 2 pd

(S|C|A) @ (S|C|A):CD10Hz 3 pd| indicates concurrency

for multi processing

@ separates 20 Hz timeframes

Implied C deadline

Amount of phase delay

Page 111: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 111

Application Design Tradeoff

• When do I need immediate data transfer?• When do I need phase delayed transfer?• When can I afford phase delayed transfer?

Reduction in resource constraints results in higher resource utilization

Page 112: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 112

Observations: AADL Communication• Focus on what communication is desired, not how it

is implemented.• Assures deterministic communication when desired• Shows application rates & desired phase delay

explicitly.• Bridging the time gap:

Basis for tradeoff between application and system engineer;Sensitivity analysis on variation in sampling rates & dispatch rates;Connection timing affects latency;Connection timing choice affects resource utilization & controller stability.

Page 113: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 113

Preemptive Scheduling & Data Flow

• Preemptive scheduling & shared variables• Data flow patterns• Threads and port connections in AADL• Efficient and correct implementations

Modernizing an embedded real-time systemFrom cyclic executive to preemptive schedulingFrom shared variables to port communication

Page 114: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 114

Efficient Communication

• Should not be application developer responsibility• Optimization problem for software system engineer• Built into a runtime generation tool

Page 115: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 115

Port Communication & Buffers

MSk

MSj

MPj

Sensor

Send

MRj

Xfer

MPk

Controller

MCj

Receive Send

Actuator

MCk

MRkXfer

Receive

MP: producer copyMS: send copyMR: receive copyMC: consumer copy

Buffer reduction techniques • Send/receive with or without copy or no send/receive• Transfer with or without copy or no transfer• Processing with or without copy

ARINC653, OSEK & other standards intend to support such optimizations

Page 116: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 116

Efficient Communication Implementation

• No preemption within priority level is assumed• Dispatch order determines precedence order within

priority level• Consider port & buffer variable lifespan to determine

sharing of buffer variables

Sensor20Hz

Controller20Hz

Actuator20Hz

S/C data

C/A data

Timeline

Sensor SensorController

Actuator Controller

Dispatch order S, C, A

p1 Lifespan

p1 p2 p3 p4

p2 Lifespanp3 Lifespan p4 Lifespan

p1 Lifespan

Ti,20Hz Ti+1,20Hz

Similar to register allocation problem for compilers

Page 117: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 117

Going All The Way• Specify common in & out port within component

using in out port in AADL• Same data type for both ports• Thread B updates port data

Sensor20Hz Controller

20Hz

Actuator20Hz

S/C data

C/A data

Timeline

Sensor Sensor

ControllerActuator

Controller

Dispatch order S, C, AS/C/A data

Ti,20Hz Ti+1,20Hz

Page 118: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 118

Need For Double Buffering• Delayed actuator connection: controller time

extrapolation• Dispatch order affects # of buffer variables

Sensor20Hz Controller

20Hz

Actuator20Hz

Timeline

Sensor Sensor

ControllerActuator

ControllerActuator

Ti,20Hz Ti+1,20Hz

Timeline

Sensor Sensor

ControllerActuator

ControllerActuator

Ti,20Hz Ti+1,20Hz

Dispatch order S, C, A -> 2 variables

Dispatch order A, S, C -> 1 variable

Page 119: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 119

Periodic Task Communication Summary

Periodic Same period

ASRIMT | PMT

DSRIMT | PMT

CSRIMT | PMT

τC ; τPPD/1BS/XNC

RNC

PD/1BSNC, XNC

RNC

PD/1BS/XNC

RNC

PD/1BSNC

X/RNC

NA

PD/2B(S∨X/R)C

NA

τP ≠ τCND/1BS/XNC

RNC

PD/2BSNC, XC

RNC

PD/2BS/XNC

RC

PD/2BSNC

X/RC

ND/1BS/X/RNC

NA

NAPD/2BSNC

X/RC

PD/2B(S∨X∨R)C

PD/2BSNC, XC

RNC

PD/1BS/X/RNC

τP ; τCMF/1BS/XNC

RNC

PD/2BS/XNC

RC

MF/1BS/X/RNC

τP | τCND/3B

S/XC

RC

PD/2BS/XNC

RC

DR/2BS/X/RC

1B: Single buffer2B: Two buffers3B: Three buffers4B: Four buffers

OpC : S, X, R data copyOpNC : S, X, R no data copyS/X : IMT combined send/xferS/X/R : CSR combined S, X, R (o1∨o2) C : One operation copy

MF: Mid-Frame PD: Period Delay ND: Non-DeterministicDR: Destructive ReceiveNA: Not Applicable

Application-level send & receive compounds problem

Page 120: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 120

Harmonic Task Communication SummaryHarmonic Slow - Fast

ASRIMT | PMTP | PMTC .

DSRIMT | MTP | PMTC

DMT

τC ; τP ; τC PDC

1BPDP

2B: X

PDDC

2B: XNDDP

3B: S X

PDD

1BPDP

2B:XPDD

3B: S X/RPDC

1B

τP ; τC ;; τC MF1B

PDP

2B: X

PDDC

2B: XNDDP

3B: S X

PDC

1BPDP

2B:XPDD

3B: S X/RMF1B

(τP ≠ τC) ; τC

τC ; (τP ≠ τC)ND1B

PDP

2B: X

PDDC

2B: XNDDP

3B: S X

PDD

1BPDD

3B: S X/R

ND3B:

S/X R

PDD

3B: S X/RPDD

3B: S R

PDP

2B:XND1B

(τP | τC) ; τC

τC ; (τP | τC)τP | τC | τC

PDP

2B: X

ND3B: S X

PDP

2B:XNDI2B:

S/X/R

NDDP : DP > TC (ND) PDDC : DP ≤ TC (PDC )PDDP : DP > TC (PDP )

PDC : Consumer period delay (T)PDP : Producer period delay (2T)PDD : DP ≤ TC then PDC else PDP

Read-only consumer bufferTransfer at producer or consumer rate

This can be analyzed!!!

Should be responsibility of AADL analyzer & executive generator

Page 121: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 121

No AADL Generator?

• AADL supports application flow specification & preemptive scheduling.

• Complexity left to AADL tools.

• What if no AADL tool?Plug-in as application component development style.Application code unaffected by implementation decisions.Runtime system implementation patterns used by system implementer.

Page 122: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 122

Some Observations• Legacy Option

Static timeline scheduling.Deterministic execution & communication.Underutilized resources & brittle timing architecture.

• Modernization OptionPredictable preemptive fixed-priority scheduling.Better resource utilization & flexible timing architecture.Explicit data flow modeling & communication timing.Buffer management is an optimization problem.

Page 123: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 123

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 124: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 124

AADL and Scheduling

• AADL does not prescribe a scheduling protocol.• AADL task and communication abstractions

support scheduling protocolsA cyclic executive can be supported.

• Specific scheduling protocols may require additional properties.

• Predefined properties support rate-monotonic fixed priority preemptive scheduling that

is analyzable,requires a small runtime footprint,provides a flexible runtime architecture.

Page 125: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 125

Some Thread Properties

• Dispatch_Protocol => Periodic;• Period => 100 ms;• Compute_Deadline => value(Period);• Compute_Execution_Time => 20 ms; • Initialize_Deadline => 10 ms;• Initialize_Execution_Time => 1 ms;• Compute_Entrypoint => “speed_control”;• Source_Text => “waypoint.java”;• Source_Code_Size => 1.2 KB;• Source_Data_Size => .5 KB; File containing the

application code

Dispatch execution properties

Code function to be executed on dispatch

Page 126: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 126

control/output

speed_control

Threads to Source Text and Executables

main(){Initialize(){//initialize variables and states

Speed_error = 0;…….

} static float throttle_cmdspeed_control( ){//Computing throttle command….

……// output throttle command

throttle_cmd = s*t;}}

throttle_cmd

memory

executables

Page 127: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 127

Execution View

Logical

PhysicalReal-Time OS

Processor RAMBinding

Navigation Sensor

Processing

Integrated Navigation Guidance

Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz 20Hz

5Hz

2Hz

From Partitions

To Partitions

Fuel Flow

Guidance

Nav sensor data

Nav signal data

FP data

Performance data

Nav dataNav sensor

data

Nav data

FP data

MemoryProcessor

Page 128: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 128

Scheduling Analysis• Scheduling protocol determines analysis

Processor budget for static time line (cyclic executive)Rate-monotonic Analysis (RMA) for preemptively scheduled fixed-priority tasks100% utilization for Earliest Deadline First (EDF)

• What if analysis of Schedulability under different dispatch & scheduling schemesMiss-estimated worst case execution times (WCET)

Commercial real-time system analysis tools provide such support

Page 129: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 129

WCET & Sensitivity Analysis

Processor timing, application Periodic_IO, mode Periodic_IO, processor Ada95

Module Period Budget Critical Maximum % Margin % Util Max Pri

Periodic_IO_system 10000 100 588 8399 98.8 1.0

Fast 10000 1050 6174 9349 88.8 10.5

<self> 1000 5880 9299 89.2 10.0 Fast

<system> 50 294 4425 98.9 0.5 Fast

Slow 20000 1051 6178 17649 94.0 5.3

<self> 1000 5880 17599 94.3 5.0 Slow

<system> 51 298 8350 99.4 0.3 Slow

Total utilization = 16.8%

Breakdown utilization = 98.5%

Critical scaling factor = 5.88

Processor schedule is feasible

Times are reported in microseconds

Nominal compute times were used in the compute paths.

How much all task can increase their WCETCVHow much all tasks can

increase their WCET

Page 130: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 130

Real-time Performance

• If a single processor system is not schedulable • Might consider

rewrite code to make it fasterConsider lower signal processing rate for controller (e.g. 40Hz)Use faster processorAdd second processor

• Explore these options using AADL and support toolsReduce worst-case execution timeIdentify schedulable rate from sensitivity analysis resultsExecution time properties specific to processor speedReconfigure to different execution platform

Page 131: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 131

Thread Distribution

Logical

Physical

Navigation Sensor

Processing

Integrated Navigation Guidance

Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz 20Hz

5Hz

2Hz

From Partitions

To Partitions

Fuel Flow

Guidance

Nav sensor data

Nav signal data

FP data

Performance data

Nav dataNav sensor

data

Nav data

FP data

Processor 1 Memory

bus

Processor 2

Page 132: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 132

Observations: AADL and Performance

• Enables exploration of design alternatives without rewriting code

• Makes explicit critical design considerations• Facilitates early decisions on real-time design

issues• Redistribution of components

Potentially even threadsCompletely specified interfaces for threads

More on performance later.

Page 133: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 133

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 134: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 134

Event Handling By Polling

• Establishes deterministic system execution patterns

Fits easily into a cyclic executive.Helps avoid saturation (e.g. alarm overload).

• Minimizes response timesEstablishes a well-defined reaction latency.Possible to readily minimize reaction latency.Polling rate driven by minimum state change interval.

• Supports hardware environments that are not interrupt driven.

Page 135: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 135

Avionics System Polling Examples

• 10 Hz keypad polling10 Hz execution rate reservedInteraction transactionsKeypad input -> page content update -> keypad inputMultiple partitions reserve resourcesRealistic event interarrival timeKeypad interrupt to get system attention

• 20 Hz Navigation radio channel setting Always-on periodic pollingPlaced with flight manager partitionOccasional pilot activityReserved resource

Page 136: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 136

Nav Radio In Flight Manager

Navigation Sensor

Processing

Integrated Navigation

Guidance Processing

Flight PlanProcessing

Aircraft Performance Calculation

20Hz

10Hz

20Hz

5Hz

2Hz

From other Partitions

Dec

reas

ing

Prio

rity

Periodic I/O20Hz

To otherPartitions

Nav Radio20Hz

Where to place this thread in the

priority hierarchy?

shared data area

Page 137: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 137

Polling and Scheduling Analysis

• Consider a polling system with a 5x over sampling of a10 Hz stream (scheduling rate of 50 Hz)

High rate is to reduce reaction latencyReserve processing time at 50Hz: max. 20% resource utilizationAssume processing at 10Hz: impact of variation in data arrival

• Many devices (e.g., switches) are polledResource reservation for allAssume a subset of switches are can be manipulated at any one time

• Towards an event-driven systemprocess only when new data arrivesbounded minimum interarrival timeresults in aperiodic/sporadic thread sequence

Page 138: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 138

Event-Based Processing

• Recognize bounded event arrival rates• Manage event processing resource needs• Leverage operational modes

Page 139: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 139

Bounds on Interaction Rate

• Examine end-to-end flow of interactionUtilize AADL flow specificationsAvionics example: Nav RadioDM -> PCM/domain -> FM -> 1553 IO -> 1553 device -> 1553 IO -> FM -> PCM -> DMEach inter-partition step contributes phase delayInteraction as single-threaded synchronous call/returnRealistic inter-arrival rate much lower

Events with minimum interarrival timeBounded by physical world

Bounded by application logic

Page 140: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 140

Manage Event Processing Resources• Sporadic Threads

Dispatching of threads with hard deadlines and minimum dispatch separationSpread the processing load over time

• Sporadic Server Integrated into schedulerManage response time through queuing disciplineApplication level implementations exist

• Event samplingPeriodic sampling of event queuesBundled event processingExample: cascading alarm processing

Approach used by • Process control systems • Time-Triggered Architecture (TTA)

All three techniques are supported by AADL

Page 141: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 141

Event arrival

{Slack(t) is maximum time that scheduled tasks can be delayed at time t without missing their deadlines.

Slack Scheduling Approach• Guarantees deadline of scheduled threads.• Static slack

Unscheduled time• Dynamic slack

Unused scheduled time

Deadline

Page 142: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 142

response time

% re

spon

ding

with

in

slack-scheduled

background

Slack Scheduling PerformancePartitioned aperiodic, incremental, and dynamic threads

• DEOS (Primus Epic RTOS, replaced deferred server)

COTS FTP/TCP/IP stack hosted in DEOS• > 3X improvement in throughput• 7X reduction in reserved processor utilization (70% down to 10%)

Page 143: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 143

Leverage Operational Modes

• Limit on number of sporadic streams.• Limit due to physical environment:

Pilot only has two hands.

• Operational mode limits pilot activity:Landing gear switch disabled during dogfight.

Page 144: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 144

Mode-Based Solutions

• Improvements for polled systems.• Consider optional services

Active only in certain operational modes.Smaller set of polling threads.

• Consider reachable mode combinationsReduction in worst-case execution time requirements.

Page 145: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 145

Mode Sensitive WCET• Worst-case mode combinations

Example: Terrain Following (TF) & Reconnaissance (Recon)Recon Hi & TF Hi operationally or logically infeasible

Worst-CaseExecution Time

TF Hi TF Lo

Recon Hi 50ms+50ms 50ms+10ms

Recon Lo 20ms+50ms 20ms+10ms

Page 146: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 146

Observations on Polling

• AADL supports event driven system view.• Co-existence with periodic processing.• Realistic event rates for given flows.• Techniques for managing resource demands.• Real-time performance analysis sensitive to

operational modes.

Page 147: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 147

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 148: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 148

The Partition Concept

• Found in ARINC 653• Runtime protected address space • A virtual processor scheduled on a static timeline• Contained threads (ARINC processes) are

scheduled within the bounds of a scheduled partition

• Different partitions can use different thread scheduling protocols

• Communication of queued and unqueued data• Inter vs. intra partition communication

Page 149: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 149

Partitioning in AADL

• Core AADL hasSystems as logical units of composition.Threads as schedulable units of execution.Processes as protected address spaces.

• Extend process concept of AADLNew partition scheduling protocol. New scheduler properties for process.Clarification of communication timing.

partition

Page 150: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 150

Partition Order Side Effects

T1

T2

Partition A

T3

T4

Partition B

T4

t0 t1 t2

T1 T2T3

Partition A Partition B Partition A Partition B

T1 T2T3 T4

Partition communication via send/receive

Page 151: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 151

Partition Order Side Effects: Periodic I/O

T1

T2

Partition A

T3

T4

Partition BData1

PIOA PIOB

T4

t0 t1 t2

T1 T2T3

Partition A Partition B Partition A Partition Bt3

PBPA

T4

T1 T2T3PB

PAT4

T1 T2T3PB

PA

Partition A Partition B

Periodic I/O adds phase delayPeriodic I/O is sensitive to partition order

Page 152: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 152

Why Periodic I/O Does Not Work• Partitions on single processor

Periodic I/O has partition dispatch as time reference.Statically known communication timing characteristics.Partition order affects communication timing.

• Partitions distributed on multiple processorsConcurrent partition execution.Non-deterministic communication timing.

Partitions execute simultaneously

Page 153: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 153

Network Loopback Approach

• Partition communication within processor via network.• Latency unaffected by partition placement.

• Network load unaffected by partition placementNo network load reduction through partition relocation

No latency reduction through partition relocation

Page 154: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 154

Partition Communication in AADL

• Communication via ports and connections.• Common reference time for data transfer across

partitions.

• AADL runtime system managesPartition execution.Inter-partition communication with respect to processor time.Assumes synchronous system.

AADL Annex on partitions must address this.

Periodic system bus plays such a role in Time-Triggered Architecture (TTA)

Page 155: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 155

Partitioned System Design in AADL• Focus on partition order isolation

Delayed connections insensitive to partition order.Delayed connections insensitive to partition concurrency for synchronous systems.Delayed connections contribute to latency.

• Focus on latencyImmediate connections reduce latency.Immediate connections constrain partition order.Immediate connection cycles

• Direct cycle: PA.T1 -> PB.T2 -> PA.T3• Pair-wise cyclic: PA.T1 -> PB.T2 & PB.T4 -> PA.T3

• Focus on flexibilityAcceptable variation in phase delay.

Detectable by analysis

Document as property

Page 156: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 156

Asynchronous Systems

•Periodic sampling by independent clocks.•Potential clock drift•Sliding [0-period] sampling delay variance for inter-processor communication.•Partition placement results in latency variation.

Aperiodic thread sequences are independent of clock drift.

Page 157: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 157

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 158: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 158

Acceptable AADL Connection Patterns

• Connection sequencesPipeline, flow

• Connection tree Branching flowDifferent endpoint latencies

• Directed acyclic graph (DAG)Flow with merge pointsPhase delay difference of branches at merge pointEffects of phase delay oscillation in non-deterministic case

• Cyclic connectionsFeedback control, action/observationPhase delay breaks cycle

Analyzable in AADL

Page 159: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 159

How Does Periodic IO Stack Up?

• Periodic IO as application threadPhase delay within source partition.Unnecessary merge-point phase delay.

FM

WAM

Expressed in AADL

PeriodicI/O

Page 160: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 160

Time Consistent Data Sets

• Aggregated data transferUse of port group conceptProperty to indicate aggregation semantics

FM

WAMA

Page 161: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 161

Flow Specification in AADL

System S1flow path F1

flow path F2

Flow Specificationflow path F1: pt1 -> pt2flow path F2: pt1 -> pt3

pt2

pt3

pt1

Process P1

System implementation S1.impl

Process P2

Flow Implementationflow path F1: pt1 -> C1 -> P2.F5 -> C3 -> P1.F7 -> C5 -> pt2

C1

C5C3

flow path F5

flow path F7

pt1

pt2

pt3Connection

Page 162: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 162

End-To-End Flow Semantics

System S2System S1

flow path F1

C2System S0

C1

End-To-End Flow Semantics of SenseControlActuate T0.FS1 -> <SemCon1> -> S1.P1.T1.FX1 -> <SemCon3> -> S1.P1.T2.FX2

-> <SemCon3> -> S2.P2.T5.FS1

Process impl P2

Thread T5

flow sink FS1

Process impl P0

Thread T0

flow source FS1

Process impl P1

Thread T1 Thread T2

Semantic Connection

End-To-End Flow Declarationflow SenseControlActuate: S0.FS1 -> C1 -> S1.F1 -> C2 -> S2.FS1

ConnectionDeclaration

Page 163: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 163

Data Stream Latency Analysis

• Flow specifications in AADLProperties on flows: expected & actual end-to-end latencyProperties on ports: expected incoming & end latency

• End-to-end latency contributorsDelayed connections result in sampling latencyImmediate periodic & aperiodic sequences result in cumulative execution time latency

• Phase delay shift & oscillationNoticeable at flow merge pointsVariation interpreted as noisy signal to controllerAnalyzable in AADL

Potential hazard

Latency calculation & jitter accumulation

Page 164: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 164

Reduce End-To-End Latency

Consider engineering alternatives• Reduce execution time

Limited impact in periodic sampling systems.• Eliminate unnecessary sampling steps

Change to immediate connections for critical flows.Results in partition order constraint.

• Merge partitionsEliminates partition order constraint.

• Aperiodic sequencing of periodic streamsEliminates sampling phase delay.Quasi-periodic stream processing by individual threads.Worst-case latency: sum of deadlines.

Page 165: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 165

Insights into Flow Characteristics

• Miss rate of data streamAccommodates incomplete sensor readings.Allows for controlled deadline misses.

• State vs. state delta communicationData reduction technique.Events as state transitions.Requirement for guaranteed delivery.

• Data accuracyReading accuracy.Computational error accumulation.

• Information flow as state transition

Page 166: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 166

End-To-End ResponseCommander

Battle Command B

BC MissionTask order

Warfighter BWarfighter A

WF MissionTask order A

WF MissionTask order B

Expand Acknowledge

Issue Issue

ACK

Done

Acknowledged Delivery

Plan Expansion

Plan Distribution

Action Target

Weapon Released

Observer A

Observed Result

ReportedObservation

CorrelatedObservation

Sensor

Target

Action

Observer B

Sensor

AggregatedObservations

Flow failuresGuaranteed delivery

Completion/Exception reportingIndependent observation

Page 167: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 167

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 168: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 168

System Redundancy

High speed bus

1553 bus

DM

WAM

PCM

DM

WAM

DM

WAM

PCM

DM

WAM

FM FMFD

WM WMSA

FDSA CM

CM1553

High speed bus

1553 bus

CM

1553

Revisited

Page 169: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 169

Redundancy Specification

MFD DM1

MFD DM2

MFD DM3

MFD DM4

WAM

PCM

CM

WM

FM

SA

FD

1553

• Grouping into subsystems for configuration• Non-redundant component replication

SS1

SS2

4X

2X

2X2X

Redundancy characteristics as

properties

Page 170: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 170

Runtime Co-location Constraints

MFD DM1

MFD DM2

MFD DM3

MFD DM4

WAM

PCM

WM

FM

CM

SA

FD

1553SS1

SS2

4X

2X

2X2X

MissionProcessor

MissionProcessor

MissionProcessor

Processor Bindings

AADL collocation constraints

Page 171: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 171

Replication as AADL Pattern

WM

FM

1553SS1.1

SS1.2

CSS1 Mode1

WM

FM

1553SS1.1

SS1.2

CSS1 Mode2

• Encapsulate redundancy replication in system • Use mode to specify alternative configurations• Specify processor and memory binding constraints

Page 172: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 172

Master/Slave Configurations

SS1.2

CSS1 Master

SS1.1

SS1.2

CSS1 Slave

SS1.1

SS1.2

SS1.1

SS1.2

SS1.1

Passive Slave Hot Standby

SS1.2

CSS1

SS1.1

SS1.2

CSS1

SS1.1

Continuous State Exchange

State

CSS1 Master

CSS1 SlaveVoted Output

SS1.3

Page 173: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 173

Master Slave Synchronization

WAM

WAMSlave

state

state

20Hz

20Hz

master slave

init

masterfail

masterok

20Hz

Init/restart

Observer

Master

• External and internal mode control• Errors reported as events• Supports reasoning about master/slave logic

Mode

20Hz

Page 174: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 174

Observations On System Redundancy

• Redundancy as an abstractionMultiple redundant instancesGrouping of redundant instancesRedundancy protocol selectionDeployment constraints

• Redundancy mechanism as patternAn orthogonal architecture viewNominal & anomalous behaviorModeling of redundancy logic

Understandable and analyzable

Page 175: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 175

AADL Fault Handling

• Application language exception handling not represented in AADL.

• Thread-level recovery recovery entrypoint execution to prepare for next dispatch.

• Thread unrecoverableReported as error event.

Page 176: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 176

Suspended

Initialized Thread

Inactive

UninitializedThread

Active

DeactivateComplete:

ActiveInNewMode:

Terminate:

Thread Halted

Dispatch:Complete:

Fault:Recovered:

InitializeComplete:

ActiveInInitMode:InactiveInInitMode:

InactiveInNewMode:

FinalizeComplete:Execute composite state

Initialize

Activate

Deactivate

Finalize

Compute

Recover

Thread State

Thread States

Page 177: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 177

Thread Entrypoints & Source Text

main(){Initialize(){//initialize variables and states

Speed_error = 0;…….

} static float throttle_cmd;speed_control( ) {//Computing throttle command….

……// output throttle command

throttle_cmd = s*t;}}

Specified by Entrypoint properties

Page 178: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 178

Fault Management

• Fault containmentProcess as a runtime protected address space.

• Fault recoveryWithin application code & thread local.Error propagation.

• Propagated error managementPropagation through event connections.Trigger reconfiguration through mode switching.Monitoring & decision making through health monitor.

Event queue processing by aperiodic & periodic threads

Page 179: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 179

Temporary Load Shedding• Scheduling priority-based shedding

Fixed priority: lowest rate first; urgency property controls who.EDF: spread the shedding across threads.

• Occasional deadline missesData sample miss already handled by controller.Multiple misses per time window.

• AADL: Flow/connection propertyExpected and provided degree of stream completeness.

Affected by scheduling protocol

Page 180: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 180

Explicit Load Management

• Detection mechanism modeled in AADLDeadline miss as processor event.

• Service level reduction via AADL modeMode-specific property values.Thread internal modes• Different service levels within application component.• Different precision, different algorithm, …

Alternative active thread configurations• Load balancing via AADL mode.• Preconfigured alternate bindings.

Page 181: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 181

Modal Systems• Operational modes

Reflecting system operation.

• Modal subsystemsIndependent & coordinated mode switching.

• Alternate system configurationsReachability of mode combinations.

• Reduced analysis spaceWorst-case scheduling analysis.

• Dynamic configuration managementInconsistency identification through analysis.Inconsistency repair through selective reconfiguration.

Page 182: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 182

Analysis & Design of an Avionics System

• Preemptive Scheduling and Data Flow• Scheduling and Real-time Performance• To Poll or Not to Poll• Partitions & Communication Timing• End-to-end Flows• Many Uses of Modes• System Safety Engineering

Page 183: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 183

System Dependability and Safety

• Enables integration of system dependability and safety analyses with architectural design

Capture the results of• Hazard analysis.• Component failure modes & effects analysis.

Specify and analyze• Partition isolation/event independence.• Fault trees.• Markov models.

• AdvantagesEnsures consistency between dependability and safety models and architectural design.Enables cross-checking among analysis models.Reduces specification and verification effort.

Page 184: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 184

Fault Avoidance With AADL

• Support to identify and prevent design faults and to ensure correct runtime characteristics.

• Language features for fault avoidance thatEncourage and enforce safe software engineering practices.Provide explicit space and time partitioning.Clearly define system fault and error behaviors.Provide clear specification of safety and certification properties. Ready incorporates specialized safety/fault tolerance hardware.

Page 185: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 185

Fault-Tolerance and Safety Features

• Processes may be time and space partitioned• Safety/design assurance level can be specified for

any component• Hazardous run-time capabilities enabled on a per-

process basis• Executive consensus protocol is plug-replaceable• Message data errors detected and reported • Well-defined process error handling semantics

Page 186: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 186

An Error Model Extension• Supports reliability, availability, maintainability, safety,

and related specification and analysis activities. • Useful in system safety certification and qualification. • Optional set of declarations and associated

semantics. • Facilitates a variety of analyses

Top-down hazard analysis.A bottom-up failure modes and effects analysis. Fault tree and stochastic process analyses. Safety, reliability, availability, maintainability.Integrated analyses.

• Provides a representation ofSystem hazards. Component failure modes.

Page 187: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 187

Error Annex Foundations

• Based on the concepts and terminology defined by IFIP WG10.4.

• Compatible with the core AADL standard.• Coupled with AADL core capabilities provides

Fault avoidance,Fault tolerance,Integrated dependability analyses.

Page 188: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 188

Error Model DescriptionError model descriptions may declare

Fault events (in subcomponents section)Additional error models (in modes section)Error mode transitions (in modes section)

error_free

babblingfail_stopped

undetected_faultdetected_fault

propagate fail_stopped

propagate babbling

Page 189: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 189

Reliability Modeling

• Model generators output human-readable & structured models.

• Capture data from top-down hazard analysis.• Capture data from bottom-up failure modes and

effects analysis.• Enables multiple integrated system safety checks

and analyses.

Page 190: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 190

Integrated Analysis Capabilities

• Expandable set of analyses of a system specification Basic error model states and transitions.Partition isolation analysis.

Stochastic concurrent process model• Interfacing with a Markov chain as the reachable non-

death states of stochastic concurrent process model.• Interfacing with Markov chain analysis tools (e.g. SURE

from NASA Langley, UltraSAN from University of Illinois, SHARPE from Duke).

Page 191: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 191

Partition Isolation Analysis

• Partitions support software error containment.• Safety level properties for analysis and certification

RTCA/DO-178B defines 5 failure categories• Catastrophic• Hazardous• Major• Minor• No effect

Lower category defect must not affect higher category component.

• Significant reduction of re-certification costs.

Page 192: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 192

Isolation Verification Algorithm

Analysis tool constructs “can affect” relationships:Port-to-port data connection (unless specified to the contrary).Software component hosted-on hardware component.Shared data structures.Scheduling attributes impacts on potential timing interference.Software component affects on processor or system.

Page 193: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 193

Example Redundant SystemComputer Fault Event Rates

Permanent => 0.0001Transient => 0.001

Page 194: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 194

Stochastic Concurrent Process Reliability Model

Error models mapped to system componentsError model interactions

SW ProcessError Model

HWProcessor AError Model

SW ProcessError Model

HWProcessor BError Model

SW ProcessError Model

SW ProcessError Model

errorpropagations

masking expression,(e.g. 2 or more A, B, C)

errorpropagations

?

Page 195: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 195

Reachable States: A Markov Chain

A 1 B 2

A 1 B 1

A 2 B 1

A 2 B 2

B

BA

λ λ

λ

Generated model

Page 196: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 196

Example Analysis Results

SURE V7.9.8 NASA Langley Research Center

LOWERBOUND UPPERBOUND COMMENTS RUN #1---------- ----------- ----------- -------------------------

3.05514e-06 3.05513e-06 <prune 3.5e-13> <ExpMat>

103055 PATH(S) TO DEATH STATES 11939 PATH(S) PRUNEDHIGHEST PRUNE LEVEL = 1.29776e-15Q(T) ACCURACY >= 7 DIGITS480.733 SECS. CPU TIME UTILIZED

Page 197: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 197

Dependability and Safety Summary

• Integration of dependability and system safety with architectural design

Ensures consistency of error models and design architecture. Extensible to include additional models.Enables cross-checking between models.Reduces specification and verification effort.

Page 198: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 198

Tutorial Outline

• Background & Introduction • Introduction to AADL• AADL in Use• AADL Development Environment• Benefits of AADL

Page 199: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 199

Evolutionary Development With Continuous Feedback

• A control systems simulation perspective• A model-based architecture perspective• An integrated perspective

Page 200: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 200

A Control Engineer Perspective

with Text_IO;package Main is

begin

type real is digits 14;type flag is boolean;

x : real := 0.0;ready : flag := TRUE;

K1 K2s+

-

Matlab

Component Analysis

Application Code

with Text_IO;package Main is

begin

type real is digits 14;type flag is boolean;

x : real := 0.0;ready : flag := TRUE;

Simulink

Tune parameters

Continuous feedback for a control engineer

Validate simulation

Continuous feedback

in a controller

Page 201: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 201

A Software System Engineer Perspectivewith Text_IO;package Main is

begin

type real is digits 14;type flag is boolean;

x : real := 0.0;ready : flag := TRUE;

AADL Tools

with Text_IO;package Main is

begin

type real is digits 14;type flag is boolean;

x : real := 0.0;ready : flag := TRUE;

AADL Runtimepackage Dispatcher is

A.p1 := B.p2;Case 10ms:

dispatch(a);dispatch(b);

T1 T2 T3 T4

12 12 5 623 34 8 824 23 234

Timing analysisReliability analysis R1 R2 R3 R4

12 12 5 623 34 8 824 23 234

T1 T2 T3 T4

12 12 5 623 34 8 824 23 234

T1 T2 T3 T4

12 12 5 623 34 8 824 23 2 34

RuntimeData

R1 R2 R3 R4

12 12 5 623 34 8 824 23 234

Refine properties

Continuous feedback for software system engineer

ApplicationComponents

AADL-based Architecture Model

ExecutionPlatform

Page 202: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 202

A Combined Perspective

with Text_IO;package Main is

begin

type real is digits 14;type flag is boolean;

x : real := 0.0;ready : flag := TRUE;

K1 K2s+

-

Matlab Component Analysis

Application Code

with Text_IO;package Main is

begin

type real is digits 14;type flag is boolean;

x : real := 0.0;ready : flag := TRUE;

Tune parameters Simulink

Continuous interaction between

Control engineer & system engineer

Validate simulation

AADL-based Architecture Models

AADL Tools AADL Runtimepackage Dispatcher is

A.p1 := B.p2;Case 10ms:

dispatch(a);dispatch(b);

T1 T2 T3 T4

12 12 5 623 34 8 824 23 234

Timing analysisReliability analysis R1 R2 R3 R4

12 12 5 623 34 8 824 23 234

T1 T2 T3 T4

12 12 5 623 34 8 824 23 234

T1 T2 T3 T4

12 12 5 623 34 8 824 23 2 34

RuntimeData

R1 R2 R3 R4

12 12 5 623 34 8 824 23 234

Refine properties

Page 203: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 203

Predictable System Integration

• Required, predicted, and actual runtime properties.

• Application components designed against functional and non-functional properties.

• Application code separated from task dispatch & communication code.

• Consistency between task & communication model and implementation through generation.

• Feedback into model parameters: refinement of estimated performance values.

Page 204: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 204

Application Components as Plug-ins

Strong Partitioning • Timing Protection• OS Call Restrictions• Memory Protection

Interoperability/Portability• Tailored Runtime Executive• Standard RTOS API• Application Components

Real-Time Operating System

Application Software

Component

Embedded Hardware Target

AADL Runtime System

Application Software

Component

Application Software

Component

Application Software

Component

Page 205: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 205

Partitioning of Responsibilities: The Control Engineer

Software Component

Software Component

SoftwareComponent

AADL Runtime Executive

Executive code generated from AADL

Application design perspectiveSignal content properties

Stream completeness characteristicsPhase delay & timeliness

Application implementation perspectivePorts accessible as variables

Port variable values not overwritten during executionControl flow via events & messages

Initialize, activate, deactivate, compute, recover, finalize entrypoints

Real-time OS API

Page 206: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 206

Partitioning of Responsibilities: The Software System Engineer

Software Component

Software Component

SoftwareComponent

AADL Runtime System

Executive code generated from AADL

Task & Communication PerspectiveTask dispatch & deadlines

Timely & deterministic communicationDynamic reconfiguration

Real-time OS API

Runtime System perspectiveRate groups, priorities & dispatch orderCoordinated dispatch & communication

Double buffering where necessaryShared variables where appropriate

Page 207: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 207

Application Development Environment

re-engineeringof legacysoftware

traditionaldevelopment

target hardwarespecifications

SimuLink

otherspecialized

tools

AADL-BasedSoftware & SystemsIntegration Toolset

AADL-BasedSoftware & SystemsIntegration Toolset

Complete, ValidatedExecutable System

Complete, ValidatedExecutable System

Application Development

Tools

Application Development

Tools

Page 208: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 208

An XML-Based AADL Tool Strategy

AADL Model XML

TextualAADL

GraphicalAADL

SchedulingAnalysis

ReliabilityAnalysis

Filter to MarkovAnalysis

AADL InstanceXML

CommercialTool likeTimeWiz

Complete Execution Platform Binding

SafetyAnalysis

Project-SpecificIn-House

AADL RuntimeGenerator

Page 209: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 209

Platform Runtime

Workspace

Help

TeamWorkbench

JFace

SWT

Eclipse Environment

JavaDevelopment

Tools(JDT)

AnalysisTool

Via XMLAADL

TextualEditor

AADL Parser

An Open Source AADL Environment

Plug-inDevelopmentEnvironment

(PDE)

Eclipse Platform

Debug

AADLGraphical

Editor

AADL Environment

AADL Object

APIXML

DocumentPersistence

AnalysisTool

Via Java

StandaloneGeneration

Tool

Page 210: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 210

AADL/UML Strategy

MetaH AADLV1

AADLV2

ExtensibilityTerminology updateExecution platform

UML-RT

Expansion Discrete event systemsNew analyses

UML/AADL

UMLProfile

UML 1.3UML 2.0

UML class diagramsUML stereotypes

ADL Influence

Real-time Influence

UML statecharts

ACME Influence

Accelerated

2003 2006

Page 211: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 211

AADL/UML Relationship

ADLComponentsInteractions

UML 2.0

UML-RTPerformanceTimeliness

UML 1.4Detailed design

AADLCore

Dependability

Security

Extensible AADL AnnexesAdd to Language, provide

UML extensions

To Be submitted to OMG for Adoption

AADLUML Profile

Page 212: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 212

Tutorial Outline

• Background & Introduction• Introduction to AADL• AADL in Use• AADL Development Environment• Benefits of AADL

Page 213: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 213

Final Observations• Abstract but precise task & communication

architectureA bridge between control engineer & software system engineer

• Early insight into para-functional properties• Runtime system generation leads to model-

consistent implementation• Leads to architecture patterns with predictable

characteristics• An extensible basis for a wide range of

embedded systems analyses

Page 214: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 214

Summary of AADL Capabilities

• AADL abstractions separate application architecture concerns from runtime architecture concerns

• AADL incorporates a run-time architecture perspective through application system and execution platform

• AADL is effective for specialized views of embedded, real-time, high-dependability, software-intensive application systems

• AADL supports predictable system integration and deployment through model-based system engineering

• AADL component semantics facilitate the dialogue between application and software experts

Page 215: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 215

Value of AADL-Based Development• Early Prediction and Verification Tools

performancereliabilitysystem safety

• Component Compliance Verification Toolsfunctional interface resource requirements system safety

• System Integration and Verification Toolsworkstation testing system performance system safety verification

Page 216: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 216

Benefits• Model-based system engineering benefits

• Benefits of AADL as SAE standard

Predictable runtime characteristics addressed early and throughout life

cycle greatly reduces integration and maintenance effort

AADL as standard provides confidence in language stability, broad adoption, and strong tool support

Page 217: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 217

Contacts

• Bruce Lewis AS2C Chair, [email protected]• Joyce Tokar, AS2C Member, [email protected]• www.aadl.info

Page 218: The SAE Architecture Analysis & Design Language (AADL)sigada.org/conf/sigada2004/SIGAda2004-CDROM/SIGAda2004...AADL Tutorial 1 The SAE Architecture Analysis & Design Language (AADL)

AADL TutorialAADL Tutorial 218

Thank You

www.aadl.info