ΗΜΥ 653 Ενσωματωμένα Συστήματα και Συστήματα Πραγματικού Χρόνου Εαρινό Εξάμηνο 2017

Size: px
Start display at page:

Download "ΗΜΥ 653 Ενσωματωμένα Συστήματα και Συστήματα Πραγματικού Χρόνου Εαρινό Εξάμηνο 2017"

Transcription

1 ΗΜΥ 653 Ενσωματωμένα Συστήματα και Συστήματα Πραγματικού Χρόνου Εαρινό Εξάμηνο 2017 ΔΙΑΛΕΞΕΙΣ 7-8: Neural Network Build-Up and Training Mapping Applications Scheduling - Optimization Algorithms -- Mapping Tools ΧΑΡΗΣ ΘΕΟΧΑΡΙΔΗΣ Επίκουρος Καθηγητής ΗΜΜΥ (ttheocharides@ucy.ac.cy) Slides adopted from Prof. Peter Marwedel, Microsoft

2 Embedded System Software Application Knowledge 2: Specification 3: ES-hardware 4: system software (RTOS, middleware, ) Design repository 6: Application mapping 7: Optimization 5: Validation & Evaluation (energy, cost, performance, ) Design 8: Test ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.2 Θεοχαρίδης, ΗΜΥ, 2017

3 Mapping of Applications to Platforms Renesas, Thiele ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.3 Θεοχαρίδης, ΗΜΥ, 2017

4 Distinction between mapping problems ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.4 Θεοχαρίδης, ΗΜΥ, 2017

5 Problem Description q Given q Find A set of applications Scenarios on how these applications will be used A set of candidate architectures comprising - (Possibly heterogeneous) processors - (Possibly heterogeneous) communication architectures - Possible scheduling policies A mapping of applications to processors Appropriate scheduling techniques (if not fixed) A target architecture (if DSE is included) q Objectives Keeping deadlines and/or maximizing performance Minimizing cost, energy consumption ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.5 Θεοχαρίδης, ΗΜΥ, 2017

6 Related Work Mapping to EXUs in automotive design Scheduling theory: Provides insight for the mapping task start times Hardware/software partitioning: Can be applied if it supports multiple processors High performance computing (HPC) Automatic parallelization, but only for - single applications, - fixed architectures, - no support for scheduling, - memory and communication model usually different High-level synthesis Provides useful terms like scheduling, allocation, assignment Optimization theory ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.6 Θεοχαρίδης, ΗΜΥ, 2017

7 Scope of mapping algorithms Useful terms from hardware synthesis: Resource Allocation Decision concerning type and number of available resources Resource Assignment Mapping: Task (Hardware) Resource xx to yy binding: Describes a mapping from behavioral to structural domain, e.g. task to processor binding, variable to memory binding Scheduling Mapping: Tasks Task start times Sometimes, resource assignment is considered being included in scheduling. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.7 Θεοχαρίδης, ΗΜΥ, 2017

8 Classes of mapping algorithms (considered in this course) Classical scheduling algorithms Mostly for independent tasks & ignoring communication, mostly for mono- and homogeneous multiprocessors Hardware/software partitioning Dependent tasks, heterogeneous systems, focus on resource assignment Dependent tasks as considered in architectural synthesis Initially designed in different context, but applicable Design space exploration using genetic algorithms Heterogeneous systems, incl. communication modeling ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.8 Θεοχαρίδης, ΗΜΥ, 2017

9 Real-time scheduling q Assume that we are given a task graph G=(V,E). q Def.: A schedule s of G is a mapping V T of a set of tasks V to start times from domain T. G=(V,E) V1 V2 V3 V4 s T t Typically, schedules have to respect a number of constraints, incl. resource constraints, dependency constraints, deadlines. Scheduling = finding such a mapping. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.9 Θεοχαρίδης, ΗΜΥ, 2017

10 Hard and soft deadlines q Def.: A time-constraint (deadline) is called hard if not meeting that constraint could result in a catastrophe [Kopetz, 1997]. q All other time constraints are called soft. q We will focus on hard deadlines. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.10 Θεοχαρίδης, ΗΜΥ, 2017

11 Periodic and aperiodic tasks q Def.: Tasks which must be executed once every p units of time are called periodic tasks. p is called their period. Each execution of a periodic task is called a job. q All other tasks are called aperiodic. q Def.: Tasks requesting the processor at unpredictable times are called sporadic, if there is a minimum separation between the times at which they request the processor. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.11 Θεοχαρίδης, ΗΜΥ, 2017

12 Preemptive and non-preemptive scheduling Non-preemptive schedulers: Tasks are executed until they are done. Response time for external events may be quite long. Preemptive schedulers: To be used if - some tasks have long execution times or - if the response time for external events to be short. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.12 Θεοχαρίδης, ΗΜΥ, 2017

13 Centralized and distributed scheduling Centralized and distributed scheduling: Multiprocessor scheduling either locally on 1 or on several processors. Mono- and multi-processor scheduling: - Simple scheduling algorithms handle single processors, - more complex algorithms handle multiple processors. algorithms for homogeneous multi-processor systems algorithms for heterogeneous multi-processor systems (includes HW accelerators as special case). ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.13 Θεοχαρίδης, ΗΜΥ, 2017

14 Dynamic/online scheduling Dynamic/online scheduling: Processor allocation decisions (scheduling) at run-time; based on the information about the tasks arrived so far. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.14 Θεοχαρίδης, ΗΜΥ, 2017

15 Static/offline scheduling Static/offline scheduling: Scheduling taking a priori knowledge about arrival times, execution times, and deadlines into account. Dispatcher allocates processor when interrupted by timer. Timer controlled by a table generated at design time. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.15 Θεοχαρίδης, ΗΜΥ, 2017

16 Time-triggered systems (1) q In an entirely time-triggered system, the temporal control structure of all tasks is established a priori by off-line support-tools. This temporal control structure is encoded in a Task-Descriptor List (TDL) that contains the cyclic schedule for all activities of the node. This schedule considers the required precedence and mutual exclusion relationships among the tasks such that an explicit coordination of the tasks by the operating system at run time is not necessary... q The dispatcher is activated by the synchronized clock tick. It looks at the TDL, and then performs the action that has been planned for this instant [Kopetz]. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.16 Θεοχαρίδης, ΗΜΥ, 2017

17 Time-triggered systems (2) q pre-run-time scheduling is often the only practical means of providing predictability in a complex system. [Xu, Parnas]. q It can be easily checked if timing constraints are met. The disadvantage is that the response to sporadic events may be poor. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.17 Θεοχαρίδης, ΗΜΥ, 2017

18 Schedulability q Set of tasks is schedulable under a set of constraints, if a schedule exists for that set of tasks & constraints. q Exact tests are NP-hard in many situations. q Sufficient tests: sufficient conditions for schedule checked. (Hopefully) small probability of not guaranteeing a schedule even though one exists. q Necessary tests: checking necessary conditions. Used to show no schedule exists. There may be cases in which no schedule exists & we cannot prove it. sufficient schedulable necessary ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.18 Θεοχαρίδης, ΗΜΥ, 2017

19 Cost functions q Cost function: Different algorithms aim at minimizing different functions. q Def.: Maximum lateness = max all tasks (completion time deadline) Is <0 if all tasks complete before deadline. T1 T2 t ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.19 Θεοχαρίδης, ΗΜΥ, 2017

20 Aperiodic scheduling - Scheduling with no precedence constraints - q Let {T i } be a set of tasks. Let: c i be the execution time of T i, d i be the deadline interval, that is, the time between T i becoming available and the time until which T i has to finish execution. l i be the laxity or slack, defined as l i = d i - c i f i be the finishing time. i d i c i l i t ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.20 Θεοχαρίδης, ΗΜΥ, 2017

21 Uniprocessor with equal arrival times q Preemption is useless. q Earliest Due Date (EDD): Execute task with earliest due date (deadline) first. f i f i f i EDD requires all tasks to be sorted by their (absolute) deadlines. Hence, its complexity is O(n log(n)). ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.21 Θεοχαρίδης, ΗΜΥ, 2017

22 Optimality of EDD q EDD is optimal, since it follows Jackson's rule: Given a set of n independent tasks, any algorithm that executes the tasks in order of non-decreasing (absolute) deadlines is optimal with respect to minimizing the maximum lateness. q Proof (See Buttazzo, 2002): Let s be a schedule produced by any algorithm A If A ¹ EDD $ T a, T b, d a d b, T b immediately precedes T a in s. Let s' be the schedule obtained by exchanging T a and T b. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.22 Θεοχαρίδης, ΗΜΥ, 2017

23 Exchanging T a and T b cannot increase lateness q Max. lateness for T a and T b in s is L max (a,b)=f a -d a Max. lateness for T a and T b in s' is L' max (a,b)=max(l' a,l' b ) Two possible cases 1. L' a L' b : L' max (a,b) = f' a d a < f a d a = L max (a,b) since T a starts earlier in schedule s'. 2. L' a L' b : L' max (a,b) = f' b d b = f a d b f a d a = L max (a,b) since f a =f' b and d a d b F L' max (a,b) L max (a,b) s s' T b T a T a T b f a =f' b ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.23 Θεοχαρίδης, ΗΜΥ, 2017

24 EDD is optimal F Any schedule s with lateness L can be transformed into an EDD schedule s n with lateness L n L, which is the minimum lateness. F EDD is optimal (q.e.d.) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.24 Θεοχαρίδης, ΗΜΥ, 2017

25 Earliest Deadline First (EDF) - Horn s Theorem - q Different arrival times: Preemption potentially reduces lateness. q Theorem [Horn74]: Given a set of n independent tasks with arbitrary arrival times, any algorithm that at any instant executes the task with the earliest absolute deadline among all the ready tasks is optimal with respect to minimizing the maximum lateness. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.25 Θεοχαρίδης, ΗΜΥ, 2017

26 Earliest Deadline First (EDF) - Algorithm - q Earliest deadline first (EDF) algorithm: Each time a new ready task arrives: It is inserted into a queue of ready tasks, sorted by their absolute deadlines. Task at head of queue is executed. If a newly arrived task is inserted at the head of the queue, the currently executing task is preempted. q Straightforward approach with sorted lists (full comparison with existing tasks for each arriving task) requires run-time O(n 2 ); (less with binary search or bucket arrays). Sorted queue Executing task ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.26 Θεοχαρίδης, ΗΜΥ, 2017

27 Earliest Deadline First (EDF) - Example - Earlier deadline F preemption Later deadline F no preemption ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.27 Θεοχαρίδης, ΗΜΥ, 2017

28 Optimality of EDF q To be shown: EDF minimizes maximum lateness. q Proof (Buttazzo, 2002): Let s be a schedule produced by generic schedule A Let s EDF : schedule produced by EDF Preemption allowed: tasks executed in disjoint time intervals s divided into time slices of 1 time unit each Time slices denoted by [t, t+1) Let s(t): task executing in [t, t+1) Let E(t): task which, at time t, has the earliest deadline Let t E (t): time (³t) at which the next slice of task E(t) begins its execution in the current schedule ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.28 Θεοχαρίδης, ΗΜΥ, 2017

29 Optimality of EDF (2) q If s ¹ s EDF, then there exists time t: s(t) ¹ E(t) q Idea: swapping s(t) and E(t) cannot increase max. lateness. T 1 t=4; s(t)=4; E(t)=2; t E =6; s(t E )=2 t T 2 t T 3 t T t T 1 s(t)=2; s(t E )=4 t T 2 T 3 T 4 t t t If s(t) starts at t=0 and D=max i {d i } then s EDF can be obtained from s by at most D transpositions. [Buttazzo, 2002] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.29 Θεοχαρίδης, ΗΜΥ, 2017

30 Optimality of EDF (3) q Algorithm interchange: q { for (t=0 to D-1) { Using the same argument as in the proof of Jackson s algorithm, it is easy to show that swapping cannot increase maximum lateness; hence EDF is optimal. q if (s(t) ¹ E(t)) { q s(t E ) = s(t); q s(t) = E(t); }}} Does interchange preserve schedulability? 1. task E(t) moved ahead: meeting deadline in new schedule if meeting deadline in s 2. task s(t) delayed: if s(t) is feasible, then (t E +1) d E, where d E is the earliest deadline. Since d E d i for any i, we have t E +1 d i, which guarantees schedulability of the delayed task. [Buttazzo, 2002] q.e.d. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.30 Θεοχαρίδης, ΗΜΥ, 2017

31 Least laxity (LL), Least Slack Time First (LST) q Priorities = decreasing function of the laxity (the less laxity, the higher the priority); dynamically changing priority; preemptive. l l l l l l l l l l l l ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.31 Θεοχαρίδης, ΗΜΥ, 2017

32 Properties Not sufficient to call scheduler & re-compute laxity just at task arrival times. Overhead for calls of the scheduler. Many context switches. Detects missed deadlines early. LL is also an optimal scheduling for mono-processor systems. Dynamic priorities F cannot be used with a fixed prio OS. LL scheduling requires the knowledge of the execution time. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.32 Θεοχαρίδης, ΗΜΥ, 2017

33 Scheduling without preemption (1) Lemma: If preemption is not allowed, optimal schedules may have to leave the processor idle at certain times. Proof: Suppose: optimal schedulers never leave processor idle. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.33 Θεοχαρίδης, ΗΜΥ, 2017

34 Scheduling without preemption (2) q T1: periodic, c 1 = 2, p 1 = 4, d 1 = 4 q T2: occasionally available at times 4*n+1, c 2 = 1, d 2 = 1 q T1 has to start at t=0 q F deadline missed, but schedule is possible (start T2 first) q F scheduler is not optimal F contradiction! q.e.d. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.34 Θεοχαρίδης, ΗΜΥ, 2017

35 Scheduling without preemption q Preemption not allowed: F optimal schedules may leave processor idle to finish tasks with early deadlines arriving late. F Knowledge about the future is needed for optimal scheduling algorithms FNo online algorithm can decide whether or not to keep idle. q EDF is optimal among all scheduling algorithms not keeping the processor idle at certain times. q If arrival times are known a priori, the scheduling problem becomes NP-hard in general. B&B typically used. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.35 Θεοχαρίδης, ΗΜΥ, 2017

36 Scheduling with precedence constraints q Task graph and possible schedule: ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.36 Θεοχαρίδης, ΗΜΥ, 2017

37 Simultaneous Arrival Times: The Latest Deadline First (LDF) Algorithm q LDF [Lawler, 1973]: reads the task graph and among the tasks with no successors inserts the one with the latest deadline into a queue. It then repeats this process, putting tasks whose successor have all been selected into the queue. q At run-time, the tasks are executed in the generated total order. q LDF is non-preemptive and is optimal for mono-processors. If no local deadlines exist, LDF performs just a topological sort. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.37 Θεοχαρίδης, ΗΜΥ, 2017

38 Asynchronous Arrival Times: Modified EDF Algorithm q This case can be handled with a modified EDF algorithm. The key idea is to transform the problem from a given set of dependent tasks into a set of independent tasks with different timing parameters [Chetto90]. q This algorithm is optimal for mono-processor systems. q If preemption is not allowed, the heuristic algorithm developed by Stankovic and Ramamritham can be used. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.38 Θεοχαρίδης, ΗΜΥ, 2017

39 L. Thiele, 2006 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.39 Θεοχαρίδης, ΗΜΥ, 2017

40 Summary q Definition mapping terms Resource allocation, assignment, binding, scheduling Hard vs. soft deadlines Static vs. dynamic FTT-OS Schedulability q Classical scheduling Aperiodic tasks - No precedences Simultaneous (FEDD) & Asynchronous Arrival Times (FEDF, LL) - Precedences Simultaneous Arrival Times (F LDF) Asynchronous Arrival Times (F medf) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.40 Θεοχαρίδης, ΗΜΥ, 2017

41 The need to support heterogeneous architectures Energy efficiency a key constraint, e.g. for mobile systems Unconventional architectures close to IPE Hugo De Man/Philips, 2007 Renesas, MPSoC 07 F How to map to these architectures? ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.41 Θεοχαρίδης, ΗΜΥ, 2017

42 Practical problem in automotive design Which processor should run the software? ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.42 Θεοχαρίδης, ΗΜΥ, 2017

43 A Simple Classification? Architecture fixed/ Auto-parallelizing Fixed Architecture Architecture to be designed Starting from given task graph Take a job and put it on a fixed processor, i.e. CELL. Design a custom architecture for the job. Auto-parallelizing Devise an algorithm to parallelize the task on fixed resources. Design an algorithm AND a custom architecture to parallelize the job! ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.43 Θεοχαρίδης, ΗΜΥ, 2017

44 Example: System Synthesis L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.44 Θεοχαρίδης, ΗΜΥ, 2017

45 Basic Model Problem Graph L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.45 Θεοχαρίδης, ΗΜΥ, 2017

46 Basic Model: Specification Graph L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.46 Θεοχαρίδης, ΗΜΥ, 2017

47 Design Space Communication Templates Computation Templates Cipher FPGA SDRAM RISC DSP µe LookUp Scheduling/Arbitration TDMA EDF proportional WFQ share FCFS dynamic fixed priority static Which architecture is better suited for our application? Architecture # 1 Architecture # 2 LookUp Cipher RISC DSP EDF TDMA Priority WFQ µe µe µe µe µe µe static L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.47 Θεοχαρίδης, ΗΜΥ, 2017

48 Evolutionary Algorithms for Design Space Exploration (DSE) L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.48 Θεοχαρίδης, ΗΜΥ, 2017

49 Challenges L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.49 Θεοχαρίδης, ΗΜΥ, 2017

50 Application Model q Example of a simple stream processing task structure: L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.50 Θεοχαρίδης, ΗΜΥ, 2017

51 Exploration Case Study (1) L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.51 Θεοχαρίδης, ΗΜΥ, 2017

52 Exploration Case Study (2) L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.52 Θεοχαρίδης, ΗΜΥ, 2017

53 Exploration Case Study (3) L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.53 Θεοχαρίδης, ΗΜΥ, 2017

54 More Results Performance for encryption/decryption Performance for RT voice processing L. Thiele, ETHZ ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.54 Θεοχαρίδης, ΗΜΥ, 2017

55 Design Space Exploration with SystemCoDesigner (Teich, Erlangen) System Synthesis comprises: Idea: - Resource allocation - Actor binding - Channel mapping - Transaction modeling - Formulate synthesis problem as 0-1 ILP - Use Pseudo-Boolean (PB) solver to find feasible solution - Use multi-objective Evolutionary algorithm (MOEA) to optimize Decision Strategy of the PB solver J. Teich, U. Erlangen-Nürnberg ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.55 Θεοχαρίδης, ΗΜΥ, 2017

56 A 3rd approach based on evolutionary algorithms: SYMTA/S: q [R. Ernst et al.: A framework for modular analysis and exploration of heteterogenous embedded systems, Real-time Systems, 2006, p. 124] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.56 Θεοχαρίδης, ΗΜΥ, 2017

57 A fixed architecture approach: Map CELL q Martino Ruggiero, Luca Benini: Mapping task graphs to the CELL BE processor, 1st Workshop on Mapping of Applications to MPSoCs, Rheinfels Castle, 2008 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.57 Θεοχαρίδης, ΗΜΥ, 2017

58 Partitioning into Allocation and Scheduling R Ruggiero, Benini, 2008 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.58 Θεοχαρίδης, ΗΜΥ, 2017

59 JPEG/JPEG2000 case study q Example architecture instances for a single-tile JPEG encoder: 16KB 2KB 32KB 32KB Vin,DCT Q,VLE,Vout Vin,Q,VLE,Vout 4KB DCT 2 MicroBlaze processors (50KB) 1 MicroBlaze, 1HW DCT (36KB) 8KB Vin DCT, Q DCT, Q 4x2KB 32KB VLE, Vout 2KB Vin 8KB DCT 2KB Q 8KB 32KB 2KB VLE, Vout 4x2KB DCT, Q DCT, Q 4x16KB 2KB DCT 2KB 8KB Q 2KB 6 MicroBlaze processors (120KB) 4 MicroBlaze, 2HW DCT (68KB) E. Deprettere, U. Leiden ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.59 Θεοχαρίδης, ΗΜΥ, 2017

60 Introduction of Memory Architecture-Aware Optimization The MACC PMS (Processor/Memory/Switch) Model Explicit memory architecture API provides access to memory information MACC_System C code CPU1 CPU2 CPU3 SPM SPM SPM L1$ L1$ BUS1 MM1 MM2 BRI L2$ MM3 BUS2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.60 Θεοχαρίδης, ΗΜΥ, 2017

61 MaCC Modeling Example via GUI ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.61 Θεοχαρίδης, ΗΜΥ, 2017

62 Toolflow Detailed View (Sequential C Source Code) START MACC Eco-System (1) Dynamic Data Type Optimizations (2) Map source code to task graphs (3) Parallelization Implem. MPSoC Parallelization Assistant (MPA) Memory Hierarchy (MH) (4) Dynamic Memory Management Optimizations MNEMEE Toolflow 1. Optimization of dynamic data structures 2. Extraction of potential parallelism 3. Implementation of parallelism; placement of static data 4. Placement of dynamic data ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.62 Θεοχαρίδης, ΗΜΥ, 2017 Page 62

63 Toolflow Detailed View (5) Scenario Based Mapping (5) Memory Aware Mapping (6) RTLIB Mapping (7) Scratchpad Memory Optimizations per PE MNEMEE Toolflow 5. Perform mapping to processing elements Scenario based Memory aware 6. Transform the code to implement the mapping 7. Perform scratchpad memory optimizations for each processing element Platform DB END (Optimized Source Code) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.63 Θεοχαρίδης, ΗΜΥ, 2017 Page 63

64 MAPS-TCT Framework Leupers, Sheng, 2008 Rainer Leupers, Weihua Sheng: MAPS: An Integrated Framework for MPSoC Application Parallelization, 1st Workshop on Mapping of Applications to MPSoCs, Rheinfels Castle, 2008 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.64 Θεοχαρίδης, ΗΜΥ, 2017

65 Summary Clear trend toward multi-processor systems for embedded systems, there exists a large design space Using architecture crucially depends on mapping tools Mapping applications onto heterogeneous MP systems needs allocation (if hardware is not fixed), binding of tasks to resources, scheduling Two criteria for classification - Fixed / flexible architecture - Auto parallelizing / non-parallelizing Introduction to proposed Mnemee tool chain q Evolutionary algorithms currently the best choice ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.65 Θεοχαρίδης, ΗΜΥ, 2017

66 Integer (linear) programming models q Ingredients: Cost function Constraints Involving linear expressions of integer variables from a set X Cost function C = å a x ÎX i i x i with a i ÎR, x Î N i N (1) Constraints: " j Î J : åbi, j xi ³ c j with bi, j, c j Î R x ÎX i R (2) Def.: The problem of minimizing (1) subject to the constraints (2) is called an integer (linear) programming (ILP) problem. If all x i are constrained to be either 0 or 1, the IP problem said to be a 0/1 integer (linear) programming problem. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.66 Θεοχαρίδης, ΗΜΥ, 2017

67 Example C = 5x + x x x 1 1 +, x x2 4 x 2, x + 3 x 3 3 ³ 2 Î {0,1} C Optimal ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.67 Θεοχαρίδης, ΗΜΥ, 2017

68 Remarks on integer programming Maximizing the cost function: just set C =-C Integer programming is NP-complete. Running times depend exponentially on problem size, but problems of >1000 vars solvable with good solver (depending on the size and structure of the problem) The case of x i Î R is called linear programming (LP). Polynomial complexity, but most algorithms are exponential, in practice still faster than for ILP problems. The case of some x i Î R and some x i Î N is called mixed integer-linear programming. ILP/LP models good starting point for modeling, even if heuristics are used in the end. Solvers: lp_solve (public), CPLEX (commercial), ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.68 Θεοχαρίδης, ΗΜΥ, 2017

69 Simulated Annealing General method for solving combinatorial optimization problems. Based the model of slowly cooling crystal liquids. Some configuration is subject to changes. Special property of Simulated annealing: Changes leading to a poorer configuration (with respect to some cost function) are accepted with a certain probability. This probability is controlled by a temperature parameter: the probability is smaller for smaller temperatures. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.69 Θεοχαρίδης, ΗΜΥ, 2017

70 Simulated Annealing Algorithm procedure SimulatedAnnealing; var i, T: integer; begin i := 0; T := MaxT; configuration:= <some initial configuration>; while not terminate(i, T) do begin while InnerLoop do begin NewConfig := variation(configuration); delta := evaluation(newconfig,configuration); if delta < 0 then configuration := NewConfig; else if SmallEnough(delta, T, random(0,1)) then configuration := Newconfiguration; end; T:= NewT(i,T); i:=i+1; end; end; ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.70 Θεοχαρίδης, ΗΜΥ, 2017

71 Explanation Initially, some random initial configuration is created. Current temperature is set to a large value. Outer loop: - Temperature is reduced for each iteration - Terminated if (temperature lower limit) or (number of iterations ³ upper limit). Inner loop: For each iteration: - New configuration generated from current configuration - Accepted if (new cost cost of current configuration) - Accepted with temperature-dependent probability if (cost of new config. > cost of current configuration). ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.71 Θεοχαρίδης, ΗΜΥ, 2017

72 Behavior for actual functions q 130 steps 200 steps [people.equars.com/~marco/poli/phd/node57.html] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.72 Θεοχαρίδης, ΗΜΥ, 2017

73 Jigsaw puzzles Intuitive usage of Simulated Annealing Given a jigsaw puzzle such that one has to obtain the final shape using all pieces together. Starting with a random configuration, the human brain unconditionally chooses certain moves that tend to the solution. However, certain moves that may or may not lead to the solution are accepted or rejected with a certain small probability. The final shape is obtained as a result of a large number of iterations. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.73 Θεοχαρίδης, ΗΜΥ, 2017

74 Performance This class of algorithms has been shown to outperform others in certain cases [Wegener, 2005]. Demonstrated its excellent results in the TimberWolf layout generation package [Sechen] Many other applications ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.74 Θεοχαρίδης, ΗΜΥ, 2017

75 Evolutionary Algorithms (1) Evolutionary Algorithms are based on the collective learning process within a population of individuals, each of which represents a search point in the space of potential solutions to a given problem. The population is arbitrarily initialized, and it evolves towards better and better regions of the search space by means of randomized processes of - selection (which is deterministic in some algorithms), - mutation, and - recombination (which is completely omitted in some algorithmic realizations). [Bäck, Schwefel, 1993] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.75 Θεοχαρίδης, ΗΜΥ, 2017

76 Evolutionary Algorithms (2) The environment (given aim of the search) delivers a quality information (fitness value) of the search points, and the selection process favours those individuals of higher fitness to reproduce more often than worse individuals. The recombination mechanism allows the mixing of parental information while passing it to their descendants, and mutation introduces innovation into the population [Bäck, Schwefel, 1993] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.76 Θεοχαρίδης, ΗΜΥ, 2017

77 Evolutionary Algorithms Principles of Evolution Selection Cross-over Mutation Thiele ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.77 Θεοχαρίδης, ΗΜΥ, 2017

78 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.78 Θεοχαρίδης, ΗΜΥ, 2017

79 An Evolutionary Algorithm in Action max. y2 hypothetical trade-off front min. y1 Thiele ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.79 Θεοχαρίδης, ΗΜΥ, 2017

80 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.80 Θεοχαρίδης, ΗΜΥ, 2017

81 A Generic Multiobjective EA population archive evaluate sample vary update truncate new population new archive Thiele ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.81 Θεοχαρίδης, ΗΜΥ, 2017

82 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.82 Θεοχαρίδης, ΗΜΥ, 2017

83 Summary q Integer (linear) programming Integer programming is NP-complete Linear programming is faster Good starting point even if solutions are generated with different techniques q Simulated annealing Modeled after cooling of liquids Overcomes local minima q Evolutionary algorithms Maintain set of solutions Include selection, mutation and recombination ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.83 Θεοχαρίδης, ΗΜΥ, 2017

84 Classes of mapping algorithms considered in this course Classical scheduling algorithms Mostly for independent tasks & ignoring communication, mostly for mono- and homogeneous multiprocessors Dependent tasks as considered in architectural synthesis Initially designed in different context, but applicable Hardware/software partitioning Dependent tasks, heterogeneous systems, focus on resource assignment Design space exploration using genetic algorithms Heterogeneous systems, incl. communication modeling ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.84 Θεοχαρίδης, ΗΜΥ, 2017

85 Classification of Scheduling Problems Scheduling Independent Tasks Dependent Tasks EDD, EDF, LLF, RMS 1 Proc. Resource constrained Time constrained Unconstrained LDF LS FDS ASAP, ALAP ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.85 Θεοχαρίδης, ΗΜΥ, 2017

86 Dependent tasks The problem of deciding whether or not a schedule exists for a set of dependent tasks and a given deadline is NP-complete in general [Garey/Johnson]. q Strategies: 1. Add resources, so that scheduling becomes easier 2. Split problem into static and dynamic part so that only a minimum of decisions need to be taken at run-time. 3. Use scheduling algorithms from high-level synthesis ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.86 Θεοχαρίδης, ΗΜΥ, 2017

87 Taskgraph a b c d e f g h i j k l m q Assumption: execution time = 1 q for all tasks n z ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.87 Θεοχαρίδης, ΗΜΥ, 2017

88 As soon as possible (ASAP) scheduling q ASAP: All tasks are scheduled as early as possible q Loop over (integer) time steps: Compute the set of unscheduled tasks for which all predecessors have finished their computation Schedule these tasks to start at the current time step. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.88 Θεοχαρίδης, ΗΜΥ, 2017

89 As soon as possible (ASAP) scheduling: Example s=0 a s=1 s=2 s=3 b c d e f g h i j k l m s=4 s=5 n z ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.89 Θεοχαρίδης, ΗΜΥ, 2017

90 As-late-as-possible (ALAP) scheduling q ALAP: All tasks are scheduled as late as possible Start at last time step*: Schedule tasks with no successors and tasks for which all successors have already been scheduled. * Generate a list, starting at its end ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.90 Θεοχαρίδης, ΗΜΥ, 2017

91 As-late-as-possible (ALAP) scheduling: Example s=0 a s=1 b c d e f g s=2 s=3 h i j k l m Start s=4 s=5 n z ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.91 Θεοχαρίδης, ΗΜΥ, 2017

92 (Resource constrained) List Scheduling q List scheduling: extension of ALAP/ASAP method q Preparation: Topological sort of task graph G=(V,E) Computation of priority of each task: Possible priorities u: - Number of successors - Longest path - Mobility = s (ALAP schedule)- s (ASAP schedule) Source: Teich: Dig. HW/SW Systeme ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.92 Θεοχαρίδης, ΗΜΥ, 2017

93 Mobility as a priority function s=0 a s=0 a s=1 b c d e f g s=1 b c d e f g s=2 h i j s=2 h i j s=3 k l m s=3 k l m s=4 s=5 n z s=4 s=5 n z Mobility is not very precise ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.93 Θεοχαρίδης, ΗΜΥ, 2017

94 Algorithm List(G(V,E), B, u){ i :=0; repeat { Compute set of candidate tasks A i ; Compute set of not terminated tasks G i ; Select S i Í A i of maximum priority r such that S i + G i B (*resource constraint*) may be repeated for different task/ processor classes foreach (v j Î S i ): s (v j ):=i; (*set start time*) i := i +1; } until (all nodes are scheduled); return (s); } Complexity: O( V ) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.94 Θεοχαρίδης, ΗΜΥ, 2017

95 Example q Assuming B =2, unit execution time and u : path length q u(a)= u(b)=4 u(c)= u(f)=3 u(d)= u(g)= u(h)= u(j)=2 u(e)= u(i)= u(k)=1 " i : G i =0 s=0 s=1 s=2 s=3 a c d b f g h j a b f h j s=4 e i c g i k s=5 k d e Modified example based on J. Teich ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.95 Θεοχαρίδης, ΗΜΥ, 2017

96 (Time constrained) Force-directed scheduling q Goal: balanced utilization of resources q Based on spring model; q Originally proposed for high-level synthesis (HLT) ACM * [Pierre G. Paulin, J.P. Knight, Force-directed scheduling in automatic data path synthesis, Design Automation Conference (DAC), 1987, S ] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.96 Θεοχαρίδης, ΗΜΥ, 2017

97 Phase 1: Generation of ASAP and ALAP Schedule s=0 a s=0 a s=1 b c d e f g s=1 b c d e f g s=2 h i j s=2 h i j s=3 k l m s=3 k l m s=4 s=5 n z s=4 s=5 n z ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.97 Θεοχαρίδης, ΗΜΥ, 2017

98 Next: computation of forces Direct forces push each task into the direction of lower values of D(i). Impact of direct forces on dependent tasks taken into account by indirect forces Balanced resource usage» smallest forces For our simple example and time constraint=6: result = ALAP schedule s=0 a 0 s=1 b c d e f g s=2 h i j s=3 k l m s=4 n s=5 z i F More precisely ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.98 Θεοχαρίδης, ΗΜΥ, 2017

99 1. Compute time frames R(j) 2. Compute probability P(j,i) of assignment j i R(j)={ASAP-control step ALAP-control step} if 0 otherwise ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.99 Θεοχαρίδης, ΗΜΥ, 2017

100 3. Compute distribution D(i) (# Operations in control step i) P(j,i) D(i) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.100 Θεοχαρίδης, ΗΜΥ, 2017

101 4. Compute direct forces (1) DP i ( j,i ): D for force on task j in time step i, if j is mapped to time step i. The new probability for executing j in i is 1; the previous was P ( j, i). i The new probability for executing j in i ¹ i is 0; the previous was P (j, i). F if otherwise ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.101 Θεοχαρίδης, ΗΜΥ, 2017

102 4. Compute direct forces (2) SF(j, i) is the overall change of direct forces resulting from the mapping of j to time step i. if otherwise Example ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.102 Θεοχαρίδης, ΗΜΥ, 2017

103 4. Compute direct forces (3) q Direct force if task/operation 1 is mapped to time step 2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.103 Θεοχαρίδης, ΗΜΥ, 2017

104 5. Compute indirect forces (1) Mapping task 1 to time step 2 D implies mapping task 2 to time step 3 F Consider predecessor and successor forces: j Î predecessor of j j Î successor of j DP j, i (j,i ) is the D in the probability of mapping j to i resulting from the mapping of j to i ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.104 Θεοχαρίδης, ΗΜΥ, 2017

105 5. Compute indirect forces (2) j Î predecessor of j j Î successor of j Example: Computation of successor forces for task 1 in time step 2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.105 Θεοχαρίδης, ΗΜΥ, 2017

106 Overall forces q The total force is the sum of direct and indirect forces: In the example: The low value suggests mapping task 1 to time step 2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.106 Θεοχαρίδης, ΗΜΥ, 2017

107 Overall approach q procedure forcedirectedscheduling; begin end AsapScheduling; AlapScheduling; while not all tasks scheduled do begin select task T with smallest total force; schedule task T at time step minimizing forces; recompute forces; end; May be repeated for different task/ processor classes Not sufficient for today's complex, heterogeneous hardware platforms ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.107 Θεοχαρίδης, ΗΜΥ, 2017

108 Evaluation of HLS-Scheduling Focus on considering dependencies Mostly heuristics, few proofs on optimality Not using global knowledge about periods etc. Considering discrete time intervals Variable execution time available only as an extension Includes modeling of heterogeneous systems ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.108 Θεοχαρίδης, ΗΜΥ, 2017

109 Classes of mapping algorithms considered in this course Classical scheduling algorithms Mostly for independent tasks & ignoring communication, mostly for mono- and homogeneous multiprocessors Hardware/software partitioning Dependent tasks, heterogeneous systems, focus on resource assignment Dependent tasks as considered in architectural synthesis Initially designed in different context, but applicable Design space exploration using genetic algorithms Heterogeneous systems, incl. communication modeling ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.109 Θεοχαρίδης, ΗΜΥ, 2017

110 Periodic scheduling T1 T2 q For periodic scheduling, the best that we can do is to design an algorithm which will always find a schedule if one exists. F A scheduler is defined to be optimal iff it will find a schedule if one exists. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.110 Θεοχαρίδης, ΗΜΥ, 2017

111 Periodic scheduling - Scheduling with no precedence constraints - q Let {T i } be a set of tasks. Let: p i be the period of task T i, c i be the execution time of T i, d i be the deadline interval, that is, the time between T i becoming available and the time until which T i has to finish execution. l i be the laxity or slack, defined as l i = d i - c i f i be the finishing time. p i i d i c i l i t ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.111 Θεοχαρίδης, ΗΜΥ, 2017

112 Average utilization q Average utilization: µ = n å i= 1 c i p i Necessary condition for schedulability (with m=number of processors): µ m ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.112 Θεοχαρίδης, ΗΜΥ, 2017

113 Independent tasks: Rate monotonic (RM) scheduling q Most well-known technique for scheduling independent periodic tasks [Liu, 1973]. q Assumptions: All tasks that have hard deadlines are periodic. All tasks are independent. d i =p i, for all tasks. c i is constant and is known for all tasks. The time required for context switching is negligible. For a single processor and for n tasks, the following equation holds for the average utilization µ: n µ = å i= 1 ci p i n(2 1/ n -1) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.113 Θεοχαρίδης, ΗΜΥ, 2017

114 Rate monotonic (RM) scheduling - The policy - RM policy: The priority of a task is a monotonically decreasing function of its period. At any time, a highest priority task among all those that are ready for execution is allocated. Theorem: If all RM assumptions are met, schedulability is guaranteed. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.114 Θεοχαρίδης, ΗΜΥ, 2017

115 Maximum utilization for guaranteed schedulability Maximum utilization as a function of the number of tasks: µ = n å i= 1 lim( n(2 n ci p i 1/ n n(2 1/ n -1) -1) = ln(2) ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.115 Θεοχαρίδης, ΗΜΥ, 2017

116 Example of RM-generated schedule t T1 preempts T2 and T3. T2 and T3 do not preempt each other. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.116 Θεοχαρίδης, ΗΜΥ, 2017

117 Case of failing RM scheduling Task 1: period 5, execution time 2 Task 2: period 7, execution time 4 µ=2/5+4/7=34/35» (2 1/2-1)» t Missed deadline Missing computations scheduled in the next period levirts animation ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.117 Θεοχαρίδης, ΗΜΥ, 2017

118 Intuitively: Why does RM fail? Switching to T 1 too early, despite early deadline for T 2 T 1 tt T 2 No problem if p 2 = m p 1, mîn : should be completed T 1 fits t T 2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.118 Θεοχαρίδης, ΗΜΥ, 2017

119 Critical instants q Definition: A critical instant of a task is the time at which the release of a task will produce the largest response time. Lemma: For any task, the critical instant occurs if that task is simultaneously released with all higher priority tasks. Proof: Let T={T 1,,T n }: periodic tasks with "i: p i p i +1. Source: G. Buttazzo, Hard Real-time Computing Systems, Kluwer, 2002 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.119 Θεοχαρίδης, ΗΜΥ, 2017

120 Critical instances (1) q Response time of T n is delayed by tasks T i of higher priority: T n T i c n +2c i t Delay may increase if T i starts earlier T n T i c n +3c i t Maximum delay achieved if T n and T i start simultaneously. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.120 Θεοχαρίδης, ΗΜΥ, 2017

121 Critical instants (2) q F Repeating the argument for all i = 1, n-1: The worst case response time of a task occurs when it is released simultaneously with all higher-priority tasks. q.e.d. F F F Schedulability is checked at the critical instants. If all tasks of a task set are schedulable at their critical instants, they are schedulable at all release times. Observation helps designing examples ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.121 Θεοχαρίδης, ΗΜΥ, 2017

122 The case "i: p i+1 = m i p i q Lemma*: If each task period is a multiple of the period of the next higher priority task, then schedulability is also guaranteed if µ 1. Proof: Assume schedule of T i is given. Incorporate T i+1 : T i+1 fills idle times of T i ; T i+1 completes in time, if µ 1. T i T i+1 t F T i+1 Used as the higher priority task at the next iteration. * wrong in the book of 2007 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.122 Θεοχαρίδης, ΗΜΥ, 2017

123 Proof of the RM theorem q Let T={T 1, T 2 } with p 1 < p 2. q Assume RM is not used à prio(t 2 ) is highest: More in-depth: p 1 T 1 c 1 T 2 c 2 t Schedule is feasible if c 1 +c 2 p 1 (1) Define F= ëp 2 /p 1 û: # of periods of T 1 fully contained in T 2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.123 Θεοχαρίδης, ΗΜΥ, 2017

124 Case 1: c 1 p 2 Fp 1 q Assume RM is used à prio(t 1 ) is highest: Case 1*: c 1 p 2 F p 1 (c 1 small enough to be finished before 2nd instance of T 2 ) T 1 T 2 t Fp 1 p 2 Schedulable if (F +1) c 1 + c 2 p 2 (2) * Typos in [Buttazzo 2002]: < and mixed up] ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.124 Θεοχαρίδης, ΗΜΥ, 2017

125 Proof of the RM theorem (3) q Not RM: schedule is feasible if c 1 +c 2 p 1 (1) q RM: schedulable if (F+1) c 1 + c 2 p 2 (2) q From (1): Fc 1 +Fc 2 Fp 1 q Since F ³ 1: Fc 1 +c 2 Fc 1 +Fc 2 Fp 1 q Adding c 1 : (F+1)c 1 +c 2 Fp 1 +c 1 q Since c 1 p 2 Fp 1 : (F+1)c 1 +c 2 Fp 1 +c 1 p 2 q Hence: if (1) holds, (2) holds as well q FFor case 1: Given tasks T 1 and T 2 with p 1 < p 2, then if the schedule is feasible by an arbitrary (but fixed) priority assignment, it is also feasible by RM. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.125 Θεοχαρίδης, ΗΜΥ, 2017

126 Case 2: c 1 > p 2 Fp 1 q Case 2: c 1 > p 2 Fp 1 (c 1 large enough not to finish before 2 nd instance of T 2 ) T 1 T 2 t Fp 1 p 2 Schedulable if F c 1 + c 2 F p 1 (3) c 1 +c 2 p 1 (1) Multiplying (1) by F yields F c 1 + F c 2 F p 1 Since F ³ 1: F c 1 + c 2 F c 1 + Fc 2 F p 1 F Same statement as for case 1. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.126 Θεοχαρίδης, ΗΜΥ, 2017

127 Calculation of the least upper utilization bound q Let T={T 1, T 2 } with p 1 < p 2. q Proof procedure: compute least upper bound U lup as follows Assign priorities according to RM Compute upper bound U up by setting computation times to fully utilize processor Minimize upper bound with respect to other task parameters q As before: F= ëp 2 /p 1 û q c 2 adjusted to fully utilize processor. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.127 Θεοχαρίδης, ΗΜΥ, 2017

128 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.128 Θεοχαρίδης, ΗΜΥ, 2017 Case 1: c 1 p 2 Fp 1 q Largest possible value of c 2 is c 2 = p 2 c 1 (F+1) q Corresponding upper bound is T 1 T 2 t p 2 Fp 1 þ ý ü + - î í ì + = = + + = + = 1) ( F p p p c p F c p c p F c p p c p c p c U ub ) ( ) ( { } is <0 à U ub monotonically decreasing in c 1 Minimum occurs for c 1 = p 2 Fp 1

129 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.129 Θεοχαρίδης, ΗΜΥ, 2017 Case 2: c 1 ³ p 2 Fp 1 q Largest possible value of c 2 is c 2 = (p 1 -c 1 )F q Corresponding upper bound is: T 1 T 2 t p 2 Fp 1 þ ý ü - î í ì + = - + = + = + = F p p p c F p p F p c p c F p p p F c p p c p c p c U ub ) ( { } is ³ 0 à U ub monotonically increasing in c 1 (independent of c 1 if {}=0) Minimum occurs for c 1 = p 2 Fp 1, as before.

130 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.130 Θεοχαρίδης, ΗΜΥ, 2017 Utilization as a function of G=p 2 /p 1 -F q For minimum value of c 1 : ( ) ïî ï í ì þ ý ü ø ö ç ç è æ - ø ö ç ç è æ - + = ø ö ç ç è æ = ø ö ç ç è æ - + = F p p F p p F p p F p p p F p p F p p F p p p c F p p U ub Þ - = Let ; 1 2 F p p G ( ) ( ) ( ) ( ) ( ) ( ) ( ) G F G G G F G G G F G F G F F F p p G F p p G F G F p p U ub = = + + = = + = + = 1 1 ) ( / / Since 0 G< 1: G(1-G) ³ 0 à U ub increasing in F à Minimum of U ub for min(f): F=1 à G G U ub + =

131 Proving the RM theorem for n=2 end 2 1+ G Uub = 1+ G Using derivative to find minimum of U du dg ub = 2G(1 + G) - (1 + G 2 (1 + G) 2 ) = ub 2 G + 2G -1 2 (1 + G) : = 0 G 1 = -1-2; Considering only G G 2 2 = -1+, since 0 2; G < 1: U lub = 1+ ( 1+ ( 2-1) 2 2-1) = = 2( 2-1) = q This proves the RM theorem for the special case of n=2 ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.131 Θεοχαρίδης, ΗΜΥ, 2017

132 Properties of RM scheduling RM scheduling is based on static priorities. This allows RM scheduling to be used in standard OS, such as Windows NT. No idle capacity is needed if "i: p i+1 =F p i : i.e. if the period of each task is a multiple of the period of the next higher priority task, schedulability is then also guaranteed if µ 1. A huge number of variations of RM scheduling exists. In the context of RM scheduling, many formal proofs exist. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.132 Θεοχαρίδης, ΗΜΥ, 2017

133 EDF q EDF can also be applied to periodic scheduling. q EDF optimal for every period F F Optimal for periodic scheduling EDF must be able to schedule the example in which RMS failed. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.133 Θεοχαρίδης, ΗΜΥ, 2017

134 Comparison EDF/RMS q RMS : EDF: T2 not preempted, due to its earlier deadline. EDF-animation ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.134 Θεοχαρίδης, ΗΜΥ, 2017

135 EDF: Properties q EDF requires dynamic priorities q F EDF cannot be used with a standard operating system just providing static priorities. q However, a recent paper (by Margull and Slomka) at DATE 2008 demonstrates how an OS with static priorities can be extended with a plug-in providing EDF scheduling (key idea: delay tasks becoming ready if they shouldn t be executed under EDF scheduling. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.135 Θεοχαρίδης, ΗΜΥ, 2017

136 Comparison RMS/EDF RMS EDF Priorities Static Dynamic Works with std. OS with fixed priorities Uses full computational power of processor Possible to exploit full computational power of processor without provisioning for slack Yes No, just up till µ=n(2 1/n -1) No No* Yes Yes * Unless the plug-in by Slomka et al. is added. ΗΜΥ653 Δ7-8 Mapping Applications, Optimization and Scheduling.136 Θεοχαρίδης, ΗΜΥ, 2017

Mapping of Applications to Multi-Processor Systems

Mapping of Applications to Multi-Processor Systems Mapping of Applications to Multi-Processor Systems Peter Marwedel TU Dortmund, Informatik 12 Germany Marwedel, 2003 Graphics: Alexandra Nolte, Gesine 2011 年 12 月 09 日 These slides use Microsoft clip arts.

More information

Simplified design flow for embedded systems

Simplified design flow for embedded systems Simplified design flow for embedded systems 2005/12/02-1- Reuse of standard software components Knowledge from previous designs to be made available in the form of intellectual property (IP, for SW & HW).

More information

Standard Optimization Techniques

Standard Optimization Techniques 12 Standard Optimization Techniques Peter Marwedel Informatik 12 TU Dortmund Germany 2009/12/10 Graphics: Alexandra Nolte, Gesine Marwedel, 2003 These slides use Microsoft cliparts. All Microsoft restrictions

More information

Standard Optimization Techniques

Standard Optimization Techniques 12 Standard Optimization Techniques Peter Marwedel TU Dortmund, Informatik 12 Germany Springer, 2010 2012 年 12 月 19 日 These slides use Microsoft clip arts. Microsoft copyright restrictions apply. Structure

More information

Mapping of Applications to Multi-Processor Systems

Mapping of Applications to Multi-Processor Systems Springer, 2010 Mapping of Applications to Multi-Processor Systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2014 年 01 月 17 日 These slides use Microsoft clip arts. Microsoft copyright restrictions

More information

CSE 237A Timing and scheduling. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

CSE 237A Timing and scheduling. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego. CSE 237A Timing and scheduling Department of Computer Science and Engineering University of California, San Diego. 1 Where we are now n What we covered thus far: Introduction to design process and models

More information

Introduction to Embedded Systems

Introduction to Embedded Systems Introduction to Embedded Systems Sanjit A. Seshia UC Berkeley EECS 9/9A Fall 0 008-0: E. A. Lee, A. L. Sangiovanni-Vincentelli, S. A. Seshia. All rights reserved. Chapter : Operating Systems, Microkernels,

More information

Introduction to Real-Time Systems ECE 397-1

Introduction to Real-Time Systems ECE 397-1 Introduction to Real-Time Systems ECE 97-1 Northwestern University Department of Computer Science Department of Electrical and Computer Engineering Teachers: Robert Dick Peter Dinda Office: L477 Tech 8,

More information

Event-Driven Scheduling. (closely following Jane Liu s Book)

Event-Driven Scheduling. (closely following Jane Liu s Book) Event-Driven Scheduling (closely following Jane Liu s Book) Real-Time Systems, 2006 Event-Driven Systems, 1 Principles Assign priorities to Jobs At events, jobs are scheduled according to their priorities

More information

Homework index. Processing resource description. Goals for lecture. Communication resource description. Graph extensions. Problem definition

Homework index. Processing resource description. Goals for lecture. Communication resource description. Graph extensions. Problem definition Introduction to Real-Time Systems ECE 97-1 Homework index 1 Reading assignment.............. 4 Northwestern University Department of Computer Science Department of Electrical and Computer Engineering Teachers:

More information

4/6/2011. Informally, scheduling is. Informally, scheduling is. More precisely, Periodic and Aperiodic. Periodic Task. Periodic Task (Contd.

4/6/2011. Informally, scheduling is. Informally, scheduling is. More precisely, Periodic and Aperiodic. Periodic Task. Periodic Task (Contd. So far in CS4271 Functionality analysis Modeling, Model Checking Timing Analysis Software level WCET analysis System level Scheduling methods Today! erformance Validation Systems CS 4271 Lecture 10 Abhik

More information

Real-Time Architectures 2004/2005

Real-Time Architectures 2004/2005 Real-Time Architectures 2004/2005 Scheduling Analysis I Introduction & Basic scheduling analysis Reinder J. Bril 08-04-2005 1 Overview Algorithm and problem classes Simple, periodic taskset problem statement

More information

Aperiodic Task Scheduling

Aperiodic Task Scheduling Aperiodic Task Scheduling Radek Pelánek Preemptive Scheduling: The Problem 1 processor arbitrary arrival times of tasks preemption performance measure: maximum lateness no resources, no precedence constraints

More information

Hardware/Software Codesign

Hardware/Software Codesign Hardware/Software Codesign 3. Partitioning Marco Platzner Lothar Thiele by the authors 1 Overview A Model for System Synthesis The Partitioning Problem General Partitioning Methods HW/SW-Partitioning Methods

More information

Microkernel/OS and Real-Time Scheduling

Microkernel/OS and Real-Time Scheduling Chapter 12 Microkernel/OS and Real-Time Scheduling Hongwei Zhang http://www.cs.wayne.edu/~hzhang/ Ack.: this lecture is prepared in part based on slides of Lee, Sangiovanni-Vincentelli, Seshia. Outline

More information

Precedence Graphs Revisited (Again)

Precedence Graphs Revisited (Again) Precedence Graphs Revisited (Again) [i,i+6) [i+6,i+12) T 2 [i,i+6) [i+6,i+12) T 3 [i,i+2) [i+2,i+4) [i+4,i+6) [i+6,i+8) T 4 [i,i+1) [i+1,i+2) [i+2,i+3) [i+3,i+4) [i+4,i+5) [i+5,i+6) [i+6,i+7) T 5 [i,i+1)

More information

Response Time Analysis of Asynchronous Real-Time Systems

Response Time Analysis of Asynchronous Real-Time Systems Response Time Analysis of Asynchronous Real-Time Systems Guillem Bernat Real-Time Systems Research Group Department of Computer Science University of York York, YO10 5DD, UK Technical Report: YCS-2002-340

More information

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5 OPERATING SYSTEMS CS3502 Spring 2018 Processor Scheduling Chapter 5 Goals of Processor Scheduling Scheduling is the sharing of the CPU among the processes in the ready queue The critical activities are:

More information

Software Synthesis, Code Generation and Timing Analysis

Software Synthesis, Code Generation and Timing Analysis Year 1 Review Brussels, January 23rd, 2008 Cluster Achievements and Perspectives : Software Synthesis, Code Generation and Timing Analysis Cluster leader : Peter Marwedel TU Dortmund High-Level Objectives

More information

2. Introduction to Software for Embedded Systems

2. Introduction to Software for Embedded Systems 2. Introduction to Software for Embedded Systems Lothar Thiele ETH Zurich, Switzerland 2-1 Contents of Lectures (Lothar Thiele) 1. Introduction to Embedded System Design 2. Software for Embedded Systems

More information

LECTURE 3:CPU SCHEDULING

LECTURE 3:CPU SCHEDULING LECTURE 3:CPU SCHEDULING 1 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time CPU Scheduling Operating Systems Examples Algorithm Evaluation 2 Objectives

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

Introduction to Real-time Systems. Advanced Operating Systems (M) Lecture 2

Introduction to Real-time Systems. Advanced Operating Systems (M) Lecture 2 Introduction to Real-time Systems Advanced Operating Systems (M) Lecture 2 Introduction to Real-time Systems Real-time systems deliver services while meeting some timing constraints Not necessarily fast,

More information

CS4514 Real Time Scheduling

CS4514 Real Time Scheduling CS4514 Real Time Scheduling Jose M. Garrido Fall 2015 Department of Computer Science 1 Periodic Tasks Typical real-time application has many tasks that need to be executed periodically Reading sensor data

More information

Exam Review TexPoint fonts used in EMF.

Exam Review TexPoint fonts used in EMF. Exam Review Generics Definitions: hard & soft real-time Task/message classification based on criticality and invocation behavior Why special performance measures for RTES? What s deadline and where is

More information

Global Scheduling in Multiprocessor Real-Time Systems

Global Scheduling in Multiprocessor Real-Time Systems Global Scheduling in Multiprocessor Real-Time Systems Alessandra Melani 1 Global vs Partitioned scheduling Single shared queue instead of multiple dedicated queues Global scheduling Partitioned scheduling

More information

SCHEDULING II Giovanni De Micheli Stanford University

SCHEDULING II Giovanni De Micheli Stanford University SCHEDULING II Giovanni De Micheli Stanford University Scheduling under resource constraints Simplified models: Hu's algorithm. Heuristic algorithms: List scheduling. Force-directed scheduling. Hu's algorithm

More information

Hardware-Software Codesign

Hardware-Software Codesign Hardware-Software Codesign 4. System Partitioning Lothar Thiele 4-1 System Design specification system synthesis estimation SW-compilation intellectual prop. code instruction set HW-synthesis intellectual

More information

Reference Model and Scheduling Policies for Real-Time Systems

Reference Model and Scheduling Policies for Real-Time Systems ESG Seminar p.1/42 Reference Model and Scheduling Policies for Real-Time Systems Mayank Agarwal and Ankit Mathur Dept. of Computer Science and Engineering, Indian Institute of Technology Delhi ESG Seminar

More information

CLOCK DRIVEN SCHEDULING

CLOCK DRIVEN SCHEDULING CHAPTER 4 By Radu Muresan University of Guelph Page 1 ENGG4420 CHAPTER 4 LECTURE 2 and 3 November 04 09 7:51 PM CLOCK DRIVEN SCHEDULING Clock driven schedulers make their scheduling decisions regarding

More information

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date: Subject Name: OPERATING SYSTEMS Subject Code: 10EC65 Prepared By: Kala H S and Remya R Department: ECE Date: Unit 7 SCHEDULING TOPICS TO BE COVERED Preliminaries Non-preemptive scheduling policies Preemptive

More information

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013) CPU Scheduling Daniel Mosse (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013) Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process

More information

Multiprocessor and Real-Time Scheduling. Chapter 10

Multiprocessor and Real-Time Scheduling. Chapter 10 Multiprocessor and Real-Time Scheduling Chapter 10 1 Roadmap Multiprocessor Scheduling Real-Time Scheduling Linux Scheduling Unix SVR4 Scheduling Windows Scheduling Classifications of Multiprocessor Systems

More information

Effects of Hard Real-Time Constraints in Implementing the Myopic Scheduling Algorithm

Effects of Hard Real-Time Constraints in Implementing the Myopic Scheduling Algorithm Effects of Hard Real-Time Constraints in Implementing the Myopic Scheduling Algorithm Abstract- Institute of Information Technology, University of Dhaka, Dhaka 1 muheymin@yahoo.com, K M. Sakib, M S. Hasan

More information

OVERHEADS ENHANCEMENT IN MUTIPLE PROCESSING SYSTEMS BY ANURAG REDDY GANKAT KARTHIK REDDY AKKATI

OVERHEADS ENHANCEMENT IN MUTIPLE PROCESSING SYSTEMS BY ANURAG REDDY GANKAT KARTHIK REDDY AKKATI CMPE 655- MULTIPLE PROCESSOR SYSTEMS OVERHEADS ENHANCEMENT IN MUTIPLE PROCESSING SYSTEMS BY ANURAG REDDY GANKAT KARTHIK REDDY AKKATI What is MULTI PROCESSING?? Multiprocessing is the coordinated processing

More information

Time Triggered and Event Triggered; Off-line Scheduling

Time Triggered and Event Triggered; Off-line Scheduling Time Triggered and Event Triggered; Off-line Scheduling Real-Time Architectures -TUe Gerhard Fohler 2004 Mälardalen University, Sweden gerhard.fohler@mdh.se Real-time: TT and ET Gerhard Fohler 2004 1 Activation

More information

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system Real world exposed programs Programs written to interact with the real world, outside the computer Programs handle input and output of data in pace matching the real world processes Necessitates ability

More information

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner Real-Time Component Software slide credits: H. Kopetz, P. Puschner Overview OS services Task Structure Task Interaction Input/Output Error Detection 2 Operating System and Middleware Application Software

More information

Local-Deadline Assignment for Distributed Real-Time Systems

Local-Deadline Assignment for Distributed Real-Time Systems Local-Deadline Assignment for Distributed Real-Time Systems Shengyan Hong, Thidapat Chantem, Member, IEEE, and Xiaobo Sharon Hu, Senior Member, IEEE Abstract In a distributed real-time system (DRTS), jobs

More information

Multimedia Systems 2011/2012

Multimedia Systems 2011/2012 Multimedia Systems 2011/2012 System Architecture Prof. Dr. Paul Müller University of Kaiserslautern Department of Computer Science Integrated Communication Systems ICSY http://www.icsy.de Sitemap 2 Hardware

More information

Authors Abugchem, F. (Fathi); Short, M. (Michael); Xu, D. (Donglai)

Authors Abugchem, F. (Fathi); Short, M. (Michael); Xu, D. (Donglai) TeesRep - Teesside's Research Repository A Note on the Suboptimality of Nonpreemptive Real-time Scheduling Item type Article Authors Abugchem, F. (Fathi); Short, M. (Michael); Xu, D. (Donglai) Citation

More information

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9 Implementing Scheduling Algorithms Real-Time and Embedded Systems (M) Lecture 9 Lecture Outline Implementing real time systems Key concepts and constraints System architectures: Cyclic executive Microkernel

More information

High-Level Synthesis

High-Level Synthesis High-Level Synthesis 1 High-Level Synthesis 1. Basic definition 2. A typical HLS process 3. Scheduling techniques 4. Allocation and binding techniques 5. Advanced issues High-Level Synthesis 2 Introduction

More information

Bi-Objective Optimization for Scheduling in Heterogeneous Computing Systems

Bi-Objective Optimization for Scheduling in Heterogeneous Computing Systems Bi-Objective Optimization for Scheduling in Heterogeneous Computing Systems Tony Maciejewski, Kyle Tarplee, Ryan Friese, and Howard Jay Siegel Department of Electrical and Computer Engineering Colorado

More information

requests or displaying activities, hence they usually have soft deadlines, or no deadlines at all. Aperiodic tasks with hard deadlines are called spor

requests or displaying activities, hence they usually have soft deadlines, or no deadlines at all. Aperiodic tasks with hard deadlines are called spor Scheduling Aperiodic Tasks in Dynamic Priority Systems Marco Spuri and Giorgio Buttazzo Scuola Superiore S.Anna, via Carducci 4, 561 Pisa, Italy Email: spuri@fastnet.it, giorgio@sssup.it Abstract In this

More information

Copyright Notice. COMP9242 Advanced Operating Systems S2/2014 Week 9: Real-Time Systems. Real-Time System: Definition

Copyright Notice. COMP9242 Advanced Operating Systems S2/2014 Week 9: Real-Time Systems. Real-Time System: Definition Copyright Notice These slides are distributed under the Creative Commons Attribution.0 License COMP94 Advanced Operating Systems S/014 Week 9: Real- Systems @GernotHeiser You are free: to share to copy,

More information

Applied Algorithm Design Lecture 3

Applied Algorithm Design Lecture 3 Applied Algorithm Design Lecture 3 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 3 1 / 75 PART I : GREEDY ALGORITHMS Pietro Michiardi (Eurecom) Applied Algorithm

More information

Scheduling Multi-Periodic Mixed-Criticality DAGs on Multi-Core Architectures

Scheduling Multi-Periodic Mixed-Criticality DAGs on Multi-Core Architectures Scheduling Multi-Periodic Mixed-Criticality DAGs on Multi-Core Architectures Roberto MEDINA Etienne BORDE Laurent PAUTET December 13, 2018 1/28 Outline Research Context Problem Statement Scheduling MC-DAGs

More information

Real-time operating systems and scheduling

Real-time operating systems and scheduling Real-time operating systems and scheduling Problem 21 Consider a real-time operating system (OS) that has a built-in preemptive scheduler. Each task has a unique priority and the lower the priority id,

More information

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou (  Zhejiang University Operating Systems (Fall/Winter 2018) CPU Scheduling Yajin Zhou (http://yajin.org) Zhejiang University Acknowledgement: some pages are based on the slides from Zhi Wang(fsu). Review Motivation to use threads

More information

3 No-Wait Job Shops with Variable Processing Times

3 No-Wait Job Shops with Variable Processing Times 3 No-Wait Job Shops with Variable Processing Times In this chapter we assume that, on top of the classical no-wait job shop setting, we are given a set of processing times for each operation. We may select

More information

Hardware-Software Codesign

Hardware-Software Codesign Hardware-Software Codesign 8. Performance Estimation Lothar Thiele 8-1 System Design specification system synthesis estimation -compilation intellectual prop. code instruction set HW-synthesis intellectual

More information

Learning Outcomes. Scheduling. Is scheduling important? What is Scheduling? Application Behaviour. Is scheduling important?

Learning Outcomes. Scheduling. Is scheduling important? What is Scheduling? Application Behaviour. Is scheduling important? Learning Outcomes Scheduling Understand the role of the scheduler, and how its behaviour influences the performance of the system. Know the difference between I/O-bound and CPU-bound tasks, and how they

More information

Scan Scheduling Specification and Analysis

Scan Scheduling Specification and Analysis Scan Scheduling Specification and Analysis Bruno Dutertre System Design Laboratory SRI International Menlo Park, CA 94025 May 24, 2000 This work was partially funded by DARPA/AFRL under BAE System subcontract

More information

High Level Synthesis

High Level Synthesis High Level Synthesis Design Representation Intermediate representation essential for efficient processing. Input HDL behavioral descriptions translated into some canonical intermediate representation.

More information

6.1 Motivation. Fixed Priorities. 6.2 Context Switch. Real-time is about predictability, i.e. guarantees. Real-Time Systems

6.1 Motivation. Fixed Priorities. 6.2 Context Switch. Real-time is about predictability, i.e. guarantees. Real-Time Systems Real-Time Systems Summer term 2017 6.1 Motivation 6.1 Motivation Real-Time Systems 6 th Chapter Practical Considerations Jafar Akhundov, M.Sc. Professur Betriebssysteme Real-time is about predictability,

More information

2. Software Introduction

2. Software Introduction Embedded Systems Summary Andreas Biri, D-ITET 10.07.15 1. Introduction Embedded Systems (ES): information processing systems embedded into a larger project Cyber-physical system (CPS): must operate dependably,

More information

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #8: Task Assignment and Scheduling on Multiprocessor Systems

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #8: Task Assignment and Scheduling on Multiprocessor Systems EECS 571 Principles of Real-Time Embedded Systems Lecture Note #8: Task Assignment and Scheduling on Multiprocessor Systems Kang G. Shin EECS Department University of Michigan What Have We Done So Far?

More information

Hardware/Software Partitioning and Scheduling of Embedded Systems

Hardware/Software Partitioning and Scheduling of Embedded Systems Hardware/Software Partitioning and Scheduling of Embedded Systems Andrew Morton PhD Thesis Defence Electrical and Computer Engineering University of Waterloo January 13, 2005 Outline 1. Thesis Statement

More information

Introduction to Electronic Design Automation. Model of Computation. Model of Computation. Model of Computation

Introduction to Electronic Design Automation. Model of Computation. Model of Computation. Model of Computation Introduction to Electronic Design Automation Model of Computation Jie-Hong Roland Jiang 江介宏 Department of Electrical Engineering National Taiwan University Spring 03 Model of Computation In system design,

More information

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling Uniprocessor Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Three level scheduling 2 1 Types of Scheduling 3 Long- and Medium-Term Schedulers Long-term scheduler Determines which programs

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 10 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Chapter 6: CPU Scheduling Basic Concepts

More information

Analyzing Real-Time Systems

Analyzing Real-Time Systems Analyzing Real-Time Systems Reference: Burns and Wellings, Real-Time Systems and Programming Languages 17-654/17-754: Analysis of Software Artifacts Jonathan Aldrich Real-Time Systems Definition Any system

More information

Multiprocessor and Real- Time Scheduling. Chapter 10

Multiprocessor and Real- Time Scheduling. Chapter 10 Multiprocessor and Real- Time Scheduling Chapter 10 Classifications of Multiprocessor Loosely coupled multiprocessor each processor has its own memory and I/O channels Functionally specialized processors

More information

Real Time Operating Systems and Middleware

Real Time Operating Systems and Middleware Real Time Operating Systems and Middleware Introduction to Real-Time Systems Luca Abeni abeni@disi.unitn.it Credits: Luigi Palopoli, Giuseppe Lipari, Marco Di Natale, and Giorgio Buttazzo Scuola Superiore

More information

Computer Science 4500 Operating Systems

Computer Science 4500 Operating Systems Computer Science 4500 Operating Systems Module 6 Process Scheduling Methods Updated: September 25, 2014 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 1 In This Module Batch and interactive workloads

More information

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13 PROCESS SCHEDULING II CS124 Operating Systems Fall 2017-2018, Lecture 13 2 Real-Time Systems Increasingly common to have systems with real-time scheduling requirements Real-time systems are driven by specific

More information

Co-synthesis and Accelerator based Embedded System Design

Co-synthesis and Accelerator based Embedded System Design Co-synthesis and Accelerator based Embedded System Design COE838: Embedded Computer System http://www.ee.ryerson.ca/~courses/coe838/ Dr. Gul N. Khan http://www.ee.ryerson.ca/~gnkhan Electrical and Computer

More information

CPU Scheduling: Objectives

CPU Scheduling: Objectives CPU Scheduling: Objectives CPU scheduling, the basis for multiprogrammed operating systems CPU-scheduling algorithms Evaluation criteria for selecting a CPU-scheduling algorithm for a particular system

More information

Worst-Case Utilization Bound for EDF Scheduling on Real-Time Multiprocessor Systems

Worst-Case Utilization Bound for EDF Scheduling on Real-Time Multiprocessor Systems Worst-Case Utilization Bound for EDF Scheduling on Real-Time Multiprocessor Systems J.M. López, M. García, J.L. Díaz, D.F. García University of Oviedo Department of Computer Science Campus de Viesques,

More information

Chapter 16. Greedy Algorithms

Chapter 16. Greedy Algorithms Chapter 16. Greedy Algorithms Algorithms for optimization problems (minimization or maximization problems) typically go through a sequence of steps, with a set of choices at each step. A greedy algorithm

More information

1.1 Explain the difference between fast computing and real-time computing.

1.1 Explain the difference between fast computing and real-time computing. i 1.1 Explain the difference between fast computing and real-time computing. 1.2 What are the main limitations of the current real-time kernels for the development of critical control applications? 1.3

More information

High-Level Synthesis (HLS)

High-Level Synthesis (HLS) Course contents Unit 11: High-Level Synthesis Hardware modeling Data flow Scheduling/allocation/assignment Reading Chapter 11 Unit 11 1 High-Level Synthesis (HLS) Hardware-description language (HDL) synthesis

More information

CEC 450 Real-Time Systems

CEC 450 Real-Time Systems CEC 450 Real-Time Systems Lecture 2 Introduction Part 1 August 31, 2015 Sam Siewert So Why SW for HRT Systems? ASIC and FPGA State-Machine Solutions Offer Hardware Clocked Deterministic Solutions FPGAs

More information

Preemptive Scheduling of Equal-Length Jobs in Polynomial Time

Preemptive Scheduling of Equal-Length Jobs in Polynomial Time Preemptive Scheduling of Equal-Length Jobs in Polynomial Time George B. Mertzios and Walter Unger Abstract. We study the preemptive scheduling problem of a set of n jobs with release times and equal processing

More information

An application-based EDF scheduler for OSEK/VDX

An application-based EDF scheduler for OSEK/VDX An application-based EDF scheduler for OSEK/VDX Claas Diederichs INCHRON GmbH 14482 Potsdam, Germany claas.diederichs@inchron.de Ulrich Margull 1 mal 1 Software GmbH 90762 Fürth, Germany margull@1mal1.com

More information

Timing Analysis on Complex Real-Time Automotive Multicore Architectures

Timing Analysis on Complex Real-Time Automotive Multicore Architectures 2 nd Workshop on Mapping Applications to MPSoCs St. Goar, June 2009 Timing Analysis on Complex Real-Time Automotive Multicore Architectures Mircea Negrean Simon Schliecker Rolf Ernst Technische Universität

More information

Scheduling in Multiprocessor System Using Genetic Algorithms

Scheduling in Multiprocessor System Using Genetic Algorithms Scheduling in Multiprocessor System Using Genetic Algorithms Keshav Dahal 1, Alamgir Hossain 1, Benzy Varghese 1, Ajith Abraham 2, Fatos Xhafa 3, Atanasi Daradoumis 4 1 University of Bradford, UK, {k.p.dahal;

More information

HW SW Partitioning. Reading. Hardware/software partitioning. Hardware/Software Codesign. CS4272: HW SW Codesign

HW SW Partitioning. Reading. Hardware/software partitioning. Hardware/Software Codesign. CS4272: HW SW Codesign CS4272: HW SW Codesign HW SW Partitioning Abhik Roychoudhury School of Computing National University of Singapore Reading Section 5.3 of textbook Embedded System Design Peter Marwedel Also must read Hardware/software

More information

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured System Performance Analysis Introduction Performance Means many things to many people Important in any design Critical in real time systems 1 ns can mean the difference between system Doing job expected

More information

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week 05 Lecture 18 CPU Scheduling Hello. In this lecture, we

More information

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018 CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved.

More information

Foundations of Computing

Foundations of Computing Foundations of Computing Darmstadt University of Technology Dept. Computer Science Winter Term 2005 / 2006 Copyright c 2004 by Matthias Müller-Hannemann and Karsten Weihe All rights reserved http://www.algo.informatik.tu-darmstadt.de/

More information

HIGH-LEVEL SYNTHESIS

HIGH-LEVEL SYNTHESIS HIGH-LEVEL SYNTHESIS Page 1 HIGH-LEVEL SYNTHESIS High-level synthesis: the automatic addition of structural information to a design described by an algorithm. BEHAVIORAL D. STRUCTURAL D. Systems Algorithms

More information

Evaluation and Validation

Evaluation and Validation 12 Evaluation and Validation Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: Alexandra Nolte, Gesine Marwedel, 2003 2010 年 12 月 05 日 These slides use Microsoft clip arts. Microsoft copyright

More information

Competitive Analysis of On-line Algorithms for On-demand Data Broadcast Scheduling

Competitive Analysis of On-line Algorithms for On-demand Data Broadcast Scheduling Competitive Analysis of On-line Algorithms for On-demand Data Broadcast Scheduling Weizhen Mao Department of Computer Science The College of William and Mary Williamsburg, VA 23187-8795 USA wm@cs.wm.edu

More information

11. APPROXIMATION ALGORITHMS

11. APPROXIMATION ALGORITHMS 11. APPROXIMATION ALGORITHMS load balancing center selection pricing method: vertex cover LP rounding: vertex cover generalized load balancing knapsack problem Lecture slides by Kevin Wayne Copyright 2005

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms CSE 101, Winter 018 D/Q Greed SP s DP LP, Flow B&B, Backtrack Metaheuristics P, NP Design and Analysis of Algorithms Lecture 8: Greed Class URL: http://vlsicad.ucsd.edu/courses/cse101-w18/ Optimization

More information

Previous Exam Questions System-on-a-Chip (SoC) Design

Previous Exam Questions System-on-a-Chip (SoC) Design This image cannot currently be displayed. EE382V Problem: System Analysis (20 Points) This is a simple single microprocessor core platform with a video coprocessor, which is configured to process 32 bytes

More information

Scheduling Algorithms to Minimize Session Delays

Scheduling Algorithms to Minimize Session Delays Scheduling Algorithms to Minimize Session Delays Nandita Dukkipati and David Gutierrez A Motivation I INTRODUCTION TCP flows constitute the majority of the traffic volume in the Internet today Most of

More information

EXERCISES SHORTEST PATHS: APPLICATIONS, OPTIMIZATION, VARIATIONS, AND SOLVING THE CONSTRAINED SHORTEST PATH PROBLEM. 1 Applications and Modelling

EXERCISES SHORTEST PATHS: APPLICATIONS, OPTIMIZATION, VARIATIONS, AND SOLVING THE CONSTRAINED SHORTEST PATH PROBLEM. 1 Applications and Modelling SHORTEST PATHS: APPLICATIONS, OPTIMIZATION, VARIATIONS, AND SOLVING THE CONSTRAINED SHORTEST PATH PROBLEM EXERCISES Prepared by Natashia Boland 1 and Irina Dumitrescu 2 1 Applications and Modelling 1.1

More information

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable What s An OS? Provides environment for executing programs Process abstraction for multitasking/concurrency scheduling Hardware abstraction layer (device drivers) File systems Communication Do we need an

More information

SFU CMPT Lecture: Week 8

SFU CMPT Lecture: Week 8 SFU CMPT-307 2008-2 1 Lecture: Week 8 SFU CMPT-307 2008-2 Lecture: Week 8 Ján Maňuch E-mail: jmanuch@sfu.ca Lecture on June 24, 2008, 5.30pm-8.20pm SFU CMPT-307 2008-2 2 Lecture: Week 8 Universal hashing

More information

Process- Concept &Process Scheduling OPERATING SYSTEMS

Process- Concept &Process Scheduling OPERATING SYSTEMS OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne PROCESS MANAGEMENT Current day computer systems allow multiple

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms Given an NP-hard problem, what should be done? Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one of three desired features. Solve problem to optimality.

More information

But this will not be complete (no book covers 100%) So consider it a rough approximation Last lecture OSPP Sections 3.1 and 4.1

But this will not be complete (no book covers 100%) So consider it a rough approximation Last lecture OSPP Sections 3.1 and 4.1 ADRIAN PERRIG & TORSTEN HOEFLER ( 252-0062-00 ) Networks and Operating Systems Chapter 3: Scheduling Source: slashdot, Feb. 2014 Administrivia I will try to indicate book chapters But this will not be

More information

Scheduling with Bus Access Optimization for Distributed Embedded Systems

Scheduling with Bus Access Optimization for Distributed Embedded Systems 472 IEEE TRANSACTIONS ON VERY LARGE SCALE INTEGRATION (VLSI) SYSTEMS, VOL. 8, NO. 5, OCTOBER 2000 Scheduling with Bus Access Optimization for Distributed Embedded Systems Petru Eles, Member, IEEE, Alex

More information

Compositional Schedulability Analysis of Hierarchical Real-Time Systems

Compositional Schedulability Analysis of Hierarchical Real-Time Systems Compositional Schedulability Analysis of Hierarchical Real-Time Systems Arvind Easwaran, Insup Lee, Insik Shin, and Oleg Sokolsky Department of Computer and Information Science University of Pennsylvania,

More information

Unit 2: High-Level Synthesis

Unit 2: High-Level Synthesis Course contents Unit 2: High-Level Synthesis Hardware modeling Data flow Scheduling/allocation/assignment Reading Chapter 11 Unit 2 1 High-Level Synthesis (HLS) Hardware-description language (HDL) synthesis

More information