Professional Documents
Culture Documents
SURVEY OF SOFTWARE
ARCHITECTURES
1
OUTLINE
INTRODUCTION
ROUND ROBIN ARCHITECTURE
ROUND ROBIN WITH INTERRUPTS
FUNCTION QUEUES- SCHEDULING
RTOS ARCHITECTURE
SUMMARY
2
SURVEY OF SOFTWARE ARCHITECTURES
Overview
◦ The basic ‘computational model’ that helps structuring or organizing the
components of your embedded software
◦ The underlying criterion is: how much (logical) control is needed to satisfy the
required system ‘response time.’
◦ Other factors affecting ‘response’ are: processor speed, system overhead
◦ Guides:
A simple architecture: if response time is not a major issue.
A complex architecture: if there are multiple, rapid deadline and priority requirements.
◦ Topics:
Round-robin - simple
Round-robin with interrupts - fairly complex
Function-queue-scheduling - complex
Real-time operating system - very complex
3
SURVEY OF SOFTWARE ARCHITECTURES
4
ROUND ROBIN ARCHITECTURE
5
6
MULTIMETER PROGRAM
7
SURVEY OF SOFTWARE ARCHITECTURES
◦ Disadvantages:
All task code still executes at same priority.
Maximum delay unchanged.
Worst case response time = sum all other execution times + execution times of any other
interrupts that occur
8
ROUND ROBIN WITH INTERRUPT
ARCHITECTURE
9
PRIORITY LEVELS FOR ROUND
ROBIN ARCHITECTURE
10
SURVEY OF SOFTWARE ARCHITECTURES
◦ Assumptions:
Characters arrives at the hardware I/O port, one at a time, causing interrupt routines to read/write out of
the port
No hard deadline, or speed requirement, for the time to read/write from/to the port
Read/write routines do so from/into a queue for the bridge to encrypt/decrypt, one character at a time
(the queue is a shared data, and it is handled in the task code to avoid problems)
11
12
13
14
15
16
17
SURVEY OF SOFTWARE ARCHITECTURES
18
SURVEY OF SOFTWARE ARCHITECTURES
◦ Low priority tasks could experience longer delays, if higher priority tasks execute code (outside
their critical section) which take a long time
◦ Ex: If task A takes 200 ms to execute code outside its CS, then the waiting/response time for
lower priority tasks B, C, will be so increased
◦ Moving out-of-CS code for B and C into their interrupt handlers will help regain some time or
indirectly increase their priority levels. Meaning, the handlers for B and C will also take 200 ms
more to execute, increasing the overall response time for B and C
◦ One way to improve the response time of a task with lower priority is to ‘check’ its status flag
more frequently than others’ (typical RR technique in OS)
Summary: Any task which is a processor hog will not be good to model using a RR with
interrupt architecture, since response time will be bad! [Ex. The laser printer task and
the underground tank-monitoring task in Chapter 1]
19
SURVEY OF SOFTWARE ARCHITECTURES
◦ Characteristics:
The worst-case response time for highest-priority tasks is: sum(longest task code, any interrupts this code
generates), and not the sum of the response times of all the handlers
The response time for lowest-priority tasks could be long when their code segments are long
20
21
22
SURVEY OF SOFTWARE ARCHITECTURES
◦ In this architecture, the handlers signal the OS when their work is done. The OS then
‘switches’ control to the task code (when appropriate) to continue its job.
◦ Most complex.
◦ Interrupts handle urgent operations, the signal that there is more work to do for task code.
23
24
25
REAL TIME ARCHITECTURE
PRIORITIES AND COMPARISION
26
SELECTING AN ARCHITECTURE
27
summary
28
THANK YOU
ALL THE BEST
29