Slides - ETH TIK
Transcription
Slides - ETH TIK
Embedded Systems Exercise 8: Integer Linear Programming and Iterative Algorithms 01. June 2016 Georgia Giannopoulou (ETZ G77) [email protected] Swiss Federal Institute of Technology 1 Computer Engineering and Networks Laboratory Synthesis Problem Specification (1) Sequence Graph GS(VS,ES) nop T2 T1 T3 nop Swiss Federal Institute of Technology 2 Computer Engineering and Networks Laboratory Synthesis Problem Specification (2) Resource graph, GR(VR,ER) Operations, VS Resources, VT 4 T1 r1 (r1)=1 r2 (r2)=1 2 T2 3 T3 Execution times, wi Swiss Federal Institute of Technology 3 Computer Engineering and Networks Laboratory Integer Linear Programming Principle Synthesis Problem transformation into ILP Integer Linear Program (ILP) optimization of ILP Solution of ILP back interpretation Solution of Synthesis Problem Swiss Federal Institute of Technology 4 Computer Engineering and Networks Laboratory Question 1 – Integer Linear Program Swiss Federal Institute of Technology 5 Computer Engineering and Networks Laboratory nop Earliest starting time li T2 T1 T3 nop T1 nop nop T2 T3 0 Swiss Federal Institute of Technology 6 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Earliest starting time li T2 T1 ASAP T3 nop T1 nop nop T2 T3 0 Swiss Federal Institute of Technology 7 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Earliest starting time li T2 T1 ASAP T3 nop T1 nop nop T2 T3 l3 = 2 0 Swiss Federal Institute of Technology 8 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Latest starting time hi T2 T1 ALAP T3 nop T1 nop nop T2 T3 l3 = 2 0 Swiss Federal Institute of Technology 9 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Latest starting time hi T2 T1 ALAP T3 nop T1 nop nop T2 T3 l3 = 2 Lmax 0 Swiss Federal Institute of Technology 10 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Latest starting time hi T2 T1 ALAP T3 nop T1 nop nop T2 T3 l3 = 2 h3 =6 Lmax 0 Swiss Federal Institute of Technology 11 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Latest starting time hi T2 T1 ALAP T3 nop T1 nop nop T2 T3 l3 = 2 h3 =6 Lmax 0 Swiss Federal Institute of Technology 12 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Latest starting time hi T2 T1 ALAP T3 nop T1 nop nop T2 T3 l3 = 2 h3 =6 Lmax 0 Swiss Federal Institute of Technology 13 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Binary variables xi,t T2 T1 T3 nop T1 nop nop T2 T3 x3,t Swiss Federal Institute of Technology 14 0 0 0 0 0 0 1 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Binary variables xi,t T2 T1 T3 nop T1 nop nop T2 T3 x3,t 0 0 0 0 0 0 1 0 0 0 8 9 x3,6 = 1 0 Swiss Federal Institute of Technology 15 1 2 3 4 5 6 7 Computer Engineering and Networks Laboratory t nop Binary variables xi,t T2 T1 T3 nop T1 nop nop T2 T3 x3,t 0 0 0 0 1 0 0 0 0 0 6 7 8 9 x3,4 = 1 0 Swiss Federal Institute of Technology 16 1 2 3 4 5 Computer Engineering and Networks Laboratory t nop Binary variables xi,t T2 T1 T3 nop T1 nop An operation cannot have more than one starting point! nop T2 T3 x3,t 0 0 0 0 1 0 0 0 0 0 6 7 8 9 x3,4 = 1 0 Swiss Federal Institute of Technology 17 1 2 3 4 5 Computer Engineering and Networks Laboratory t nop Starting times (Ti) T2 T1 T3 nop T1 nop nop T2 T3 Starting time of Ti Swiss Federal Institute of Technology x3,t 18 0 0 0 0 0 1 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Starting times (Ti) T2 T1 T3 nop T1 nop nop T2 T3 Starting time of Ti x3,t 0 0 0 0 0 1 0 0 0 0 x3,5 = 1 (T3) = 5 0 Swiss Federal Institute of Technology 19 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Starting times (Ti) T2 T1 T3 nop T1 nop nop T2 T3 Starting time of Ti x3,t 0 0 0 1 0 0 0 0 0 0 7 8 9 x3,3 = 1 (T3) = 3 0 Swiss Federal Institute of Technology 20 1 2 3 4 5 6 Computer Engineering and Networks Laboratory t nop Precedence (timing) constraints T2 T1 T3 nop T1 nop nop T2 T3 0 Swiss Federal Institute of Technology 21 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Precedence (timing) constraints T2 T1 T3 nop T1 nop nop T2 T3 (T2) 0 Swiss Federal Institute of Technology 22 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Precedence (timing) constraints T2 T1 T3 nop T1 nop nop T2 T3 (T2) (T3) 0 Swiss Federal Institute of Technology 23 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Precedence (timing) constraints T2 T1 T3 nop T1 nop nop T2 T3 (T2) (T3) w(T2) 0 Swiss Federal Institute of Technology 24 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T3 0 Swiss Federal Institute of Technology 25 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T3 x2,t Swiss Federal Institute of Technology 26 0 1 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T3 x2,t Swiss Federal Institute of Technology 27 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T3 x2,t Swiss Federal Institute of Technology 28 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T3 x2,t Swiss Federal Institute of Technology 29 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 for T2: t = 0: x2,0 t = 1: x2,0 + x2,1 t = 2: x2,1 + x2,2 t = 3: x2,2 + x2,3 T1 nop nop T2 T3 … x2,t Swiss Federal Institute of Technology nop 30 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T3 0 Swiss Federal Institute of Technology 31 1 2 3 4 5 6 7 8 Computer Engineering and Networks Laboratory 9 t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T1 : Swiss Federal Institute of Technology 32 T3 0 0 0 0 0 1 1 1 1 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 Swiss Federal Institute of Technology T3 T1 : 0 0 0 0 0 1 1 1 1 0 T2 : 0 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 33 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T1 : T2 : Swiss Federal Institute of Technology 34 0 0 0 0 0 T3 1 1 1 1 0 0 0 0 0 0 + 0 1 1 0 0 = 0 1 1 0 0 1 1 1 1 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t nop Resource constraints T2 T1 T3 nop T1 nop nop T2 T1 : T2 : Swiss Federal Institute of Technology 35 0 0 1 1 1 T3 1 0 0 0 0 0 0 0 0 0 + 0 1 1 0 0 = 0 1 2 1 1 1 0 0 0 0 0 1 2 3 4 5 6 7 8 9 Computer Engineering and Networks Laboratory t Question 1 Swiss Federal Institute of Technology 36 Exec. Times Allocation D+ = 1 Dx = 2 α+ = 2 αx = 2 Computer Engineering and Networks Laboratory Question 1 – Solution Steps (1) Perform ASAP & ALAP scheduling to find li, hi Question: How to select Lmax for ALAP? Hint: “Lmax is chosen such that a feasible solution to the problem (scheduling under resource constraints) exists.” (2) Define binary variables xi,t (3) Define the starting times of the operations τ(vi) (4) Write down the set of constraints (precedence, resource) (5) Specify the objective function (6) Modify your ILP formulation for a different objective (1c) Swiss Federal Institute of Technology 37 Computer Engineering and Networks Laboratory Question 1a – Solution Lmax = 7 Swiss Federal Institute of Technology 38 Computer Engineering and Networks Laboratory Question 1a – Solution Swiss Federal Institute of Technology 39 Computer Engineering and Networks Laboratory Question 1a – Solution Swiss Federal Institute of Technology 40 Computer Engineering and Networks Laboratory Question 1a – Solution ... Swiss Federal Institute of Technology 41 Computer Engineering and Networks Laboratory Question 1a – Solution Swiss Federal Institute of Technology 42 Computer Engineering and Networks Laboratory Question 1c – Solution Swiss Federal Institute of Technology 43 Computer Engineering and Networks Laboratory Question 2 – Iterative Algorithms Swiss Federal Institute of Technology 44 Computer Engineering and Networks Laboratory Iterative Algorithms displacement Swiss Federal Institute of Technology Iteration interval 45 Computer Engineering and Networks Laboratory Iterative Algorithms Extended sequence graph Swiss Federal Institute of Technology 46 Computer Engineering and Networks Laboratory Iterative Algorithms P=2 Swiss Federal Institute of Technology 47 Computer Engineering and Networks Laboratory Question 2 (1) Draw extended sequence graph (2) Formulate dependency constraints (3) Compute minimum iteration interval P and latency L without and with functional pipelining Swiss Federal Institute of Technology 48 Computer Engineering and Networks Laboratory Question 2 – Solution Swiss Federal Institute of Technology 49 Computer Engineering and Networks Laboratory Question 2 – Solution Swiss Federal Institute of Technology 50 Computer Engineering and Networks Laboratory Question 2 – Solution Swiss Federal Institute of Technology 51 Computer Engineering and Networks Laboratory