introduction to embedded systems research: real...
TRANSCRIPT
![Page 1: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/1.jpg)
Introduction to Embedded Systems Research:Real-Time Systems
Robert Dick
[email protected] of Electrical Engineering and Computer Science
University of Michigan
Fovea
Lens
Cornea
Variable Resolution
and Position Sampling
Change-Adaptive
Signalling
Spatial State
Cache
(Occipital
Place Area)
Analasys, e.g.,
Classification
Adequate
decision confidence?
Sampling Guidance
Y
N
Long-Term Memory
Decision /
Result
(b) Iterative, multi-round human vision system.
Image Signal
Processor
Application Processor
(CPU and/or GPU)
CloudDecision /
Result
(a) Conventional machine vision pipeline.
Image Sensor: typically
homogeneous RGGB or RCCC.
Demosaicing, binning,
denoising, gamma
correction, and compression.
Hardware Feature
Extraction Accelerator
or
Feature extraction on
raw captured data.
Runs CNN, LSTM or
other analysis algorithm.
May drop computation on less
important data, but already payed
Image Signal Processor transfer cost.
May render decision or (at high
energy cost) do feature extraction
and defer decision to cloud.
Minimalistic
Image Pre-Processor
Application Processor
(CPU and/or GPU)
CloudDecision /
Result
Image Sensor: capture only the
most important
data for decision accuracy.
Efficient gamma
correction
and binning.
Decide based on features.
Very high energy cost for
wireless data transfer.
Scene Cache
Capture ControllerHardware Feature
Extraction Accelerator
or
Adequate
decision confidence?
or
Y
N
Captures most relevant
and rapidly changing data.
Learns important sample locations
from prior rounds.
Maintains state built from
prior still-relevant samples.
Determine and
transmit
relevant data.
Decide based on features.
Very high energy cost for
wireless data transfer.
Issue commands to
capture important data.
(c) Goal: multi-round, energy-efficient, low-latency
continuous learning machine vision.
Feature extraction on sparse captured
data with similar distribution to processed data.
Continuously learn features and important
data based on prior captures.
1.1040
2.1041
385
2.1039
704
1.1039
36
2.1040
1734
0.1039
1
3.1040
4
4.1039
642
3.1039
4.1040
409
3.1041
396665
5.1042
108612774
5.1040
337
4.1041
10644
6.1044
117
6.1039
609
6.1045
164
6.1040
841434 723938
6.1042
209
5.1041
4 12 164
5.1045
529417
5.1044
140105 88
5.1039
154 10551 90677
7.1039
1248
7.1047
2106
7.1040
29773362 241966 22903106
6.1041
3119 1936 40
6.1047
4128 253
8.1050
4
8.1042
9.1050
24784
8.1039
89632
8.1044
2840
8.1040
1088
9.1039
10.1040
4
11.1039
957
10.1050
144
11.1040
156
10.1041
32 16
10.1047
87780
10.1045
2152
10.1039
1165
12.1040
145
13.1052
2404
12.1042
24
12.1045
33008
12.1044
8217
12.1041
8
12.1039
135427
14.1049
113
14.1040
229
13.1050
132
13.1042
74433
13.1041
17187
13.1040
2715
13.1039
170059 90
15.1040
16
15.1050
242 1225
14.1050
237
14.1042
6200
14.1041
4
14.1044
720
14.1052
20
14.1039
84 36939
16.1040
88
15.1049
6
15.1039
56
17.1054
2919
16.1050
129
16.1041
36
16.1047
49154
16.1045
2632
16.1049
27
16.1052
16
16.1039
222734
18.1048
133
18.1039
3439
18.1040
241
17.1050
16
18.1049
36 339224
17.1042
172832
17.1041
49620 448
17.1040
1376493 2883
17.1045
72
17.1044
1073
17.1049
55441826
17.1048
124 3648290
17.1052
3547
17.1039
2484110477445
17.1047
24
19.1040
72
19.1039
6 88 60631617
18.1041
28 76
18.1047
3305
18.1054
13744
20.1040
109
20.1039
269
19.1052
8
19.1047
11712
19.1049
10
19.1054
7520
21.1039
82
20.1049
5
20.1047
4896
20.1054
864
22.1040
4
22.1050
23.1040
4
22.1039
144
24.1058
3389
23.1050
76
24.1040
4
23.1042
17528
23.1041
4
23.1054
24
23.1044
6234
23.1058
261
23.1049
4
23.1052
2944
23.1039
3069658
25.1040
80
24.1050
4
24.1039
58
25.1039
26.1040
4
27.1039
489
26.1050
4
27.1040
4
26.1047
3808
26.1045
2248
26.1058
113 80
26.1049
11
26.1039
66
26.1054
840
28.1055
84266 1542
27.1042
1229
27.1041
29619
27.1058
12
27.1049
3984
27.1048
35337
29.1040
262
29.1056
164
29.1039
742
28.1050
4 2464
28.1042
2137912
29.1055
1128
28.1041
4 2633 4
28.1040
2716132 691
28.1058
24 84 32
28.1049
36176 3
28.1048
1192 48
28.1039
365 110957 24475
29.105029.104229.104129.104729.104529.105829.104929.105229.1054
2
3
4
5
6
7
8
0 1 2 3 4 5 6 7 8
Pow
er
(mW
)
Time (s)
35 40 45 50 55 60 65 70 75 80 85 90
-8 -6 -4 -2 0 2 4 6 8
-8
-6
-4
-2
0
2
4
6
8
35 40 45 50 55 60 65 70 75 80 85 90
Temperature (°C)
Position (mm)
Temperature (°C)
![Page 2: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/2.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Outline
1. Realtime systems
2. Real-time and embedded operating systems
3. Deadlines and announcements
2 R. Dick EECS 507
![Page 3: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/3.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Section outline
1. Realtime systemsTaxonomyDefinitionsCentral areas of real-time study
3 R. Dick EECS 507
![Page 4: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/4.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Taxonomy of real-time systems
DynamicStatic
4 R. Dick EECS 507
![Page 5: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/5.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Taxonomy of real-time systems
Soft Hard
5 R. Dick EECS 507
![Page 6: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/6.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Taxonomy of real-time systems
Single rate Multi−rate
Periodic Aperiodic
Bounded
arrival intervalUnbounded
arrival interval
6 R. Dick EECS 507
![Page 7: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/7.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Taxonomy of real-time systems
DynamicStatic Soft Hard Single rate Multi−rate
Periodic Aperiodic
Bounded
arrival intervalUnbounded
arrival interval
7 R. Dick EECS 507
![Page 8: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/8.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Taxonomy of real-time systems
DynamicStatic Soft Hard Single rate Multi−rate
Periodic Aperiodic
Bounded
arrival intervalUnbounded
arrival interval
8 R. Dick EECS 507
![Page 9: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/9.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Static
Task arrival times can be predicted.
Static (compile-time) analysis possible.
Allows good resource usage (low processor idle time proportions).
Sometimes designers shoehorn dynamic problems into static formulationsallowing a good solution to the wrong problem.
9 R. Dick EECS 507
![Page 10: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/10.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Dynamic
Task arrival times unpredictable.
Static (compile-time) analysis possible only for simple cases.
Even then, the portion of required processor utilization efficiency goes to0.693.
In many real systems, this is very difficult to apply in reality (more on thislater).
Use the right tools but don’t over-simplify, e.g.,
We assume, without loss of generality, that all tasks are independent.
10 R. Dick EECS 507
![Page 11: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/11.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Soft real-time
More slack in implementation.
Timing may be suboptimal without being incorrect.
Problem formulation can be much more complicated than hard real-time.
Two common (and one uncommon) methods of dealing with non-trivial softreal-time system requirements.
Set somewhat loose hard timing constraints.
Informal design and testing.
Formulate as optimization problem.
11 R. Dick EECS 507
![Page 12: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/12.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Hard real-time
Difficult problem. Some timing constraints inflexible.
Simplifies problem formulation.
12 R. Dick EECS 507
![Page 13: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/13.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Periodic
Each task (or group of tasks) executes repeatedly with a particular period.
Allows some nice static analysis techniques to be used.
Matches characteristics of many real problems. . .
. . . and has little or no relationship with many others that designers try topretend are periodic.
13 R. Dick EECS 507
![Page 14: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/14.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Periodic → single-rate
One period in the system.
Simple.
Inflexible.
This is how a lot of wireless sensor networks are implemented.
14 R. Dick EECS 507
![Page 15: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/15.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Periodic → multirate
Multiple periods.
Can use notion of circular time to simplify static (compile-time) scheduleanalysis E. L. Lawler and D. E. Wood, “Branch-and-bound methods: Asurvey,” Operations Research, pp. 699–719, July 1966.
Co-prime periods leads to analysis problems.
15 R. Dick EECS 507
![Page 16: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/16.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Periodic → other
It is possible to have tasks with deadlines less than, equal to, or greater thantheir periods.
Results in multi-phase, circular-time schedules with multiple concurrent taskinstances.
If you ever need to deal with one of these, see me (take my code). This classof scheduler is nasty to code.
16 R. Dick EECS 507
![Page 17: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/17.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Aperiodic
Also called sporadic, asynchronous, or reactive.
Implies dynamic.
Bounded arrival time interval permits resource reservation.
Unbounded arrival time interval impossible to deal with for anyresource-constrained system.
17 R. Dick EECS 507
![Page 18: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/18.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Section outline
1. Realtime systemsTaxonomyDefinitionsCentral areas of real-time study
18 R. Dick EECS 507
![Page 19: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/19.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Definitions
Task.
Processor.
Graph representations.
Deadline violation.
Cost functions.
19 R. Dick EECS 507
![Page 20: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/20.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Task
Some operation that needs to be carried out.
Atomic completion: A task is all done or it isn’t.
Non-atomic execution: A task may be interrupted and resumed.
20 R. Dick EECS 507
![Page 21: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/21.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Processor
Processors execute tasks.
Distributed systems.
Contain multiple processors.
Inter-processor communication has impact on system performance.
Communication is challenging to analyze.
One processor type: Homogeneous system.
Multiple processor types: Heterogeneous system.
21 R. Dick EECS 507
![Page 22: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/22.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Task/processor relationship
Matrix
FIR
Tooth
Road
WC exec time (s)
310E−3
...
...
...
...
7.7E−6
330E−9
4.1E−6
IBM PowerPC 405GP 266 MHz
IDT79RC32364 100 MHz
Imsys Cjip 40 MHz
Relationship between tasks, processors, and costs.
Examples: power consumption or worst-case execution time.
22 R. Dick EECS 507
![Page 23: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/23.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Cost functions
Mapping of real-time system design problem solution instance to cost value.
I.e., allows price, or hard deadline violation, of a particular multi-processorimplementation to be determined.
23 R. Dick EECS 507
![Page 24: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/24.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Back to real-time problem taxonomy: jagged edges
Some things can dramatically complicate real-time scheduling.
Data dependencies.
Unpredictability.
Distributed systems.
Heterogeneous processors.
Preemption.
24 R. Dick EECS 507
![Page 25: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/25.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Section outline
1. Realtime systemsTaxonomyDefinitionsCentral areas of real-time study
25 R. Dick EECS 507
![Page 26: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/26.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Central areas of real-time study
Allocation, assignment and scheduling.
Operating systems and scheduling.
Distributed systems and scheduling.
Scheduling is at the core of real-time systems study.
26 R. Dick EECS 507
![Page 27: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/27.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Operating systems and scheduling
How does one best design operating systems to
Support sufficient detail in workload specification to allow good control, e.g.,over scheduling, without increasing design error rate.
Design operating system schedulers to support real-time constraints?
Support predictable costs for task and OS service execution.
27 R. Dick EECS 507
![Page 28: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/28.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Distributed systems and scheduling
How does one best dynamically control
The assignment of tasks to processing nodes...
... and their schedules.
for systems in which computation nodes may be separated by vast distancessuch that
Task deadline violations are bounded (when possible)...
... and minimized when no bounds are possible.
28 R. Dick EECS 507
![Page 29: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/29.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
The value of formality: optimization and costs
The design of a real-time system is fundamentally a cost optimizationproblem.
Minimize costs under constraints while meeting functionality requirements.
Functionality requirements are actually just constraints.
Why view problem in this manner?
Without having a concrete definition of the problem.
How is one to know if an answer is correct?
More subtly, how is one to know if an answer is optimal?
29 R. Dick EECS 507
![Page 30: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/30.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TaxonomyDefinitionsCentral areas of real-time study
Optimization
Thinking of a design problem in terms of optimization gives design teammembers objective criterion by which to evaluate the impact of a designchange on quality.
Know whether your design changes are taking you in a good direction
30 R. Dick EECS 507
![Page 31: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/31.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Outline
1. Realtime systems
2. Real-time and embedded operating systems
3. Deadlines and announcements
31 R. Dick EECS 507
![Page 32: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/32.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Many options
eCos.
LynxOS.
MontaVista Linux.
QNX.
RTAI.
RTLinux.
Symbian OS.
VxWorks.
FreeRTOS.
Etc.
32 R. Dick EECS 507
![Page 33: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/33.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Threads
Threads vs. processes: Shared vs. unshared resources.
OS impact: Windows vs. Linux.
Hardware impact: MMU.
33 R. Dick EECS 507
![Page 34: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/34.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Threads vs. processes
Threads: Low context switch overhead.
Threads: Sometimes the only real option, depending on hardware.
Processes: Safer, when hardware provides support.
Processes: Can have better performance when IPC limited.
34 R. Dick EECS 507
![Page 35: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/35.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Software implementation of schedulers
TinyOS.
Light-weight threading executive.
µC/OS-II.
Linux.
Static list scheduler.
35 R. Dick EECS 507
![Page 36: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/36.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
TinyOS
Most behavior event-driven.
High rate → livelock.
Research schedulers exist.
36 R. Dick EECS 507
![Page 37: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/37.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
BD threads
Brian Dean: Microcontroller hacker.
Simple priority-based thread scheduling executive.
Tiny footprint (fine for AVR).
Low overhead.
No MMU requirements.
37 R. Dick EECS 507
![Page 38: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/38.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
µC/OS-II
Similar to BD threads.
More flexible.
Bigger footprint.
38 R. Dick EECS 507
![Page 39: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/39.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Old Linux scheduler
Single run queue.
O (n) scheduling operation.
Allows dynamic goodness function.
39 R. Dick EECS 507
![Page 40: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/40.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
O (1) scheduler in Linux 2.6+
Written by Ingo Molnar.
Splits run queue into two queues prioritized by goodness.
Requires static goodness function.
No reliance on running process.
Compatible with preemptable kernel.
40 R. Dick EECS 507
![Page 41: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/41.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Real-time Linux
Run Linux as process under real-time executive.
Complicated programming model.
RTAI (Real-Time Application Interface) attempts to simplify.
Colleagues still have problems at > 18 kHz control period.
41 R. Dick EECS 507
![Page 42: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/42.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Real-time operating systems
Embedded vs. real-time.
Dynamic memory allocation.
Schedulers: General-purpose vs. real-time.
Timers and clocks: Relationship with HW.
42 R. Dick EECS 507
![Page 43: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/43.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Real-time operating systems
Interaction between HW and SW.
Rapid response to interrupts.
HW interface abstraction.
Interaction between different tasks.
Communication.
Synchronization.
Multitasking
Ideally fully preemptive.
Priority-based scheduling.
Fast context switching.
Support for real-time clock.
43 R. Dick EECS 507
![Page 44: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/44.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
General-purpose OS stress
Good average-case behavior.
Providing many services.
Support for a large number of hardware devices.
44 R. Dick EECS 507
![Page 45: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/45.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
RTOSs stress
Predictable service execution times.
Predictable scheduling.
Good worst-case behavior.
Low memory usage.
Speed.
Simplicity.
45 R. Dick EECS 507
![Page 46: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/46.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Predictability
General-purpose computer architecture focuses on average-case.
Caches.
Prefetching.
Speculative execution.
Real-time embedded systems need predictability.
Disabling or locking caches is common.
Careful evaluation of worst-case is essential.
Specialized or static memory management common.
46 R. Dick EECS 507
![Page 47: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/47.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
RTOS overview
Memorymanager
BasicIO
managerTask
IPC
ISRTimer
etc.
ABSMPEGencoding
Applications
RTOSservices
Communication
Micro−browser
Messagecomposer Database
Organizer
Tasks
Hardware
Other hardware
Network interface
Processor Memory
Timer
47 R. Dick EECS 507
![Page 48: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/48.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Outline
1. Realtime systems
2. Real-time and embedded operating systems
3. Deadlines and announcements
48 R. Dick EECS 507
![Page 49: Introduction to Embedded Systems Research: Real …ziyang.eecs.umich.edu/iesr/lectures/l5.pdfIntroduction to Embedded Systems Research: Real-Time Systems Robert Dick dickrp@umich.edu](https://reader036.vdocument.in/reader036/viewer/2022062403/5fd0ce07298484275f732586/html5/thumbnails/49.jpg)
Realtime systemsReal-time and embedded operating systems
Deadlines and announcements
Deadlines and announcements
On 6 February, I will be away chairing a subcommittee on the DesignAutomation Conference technical program committee.
Professor Kevin Fu will give an overview of embedded system security thatday.
Check spreadsheet for paper assignments.
Project proposal revision due on 30 January.
49 R. Dick EECS 507