Chapter 13
Components in Real-Time Systems
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 1
Overview
 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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 2
Introduction
 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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 3
Characteristics 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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 4
Tasks
 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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 5
Scheduling
 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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 6
Limited 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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 7
System 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 prerun-time scheduling techniques
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 8
Real-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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 9
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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 10
IEC 61131-3 Application Structure
Configuration
Resource
Variable
access path
Resource
Task
Task
Task
Task
FB
Function
Block
Program
Program
FB
Program
Program
Variable
FB
FB
FB
Global and direct variables
Execution
control path
Access path
Communication Function
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 11
A Configuration in IEC 61131-3
 Encapsulates all software for an application and
consists of one or several resources which provide the
computational mechanisms.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 12
A 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)
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 13
Function Block Diagram
FB1
FB2
A simple function block diagram representing a feedback control loop.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 14
A Port-based Object Approach
 The model is based upon the development of domainspecific 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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 15
A Port-based Object
Configuration parameters
Variable
input ports
Port-based object
Variable
output ports
Resource ports for communication
with sensors and actuators
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 16
Designing Component-based RTS
System specification
Top-level design
Component
library
Detailed design
Architecture analysis
Scheduling / interface
check
Create specifications for
the new components
Add new
components
to library
Implement and verify
new components using
classical development
methods
Obtain components
timing behavior on
target platform
System verification
Final product
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 17
Top-level Design
 The first stage of the development process involves decomposition of the system into manageable
components
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 18
Detailed Design
 At this stage a detailed component design is performed,
by selecting components to be used from the candidate
set.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 19
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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 20
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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 21
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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 22
An Execution Time Graph
The execution time shows different values for the different
input sub-domains.
Execution time
Input
domain 1
domain 2
domain 3
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 23
Maximum execution time per sub-domain
Execution time
Input
domain 1
domain 2
domain 3
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 24
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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 25
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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 26
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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 27
Composition of Components
N ew C o m p o n en t (C new )
in1_C n ew
in_C 1
C o m p o n en t 1
(C 1 )
in2_C n ew
in3_C n ew
in4_C n ew
out_C 1
in2_C n
C o m p o n en t n
(C 2 )
out1_C n
out1_C n ew
out2_C n
out2_C n ew
in1_C 2
in2_C 2
C o m p o n en t 2
(C 3 )
out_C 2
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
out3_C n ew
Page 28
End-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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 29
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
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 30
RT 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.
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 31
A Task and Its Interfaces
 The timing requirements are specified by release-time,
deadline, WCET and period
T ask state info rm atio n
o il p ressure
sp eed
….
T ask:
B ra keL eftR ig h t
P erio d :
50 ms
R elease tim e: 1 0 m s
D ead line:
30 ms
P reced es:
o utp utB rakeV alues
W CET:
2 ms
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
b rake left w heel
b rake right w heel
Page 32
A 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).
S tate inform ation
brake left w heel
oil pressure
speed
S tate inform ation
C om ponent:
B rakeL eftR ight
brake right w heel
input 1
input 2
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
C om ponent:
O utputB rakeV alues
Page 33
Composition of Components in Rubus
C o m p o ne nt: B rakeS yste m
T ask state in fo rm atio n
T ask state in fo rm atio n
p ressure
o il
p ressure
sp eed
b rake left
T ask:
B ra keL eftR ig h t
b rake right
T ask:
O u tp u tB ra keV a lu es
sp eed
Building Reliable Component-based Systems
Chapter 13 -Components in Real-Time Systems
Page 34
Descargar

Document