1 / 95

Embedded Systems and Software

Embedded Systems and Software. Ed F. Deprettere, Todor Stefanov, Hristo Nikolov {edd, stefanov, nikolov}@liacs.nl Leiden Embedded Research Center Spring 2007; Friday 01:30: p.m – 04:00 p.m. http://www.liacs.nl/~cserc/EMBSYST/EMBSYST2007 /. Kahn Process Networks.

glyn
Download Presentation

Embedded Systems and Software

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Embedded Systems and Software Ed F. Deprettere, Todor Stefanov, Hristo Nikolov {edd, stefanov, nikolov}@liacs.nl Leiden Embedded Research Center Spring 2007; Friday 01:30: p.m – 04:00 p.m. http://www.liacs.nl/~cserc/EMBSYST/EMBSYST2007/

  2. Kahn Process Networks Recall: The KPN model of computation consists of concurrent sequential processes that communicate only through one-way FIFO channels with unbounded capacity. There is no global memory, nor is there a global schedule. The FIFO buffers are unbounded (writing always proceeds) and processes synchronize by means of blocking reads: reads must block until the request for data can be met. KPNs are determinate, meaning that for a given input stream the result is independent of the scheduling of processes in the network. 03EMBSYST Ed F. Deprettere

  3. Kahn Process Networks (2) More formally, - each channel in a KPN is a signal which carries a finite or infinite sequence of tokens s. - set of all possible signals is S, and n-tuple of signals is S . - relation [ is binary prefix relation on a signal: s1 [ s2 means that sequence of tokens in s1 is a prefix of the sequence of tokens in s2. - any process P in the KPN with m inputs and n outputs is a input-output mapping, P : S → S . - P must be monotonic under the element-wise prefix order: s1 [ s2 → P(s1) [ P(s2) n m n 03EMBSYST Ed F. Deprettere

  4. Kahn Process Networks (3) (additional inputs result in additional outputs; tokens cannot be revisited). Element-wise prefix order is a complete partial order (CPO). - under this restriction: a least fixpoint exists (fixpoint theorem). This is the behavior of the KPN. - Procedure for finding least fixpoint is not given under monotonicity condition alone. - need a stronger condition: continuity : result of function to infinite input is the limit of its results to the finite approximations of this input. Blocking read is a sufficient (but not necessary) condition. - continuous functions are compositional, so it is sufficient to guarantee continuity for each process in the network. in short: there exists a recursive Procedure to compute the Mappings. 03EMBSYST Ed F. Deprettere

  5. process P2 C4 P1 C1 C3 Unbounded FIFO Process P1 (‘producer’) ProcessP2 (‘consumer’) While (1){ Read(C1, token); if (token != Token) { Write(C2, Execute(token)); { else{ Write(C3, token); } } While(1){ Read(C2, token); Write(C4, Execute(token)); } Characteristic operation triplet is {Read, Execute, Write}. Execute refers to some abstract computational operator; Communication is point-to-point. KPN: an example 03EMBSYST Ed F. Deprettere

  6. Usage of KPNs The KPN model of computation is used to specify applications in a concurrent language. Processes are specified in a host language (C, C++, Java). The communication between processes is specified in a co-ordination language: blocking read. KPN is a convenient model for streaming data applications: audio, and video, multimedia in general. Processes operate on infinite streams of date, one quantum of data at a time, i.e., the streams need not be available as a whole. 03EMBSYST Ed F. Deprettere

  7. PU PU PU Bus Shared Memory Mapping An application modeled in terms of a KPN is to be transformed (mapped or deployed) to a parallel multi-processor architecture. 03EMBSYST Ed F. Deprettere

  8. Relation with Dataflow Graphs KPN Dataflow Process Network Dataflow Graphs Dynamic DFG (Boolean) Static DFG Cyclo-Static DFG SDF HSDF 03EMBSYST Ed F. Deprettere

  9. Sequential Process KPN application model Component Applications platform / / Mem Mem Mem Mem ... platform Communication Structure FPGA PE PE PE PE ... – Part II: applying it allOverview 03EMBSYST Ed F. Deprettere

  10. EASY to specify DIFFICULT to specify Sequential Application Specification Parallel Application Specification Programmable Interconnect (NoC) Memory for j = 1:1:N, [x(j)] = Source1( ); end for i = 1:1:K, [y(i)] = Source2( ); end for j = 1:1:N, for i = 1:1:K, [y(i), x(j)] = F( y(i), x(j) ); end end for i = 1:1:K, [Out(i)] = Sink( y( I ) ); end sourse1 sink F IPcore RPU CPU Memory Micro Processor source2 ... EASY to map DIFFICULT to map Translating and Mapping Application Programming Translator Mapper 03EMBSYST Ed F. Deprettere

  11. Affine Nested Loop Programs From now on: given sequential programs are static affine nested loop Programs (for simplicity, some dynamic behavior als possible). nested loops: statements are surrounded by one or more loops → for k = k lower bound (parameters) : stride : k upper bound(parameters) for l = l lower bound (k, parameters) : stride : lupper bound(k, parameters) static: no data dependent conditions affine: loop bounds, conditions, and variable index functions (see next page) are affine functions of the iterators and parameters f(x, y, z) is affine if of the form ax + by +cz +d linear if of the form ax + by + cz 03EMBSYST Ed F. Deprettere

  12. Affine Nested Loop Programs From now on: given sequential programs are static affine nested loop Programs (for simplicity, some dynamic behavior also possible). nested loops: statements are surrounded by one or more loops → for k = k lower bound (parameters) : stride : k upper bound(parameters) for l = l lower bound (k, parameters) : stride : lupper bound(k, parameters) static: no data dependent conditions affine: loop bounds, conditions, and variable index functions (see next page) are affine functions of the iterators and parameters f(x, y, z) is affine if of the form ax + by +cz +d linear if of the form ax + by + cz 03EMBSYST Ed F. Deprettere

  13. Variable indexing function: x(f(k,l)) is variable with name x and indexing function f(k,l) → f(k,l) affine (ak + bl + c) Affine Nested Loop Programs (2) Loop bound: l = k+1 : 1 : N → lower bound is k+1 or l – k – 1 ≥ 0 upper bound is N or N – l ≥ 0 Condition: if l – k ≤ N → if k – l + N ≥ 0 Extensions to non-static conditions do exist. 03EMBSYST Ed F. Deprettere

  14. Extensions • Affine nested loop programs, except for the fact • that conditions may be data dependent and of • any form. E.g., if f(x) ≥ y. • 2. Affine nested loop programs with non-static parameters. • Values of parameters may change (possible from • internally) during execution. • E.g., • [ v(i), w(j), N] = f(v(i), w(j), M); • for i = 1 : 1 : N, • for j = 1: 1 : M, 03EMBSYST Ed F. Deprettere

  15. Affine Nested Loop Programs (3) Structure of affine nested loop program. • parameter range: % parameter N 20 100 • initialization of input data, called sources • [x(n)] = Read_SourceX(); • loops, conditions, and functions • for i = 1 : 1 : N, • if i-2 ≥ 0. • [y(i,j), x(i,j)] = f(y(i,j), x(i,j); • collecting output data, called sinks • [sink(y(i,j)] = Write(y(i,j)); 03EMBSYST Ed F. Deprettere

  16. Affine NLP - Example • Parameters % parameter N 100 1000 % parameter M 8 16 • Sources ← initialization of array y(n) for n = 1 : 1 : N+M-1, [ y(n) ] = Read_SourceY(); end for n = 1 : 1 : N, [ x(n) ] = Read_SourceX(); end ← initialization of array x(n) ← initialization of array h(n) for n = 1 : 1 : M, [ h(n) ] = Read_Source(): end 03EMBSYST Ed F. Deprettere

  17. 1 M m 1 h M-1 x M y y x h y = y + h.x N N+M-1 n Affine NLP – Example (2) n = 1 : 1 : N+M-1, m = max(1, n-(N-1)) :1 : min (n,M), for n = 1 : 1 : N+M-1, if n < M, for m = 1 : 1 : n, [ y(n) ] = y(n) + h(m).x(n-m+1); end end if n > N, for m = n – (N-1) : 1 : M, [ y(n) ] = y(n) + h(m).x(n-m+1); end end for m = 1 : 1 : M, [ y(n) ] = y(n) + h(m).x(n-m+1); end end • Main 03EMBSYST Ed F. Deprettere

  18. Affine NLP – Example (3) • Sink ← saving results for n = 1 : 1 : N+M-1, [ Sink( y(n)) ] = Write(y(n)); end The 3 (by coincidence equal) statements [ y(n) ] = y(n) + h(m).x(n-m+1) are each surrounded by two loops for n = 1 : 1 : N+M-1, and (1) for m = 1 : 1 : n, (2) for m = n – (N-1) : 1 : M, (3) for m = 1 : 1 : M, The conditions are surrounded by one loop: n = 1 : 1 : N+M-1 03EMBSYST Ed F. Deprettere

  19. From ANLP to KPN • Converting ANLPs to input/output equivalent KPNs • provides (equivalent) concurrent processing specifications • that facilitate mapping onto parallel architectures • Because ANLPs are static, the corresponding • KPNs are also static. They are in some sense • similar to Cyclo-Static dataflow graphs. • Global schedules can be derived, and sizes • of buffers can be determined, at least an upper • bound for them. 03EMBSYST Ed F. Deprettere

  20. From ANLP to PN (2) Requires three steps • conversion to single assignment code (dependency analysis) • variables in an ANLP may be assigned more than one value: • e.g., x(i+j) may have different values for all i+j = c. • In a SAC, each variable gets assigned only one value: • e.g., x1 (i+1, j-1). • an intermediate compact dependence graph representation • of the SAC • construction of the PN from the intermediate format 03EMBSYST Ed F. Deprettere

  21. initialR F Data Dependency Analysis outputR MatParser G inputSamples SAC Single Assignment Code Matlab Program (or C, C++, Java) DgParser %parameter N 8 16; %parameter K 100 1000; for k = 1:1:K, for j = 1:1:N, [r(j,j), x(k,j), t ]=F( r(j,j), x(k,j) ); for i = j+1:1:N, [r(j,i), x(k,i), t]=G( r(j,i), x(k,i), t ); end end end Polyhedral Reduced Dependence Graph (PRDG) PRDG Panda Linearization Kahn Process Network Steps involved: overview Matlab Application 03EMBSYST Ed F. Deprettere Process Network

  22. i+j=6 a(i,j)→ a(i-1,j+1) dependency Data Dependency Analysis j for i= 1 : 1 : N, for j= 1 : 1 : N, [ a(i+j) ] = f( a(i+j) ); end end N=6 1 2 3 4 5 1 2 i 3 4 5 N=6 Lexicographic schedule Consumer reads from Producer The for loops define a rectangular iteration domain. Each dot is an invocation of f(). 03EMBSYST Ed F. Deprettere

  23. I = i j Is iteration vector (iterators i and j) x(h(I)) variable with name x and indexing function h(I). Example: h(I) = [1 1]. i =(i+j) j Data Dependency Analysis (2) i = 1 : 1 : N, j = 1 : 1 : M, | [ x(g(I))]= F1 (); | [ ] = F2 (x(f(I)); | end end Observe that [1 1] has a null space • consumer F2 is dependent on producer F1 iff - in the domain • {i,j | 1 ≤ i ≤ N ^ 1 ≤ j ≤ M} , • (a) g(I1) = f(I2) • (b) I1 <l I2 (<l means lexicographic preceding = prod. before • cons.) • (c) I1 is lexicographic largest iteration satisfying (a) and (b) 03EMBSYST Ed F. Deprettere

  24. j I1 d I2 i Data Dependency Analysis (3) consumer F2 is dependent on producer F1 iff - in the domain (a) g(I1) = f(I2) (b) I1 <l I2 (<l means lexicographic preceding) (c) I1 is lexicographic largest iteration satisfying (a) and (b) Dependency: d = I1 – I2 (consumer takes from producer) Equations look like (integer) linear program problem, except for (b) which is not an affine expression. This problem can be overcome: 03EMBSYST Ed F. Deprettere

  25. Data Dependency Analysis (4) consumer F2 is dependent on producer F1 iff – in the domain (a) g(I1) = f(I2) (b) I1 <l I2 (<l means lexicographic preceding) (c) I1 is lexicographic largest iteration satisfying (a) and (b) I1 <l I2 is either i1 < i2 or i1 = i2 and j1 < j2. This gives two sets of linear equations instead of one non-linear set. Of course, we have to add the range of the parameters, e.g., 30 ≤ N ≤ 100, M ≤ N. 03EMBSYST Ed F. Deprettere

  26. i = 1 j a(4) a1(1,3) i a1 (2,2) a1 (3,1) i ≥ 2 and j = M i≥ 2 and j ≤ M-1 Single Assignment Code % parameter N 10 20; % parameter N 10 20; % parameter M 10 20; % parameter M 10 20; for i = 1 : 1 : N, for i = 1 : 1 : N, for j = 1 : 1 : M, for j = 1 : 1 : M, [ a(i+j)] = f (a(i+j) )); if i -2 ≥ 0, end if j ≤ M - 1, end [in0] = ipd (a1(i -1, j +1)); else [in0] = ipd (a (i + j)); end else [in0 ] = ipd (a (i + j)); end [out0 ] = f (in0 ); [a1(i,j)] = opd (out0 ); end end ipd input port domain opd output port domain → identity functions 03EMBSYST Ed F. Deprettere

  27. A polyhedron P is the intersection of a set of finitely many closed half - spaces = Î = Ù ³ n P { x Q | Ax b Cx d } where A is an integral k x n matrix, b is an integral k - vector, C is an integral l x n matrix, and d is an integral l - vector. x x Half-space a Hyper-plane b Polyhedron Hyper-plane and half-space 03EMBSYST Ed F. Deprettere

  28. → we only consider convex polytopes f(λx1+(1-λ)x2) k f(x1) f(x2) f(x) is convex if f(λx1 + (1-λ)x2) ≤ λf(x1) + (1-λ)f(x2), x1 and x2 in domain of f, and λє [0,1]. Example: x1(λ=0) x2(λ=0) k = 1 : 1 : K, j = 1 : 1 : N, i = j : 1 : N, 1 0 0 0 1 0 0 -1 1 -1 0 0 0 -1 0 0 0 -1 k j i 1 1 0 -K -N -N ≥ (1,1,1) N i N j Polytopes Informally: a multidimensional volume with flat faces (multidimensional extension of polygon) Formally: bounded N-dimensional figure whose faces are hyperplanes 03EMBSYST Ed F. Deprettere

  29. k Example: k = 1 : 1 : K, j = 1 : 1 : N, i = j : 1 : N, 1 0 0 0 1 0 0 -1 1 -1 0 0 0 -1 0 0 0 -1 k j i 1 1 0 -K -N -N Is of the form P(p) = AI ≥ Bp + dwith A, B, and d integral and p the parameter vector. Each row is a half space : an I≥ bn p + dn (rows of A are normals to half planes anI = bnp + dn) ≥ (1,1,1) N T T i T T N j More general: P(p) = Ax≥ Bp + d where xis rational . The points of interest are still integral points in the polytope, i.e., P(p) ∩ Polytopes(2) 03EMBSYST Ed F. Deprettere

  30. x2 (0,0) l x1 Polytopes (3) Wy x rational? one of the faces is the line l : x1 = -1/2 x2 + 6 coming in the polytope as 2x1 ≤ -x2 + 12 or 2x1 + x2 ≤ 12 the point (x1, x2) = (9/2, 3) satisfies this equation (lies on l) but is not an integral point (black dot) The nearest integral point is (4,3) Rational is sufficient because l goes at least to two integral points. 03EMBSYST Ed F. Deprettere

  31. j N=6 1 2 3 4 5 1 2 i 3 4 5 N=6 1 1 -N -N • 0 x1 • 0 1 x2 • -1 0 • 0 -1 ≥ 2 dots are intersection with Z Example for i= 1 : 1 : N, for j= 1 : 1 : N, [ a(i+j) ] = f( a(i+j) ); end end x rational vector 03EMBSYST Ed F. Deprettere

  32. j x1(i-1, j+2) x1(i,j) F → ANLP : x(f(I)) → f(I): [ 1 1] i → x(I + j ) j i [ 1 1] has a null space μ = 1 → f(I+aμ) = f(I) -1 Dependence Graph In SAC, variables get assigned only once a value → SAC : x(f(I)) → x1(Φ(I)) → Φ(I) = I or I + d no null space; d is dependency vector Variables x1(Φ(I)) propagate from function call to function call example: [ x1(i,j) ] = F((x1(i-1, j+2)) → leads to dependence graph Can be visualized graphically 03EMBSYST Ed F. Deprettere

  33. i = 1 j a(4) a1(1,3) i a1 (2,2) a1 (3,1) i ≥ 2 and j = M i≥ 2 and j ≤ M-1 ANLP, SAC, and DG % parameter N 10 20; % parameter N 10 20; % parameter M 10 20; % parameter M 10 20; for i = 1 : 1 : N, for i = 1 : 1 : N, for j = 1 : 1 : M, for j = 1 : 1 : M, [ a(i+j)] = f (a(i+j) )); if i -2 ≥ 0, end if j ≤ M - 1, end [in0] = ipd (a1(i -1, j +1)); else [in0] = ipd (a (i + j)); end else [in0 ] = ipd (a (i + j)); end [out0 ] = f (in0 ); [a1(i,j)] = opd (out0 ); end end 03EMBSYST Ed F. Deprettere

  34. Dependence Graph (some k ≠ 1 or K) Matlab Code x t1 x1 k r1 i F j SAC G %parameter N 8 16; %parameter K 100 1000; for k = 1:1:K, for j = 1:1:N, [r(j,j), x(k,j), t ]=F( r(j,j),x(k,j) ); for i = j+1:1:N, [ r(j,i), x(k,i), t]=G( r(j,i), x(k,i), t ); end end end Other example 03EMBSYST Ed F. Deprettere

  35. x r1 Polytope “D” r ← k=1 t1 x1 A C r1(K,j,j)) r ← k=1 t1 x1 E r1 x r1(K,j,i) Polytope “C” B D x →t1 → x1 → r1 Polyhedral Reduced Dependence Graph A function call with its surrounding loops forms a polytope and becomes a Node (in fact a node domain) in the reduced DG. 03EMBSYST Ed F. Deprettere

  36. x r1 Polytope “D” r ← k=1 t1 x1 A C r1(K,j,j)) r ← k=1 t1 x1 E r1 x r1(K,j,i) Polytope “C” B D x →t1 → x1 → r1 PRDG (2) The Nodes in the PRDG have Ports (input and output) which are also polyhedral domains. Example: the input Port of (yellow) Node C for variable r1 corresponds to all r1 input ports of the atomic yellow function calls in the SAC or DG. Port domains are subsets of Node domain 03EMBSYST Ed F. Deprettere

  37. A C E B D Example: out: x1 (k,j,i) in: x1 (k,j-1,i) mapping function: (k,j,i-1) = (k,j,i) + (0,-1, 0) (consumer (k,j,i) takes from producer (k,j-1,i)) D out in x1 PRDG (3) The arrows are called Channels. A Channel is directed from an output Port (domain) of a Node (domain) to an input Port (domain) of another or the same Node (domain). There is an affine mapping function between points in the input Port to points in the output Port which is the dependency function from the SAC or DG (opposite of token flow direction). Mapping function + input Port domain defines output Port domain. 03EMBSYST Ed F. Deprettere

  38. x Polytope “D” t1 x1 r1 Example: input Port domain { j = 2:1:N-1 ^ i = j+1:1:N} mapping function (-1, 0) output Port domain {j = 1:1:N-2 ^ I = j+1:1:N} Example: out: x1 (k,j,i) in: x1 (k,j-1,i) mapping function: (k,j-1,i) = (k,j,i) + (0,-1, 0) (consumer (k,j,i) takes from producer (k,j-1,i)) Polytope “C” D out in x1 PRDG (4) The SAC is in output normal form : output variables are always of the form v(I) where I is the iteration vector. The SAC does not tell where they are sent. This follows from input Port domain and mapping function. 03EMBSYST Ed F. Deprettere

  39. M-1 1 j M 2 N i Summary % parameter N 10 20; % parameter N 10 20; % parameter M 10 20; % parameter M 10 20; for i = 1 : 1 : N, for i = 1 : 1 : N, for j = 1 : 1 : M, for j = 1 : 1 : M, [ a(i+j)] = f (a(i+j) )); if i -2 ≥ 0, end if j ≤ M - 1, end [in0] = ipd (a1(i -1, j +1)); else [in0] = ipd (a (i + j)); end else [in0 ] = ipd (a (i + j)); end [out0 ] = f (in0 ); [a1(i,j)] = opd (out0 ); end end • Affine nested loop program • Dependency Analysis • Single assignment Code 03EMBSYST Ed F. Deprettere

  40. input Port output Port domain: 2 ≤ i ≤ N, 1 ≤ j ≤ M-1, domain: 1 ≤ i ≤ N-1, 2 ≤ j ≤ M, Sink Node f-Node Source Node domain: i = 1 : 1 :N, j = 1 : 1 : M, mapping input Port to output Port is (-1, +1) Summary (2) 4. Polyhedral Reduced Dependence Graph 03EMBSYST Ed F. Deprettere

  41. NP NC X1 channel j1 i1 Np Nc 1 2 3 4 5 N=6 1 2 3 4 5 N=6 write read port port i2 j2 Schedule: Schedule: for j2 = 1 : 1 : N for i1 = 1 : 1 : N for j1 = j2 : 1 : N for i2 = 1 : 1 : i1 Mx1 Producer Consumer Pair Producer with Node Np - domain 1≤ j2 ≤ N ^ j2 ≤ j1 ≤ N – and Node function [ x1(j2, j1), r1(j2, j1) ] = f( ); Consumer with Node Nc - domain 1 ≤ i1 ≤ N ^ 1 ≤ i2 ≤ i1 – and Node function [ ] = g(x1(i1, i2), r1(i1, i2)); With each input (output) variable corresponds an input (output) Port and Port domain. Shown here are output Port domain (left gray triangle) for variable x1 and input Port domain (right gray triangle) for variable x1 03EMBSYST Ed F. Deprettere

  42. j2 = Mx1( i1 ) is the (dependency) affine mapping function, j1 i2 Here: j2 = 0 1 i1 + -1 j1 1 0 i2 0 right (4,4) → left (3,4) NP NC X1 channel j1 i1 Np Nc 1 2 3 4 5 N=6 1 2 3 4 5 N=6 write read port port i2 j2 Schedule: Schedule: for j2 = 1 : 1 : N for i1 = 1 : 1 : N for j1 = j2 : 1 : N for i2 = 1 : 1 : i1 Mx1 Producer Consumer Pair (2) Consumer takes from producer ‘function’ But – of course – producer tokens are sent to consumer 03EMBSYST Ed F. Deprettere

  43. This is because the P and C schedules are loop nests Schedule: Schedule: for j2 = 1 : 1 : N for i1 = 1 : 1 : N for j1 = j2 : 1 : N for i2 = 1 : 1 : i1 Nevertheless a schedule is a linear ordering: { (j2, j1)}→ {k} i=1:1:N j=i:1:N Linearization Tokens are sent from Producer to Consumer over a linear (FIFO) Channel buffer. However, the corresponding produced and consumed variables are multidimensional: [x1(j2, j1), r1(j1, j2)] = g(x1(i1-1, i2), r1(i1, i2)); I shall show that we can get these maps by means of polynomials: 03EMBSYST Ed F. Deprettere

  44. i=1:1:N j=i:1:N Linearization (2) For the given domain {(i,j) | 1 ≤ i ≤ N ^ i ≤ j ≤ N}, and the given lexicographic order: for i = 1 : 1 : N, for j = i : 1 : N, there exists a (pseudo) polynomial E(i,j) such that, if (i’,j’ ) is the lexicographic k-th vector, then E(i’,j’ ) = k. Pseudo polynomial to be defined on next slide. Because the polynomial E(i,j) represents a ranking of vectors, we call it the ranking polynomial. Underlying theory is polynomial counting of integral points in polytopes. 03EMBSYST Ed F. Deprettere

  45. 0 1 2 3 4 p = 4 p=5 d If P (p) is a parameteriz ed polytope in Q then the number of Ç d points in P (p) Z is called the enumerator of P (p). Example: Polynomial counting It is a polynomial or a pseudo-polynomial and called Ehrhart polynomial E(p). for p = 2q: E(p) = p/2+1; for p = 2q + 1: E(p) = p/2 + 3/2 The function c(p) from Z to Q : c(p) = c (p mod l) is called a periodic coefficient with period l. The l possible values are made explicit by representing c(p) as an indexed l-array: [ c0, c1, …, cl-1] p → if (p mod l) = k, then ck E(p) = ½*p + [1 3/2] pis a pseudo polynomial ( l =2) 03EMBSYST Ed F. Deprettere

  46. ax≥b v Theorem The number of integer point in a parameterized polytope is given as a pseudo-polynomial iff the polytope is an affine-vertex polytope. P(p) with vertex set {vi(p)} is an affine-vertex polytope when Vi(p) = Mip + mi With Mi a rational matrix and mi a rational vector, and all vi (p) valid for the whole parameter range. If a polytope is not an affine-vertex polytope, then it has to be partitioned into a number of affine-vertex polytopes and a pseudo-polynomial can be derived for each of its affine-vertex polytopes. 03EMBSYST Ed F. Deprettere

  47. Let be an affine-vertex polytope. P(p) = {x є | Ax ≥ Bp + d} Theorem (2) The enumerator E(p) of P(p) is a pseudo-polynomial of degree d and pseudo-period equal to the denominator of P(p). The dimension of the pseudo-coefficients is equal to the dimension of p. The denominator of P(p) is the least common multiple of the denominators of its vertices. The denominator of a vertex V(p) is the least common multiple of the denominators of its co-ordinates. 03EMBSYST Ed F. Deprettere

  48. x2 (q,1/2q) (q+1/2p, 1/2q) (0,0) (1/2p,0) x1 Each Polynomial counting (2) P(p,q) = {(x1, x2)| 0≤ x2 ≤ 1/2q ^ 2x2 ≤ x1 ≤ 2x2 + 1/2p}, p,q ≥ 0 24 unknowns: set up set of 24 equations with 24 particular values of E(p,q) for particular values of p and q. For example E(p + Δp, q + Δq) with (p,q) = (0,0), (2,0), (4,0), (0,2), (0,4), and (2,2), and Δp,Δqє{0,1}. 03EMBSYST Ed F. Deprettere

  49. 2 P(p) = {(x1, x2) єQ | 0 ≤ x2 ≤ 4 ^ x2 ≤ x1 ≤ x2 + 9 ^ x1 ≤ p ^ p ≤ 40} x2 Four polynomials: 0≤p ≤4 4≤p ≤9 9≤p ≤13 13≤p ≤40 v7 v8 4 v5 v6 v4 9 13 x1 v3 v1 v2 x1≤ p Four affine-vertex polytopes: 0 ≤ p ≤ 4 {v1, v2, v6} = {(0,0), (p,0), (p,p)} 4 ≤ p ≤ 9 {v1, v2, v7, v8} = {(0,0), (p,0), (4,4), (p,4)} 9 ≤ p ≤ 13 {v1, v3, v4, v7, v8} = {(0,0), (9,0), (p,p-9), (4,4), (p,4)} 13 ≤ p ≤ 40 {v1, v3, v5, v7} = {(0,0), (9,0), (13,4), (4,4)} General polytope 03EMBSYST Ed F. Deprettere

  50. NP NC j1 i1 1 2 3 4 5 N=6 1 2 3 4 5 N=6 i2 j2 Producer-consumer pair Schedule: Schedule: for j2 = 1 : 1 : N for i1 = 1 : 1 : N for j1 = j2 : 1 : N for i2 = 1 : 1 : i1 X1 channel Np Nc write read port port Ranking polynomials Ranking polynomial is polynomial counting lexicographic ordered points (j2,j1) resp. (i1,i2) Example: (j2,j1) = (3,4) → 13 (i1,i2) = (4,3) → 9 03EMBSYST Ed F. Deprettere

More Related