You are on page 1of 10

Real-Time Software Development Jan F.

Broenink
(191211090) 2015 / 2016

RTSD – Introduction
• Embedded Systems
– Application areas
– Examples
• Working with Embedded Systems
– Characteristics
– Dependability
– Challenges
• Design Process
– Overview of a work flow

• Sources of some slides


– (PM) Peter Marwedel, Embedded Systems Design
– (JC) Jim Cooling, Software Engineering for Real-Time Systems

1 Jan Broenink Real-Time Software Development (191211090) University of Twente

Embedded systems
• Embedded systems (ES)
– Information processing systems embedded into a larger product
– Main reason for buying is not information processing
• ES Software is Dependable
– Availability, Reliability, Safety, Integrity, Maintainability Avizienis et al
– Security = Availability, Integrity, Confidentiality

(PM)

2 Jan Broenink Real-Time Software Development (191211090) University of Twente

CH1 Introduction 1
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Application areas

• Automotive electronics
ABS, ESP, ACC
Electric-driven cars
• Aircraft electronics
A340+ Fly-by-wire
• Trains

• Telecommunication
Fastest growing market
• Robotics

• Medical (cure, care)

Real-Time Software Development (191211090) (PM)


3 Jan Broenink University of Twente

Embedded systems characteristics

Embedded systems
characteristics

Defined by

Environment Performance Interfacing

Physical Electricial Operational Speed of Failure


response modes

8 Jan Broenink Real-Time Software Development (191211090) (JC) University of Twente

CH1 Introduction 2
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Embedded systems platforms

Embedded systems
platforms

Commercial off the shelf


Bespoke designs
(COTS) equipment

Board-based PC-based
designs designs

Vendor PC/104 Desktop Ruggedized


VME
specific Embedded PC PC PC

9 Jan Broenink Real-Time Software Development (191211090) (JC) University of Twente

Categorizing Real-Time Systems


SLOW FAST

SOFT Machinery condition monitoring Man-Machine Interfacing

HARD Missile point defence system Airbag control system

• Criticality
– Hard systems
» Deadlines (responsiveness) really critical
» Failure => severe consequences (e.g. injury, damage or death)
– Soft systems
» Deadlines are less critical
» In many cases significant tolerance can be permitted (= be too late a bit)
• Speed
– Fast systems
» Responses within µs to 100 ms
– Slow systems
» Responses in the range 1 s to days
– Rather arbitrary boundary
» Related to reaction times in computer

10 Jan Broenink Real-Time Software Development (191211090) (JC) University of Twente

CH1 Introduction 3
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Attributes of real-time systems


Execution Deadlines Software Software
time size complexity
Hard - Fast ●●●● ●●●● ● ●
Hard - Slow ● ●●●● ● à ●●● ● à ●●●●
Soft - Fast ●●●● ●● ● à ●●● ● à ●●●
Soft - Slow ●● ●● ● à ●●●● ● à ●●●●

Attribute rating
● Low ●●●● high

• Major attributes of real-time systems


• For hard systems emphasis is placed on the need to meet deadlines
• Hard-fast systems tend to have low software complexity
• For soft-fast systems emphasis is put on computation performance
• In general soft systems tend to be the more complex ones
(from a software perspective)
11 Jan Broenink Real-Time Software Development (191211090) (JC) University of Twente

Characteristics of Embedded Systems

§ Must be efficient due to restricted computer hardware


– Energy efficient
– Code-size efficient
(especially for systems on a chip)
– Run-time efficient
– Weight efficient
– Cost efficient
§ Dedicated towards a certain application
§ Knowledge about behavior at design time can be used to minimize
resources and to maximize robustness
§ Dedicated user interface
§ no mouse, keyboard and screen

Real-Time Software Development (191211090) (PM)


12 Jan Broenink University of Twente

CH1 Introduction 4
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Important for ES:

Avižienis, A., Laprie, J.-C., Randell, B. and Landwehr, C. (2004), Basic Concepts and Taxonomy of Dependable
and Secure Computing, IEEE Trans. on Dependable and Secure Computing, 1, (1), pp. 11-33.

13 Jan Broenink Real-Time Software Development (191211090) University of Twente

Characteristics of Embedded Systems (4)

§ Must be dependable
• Reliability R(t) = probability of system working correctly
provided that is was working at t=0
• Maintainability M(d) = probability of system working
correctly d time units after error occurred.
• Availability A(t): probability of system working at time t
• Safety: no harm to be caused
• Integrity: no improper system changes (from its inside)
• Failures
• At perfect design -> when assumptions are wrong
• At ‘normal’ design -> production / component errors
• Good design
• Dependability issues considered from the beginning
14 Jan Broenink Real-Time Software Development (191211090) University of Twente

CH1 Introduction 5
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Challenges for embedded software

§ Dynamic environments
§ Capture the required behaviour!
§ Validate specifications

§ Efficient translation of specifications into implementations!


§ How can we check that we meet real-time constraints?
§ How do we validate embedded real-time software?
§ large volumes of data, testing may be safety-critical

Real-Time Software Development (191211090) (PM)


15 Jan Broenink University of Twente

It is not sufficient to consider ES


just as a special case of software engineering
EE / CS knowledge must be available,
Walls between EE and CS must be torn down

Cyber-Physical Systems

CS EE • Master Embedded Systems


• Embedded Systems research
• Embedded Systems Institute

16 Jan Broenink Real-Time Software Development (191211090) University of Twente

CH1 Introduction 6
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Robots as Cyber-Physical Systems or Embedded Systems

• Robots as a specific class of Cyber Physical Systems


– Safety-critical cyber-physical systems
– Total system (cyber and physical) integrally treated Cyber domain Physical domain

• The combination is relevant Electrical domain Mechanical domain

Control DAC Actuators


– Embedded control software Software
Electrical Mechanical
Components Components
Components ADC Sensors
– Behavior of the robot mechanism
• Co-modelling and Co-Simulation
– 2 Models of Computation
» Discrete Event => CSP process algebra or VDM, functional language
» Continuous Time => Bond Graphs, port-based
– Combined in co-simulation
– Early integration of models
– Early testing: virtual prototyping

17 Jan Broenink University of Twente

Embedded Control Systems


• Essential properties
– Dynamic behavior of plant essential
» Latency small compared to time constants plant
» Whole system must be considered
– Intrinsically concurrent
– Loop controllers hard real time, 0.1-10 ms cycle time
• Software
– User Interfacing, Data processing, Plant control (5-30% of code)
– Reliable, safe, timing guaranteed
Embedded software I/O hardware Process
– Triggering: bounded jitter (isochronous) Non Soft Hard
real-time real-time real-time
• Hardware D/A
Power
amplifier
Actuators
User interface

Meas. & Act.


Loop control
Supervisory

Safety layer
Interaction

– Computer hardware & I/O


Sequence
control &

control

Physical system
– Programmable devices
Filtering/
– Distributed, heterogeneous A/D Sensors
Scaling
• Plant
– Machine, Sensors, Actuators, Power Amplifiers

18 Jan Broenink University of Twente

CH1 Introduction 7
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Concurrent Design Flow


Functional Design
Implementation

1. Architecture and Dynamic behaviour


2. Model-based control law design
Concurrently: 3. Embedded Control SW Implementation
Software, Electronics, Mechanics
Stepwise refinement, Simulation
4. First-time right Realization
19 Jan Broenink Real-Time Software Development (191211090) University of Twente

Case: Production cell

• Demonstrator
• Based on Stork molder
• 6 motors in parallel
• Synchronization
• Metal blocks
• Distributed

20 Jan Broenink University of Twente


Real-Time Software Development (191211090)

CH1 Introduction 8
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Prod Cell ECS implementations

• Embedded Control System implementations


Nr. Name Data type Target Realization
A gCSP RTAI Linux Floating point CPU Yes
B POOSL Floating point CPU Yes
C Ptolemy II Floating point CPU Yes
D gCSP QNX RTOS Floating point CPU Partial
E gCSP Handel-C int Integer FPGA Yes
F gCSP Handel-C float Floating point FPGA Yes
G SystemCSP - - No

• Different choices OS: Formalisms: Tools: Architecture:


§ RTAI Linux § CSP § gCSP, FDR2
§ QNX § CCS § 20-sim
§ No OS § Multi MoC § POOSL CPUFPGA
§ Ptolemy II
Seq Par | |
– And many more…
21 Jan Broenink University of Twente
Real-Time Software Development (191211090)

CPU gCSP RTAI (A)

• Focus: proof of concept gCSP


– Proof of concept gCSP for Embedded Control Systems software
– Combination of untimed CSP and real-time Linux
• Realization Embedded software
Non
real-time
Soft
real-time
Hard
real-time
I/O hardware

D/A
Power
Physical system

Actuators
amplifier
Loop control
Supervisory

Safety layer
Sequence
Interaction

– Bottom up
control &
interface

control

Physical process
User

Filtering/
A/D Sensors

– 6 Semi-independent units è 6 PARs


Scaling

– PRIPAR for real-time


levels
– Periodic timing
» TimerChannels
» ECS SW ó Environment
» Rendezvous with OS
timer
– Formal check with FDR2
– Generated code from
» gCSP + 20-sim

22 Jan Broenink Real-Time Software Development (191211090) University of Twente

CH1 Introduction 9
Real-Time Software Development Jan F. Broenink
(191211090) 2015 / 2016

Results FPGA Usage (integer)


• Real parallelism
– 6 Production Cell Units run parallel
• Integer algorithm (no floating point)
– Manual translation ó time consuming
• Accurate timing
• Estimated FPGA Usage
– Xilinx Spartan 3s1500
Element LUTs (amount) Flipflops (amount) Memory Used ALUs
PID controllers 13.5% (4038) 0.4% (126) 0.0% 0
Motion profiles 0.9% (278) 0.2% (72) 0.0% 0
I/O + PCI 3.6% (1090) 1.6% (471) 2.3% 0
S&C framework 10.3% (3089) 8.7% (2616) 0.6% 0
Free 71.7% (21457) 89.1% (26667) 97.1% 32
PID controllers take 50% of the used space, <1% of the code
PID controllers run | | @ 1 ms with idle time 99,95%
23 Jan Broenink University of Twente
Real-Time Software Development (191211090)

What is next?

• On Concurrency: theory and usage


– CSP: Communicating Sequential Processes
– Tooling for ECS design: TERRA editor, Luna library
• Modelling Ex 1, 2
CSP & TERRA
– Different models of computation
• Design Approach
– The concurrent design flow…
– We focus on the embedded software
Ex 3
– Target to run on a real set up Concurrency
TERRA, Luna
• Background Real-time code
– Internals, foundations
– More ‘theory’

24 Jan Broenink Real-Time Software Development (191211090) University of Twente

CH1 Introduction 10

You might also like