page 1 building reliable component-based systems chapter 13 -components in real-time systems chapter...

34
Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Chapter 13 Components in Real-Time Systems Components in Real-Time Systems

Upload: brianne-matthews

Post on 19-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 1Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Chapter 13Chapter 13

Components in Real-Time SystemsComponents in Real-Time Systems

Page 2: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 2Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

OverviewOverview

Introduction

Characteristics and challenges of real-time systems

Real-time component models

Designing component-based real-time systems

Composition of components

Example: RT components in Rubus OS

Page 3: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 3Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

IntroductionIntroduction

Embedded computers

Medical control equipment, mobile phones, and vehicle control systems.

Most of such embedded systems can also be characterized as real-time systems.

They must usually meet stringent specifications for safety, reliability, limited hardware capacity etc

Page 4: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 4Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Characteristics and Challenges of RTSCharacteristics and Challenges of RTS

Real-time systems are computing systems in which the meeting of timing constraints is essential to correctness.

If the system delivers the correct answer, but after a certain deadline, it could be regarded as having failed.

Page 5: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 5Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

TasksTasks

Real-time systems can be constructed of sequential programs, but typically they are built of concurrent programs, called tasks.

Tasks are usually divided into:

Periodic tasks: consist of an infinite sequence of identical activities, called instances, which are invoked within regular time periods.

Non-periodic : are invoked by the occurrence of an event.

Page 6: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 6Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

SchedulingScheduling

Offline scheduling:

The scheduler has complete knowledge of the task set and its constraints.

Online scheduling:

Make their scheduling decisions during run-time.

Deadline:

Is the maximum time within which the task must complete its execution with respect to an event.

Real-time systems are divided into two classes, hard and soft real-time systems

Page 7: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 7Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Limited ResourcesLimited Resources

Common CBSE technologies (JavaBeans, CORBA and COM) are seldom used as they:

Require excessive processing requirements

Require excessive memory requirements

Provide unpredictable timing characteristics

Page 8: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 8Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

System Level AnalysisSystem Level Analysis

At system level we analyze to determine if the system composed fulfils the timing requirements.

Several different mature analysis methods exist, for example, analysis for priority-based systems and pre-run-time scheduling techniques

Page 9: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 9Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Real-time Component ModelsReal-time Component Models

Using a standard operating system in a real-time application, such as windows NT must be done carefully, as it was designed to be used so.

Page 10: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 10Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Application-specific Component Models Application-specific Component Models

Maintain a component library which the application engineer can use when developing an application.

In addition to infrastructure components, domain specific component models, which in fact have been used for many years for certain domains must be considered.

Page 11: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 11Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

IEC 61131-3 Application Structure IEC 61131-3 Application Structure

Global and direct variables

Access path

Executioncontrol path

Variableaccess path

FBTask

Program Program

FB FB

Task

Program

Task

Program

FB FB

Task

Resource Resource

Configuration

Communication Function

FunctionBlock

Variable

Page 12: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 12Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

A Configuration in IEC 61131-3A Configuration in IEC 61131-3

Encapsulates all software for an application and consists of one or several resources which provide the computational mechanisms.

Page 13: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 13Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

A Program in IEC 61131-3A Program in IEC 61131-3

A program is written in any of the languages proposed in the standard, for example:

Instruction lists

Assembly languages

Structured text

A high level language similar to Pascal

Ladder diagrams

Function block diagrams (FBD)

Page 14: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 14Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Function Block Diagram Function Block Diagram

A simple function block diagram representing a feedback control loop.

FB1 FB2

Page 15: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 15Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

A Port-based Object ApproachA Port-based Object Approach

The model is based upon the development of domain-specific components which maximize usability, flexibility and predictable temporal behavior.

Independent tasks are the bases for the PBO model.

Whenever a PBO needs data for its computation, it reads the most recent information from its in-ports, irrespective of its producer.

The PBOs are in their nature periodic and the system can be analyzed using traditional schedulability analysis.

Page 16: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 16Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

A Port-based Object A Port-based Object

Port-based objectVariable input ports

Variable output ports

Resource ports for communication with sensors and actuators

Configuration parameters

Page 17: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 17Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Designing Component-based RTSDesigning Component-based RTS

System specification

Top-level design

Detailed design

Scheduling / interface check

Obtain components timing behavior on

target platform

System verification Final product

Component library

Create specifications for the new components

Implement and verify new components using classical development

methods

Add new components

to library

Architecture analysis

Page 18: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 18Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Top-level Design Top-level Design

The first stage of the development process involves de-composition of the system into manageable components

Page 19: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 19Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Detailed Design Detailed Design

At this stage a detailed component design is performed, by selecting components to be used from the candidate set.

Page 20: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 20Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Architecture Analysis Architecture Analysis

At this stage it is time to check that the system under development satisfies extra-functional requirements such as:

Maintainability

Reusability

Modifiability

Testability

Page 21: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 21Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Scheduling Scheduling

At this point we must check that the temporal requirements of the system can be satisfied, assuming time budgets assigned in the detailed design stage.

In other words, we need to make a schedulability analysis of the system based on the temporal requirements of each component

Page 22: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 22Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

WCET Verification WCET Verification

Performing a worst-case analysis can either be based on measurements or on a static analysis of the source code.

What is more interesting in the test cases is the execution time behavior shown as a function of input parameters as shown in the following slide.

Page 23: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 23Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

An Execution Time GraphAn Execution Time Graph

Execution time

Input domain 1 domain 2 domain 3

The execution time shows different values for the different

input sub-domains.

Page 24: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 24Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Maximum execution time per sub-domainMaximum execution time per sub-domain

Execution time

Input domain 1 domain 2 domain 3

Page 25: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 25Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Implementation of New Components Implementation of New Components

New components; Those not already in the library must be implemented. The designer of the component has two requirements:

The functional requirements

The assigned time budget

Page 26: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 26Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

System Build and Test System Build and Test

Finally, we build the system using old and new components.

We must now verify the functional and temporal properties of the system obtained.

If the verification test fails, we must return to the relevant stage of the development process and correct the error.

Page 27: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 27Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Component Library Component Library

Is the most central part of any CBSE system as it contains binaries of components and their descriptions.

A component library containing real-time components should provide the following:

Memory requirements

WCET test cases

Dependencies

Environment assumptions

Page 28: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 28Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Composition of ComponentsComposition of Components

Component 1

(C1)

Component 2

(C3)

Component n

(C2)

in1_Cnew

in2_Cnew

in3_Cnew

in4_Cnew

in_C1

in2_Cn

in1_C2

in2_C2

out_C1

out_C2

out1_Cn

out2_Cn

out1_Cnew

out2_Cnew

out3_Cnew

New Component (Cnew)

Page 29: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 29Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

End-To-End DeadlinesEnd-To-End Deadlines

End-to-end deadlines

Are set such that the system requirements are fulfilled in the same way as the time budgets are set

Should be specified for the input to and output from the component since the WCET cannot be computed since its parts may be executing with different periods.

Page 30: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 30Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Specification Of Timing Attributes Specification Of Timing Attributes

We specify virtual timing attributes of the composed component, which are used to compute the timing attributes of sub-components, ie:

IF virtual period is set to P,

THEN the period of a sub-component A should be fA * P

AND the period of B is fB * P,

WHERE fA and fB are constants for the composed component, which are stored in the component library

Page 31: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 31Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

RT Components in Rubus OSRT Components in Rubus OS

Rubus:

Is one of a few real-time operating systems currently available which have some concept of components.

Is a hybrid operating system, in the sense that it supports both pre-emptive static scheduling and fixed priority scheduling.

Page 32: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 32Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

A Task and Its InterfacesA Task and Its Interfaces

The timing requirements are specified by release-time, deadline, WCET and period

Task: BrakeLeftRight Period: 50 ms Release time: 10 ms Deadline: 30 ms Precedes: outputBrakeValues WCET: 2 ms

oil pressure

speed

….

brake left wheel

brake right wheel

Task state information

Page 33: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 33Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

A Composed System in the Red Model of RubusA Composed System in the Red Model of Rubus

The task depicted below is required to execute before the outputBrakeValues task, (i.E. Task BrakeLeftRight precedes task outputBrakeValues).

Component: BrakeLeftRight

oil pressure

speed

brake left wheel

brake right wheel

State information

input 1

input 2

Component:

OutputBrakeValues

State information

Page 34: Page 1 Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems Chapter 13 Components in Real-Time Systems

Page 34Building Reliable Component-based Systems Chapter 13 -Components in Real-Time Systems

Composition of Components in Rubus Composition of Components in Rubus

Task:BrakeLeftRight

oilpressure

speed

brake left

brake right

Task state information

Task:OutputBrakeValues

Task state information

Component: BrakeSystem

pressure

speed