1 / 51

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 1:30 p.m. – 4:00 p.m. http://www.liacs.nl/~cserc/EMBSYST/EMBSYST2007/. Modeling and Specification.

dimaia
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 1:30 p.m. – 4:00 p.m. http://www.liacs.nl/~cserc/EMBSYST/EMBSYST2007/

  2. Modeling and Specification • Model: to ask such questions as what shall it do? • (reasoning about) • Specification: to tell what it should do. • (for simulation, implementation) • Model based Specification: specification is at an • abstract level. • - design space exploration/performance analysis • on this level of abstraction • - come to implementation (synthesis) from this level • of abstraction 02EMBSYST Ed F. Deprettere

  3. Modeling applications and architectures We conceive a system model as comprising three major parts: • application model (functional behavior) • architecture model (non-functional behavior) • application-to-architecture mapping transformations 1. and 2. rely on models of computation (MoC) 3. relies on equivalence preserving transformations (Compiler) If architecture is parallel, then application specification should also be specified in a parallel language (textual or graphical). 02EMBSYST Ed F. Deprettere

  4. Separation of Concerns architecture model application model functional behavior timing behavior mapping performance analysis 02EMBSYST Ed F. Deprettere

  5. Models of Computation (MoC) • Distinguish between: • Specification level: no notion of specific way of execution • and/or implementation • - State transition models (Finite State Machines, Petri Nets, ..) • - Dataflow models (Process Networks, Dataflow graphs) • - Discrete Event models (HDL simulators) • Performance level: basis for evaluation and comparison of • methods for execution/design (reasoning about and predict) • Programming level: precise high-level description of correct • and efficient methods (Imperative programming, Declarative • programming) 02EMBSYST Ed F. Deprettere

  6. Models of Computation (2) Applications We model them using transformational models: compute results with input data available right from the start without any timing constraints. Results are available when and where needed (functional behavior) Architecture models require explicit inclusion of time (timeliness) (behavior in response to changes in input; time-triggered, event-triggered). Models are usually a mixture of state-based models (control dominated) and dataflow models (data-oriented models) 02EMBSYST Ed F. Deprettere

  7. MicroProcessor SPECint Compiler(GCC) S Pentium/Arm MIPS/Alpha Performance Numbers Models of Computation (3) An example of a model of computation is the sequential Imperative Language (C, C++, Java) that goes with the Instruction Set Architecture. Imperative language specification of an application and ISA (shared memory) are a perfect match. What about parallel (multi-processor) architectures ? Mapping sequential programs into parallel architectures is (almost) impossible because there is a miss-match: Sequential programs hide concurrency. 02EMBSYST Ed F. Deprettere

  8. while(1){ Execute(F1) Write (Channel) } while(1){ Read (Channel) Execute(F2) } Models of Computation (4) MoC adheres to the separation of concernsprinciple by separating computation from communication. MoC focuses on communication. • Computation is specified in a host language (C, C++, Java). • Communication is specified in a co-ordination language communication computation computation 02EMBSYST Ed F. Deprettere

  9. Models of Computation (5) There are many MoCs but we shall focus on dataflow MoCs. Dataflow MoCs are wellsuited to model streaming data applications (signal processing, multimedia, etc) While(1) That is, input data is an unbounded stream of events, or tokens. Example: video (8x8 pixel blocks in frame, for all frames) 02EMBSYST Ed F. Deprettere

  10. New state Initial state fired enabled Dataflow Graphs A dataflow graph is a directed graph with nodes, called actors, representing functional computation, andedges, called arcs interconnecting nodes and representing communication between nodes. Arcs are bounded FIFO queues that convey tokens representing values. Initial tokens on arcs are permitted. Actors are functional : they implement a (mathematical) function. Operations with state can still be represented as functional actors with self-loop and initial token(s). Tokens on arcs represent arguments or results of functions. All arguments are available All results are available 02EMBSYST Ed F. Deprettere

  11. 1 2 up up down down 2 1 enabled fired enabled fired Dataflow Graphs (2) Dataflow graphs have well-defined firing rules: all function arguments (tokens) must be available from input arcs, and output arc buffers must have room for results. Only then can the actor fire. Actors producing and consuming a constant number of tokens are called static actors, and dataflow graphs containing only static actors are called static dataflow graphs.In a homogeneous dataflow graph actors are single-token-in, single-token-out. The canonical non-homogeneous static dataflow actors are up sample and down sample. 02EMBSYST Ed F. Deprettere

  12. Static dataflow Graphs: analysis Assume, we are interested in performing computations on an endless data sequence. Therefore, we must be able to obtain a periodic schedulefor the SDF graph, which can then be run as an infinite loopusing a finite amount of physical memory. Unbounded buffers imply a sample rate inconsistency(unbalanced production and consumption of tokens), and deadlock implies that all the actors in the graph cannot be iterated indefinitely. Although SDF graphs are restricted, the main advantage is precisely that it can be determined whether or not an arbitrary SDF graph has a periodic schedule that neither deadlocks nor requires unbounded buffer sizes. Buffer sizes can be determined at compile time, so they can be allocated statically, and correctly constructed SDF graphs entail no run-time overhead. 02EMBSYST Ed F. Deprettere

  13. 1 2 1 1 [1] 2 2 [3] [2] 3 1 1 SDF Graph analysis (2) Thus, the standard problem in dataflow graph theory is whether there exists a periodic schedule with bounded FIFOs to execute in a non-terminating fashion (as infinite loops). This problem has a complete solution for static dataflow graphs. • three actors • three arcs • actor 1 produces one token on arc [1] • and two tokens on arc [2] • actor 3 consumes one token from arc • [2] and one token from arc [3]. FIFO buffers are not shown 02EMBSYST Ed F. Deprettere

  14. 1 2 [1] Topology matrix 1 1 1 -1 0 2 2 [3] = i 2 0 -1 [2] 3 0 2 -1 1 1 j SDF graph analysis (3) • one column per actor • one row per arc Actor j produces (i,j )≥0tokens on edge [i] or consumes (i,j ) ≤0 tokens from edge [i] This is independentof initial token distribution (topology!) 02EMBSYST Ed F. Deprettere

  15. 1 2 [1] 1 1 2 2 [3] [2] 3 1 1 1 1 2 1 -1 0 =0 = 2 0 -1 0 2 -1 SDF graph analysis (4) Properties: P1. A connected SDF graph with s actors and consistent sampling rates has rank () = s-1 (number of independent columns). That is,  has a 1D null space. P2. There, then, exists a smallest integervector q such that q =0, where q is coprime. q = 0 is called the balance equationand q is called the repetitions vector. P3. If each j is invoked qj times, then the number of tokens on each edge remains unchanged (return to initial state). Actors 1 and 2 fire once Actor 3 fires twice 02EMBSYST Ed F. Deprettere

  16. 2 2 1 1 2 3 2 [4] [4] 2 [1] [1] [3] [3] 1 1 1 1 1 1 1 2 3 2 3 [2] [2] 1 1 1 1 2 -1 0 0 1 -1 2 0 -1 2 0 -1 3 -1 0 0 1 -1 2 0 -1 2 0 -1 Г1 Γ = Γ= Example {1,2,3,2,3} {1,2,2,3,3} Γq = 0 has no solution because upper 3 x 3 matrix Γ1 is non-singular → Γ1q cannot be 0 Γ q = 0 has solution (1,2,2), Γ1 is singular and last column is equal to last but one. 02EMBSYST Ed F. Deprettere

  17. 1 2 [1] 1 1 2 2 [3] [2] 3 1 1 1. Represent selection of actor 1 at ‘time’ n by vector v(n) = (1,0,0) 2. Change in size of queues caused by invoking actor is given by b(n) = b(n-1) + v(n) b(0) contains number of initial tokens on each arc 3. Actor U is runnable if it has not been invoked qU times and running it will not cause a buffer size to become negative Notice from buffer size equation that If no deadlock, then at some timem b(m) = b(0) + q = b(0) SDF graph analysis (4) A periodic sequential schedulerepeats invocations {1,2,3,3} Runnable actor: 02EMBSYST Ed F. Deprettere

  18. Scheduling for single processor is easy (class S algorithm): 1. Solve balance equation for smallest possible q 2. Form arbitrary list L of all actors in the SDF graph 3. For each U in L, schedule U if it is runnable; trying each actor once 4. If each actor U has been scheduled q(U) times, STOP 5. If no U can be scheduled (deadlock), ERROR 6. Else go to 3. SDF graph analysis (5) SDF graph specifications offer concrete advantages for single processor implementations. The ability to interconnect modular blocks of code (nodes) in a natural way could considerably ease the task of programming e.g., signal processing processors. But a single processor implementation cannot take advantage of possible explicit concurrency in an SDF specification. 02EMBSYST Ed F. Deprettere

  19. C A B 20 10 20 10 (1) ABCBCCC (2) A(2 B(2 C)) % (2 B(2 C) represents invocation sequence BCCBCC ) (3) A(2 B)(4 C) (4) A(2 BC)(2 C) (4): code block for A for (i = 0; i < 2; i++) { code block for B; code block for C } for (i = 0; i < 2; i++) { code block for C } From SDF graphs to Code minimum code size and minimum buffer size(NP-complete). Minimum code size. Possible periodic schedules: (2) is a nested loop schedule; (3) and (4) arecascades of loops. Each appearance of an actor in the schedule becomes code block in program. C appears twice in (4): code block must be duplicated No duplication in (2) and (3) : single appearance schedules. 02EMBSYST Ed F. Deprettere

  20. C A B 20 10 20 10 (1) ABCBCCC (2) A(2 B(2 C)) (3) A(2 B)(4 C) (4) A(2 BC)(2 C) From SDF graphs to Code (2) Instead of running the SDF graph on data, we run it to produce its code: read tokens, execute, write tokens. The result depends on the schedule. Single appearance schedule yields optimally compact inline implementation of an SDF graph with regard to code size (neglecting loop-control overhead). The single processor implementation really uses communication buffers (possibly implemented in RAM memory) instead of arrays. Buffer size requirements depends on schedule: for 4 schedules: 50, 40, 60, and 50. 02EMBSYST Ed F. Deprettere

  21. 2 A B 2 3 port 1 q = {3, 2} port 3 A1 port 1 B1 port 2 port 2 A3 port 3 B2 A2 Converting SDF to HSDF Each Ai produces 2 tokens Each Bj consumes 3 tokens B must start with consuming the initial tokens (FIFO queue), and at end of period no net change in initial tokens. Algorithm: see text. 02EMBSYST Ed F. Deprettere

  22. 2 A B A0 B0 A1 B1 A2 B2 Unfolding HDF graphs Unfolding factor N = 3: Again, B must start with first initial token, then second one. At the end of the cycle, initial tokens must be restored. (precedence constraints must be preserved). Algorithm: see text 02EMBSYST Ed F. Deprettere

  23. 2 11 remove initial tokens 11 2 12 12 3 3 HSDF graph Precedence Graph Precedence Graph of HSDF Actors in SDF are in general invoked more than once, so removing initial tokens of an SDF does not lead to a precedence graph Periodic schedule (all actors invoked once) returns to initial state (initial tokens) Precedence graph reveals intra iteration dependencies. All operations in precedence graph must execute before end of execution period. Thus, initial tokens are inter iteration dependencies. 02EMBSYST Ed F. Deprettere

  24. Parallel implementation of SDF Scheduling for Parallel Processors is more involved (and interesting) A blocked periodic parallelschedule is a set of lists {i , i = 1, .., M}, M number of processors and i specifying a periodic schedule for each processor. Now a cycle of a schedule invokes each actor the number of times given in p = Jq, J being the blocking factor (unfolding factor). J > 1 may speed up the iteration period (run-time for one cycle of the schedule divided by J), because unfolding reveals hidden concurrency. The first step is to construct a graph describing the precedences in p=Jq invocations of each node (precedence graph of J-unfolded SDF graph). The second step is to find a parallel schedule {i , i = 1, .., M}, from the acyclic precedence graph. 02EMBSYST Ed F. Deprettere

  25. -1 0 2 1 -2 0 0 1 -1 2 1 1 = 0 2 1 2 1 3 11 1 1 12 2 1 2 3 SDF Graph 11 2 11 12 2 Processor 1 Processor 2 3 12 3 time Precedence Graph Periodic schedule (1 period) Example Case J=1 - Convert SDF graph to equivalent HDF graph (see text); • Unfold HDF graph (see text) with factor J (here 1); • repetitions vector is p = q - Remove initial tokens to get precedence graph: period is 4 Idle time q(1)=2 → 11 and 12 Execution times: actor 1: 1 u.t., actor 2: 2 u.t., actor 3: 3 u.t. 02EMBSYST Ed F. Deprettere

  26. - Convert SDF graph to equivalent HDF graph (see text) • Unfold HDF graph (see text) with factor J (here 2); • repetitions vector is p = Jq - Remove initial tokens to get precedence graph: 11 21 32 1 = { 1,1,2,3} 12 2 = {3,1,1,2} 22 13 14 11 12 21 32 31 31 13 14 22 The periodic schedule (1 period) Precedence graph for J =2 p(1) = 4→ 11- 14 Example (2) Run-time of nodes is 1 u.t, 2 u.t, and 3 u.t, respectively period is 7, average period is 7/2 = 3.5 < 4 No idle time 02EMBSYST Ed F. Deprettere

  27. 11 2 12 2 3 2 A B Valid schedules The existence of a repetitions vector (periodic schedule) is not sufficient for a schedule to be valid. It must also be admissible: It must satisfy precedence constraints: Consider an edge (A,B) in a HSDF graph, then: start(B,k) ≥ end(A,k – delay(A,B)), all actor execution times k≥ delay(A,B) Here, delay(A,B) = 2 B can execute at k=0 and k = 1, but not at k=2, except when A has finished it’s 0th execution. 02EMBSYST Ed F. Deprettere

  28. B A D C P1 P2 M Scheduling consist of three operations: • assigning actors to processors (A and C to P1) • ordering of execution of actors on each processor (A then C) • determining exact starting time of each actor (A at t1, B at t2) Scheduling taxonomy: assignment ordering tasks timing Fully static compile time compile time compile time Self-timed compile time compile time run time Static allocation compile time run time run time Dynamic run time run time run time Scheduling Dataflow graphs are globally scheduled. 02EMBSYST Ed F. Deprettere

  29. Scheduling (2) Static schedule is only possible if actor execution times are known. Other schedules are derived from static schedule using good estimates of actor execution times. Then parts of the static schedule are neglected. • ordered transaction : similar to self-timed except that the • order of inter-processor communication is now also retained from • the static schedule. In general: Fully static period > Ordered transaction period > self timed period. When inter-processor communication cost (in particular arbitration) is taken into account, OT may outperform ST on the average. 02EMBSYST Ed F. Deprettere

  30. u v 2 3 • linear buffer • schedule 3u2v simultaneous live tokens is 6, hence min. buffer size is 6 Example 2. • linear buffer • schedule u(2uv) simultaneous live tokens is 4, hence min. buffer size is 4 Memory management The channel FIFOs can be implemented as FIFOs or as segments in a RAM. How big should they be? Depends on maximum of simultaneous live tokens, schedule and type of memory. Example 1. 02EMBSYST Ed F. Deprettere

  31. (schedule u(2 uv) ) u v 2 3  u1 w,r w r u3 r rr       Live token(produced, not consumed) u2 r w w r v2     w, r writeand read pointers v1 w,r w,r Memory management (2) Modulo addressing. Static buffer :for arc() token produced (consumed) resides at fixed location for all schedule periods. Not really static (although reset of w,r is possible) 02EMBSYST Ed F. Deprettere

  32. (schedule u(2 uv) ) u v 2 3 write and read pointers start here at every iteration Memory management (2) Real static: If u (v) is invoked q (p) times, producing (consuming) i (j) tokens on circular buffer of length N not less than # simultaneously alive tokens (4 in example u(2uv)), then static buffering occurs iff iq = KN and jp = LN for some integers K and L Because the total number of advances of write pointer (w) from address 1 should be an integer multiple of N if it has to return to address 1. Thus N = iq/K is integer and → K=1 and N = 6 ≥ 4 in example. Moreover, iq = jp (sample rate consistency), hence L = K 02EMBSYST Ed F. Deprettere

  33. v1 r w w,r u1 u3 r w w r v2 u2 r w w, r u v Also for 2 3 Memory management (3) If there is no solution, then increase blocking factor (i.e., unfold to increase q). 02EMBSYST Ed F. Deprettere

  34. C A B 20 10 20 10 Buffer size requirements depends on schedule: for 4 schedules: 50, 40, 60, and 50. (1) ABCBCCC (2) A(2 B(2 C)) (3) A(2 B)(4 C) (4) A(2 BC)(2 C) Other example. Take (2): qB = 2 → 20 x 2 = N/K and N ≥ 20 → K = 2 and N = 20. Take (1): qB = 2 → 20 x 2 = N/K and N ≥ 30 → K = 1 and N = 40. 02EMBSYST Ed F. Deprettere

  35. B C A D Proc 1 Proc 2 C B D A Proc 1 Proc 2 C A D B C A D B Precedence graph Iteration period T = 3 B C blocked schedule Proc 1 Proc 2 C B D A D C B C A D A A D Iteration period T =2 overlapped schedule Proc 1 Proc 2 C A D B More about schedules Recall: fully static (FS): static assignment, actor ordering, execution times self-timed (ST) : static assignment, actor ordering ordered transaction (OT): as ST + ordering of inter-processor communication static. Example of FS Problem is to minimize period (also called makespan) 02EMBSYST Ed F. Deprettere

  36. acyclic precedence graph B C B C send/receive send/receive A D A D Proc 1 Proc 2 C B D A Self-timed implementation (schematic) Proc 1 Proc 2 start rec D A send start C rec B send Buffers: block on full/empty Proc 1 Proc 2 D A C B Fully-static blocked schedule Overlapped schedule More about schedules (2) Example of ST 02EMBSYST Ed F. Deprettere

  37. Proc 1 A Proc 4 H E D A, B, F : 3 C, H : 5 D, E, G : 6, 4, 2 execution times Proc 5 Proc 3 B C F Proc 2 G Proc1 Proc2 Proc3 Proc4 Proc5 1 1 E A 6 B F G C 3 4 D 2 5 H Transaction order: (s1,r1,s2,r2,s3,r3,s4,r4,s5,r5,s6,r6) More about schedules (3) Fully-static: iteration period TFS is 11 Self-timed: average iteration period TST is 9 Ordered transaction: iteration period TOT is 10 Self-timed: starts with given transaction order, then alternates between (s3,r3,s1,r1,s2,r2,s4,r4,s6,r6,s5,r5) and (s1,r1,s3,r3,s4,r4,s2,r2,s5,r5,s6,r6) TFS ≥ TOT ≥ TST (only if inter-processor communication cost is not considered. Otherwise TOT can outperform TST) 02EMBSYST Ed F. Deprettere

  38. Under the transaction order specified by the modified FS schedule, TST ≤ TOT ≤ TST : More about schedules (4) For given processor assignment and actor ordering, it is possible to modify the FS schedule by skewing the relative starting times of processors so that the resulting schedule has period less than TST + 1. Average period is within one unit of unconstrained self-timed strategy 02EMBSYST Ed F. Deprettere

  39. Proc 1 A Proc 4 H E D A, B, F : 3 C, H : 5 D, E, G : 6, 4, 2 execution times Proc 5 Proc 3 B C F Proc 2 G Proc 1 Proc 2 Proc 3 Proc 4 Proc 5 E E E A A A B B B F F F G G G C C C D D D H H H 9 More about schedules (5) TOT = 9 instead of 10 Transaction order O = (s1, r1, s3, r3, d2, r2, s4, r4, s6, r6, s5, r5) 02EMBSYST Ed F. Deprettere

  40. More about schedules (6) Self-timed scheduling strategy is robust with respect to changes in execution times of actors, because send/receive execution is performed at run-time. However, ST implies higher inter-processor communication costs compared To FS because of need of synchronization. In addition, ST faces arbitration costs: FS guarantees mutually exclusive access to shared communication resources, whereas shared resources need to be arbitrated at run-time in ST. The ordered transaction scheduling strategy alleviates some of these costs. Of course: all depends on the specific characteristics of the architecture 02EMBSYST Ed F. Deprettere

  41. schedule information local memory Local memory ISA ISA transaction controller bus grant lines shared bus bus release ISA ISA shared memory Fifo buffer local memory local memory (also possible without FIFO buffers. Then all transactions via shared memory) An architecture example 02EMBSYST Ed F. Deprettere

  42. [1, 0] [1,1] 2 F 1 3 [ 1, 0 ] = first 1 token, then no token, then 1 token, then no token… [0, 1] Behavior of F: F(z0, z1, z2, z3) → z0 is phase → if z0 =1, then [z2, ] = f(z1), if z0 =2, then [ ,z3] = f(z1). bottom no argument Cyclo-static dataflow (CSDF) A more general static case is the cyclo-static dataflow graph. The number of tokens produced and consumed by its actors need not be constant at each firing, but must vary in a cyclic manner. [ a, b] is called phase signature with two phases. (First a tokens, then b tokens). Phase signature lengths must be equal at all inputs and outputs of an actor. They repeat in a cyclic manner. 02EMBSYST Ed F. Deprettere

  43. [1, 0] [1, 0] [1,1] [1 1] 2 2 F F 3 1 1 3 [0, 1] [0, 1] Behavior of F: F(z0, z1, z2, z3) → z0 is phase → if z0 =1, then [z2, ] = f(z1), if z0 =2, then [ ,z3] = f(z1). bottom no argument Cyclo-static dataflow (2) Remember that actors have to be functional. If there is state, then this state has to be made explicit by means of a self-loop: The feedback token contains the information as to whether z0 is zero or one. 02EMBSYST Ed F. Deprettere

  44. 1 1 [1,1,1] 1 [1,1,0] 5 1 [1,0,0] F 2 3 6 4 1 [1,1,1] [1,0,1] 1 [1,0,0] 1 F(z0, z1, z2, z3, z4, z5, z6){ if (z0 = 1) { z5 = max(z1, z2); z6 = min(z2, z4);} else if (z0 = 2) { z5 = max(z1, z3);} else if (z0 =3) { z6 = min(z1, z3);} } CSDF Example 02EMBSYST Ed F. Deprettere

  45. Conditional and Dynamic Data Flow Static and Cyclo-static dataflow graphs are powerful models for non-dynamic applications: They allow analysis at compile time. Current practice is mainly SDF. CSDF is not as well researched as SDF. Converting CSDF to HSDF is even more explosive than converting SDF to HSDF. All other dataflow graphs are called dynamic. • token consumption and production may depend on control inputs • → Conditional Boolean data flow with canonical actors distributor and • selector (switch and select ) • actor behavior may depend on arrivals of tokens at input arcs • → Dynamic data flow with canonical actor non-determinate merge • (first-come-first-serve) 02EMBSYST Ed F. Deprettere

  46. T F T F enabled fired true select T F T F enabled fired false switch Boolean dataflow (BDF) Analysis (in terms of Γq =0) is not always possible. Some entries of Γ are not constants but probabilities. 02EMBSYST Ed F. Deprettere

  47. p2 p1 1-p1 1-p2 3 T F T F 6 1 4 B BDF example. { token = F1(); { if (B) token = F3(token); else token = F4(token); } () = F6(token); } pi is probability Here p1 = p2 (common Boolean control) And Γq = 0 has a solution. The functions Fj are modeled by means of actors, and the if-else conditional statement is modeled as a switch-select pair controlled by the same Boolean. 02EMBSYST Ed F. Deprettere

  48. process P3 P2 P1 P4 Unbounded FIFO Kahn Process Networks A Model of Computation whose nodes are functional in the sense that they map input sequences to output sequences (instead of input tokens to output tokens) is the Kahn Process Network (KPN). KPN is a graph consisting of nodes representing sequentialprocessesand arcs representing point-to-point communication channels bearing unbounded FIFO buffers. There is no global schedule and no global memory. A process can always write tokens to channels; it can only read from a channel when it contains tokens, otherwise it must block (blocking read synchronization). Testing an input for the presence of tokens is not allowed (so no indeterminate merging). KPNs are deterministic. 02EMBSYST Ed F. Deprettere

  49. KPN: an example C2 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. 02EMBSYST Ed F. Deprettere

  50. Kahn Process Networks (2) KPNs are deterministic : for given input streams, output is independent of schedule. For static applications KPNs are closely related to CSDF graphs, but are more compact representations. In the remainder of the course I will focus on KPNs that can be automatically obtained from certain sequential programs as input-output equivalent concurrent specifications. Whereas (static) dataflow graphs are mainly used to specify (static) applications in a non-sequential way for further – mostly – sequential implementations, we will obtain (static) KPNs from sequential specifications as input-output equivalent concurrent specifications for further parallel implementations. 02EMBSYST Ed F. Deprettere

More Related