Chapter 1 part 3 Embedded Computing High Performance
Chapter 1, part 3: Embedded Computing High Performance Embedded Computing Wayne Wolf High Performance Embedded Computing © 2007 Elsevier
Topics n n n n n Why models of computation? Structural models. Finite-state machines. Turing machines. Petri nets. Control flow graphs. Data flow models. Task graphs. Control flow models. © 2006 Elsevier
Models of computation n Models of computation affect programming style. No one model of computation is good for all algorithms. Large systems may require different models of computation for different parts. q Models must communicate compatibly. © 2006 Elsevier
Processor graph L 1 M 2 L 3 M 4 © 2006 Elsevier
Finite state machine n 1/0 State transition graph and table are equivalent: s 1 0/0 1/1 s 2 0/1 1/0 s 3 0/0 © 2006 Elsevier 0 s 1 s 2 0 1 s 1 0 0 s 2 1 1 s 2 s 3 0 0 s 3 0 1 s 3 s 1 1
Finite state machine properties n n Finite state. Nondeterministic variant. © 2006 Elsevier
Nondeterministic FSM n Several transitions out of a state for a given input. q n Equivalent to executing all alternatives in parallel. Can allow e moves--goes to next state without input. a s 1 s 2 a © 2006 Elsevier
Deterministic FSM from nondeterministic FSM n a Add states for the various combinations of nondeterminism. a s 1 s 2 c b s 4 s 3 nondeterministic a s 1 c s 4 © 2006 Elsevier s 12 c b s 3 deterministic
Turing machine n General model of computing: tape 1 0 0 1 1 0 state 1 1 0 head program © 2006 Elsevier 1 0 1
Turing machine step 1. 2. 3. Read current square. Erase current square. Take state-dependent action: 1. 2. 3. Print new value. Move to adjacent cell. Set machine to next state. © 2006 Elsevier
Turing machine properties n Example program: q q n If (state = 2 and cell = 0): print 0, move left, state = 4. If (state = 2 and cell = 1): print 1, move left, state = 3. n n Can be implemented on many physical devices. Turing machine is a general model of computability. Can be extended to probabilistic behavior. © 2006 Elsevier
Turing machine properties n n Infinite tape = infinite state machine. Basic model of computability. q q Lambda calculus is alternative model. Other models of computing can be shown to be equivalent/proper subset of Turing machine. © 2006 Elsevier
Control flow graph x=a n Commonly used to model program structure. i = 0? x=a-b y=c+d © 2006 Elsevier
CDFG properties n n n Finite state model. Single thread of control. Can handle subroutines. © 2006 Elsevier
Petri net n Parallel model of computation. place token transition arc © 2006 Elsevier
Firing rule n A transition is enabled if each place at its inputs have at least one token. q n n A transition doesn’t have to fire right away. Firing a transition removes tokens from inputs and adds a token to each output place. In general, may require multiple tokens to enable. © 2006 Elsevier
Properties of Petri nets n n Turing complete. Arbitrary number of tokens. q q Nondeterministic behavior. Naturally model parallelism. © 2006 Elsevier
Task graph t 2 t 1 P 2 P 3 n P 4 P 5 Used to model multi-rate systems. © 2006 Elsevier
Task graph properties n Not a Turning machine. q q n Possible models of execution time: q q q n No branching behavior. May be extended to provide conditionals. Constant. Min-max bounds. Statistical. Can model late arrivals, early departures by adding dummy processes. © 2006 Elsevier
Data flow graph n Partially-ordered computations: + -, * +, -, * + - -, +, * * © 2006 Elsevier
Data flow streams n n Captures sequence but not time. Totally-ordered set of values. q n New values are appended at the end as they appear. May be infinite. + -44 88 -23 88 7 -23 447944 -28 9 © 2006 Elsevier
Firing rules n n A node may have one or more firing rules. Firing rules determine when tokens are consumed and produced. q Firing consumes a set of tokens at inputs, generates token at output. © 2006 Elsevier
Example firing rules n Basic rule fires when tokens are available at all inputs: n Conditional firing rule depends on control input: a a + c b b T © 2006 Elsevier
Data flow graph properties n n n Finite state model. Basic data flow graph is acyclic. Scheduling provides a total ordering of operations. © 2006 Elsevier
Kahn process network n Process has unbounded FIFO at each input: channel n n process Each channel carries a possibly infinite sequence or stream. A process maps one or more input sequences to one or more output sequences. © 2006 Elsevier
- Slides: 25