Download presentation
Presentation is loading. Please wait.
1
courseware Basics of Real-Time Scheduling Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building 321 DK2800 Lyngby, Denmark Jan@imm.dtu.dk
2
SoC-MOBINET coursewareJan Madsen2 WAP application Need structure and to perform multiple processes - send requests to server - translate data received from server - render data on display - operating the user’s control panel - logically different operations - performed at different rates Tasks: Why?
3
SoC-MOBINET coursewareJan Madsen3 Why use multiple processes? Processes are a neat way to handle complex systems Processes introduce structure into the system design –understand each process independently –analyze communication between processes to determine system behavior Timing is easier to specify Communication between processes provide test points Suitable for team effort
4
SoC-MOBINET coursewareJan Madsen4 What is a process? A process is a state and a procedure State: Running Suspended Deactivated Procedure: Sequence of separate steps A process may interact with its surroundings
5
SoC-MOBINET coursewareJan Madsen5 Process execution deadline activation period
6
SoC-MOBINET coursewareJan Madsen6 Process execution Periodic –the period is the time between successive executions –the process rate is the inverse of its period Aperiodic –non-periodic process, typical an event handler Sporadic –hard real-time aperiodic process –usually, a minimum interarrival constraint is imposed
7
SoC-MOBINET coursewareJan Madsen7 Example: A software processes A process includes: code memory which belongs to the process connections to other processes A process is a unique execution of a program In most embedded systems, processes never die!
8
SoC-MOBINET coursewareJan Madsen8 CPU Memory Executing on a single CPU P 1 code & data P 2 code & data P 3 code & data P 1 state P 2 state P 3 state PC registers
9
SoC-MOBINET coursewareJan Madsen9 Execution of multiple processes On a single CPU –A Pentium processor On a distributed homogeneous system –A network of Pentium processors On a distributed heterogeneous system –A network of differing processors (CPUs and ASICs)
10
SoC-MOBINET coursewareJan Madsen10 About this lecture Huge literature on scheduling theory Aim is to give an overview of problems and possible solutions to the multi-task scheduling problem related to RTOS Structure of lecture: Some basic concepts and teminology Uni-processor scheduling Rate-monotonic scheduling Earlies-deadlines-first scheduling Multi-processor scheduling
11
SoC-MOBINET coursewareJan Madsen11 PART I Scheduling Terminology and Basic Concepts
12
SoC-MOBINET coursewareJan Madsen12 Design flow P1P1 P2P2 P3P3 Partitioning/clustering Break processes to increase parallelism Cluster processes to reduce communication Allocation PE 1 PE 2 Mapping Scheduling Communication P1P1 P3P3 P2P2 PE 1 PE 2 P1P1 P 2 & P 3
13
SoC-MOBINET coursewareJan Madsen13 Scheduling 1 3 4 2 abc 1 2 os 3 4 scheduling abc
14
SoC-MOBINET coursewareJan Madsen14 Terminology Application Architecture constraints Scheduler Schedule Architecture Application Scheduling Constraints
15
SoC-MOBINET coursewareJan Madsen15 Architecture Components Processors CPU, DSP, ASIC,... Communication Bus, network,... Devices sensor, actuator, display,... Architecture may be fixed or (re-)configurable mem device abc os 1 2 3 4
16
SoC-MOBINET coursewareJan Madsen16 Application Task A module which can be envoked to perform a particular function A schedulable entity Characterized by its: Timing constraints Precedence contraints Exclusion constraints Resource requirements 1 3 4 2
17
SoC-MOBINET coursewareJan Madsen17 Timing constraints r1r1 r 1 = time at which task becomes released (or active) e1e1 e 1 = worst case execution time (WCET) d 1 = deadline, task should complete before this! d1d1 s1s1 s 1 = time at which task starts its execution T1T1 T 1 = period, minimum time between task releases 1
18
SoC-MOBINET coursewareJan Madsen18 Task execution Periodic the period is the time between successive executions Aperiodic non-periodic task, typical an event handler Sporadic hard real-time aperiodic task typical, a minimum interarrival constraint is imposed
19
SoC-MOBINET coursewareJan Madsen19 Precedence constraints p i precede p j if p i must finish before p j begins process interrelate with each other to achieve: synchronization exchange data pipi pjpj pipi pjpj blocked
20
SoC-MOBINET coursewareJan Madsen20 Exclusion constraints p i exclude p j if no execution of p j is allowed between the time that p i starts its computation and the time that p i complete its computation Prevent simultaneous access to shared resources data memory devices pipi pjpj pipi pjpj p j blocked
21
SoC-MOBINET coursewareJan Madsen21 Resource constraints R = r 1, r 2, …, r m Example: R(p i ) = {r 1, r 3 } resource r 1 and r 3 is required by p i during its execution may be used to implement a critical section enforce PE assignment of processes
22
SoC-MOBINET coursewareJan Madsen22 Scheduling approaches Classical scheduling theory Uniprocessor systems RMS EDF Distributed real-time scheduling Deterministic (static) scheduling Dynamic scheduling
23
SoC-MOBINET coursewareJan Madsen23 Scheduling Allocation Determine number and type of processors/resources Assignment Binding tasks to processors Scheduling Determine execution order a b b a 1 21 2 Task view 1 2 Architecture view a b
24
SoC-MOBINET coursewareJan Madsen24 Scheduling principles Off-line A scheduler performing its job before the scheduled system is put into operation On-line A scheduler performing its job at run-time, when the system is running Typically list-based When a task is released (ready) it is placed in a list Scheduler select which task from the list to execute next Selection based on some criteria – scheduling policy
25
SoC-MOBINET coursewareJan Madsen25 Scheduling areas High-level Synthesis: fine grained, operation/instruction level schedule done off-line single time constraint Real-time operating systems (RTOS): coarse grained, programs/sub-programs scheduling done on-line multiple time constraints
26
SoC-MOBINET coursewareJan Madsen26 SoC scheduling Similarity to RTOS Time constraints Context switching Task synchronization Task communication Difference to RTOS Large design space Variable granularity Wide range of metrics Time, power, cost,... Flexibility, reliability,... High degree of optimization Dedicated hardware
27
SoC-MOBINET coursewareJan Madsen27 Non-preemptive scheduling Preemptive scheduling Preemption vs. Non-preemption 1 2 1 2
28
SoC-MOBINET coursewareJan Madsen28 Metrics Minimize: c i w c i i }{ max de L ii i lateness, tardiness Schedule length p1p1 p2p2 p3p3 p4p4 p5p5 p1p1 p2p2 p3p3 p4p4 p5p5 d1d1 d2d2 d3d3 d4d4 d5d5
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.