SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 1
Software engineering for real-time systems
Section 1
Introduction to real-time systems
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 2
Objectives
To:
• Outline the differences between general-purpose
computer applications and real-time systems.
• Give an overview of practical real-time system
structures.
• Describe some key environmental and performance
requirements of embedded real-time computers.
• Describe the structures of modern microprocessors
and microcomputers.
Introduction
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 3
Cray
supercomputer
Fibre-optic
communication unit
Fibre-optic
communication unit
Fibre-optic
data link
Remote site
Local site
A modern batch system
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 4
Local multiplexer Site 1 Local multiplexer Site 2 Central (mainframe) computer Remote site
Typical interactive on-line computer system
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 5
Control panel
Control
computer
Power unit
Vehicle
sensors
A real-time computer system
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 6
SLOW
FAST
SOFT
Machinery condition monitoring
Man-Machine Interfacing
HARD
Missile point defence system
Airbag control system
• Two major categorization factors: criticality and speed.
• Criticality:
• Hard systems - deadlines (responsiveness) is critical. Failure to meet these
have severe consequences (e.g. injury, damage or death).
•
Soft systems - deadlines are less critical; in many cases significant
tolerance can be permitted.
• Speed:
– Fast systems - responses in the microseconds to hundreds of milliseconds.
– Slow systems - responses in the range seconds to days.
– Arbitrary boundary: 1 second (chosen because the problems shift from
individual computing issues to overall system behaviour and interaction at
around this point).
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 7
• 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).
Execution
time
Deadlines
Software
size
Software
complexity
Hard - Fast
zzzz
zzzz
z
z
Hard - Slow
z
zzzz
z
Æ
zzz
z
Æ
zzzz
Soft - Fast
zzzz
zz
z
Æ
zzz
z
Æ
zzz
Soft - Slow
zz
zz
z
Æ
zzzz
z
Æ
zzzz
Attribute rating
z
Low
zzzz
high
Attributes of real-time systems
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 8 Remote plant 1 Data collection Control functions Communication interface Microprocessor-based outstation Sensors Actuators Land line communication link (10 miles) Wireless communication link (100 miles) Front-end communication interface Main control computer Hot standby control computer Operator display and controls Data logging computer Management information computer Local area network
Central control room
Remote plant 2
Telemetry control system
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 9
Sea Skua missile system
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 10
Submarine control console
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 11
Typical avionic platforms
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 12
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 13
Consumer communications
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 14
Embedded systems
platforms
Bespoke designs
Commercial off the shelf
(COTS) equipment
Board-based
designs
PC-based
designs
VME
PC/104
Embedded PC
Desktop
PC
Ruggedized
PC
Vendor
specific
Embedded systems platforms
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 15
Embedded systems
characteristics
Defined by
Environment
Performance
Interfacing
Physical
Electricial
Operational
Speed of
response
Failure
modes
Embedded systems characteristics
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 16
Degrees centigrade
-55 0 +50 +85 +125 +200
Military range
Industrial
range
Oil exploration
Space exploration
Extended industrial
range
Typical temperature specifications for real-time systems
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 17
Computer loading - single synchronous (periodic) task
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 18
Execute
event task
(E)
processor idle (I)
T
e
T
e
T
e
(I)
Execute
event task
(E)
Execute
event task
(E)
Time
(I)
Event
signal
Event
signal
Event
signal
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 19
Computer loading - multiple asynchronous (aperiodic) tasks
(I)
(E
1)
(E
1)
(I)
(E
2)
(E
1)
(I)
(E
1)
(E
2)
S
1S
1S
1S
1S
2(W)
S
2(W) = waiting time for task to
complete
(I)
Time
(E1) = Event task 1 execution
(E2) = Event task 2 execution
(S1) = Event signal, task1
(S2) = Event signal, task 2
(I) = Idle (spare) time
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 20
Computing elements
Microprocessors Microcomputers
Specialized computing General purpose computing
General purpose microprocessors Highly integrated microprocessors Single chip microcomputers Single chip microcontrollers Digital signal processors (DSPs) Mixed signal processors Bespoke system-on-chip designs
The computing elements of real-time systems
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 21
Elements of a microcomputer system
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 22
Timing in hardware
Real-time clock
Programmable timer
Address
bus
Chip
select
line
Control
bus
To
interrupt
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 23
Address
decoder
Retriggerable timer
(monostable)
I/P
O/P
To non-maskable interrupt
External alarm (optional)
Write
control
Address
bus
O/P
I/P
Time
Timeout
The watchdog timer
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 24
Fig.1.21 DMA operation
ROM RAM DMA controller Peripheral interface DMA request/ack (B) DMA mode of operation Micro ROM RAM DMA controller Peripheral interface Processor hold/ack DMA request/ack
(a) Normal mode of operation
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 25
Intelligent I/O processing
Main
processor
I/O processor
Disk store
Local
memory
Primary
bus
Secondary
bus
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 26
Programmable command
register
Data bus buffer
Address and control interface I/O port I/O port I/O port 8 lines 8 lines 8 lines Address and control bus Data bus
I/O interface peripheral
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 27
PowerPC 603e microprocessor core (including floating point
maths unit) Central control unit Data path controller Memory controller
PCI bus interface unit Interrupt controller and timers DMA controller Serial comms controller (I2C) Intelligent message controller (I2O) PCI bus arbiter Bus request (5) Bus grant (5) PCI bus I2C bus Data bus Memory bus Interrupts
Highly integrated processor -Motorola MPC8240
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 28
Processor
Clock
Program store
(8kByte ROM)
Data store
(256 Bytes RAM)
Hardware timers
(3)
Interrupt
controller
Serial
communication
controller
I/O ports (4)
Security ROM
External bus
Single chip microcomputer - Philips Semiconductor 8052
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 29 LED driver DAC (2) Stepper motor control I2C serial interface Sound generator GP Serial I/O ADC (16) Interrupt interface (8) Real-time clock Hardware timers (6) Pulse generator Digital I/0 y CPU y Watchdog y Interrupt controller
y Data RAM (16 kByte)
y DMA
y Cache memory (1 kByte)
Processor unit
Boot ROM (2 kByte)
Bus interface CAN interface (3) Flash (512 kByte) External bus
Single chip microcontroller - Fujitsu MB91F361
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 30
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 31
Flash
(256 bytes)
RAM
(256 bytes)
CPU
Watchdog
timer
Debug
interface
Power-on
reset
Ports with
interrupt
facility (2)
PWM
Timer
Analogue
comparator
Clock
Mixed signal processor structure - Texas MSP430
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 32
ROM
RAM
Processor
core
Custom I/O
interface
Custom
power-management
unit
Custom
MMU
Custom
peripherals
and debug
interface
Custom
co-processor
On-chip databus (OCB)
External
bus
Example system-on-a-chip (SOC) design
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to real-time systems - slide 33