end-to-end design and analysis of embedded real -time...

28
End-to-End Design and Analysis of Embedded Real-Time Systems End End- to to- End Design and Analysis of End Design and Analysis of Embedded Real Embedded Real- Time Systems Time Systems Faculty: Kang G. Shin Grad students: Sam Gu, Sharath Kodase Real-Time Computing Laboratory EECS Department The University of Michigan Ann Arbor, MI 48109-2122 http://www.eecs.umich.edu/~kgshin

Upload: others

Post on 26-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

End-to-End Design and Analysis of Embedded Real-Time Systems

EndEnd--toto--End Design and Analysis of End Design and Analysis of Embedded RealEmbedded Real--Time Systems Time Systems

Faculty: Kang G. ShinGrad students: Sam Gu, Sharath

KodaseReal-Time Computing Laboratory

EECS DepartmentThe University of MichiganAnn Arbor, MI 48109-2122

http://www.eecs.umich.edu/~kgshin

Page 2: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

ObjectivesObjectivesObjectives

• Enable the designer to express system behavior and e2e RT constraints at a higher level, closer to domain knowledge and further away from implementation details.

• Automate the process of mapping from application structure models to runtime models subject to high-level e2e timing constraints.

• Provide formal semantics for e2e extensions to enable effective formal analysis.

Page 3: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Proposed Design FlowProposed Design FlowProposed Design Flow

e2e functional andtiming requirements

Detailed design of subtasks

Decomposition

Sched analysis(RMA or ACSR)

Distributed executables

Download to target

WCET analysis

High-level applicationrequirements

Code generator

Application WCET

Application components

Formal verification(model checking)

Page 4: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Model Transformation and IntegrationModel Transformation and IntegrationModel Transformation and Integration

• Functional design model includes– Behavior model: control

specifications– Structure model:

components/subsystems – Runtime model: task graph

• Non-functional issues should be considered during transformation, especially for runtime model

StructureModel

RuntimeModel

component allocation

task assignment

BehaviorModel

ECSW design

Page 5: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Software Structure Meta-ModelSoftware Structure MetaSoftware Structure Meta--ModelModel

softwarearchitecture

componentconnection

action

port

in

out

performancerequirements(reference)

processor(reference)

communicationmechanism(reference)

1

*

1*

1

*

1*

performance(reference) 1..*

1

1

*1

11

*

performance(reference)

**

flow

1

*

Page 6: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

TacticalSteering :

pilotControl

airframe

updateDisaplyAddConnection();Update();GetData();Publish_Change();

Structure Model Example Structure Model Example Structure Model Example

airframe : BM __ LazyActiveComponent

tacticalSteering : BM__ ModalComponent

navDisplay : BM __ DisplayComponent

GPS : BM __ DeviceComponent

navSteering : BM __ ModalComponent

navSteeringPoints :

BM__ PassiveComponent

navigator : BM__ PushDataSourceComponent

pilotControl : ModeSourceComponent

5Hz

1Hz

20Hz

update_mode

invoke_mode

Publish_data

Publish_data

Publish_data

publish_data

Mode_change

mode_changeupdate

update

Comm. Media: networkComm. Type: asynch

Page 7: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Platform Meta-ModelPlatform MetaPlatform Meta--ModelModel

1

1..1

1

*

1 *

platform model1

1..* 1

0..*

processor

communicationmechanism

src

dest1

1memory

operating system

timing service schedulingservice

interruptservice

IPC network

1

*

1

*

1

*

performancecharacteristics

(reference)

*

*

*

*

*

*

*

*

*

*

*

*

Page 8: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Platform Model ExamplePlatform Model ExamplePlatform Model Example

CAN1 Mbps

MPC55520 Mhz2 MB

Pentium90 Mhz16 MB

RTLinuxSchedulingInterruptComm

OSEKWorksTimingSchedulingInterruptComm

Page 9: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Runtime Meta-ModelRuntime MetaRuntime Meta--ModelModel

runtime model

task

communication

1

1..*

1

0..*

-src

*

-dest *

*

*

platform(reference)

0..*

1performance(reference) *

*

action(reference)

communicationmechanism(reference)

performancerequirement(reference)

1*

11..*

Page 10: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Runtime Model ExampleRuntime Model ExampleRuntime Model Example

GPS-ARFM Control TaskGPSairframe

Display Control TasknavDisplay

Pilot Control TaskpilotControl

Navigation Control TasknavigatornavSteeringPoint

Steering Control TasktacticalSteeringnavSteering

Steering Control Task

tacticalSteering.getData()

navSteering.getData()

tacticalSteering.update()

navSteering.update()

tacticalSteering.AddConnection()

navSteering.AddConnection()

Page 11: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Runtime Model with Timing AnnotationsRuntime Model with Timing AnnotationsRuntime Model with Timing Annotations

GPS airframe navDisplay

Rate = 20 Hz

navDisplay:GetData(): [(P1,10), (P2,13)]update(): [(P1,50), (P2,80)]

GPS-ARFM Display Control

Pilot Control

Navigation Steering Control

Rate = 20 Hz

Loc = P1WCET = 10Period = 50

Clock speed=20MhzMemory size=2MB

Timeroverhead = 5Scheduling overhead =8Interrupt latency = 10IPC delay = 6

Delay=2Jitter=2Bandwidth=40

Page 12: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Transformation Between ModelsTransformation Between ModelsTransformation Between Models

Behavioral model

Structural modelPlatform model

Performance modelRuntime model

Programming model

System partitionComponent selectionComponent integration

System thread identificationTask allocationPerformance attribute assignments

Code generation

Page 13: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Transformation AlgorithmsTransformation AlgorithmsTransformation Algorithms

• 2-step process– Task construction– Timing assignments

• Break dependencies by considering function only in the first step, and then performancein the second

• Design involves multiple iterations of 2-step process

Page 14: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Task ConstructionTask ConstructionTask Construction

• Input: structural and platform models• Process:

– Find e2e transactions (a.k.a. execution path)– Allocate actions in transactions to platform

• Maximize utilization while preserving schedulability• Refine later with communication cost

– Group actions on the same processor to form tasks• Actions in the same transaction should be in one task• Actions with the same priority should be in one task

– Allocate shared components in the faster task– Construct task graph

• Derive dependencies according to structural model• Assign timing constraints to e2e tasks

Page 15: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Timing AssignmentTiming AssignmentTiming Assignment

• Input: Task graph with e2e timing constraints• Process

– Compute task WCET=Σeaction– Find critical execution path P in task graph– Distribute e2e deadline over P– Break task dependencies by adding shared buffer– Combine tasks with the same rate on the same

processor– Verify the satisfaction of timing constraints– Refine assignment by shortening the period of

task(s) on P until • All constraints are satisfied• Task set is found unschedulable (need more resource)

Page 16: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Timing Specification and AssignmentTiming Specification and AssignmentTiming Specification and Assignment

• Requirements are usually given in an e2e form or a rate for each component

• End-to-end constraints should be partitioned and assigned to each activity

• Schedules have to consider these timing spec as requirements

D1

D2

{r1,d1,p1} {r5,d5,p5}

{r2,d2,p2}

{r3,d3,p3}

{r4,d4,p4}

{r6,d6,p6}

{r7,d7,p7}

{r8,d8,p8}

{r9,d9,p9}

{r10,d10,p10}

r

TaskGeneration

FunctionalConstraints

TimingInformation

Page 17: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Deadline DistributionDeadline DistributionDeadline Distribution• Objective

– Partition constraints at higher-level for timing assignments and scheduling

• Deadline distribution supports hierarchical partitioning of constraints

Inputs

· A task graph with WCET

· Timing constraints:

· e2e constraints: given a sensor signal change X, the new command for actuator Y has to be outputted within ttime units

· Rate constraints: task T has to be executed at a particular rate R to satisfy the requirements of component C inside it

Outputs

· Deadlines and release times for all intermediate subtasks

DeadlineDistribution

Deadline, release time, rate, and WCET are sufficient for any scheduling algorithm to generate a schedule

Page 18: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Task Dependency ResolutionTask Dependency ResolutionTask Dependency Resolution• Task dependencies should be broken to support scalable

scheduling and allocation algorithms• Shared buffers are used to break dependencies• After introducing shared buffers, rates need to be regenerated• Tasks are clustered to reduce resource consumption

AB

C E

D F(r,d,p)

(r,d,p)

(r,d,p)

(r,d,p) (r,d,p)

(r,d,p)

AB

C E

D F(r’,d’,p’)

(r’,d’,p’)

(r’,d’,p’)

(r’,d’,p’)

(r’,d’,p’)

(r’,d’,p’)

Page 19: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Real-Time AnalysisRealReal--Time AnalysisTime Analysis

• Schedulability Analysis– Commonly used scheduling policies: RMA, EDF,

DMA, etc.– Processor utilization– Resource consumption by

• Application tasks• System software (OS and middleware)• Communication messages

• Two approaches:– Generalized Rate Monotonic Analysis– ACSR/VERSA

Page 20: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Formal AnalysisFormal AnalysisFormal Analysis

• Map event-triggered software model in UML Interaction Diagrams to Timed Petri-Nets.

• Syntax-directed automated mapping from TPN to Timed Automata, implemented in GME via mapping between meta-model elements.

• Use an existing model-checker UPPAAL to check for system property violations.

• Map counter-examples back into UMLenvironment.

Page 21: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Automated TransformationAutomated TransformationAutomated Transformation

in

out

[lb, ub]

TPN Model

TA Meta-Model

Conforms To

Transformation via mapping of meta-modelelements

TPN Meta-Model

in >= 1, go? c := 0

c >= lb, in := in – 1, out := out + 1

In == 0, go?go!

c<=ub

TA Model

Conforms To

Page 22: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

An Avionics Scenario in UML

Page 23: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

TPN Model of EDG ScenarioTPN Model of EDG ScenarioTPN Model of EDG Scenario

Page 24: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Model Checking Results (Sample)Model Checking Results (Sample)Model Checking Results (Sample)

• Transform TPN to TA, then use UPPAAL for model-checking. • End-to-end delay range of 1Hz thread is [275, 525] ms.• 5Hz thread with deadline=200 ms has frame-overrun. •UPPAAL can give a diagnostic trace for the execution scenario that leads to frame overrun.

Deadline missed!

20 110 200

S11 S12 S13 S14 S15

S21 S22 S23

Page 25: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

ConclusionsConclusionsConclusions

• ESW development is a multi-phase multi-iteration process, and requires integration of tools based on heterogeneous models– Require a common modeling framework– Require information loop

• The proposed framework supports semi-automated model transformation– Demonstrated by translating structural model to

runtime model while meeting e2e timing constraints• Formal verification by automated transformation from

UML models to TPN and TA.

Page 26: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

PublicationsPublicationsPublications

• An Integrated Approach to Modeling and Analysis of Embedded Real-Time Systems Based on Timed Petri-Nets. ICDCS 2003.

• Analysis of Event-Driven Real-Time Systems with Time Petri-Nets. DIPES 2002.

• Integrated Modeling and Analysis of Computer-Based Embedded Control Systems. ECBS 2003.

• Improving Scalability of Task Allocation and Scheduling in Large Distributed Real-Time Systems using Shared Buffers. IEEE RTAS 2003.

• Transforming Structural Model to Runtime Model of Embedded Software with Real-Time Constraints. DATE 2003.

• Automating embedded software construction and analysis with design models. Euro-uRapide 2003

Page 27: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

ENDENDEND

• Questions?

Page 28: End-to-End Design and Analysis of Embedded Real -Time Systemsweigand/aro/presentations/upenn_shin.pdf · Embedded Control Systems. ECBS 2003. • Improving Scalability of Task Allocation

Timing AssignmentTiming AssignmentTiming Assignment

• Input: – Dependent task graph with timing constraints– Platform

• Process– Compute task WCET=Σeaction

– Find critical execution path P in task graph– Distribute end-to-end deadline over P– Break task dependencies by adding shared buffers– Combine tasks with the same rate on the same processor– Verify the satisfaction of timing constraints– Refine assignment by shortening the period of task(s) on P

until • All constraints are satisfied• Task set are unschedulable (need more resource)