13.10.2013 Views

Software engineering for real-time systems

Software engineering for real-time systems

Software engineering for real-time systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Software</strong> <strong>engineering</strong> <strong>for</strong> <strong>real</strong>-<strong>time</strong> <strong>systems</strong><br />

Section 1<br />

Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong><br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 1<br />

Fibre-optic<br />

communication unit<br />

A modern batch system<br />

Local site<br />

Fibre-optic<br />

data link<br />

Remote site<br />

Fibre-optic<br />

communication unit<br />

Cray<br />

supercomputer<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 3<br />

Control panel<br />

A <strong>real</strong>-<strong>time</strong> computer system<br />

Control<br />

computer<br />

Power unit<br />

Vehicle<br />

sensors<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 5<br />

Introduction<br />

Objectives<br />

To:<br />

• Outline the differences between general-purpose<br />

computer applications and <strong>real</strong>-<strong>time</strong> <strong>systems</strong>.<br />

Give an overview of practical <strong>real</strong>-<strong>time</strong> system<br />

structures.<br />

Describe some key environmental and per<strong>for</strong>mance<br />

requirements of embedded <strong>real</strong>-<strong>time</strong> computers.<br />

Describe the structures of modern microprocessors<br />

and microcomputers.<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 2<br />

Local<br />

multiplexer<br />

Local<br />

multiplexer<br />

Typical interactive on-line computer system<br />

Site 1<br />

Site 2<br />

Remote site<br />

Central<br />

(mainframe)<br />

computer<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 4<br />

Categorizing <strong>real</strong>-<strong>time</strong> <strong>systems</strong><br />

SLOW FAST<br />

SOFT Machinery condition monitoring Man-Machine Interfacing<br />

HARD Missile point defence system Airbag control system<br />

Two major categorization factors: criticality and speed.<br />

Criticality:<br />

Hard <strong>systems</strong> - deadlines (responsiveness) is critical. Failure to meet these<br />

have severe consequences (e.g. injury, damage or death).<br />

Soft <strong>systems</strong> - deadlines are less critical; in many cases significant<br />

tolerance can be permitted.<br />

Speed:<br />

– Fast <strong>systems</strong> - responses in the microseconds to hundreds of milliseconds.<br />

– Slow <strong>systems</strong> - responses in the range seconds to days.<br />

– Arbitrary boundary: 1 second (chosen because the problems shift from<br />

individual computing issues to overall system behaviour and interaction at<br />

around this point).<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 6<br />

1


Execution Deadlines <strong>Software</strong> <strong>Software</strong><br />

<strong>time</strong><br />

size<br />

complexity<br />

Hard - Fast <br />

Hard - Slow <br />

Soft - Fast <br />

<br />

Soft - Slow <br />

Attribute rating<br />

Low high<br />

Attributes of <strong>real</strong>-<strong>time</strong> <strong>systems</strong><br />

Major attributes of <strong>real</strong>-<strong>time</strong> <strong>systems</strong>.<br />

For hard <strong>systems</strong> emphasis is placed on the need to meet deadlines.<br />

Hard-fast <strong>systems</strong> tend to have low software complexity.<br />

For soft-fast <strong>systems</strong> emphasis is put on computation per<strong>for</strong>mance.<br />

In general soft <strong>systems</strong> tend to be the more complex ones (from a software<br />

perspective).<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 7<br />

Sea Skua missile system<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 9<br />

Typical avionic plat<strong>for</strong>ms<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 11<br />

Remote plant 1<br />

Sensors<br />

Actuators<br />

Microprocessor-based outstation<br />

Data collection<br />

Control functions<br />

Communication interface<br />

Land line<br />

communication link<br />

(10 miles)<br />

Central control<br />

room<br />

Telemetry control system<br />

Main control<br />

computer<br />

Local area network<br />

Operator display<br />

and controls<br />

Front-end<br />

communication<br />

interface<br />

Data logging<br />

computer<br />

Wireless<br />

communication link<br />

(100 miles)<br />

Hot standby<br />

control computer<br />

Management<br />

in<strong>for</strong>mation<br />

computer<br />

Remote<br />

plant 2<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 8<br />

Submarine control console<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 10<br />

Microprocessor-based vending machine units<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 12<br />

2


Consumer communications<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 13<br />

Embedded <strong>systems</strong> characteristics<br />

Embedded <strong>systems</strong><br />

characteristics<br />

Defined by<br />

Environment Per<strong>for</strong>mance Interfacing<br />

Physical Electricial Operational Speed of<br />

response<br />

Failure<br />

modes<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 15<br />

Computer loading - single synchronous (periodic) task<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 17<br />

Vendor<br />

specific<br />

Bespoke designs<br />

Board-based<br />

designs<br />

VME<br />

Embedded <strong>systems</strong> plat<strong>for</strong>ms<br />

Embedded <strong>systems</strong><br />

plat<strong>for</strong>ms<br />

PC/104<br />

Embedded PC<br />

Commercial off the shelf<br />

(COTS) equipment<br />

PC-based<br />

designs<br />

Desktop<br />

PC<br />

Ruggedized<br />

PC<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 14<br />

Typical temperature specifications <strong>for</strong> <strong>real</strong>-<strong>time</strong> <strong>systems</strong><br />

Degrees centigrade<br />

-55 0 +50 +85 +125 +200<br />

Industrial<br />

range<br />

Extended industrial<br />

range<br />

Military range<br />

Oil exploration<br />

Space exploration<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 16<br />

Event<br />

signal<br />

Computer loading - single asynchronous (aperiodic) task<br />

T e T e T e<br />

Execute<br />

event task<br />

(E)<br />

processor idle (I)<br />

Event<br />

signal<br />

Execute<br />

event task<br />

(E)<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 18<br />

(I)<br />

Event<br />

signal<br />

Execute<br />

event task<br />

(E)<br />

Time<br />

(I)<br />

3


S 1<br />

Computer loading - multiple asynchronous (aperiodic) tasks<br />

(E1) = Event task 1 execution<br />

(E2) = Event task 2 execution<br />

(S1) = Event signal, task1<br />

(S2) = Event signal, task 2<br />

(I) = Idle (spare) <strong>time</strong><br />

(E (I)<br />

1 ) (I) (E1 ) (I) (E2 )<br />

(E1 ) (I) (E1 ) (E2 )<br />

S 1<br />

S 2<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 19<br />

S 1<br />

(W) = waiting <strong>time</strong> <strong>for</strong> task to<br />

complete<br />

(W)<br />

S 1<br />

S 2<br />

Time<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 21<br />

Write<br />

control<br />

Address<br />

bus<br />

O/P<br />

I/P<br />

Address<br />

decoder<br />

Elements of a microcomputer system<br />

I/P<br />

The watchdog <strong>time</strong>r<br />

Retriggerable <strong>time</strong>r<br />

(monostable)<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 23<br />

O/P<br />

To non-maskable interrupt<br />

External alarm (optional)<br />

Timeout<br />

Time<br />

General purpose<br />

microprocessors<br />

General purpose computing<br />

Microprocessors Microcomputers<br />

Highly integrated<br />

microprocessors<br />

The computing elements of <strong>real</strong>-<strong>time</strong> <strong>systems</strong><br />

Single chip<br />

microcomputers<br />

Computing elements<br />

Single chip<br />

microcontrollers<br />

Digital signal<br />

processors<br />

(DSPs)<br />

Specialized computing<br />

Mixed signal<br />

processors<br />

Bespoke<br />

system-on-chip<br />

designs<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 20<br />

Timing in hardware<br />

Real-<strong>time</strong> clock Programmable <strong>time</strong>r<br />

Control<br />

bus<br />

Address<br />

bus<br />

Chip<br />

select<br />

line<br />

To<br />

interrupt<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 22<br />

Micro<br />

ROM<br />

RAM<br />

(a) Normal mode<br />

of operation<br />

ROM<br />

RAM<br />

DMA operation<br />

Processor hold/ack<br />

DMA<br />

controller<br />

Peripheral<br />

interface<br />

DMA<br />

controller<br />

Peripheral<br />

interface<br />

(B) DMA Fig.1.21 mode DMA operation<br />

of operation<br />

DMA<br />

request/ack<br />

DMA<br />

request/ack<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 24<br />

4


SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 25<br />

I 2 C bus<br />

Interrupts<br />

Local<br />

memory<br />

Disk store<br />

Intelligent<br />

message<br />

controller<br />

(I 2 O)<br />

DMA<br />

controller<br />

Serial<br />

comms<br />

controller<br />

(I 2 C)<br />

Interrupt<br />

controller and<br />

<strong>time</strong>rs<br />

Intelligent I/O processing<br />

Primary<br />

bus<br />

Main<br />

processor<br />

I/O processor<br />

Highly integrated processor -Motorola MPC8240<br />

Secondary<br />

bus<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 27<br />

External<br />

bus<br />

PowerPC 603e<br />

microprocessor core<br />

(including floating point<br />

maths unit)<br />

Central<br />

control unit<br />

PCI bus interface<br />

unit<br />

PCI bus<br />

Data path<br />

controller<br />

Memory<br />

controller<br />

PCI bus<br />

arbiter<br />

Bus<br />

request<br />

(5)<br />

Bus<br />

grant<br />

(5)<br />

Single chip microcontroller - Fujitsu MB91F361<br />

<br />

Processor unit<br />

CPU<br />

Watchdog<br />

Interrupt controller<br />

Data RAM (16 kByte)<br />

DMA<br />

Cache memory (1<br />

kByte)<br />

Boot ROM (2 kByte)<br />

CAN<br />

interface<br />

(3)<br />

Flash<br />

(512<br />

kByte)<br />

Bus<br />

interface<br />

Sound generator<br />

LED driver<br />

GP Serial I/O<br />

I 2 C serial<br />

interface<br />

ADC (16)<br />

DAC (2)<br />

Interrupt<br />

interface (8)<br />

Stepper motor<br />

control<br />

Real-<strong>time</strong> clock<br />

Hardware <strong>time</strong>rs<br />

(6)<br />

Pulse generator<br />

Digital I/0<br />

Data<br />

bus<br />

Memory<br />

bus<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 29<br />

Address<br />

and control<br />

bus<br />

Data<br />

bus<br />

Programmable<br />

command<br />

register<br />

Data bus buffer<br />

I/O interface peripheral<br />

Address and<br />

control interface<br />

I/O port<br />

I/O port<br />

I/O port<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 26<br />

Single chip microcomputer - Philips Semiconductor 8052<br />

Clock<br />

Processor<br />

Security ROM<br />

Program store<br />

(8kByte ROM)<br />

Data store<br />

(256 Bytes RAM)<br />

External bus<br />

Hardware <strong>time</strong>rs<br />

(3)<br />

Interrupt<br />

controller<br />

Serial<br />

communication<br />

controller<br />

I/O ports (4)<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 28<br />

Digital signal processor structure<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 30<br />

8 lines<br />

8 lines<br />

8 lines<br />

5


SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 31<br />

You should now:<br />

Mixed signal processor structure - Texas MSP430<br />

Clock<br />

CPU<br />

RAM<br />

(256 bytes)<br />

Flash<br />

(256 bytes)<br />

Power-on<br />

reset<br />

Watchdog<br />

<strong>time</strong>r<br />

Debug<br />

interface<br />

Analogue<br />

comparator<br />

Ports with<br />

interrupt<br />

facility (2)<br />

PWM<br />

Timer<br />

Review of ‘Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong>’<br />

Review of section<br />

• Clearly understand the important features of <strong>real</strong>-<strong>time</strong> <strong>systems</strong>.<br />

• Know what sets them apart from batch and interactive application.<br />

• See how <strong>real</strong>-<strong>time</strong> <strong>systems</strong> may be categorized in terms of speed and criticality.<br />

• Have a general understanding of the range of <strong>real</strong>-<strong>time</strong> (and especially embedded)<br />

applications.<br />

• Realize that environmental and per<strong>for</strong>mance factors are key drivers in <strong>real</strong>-<strong>time</strong><br />

<strong>systems</strong> design.<br />

• Know the basic component parts of <strong>real</strong>-<strong>time</strong> computer units.<br />

• Appreciate the essential differences between microprocessors, microcomputers and<br />

microcontrollers.<br />

• Realize why there is a large market <strong>for</strong> specialized processors.<br />

END OF SECTION ‘Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong>’<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 33<br />

Example system-on-a-chip (SOC) design<br />

Custom coprocessor<br />

Processor<br />

core<br />

RAM<br />

ROM<br />

On-chip databus (OCB)<br />

Custom I/O<br />

interface<br />

Custom<br />

peripherals<br />

and debug<br />

interface<br />

Custom<br />

MMU<br />

Custom powermanagement<br />

unit<br />

External<br />

bus<br />

SOFTWARE ENGINEERING <strong>for</strong> REAL-TIME SYSTEMS (© J.E.Cooling 2003) Introduction to <strong>real</strong>-<strong>time</strong> <strong>systems</strong> - slide 32<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!