1 / 86

(BOCA)

Embedded Computer Architecture 2. (BOCA). Bijzondere Onderwerpen Computer Architectuur Block A Introduction. The aims of the course. Show the relation between the algorithm and the architecture. Derive the architecture from the algorithm. Explaining and formalizing the design process.

leona
Download Presentation

(BOCA)

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 Computer Architecture 2 (BOCA) Bijzondere Onderwerpen Computer Architectuur Block A Introduction

  2. The aims of the course • Show the relation between the algorithm and the architecture. • Derive the architecture from the algorithm. • Explaining and formalizing the design process. • Explain the distinction between structure and behavior. • Explain some architectures.

  3. The design process A design description may express: • Behavior: Expresses the relation between the input and the output value-streams of the system • Structure: Describes how the system is decomposed into subsystems and how these subsystems are connected • Geometry: Describes where the different parts are located. Pure behavioral, structural or geometrical descriptions do not exist in practice.

  4. Abstraction levels Behavior Geometry Structure Application Algorithm Basic operator Boolean logic Physical level Board level Layout Cell Block level Processing element Basic block Transistor

  5. The Design Process verification: The implementation i is the specification for the implementation i+1 Idea by simulation only Spec 0 by simulation formal verification Spec 1 For practical reasons a specification must be executable by simulation formal verification Spec N

  6. Descriptions • Predicate logic • Algebra (language Z, SDL (VDM) ) • Process algebras CCS, CSP, Lotos • VHDL, Verilog • Silage, ......

  7. Specification overloading Specification overloading means that the specification gives a possibly unwanted implementation suggestion, i.e. the behavioral specification expresses structure In practice: A behavioral specification always contains structure.

  8. 2 x + z a b 2 x + z a x b Example: same function same behavior, different expressions different structure different designs suggests: and suggests:

  9. Architecture Definition: Architecture is the way in which hardware and software is structured; the structure is usually based on grandiose design philosophies. Architecture deals with fundamental elements that affect the way a system operates and thus its capabilities and its limitations. The New American Computer Dictionary

  10. Our focus • Array processors. • Systolic arrays. • Wave-front array processors. • Architectures for embedded algorithms s.a. digital signal processing algorithms.

  11. PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE Array processor An array processor is a structure in which identical processing elements are arranged regularly 1 dimension 2 dimensions

  12. PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE Array processor 3 dimensions

  13. PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE Systolic array In a systolic array processor all communication path contain at least one unit delay (register). is register or delay Delay constraints are local. Therefore unlimited extension without changing the cells

  14. PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE PE Wave-front array

  15. Array Processors • Can be approached from: • Application • Algorithm • Architecture • Technology • We will focus on • Algorithm Architecture • Derive the architecture from the algorithm

  16. Array processors: Application areas • Speech processing • Image processing (video, medical ,.....) • Radar • Weather • Medical signal processing • Geology • . . . . . . . . . . . Many simple calculations on a lot of data in a short time General purpose processors do not provide sufficient processing power

  17. Example video processing • 1000 operations per pixel (is not that much) • 1024 x 1024 pixels per frame (high density TV) • 50 frames per second (100 Hz TV) • 50 G operations per second • < 1 Watt available • Pentium 2Ghz: 2G operations per second • > 30 Watt • required 25 Pentiums 750 Watt

  18. Description of the algorithms • In practice the algorithms are described (specified) in: • some programming language. • In our (toy) examples we use: • programming languages • algebraic descriptions

  19. Examples of algorithms we will use: Filter: Matrix algebra: Transformations like Fourier transform Z transform Sorting . . . .

  20. Graphs • Graphs are applicable for describing • behavior • structure • Dependency graphs • consist of: • nodes expressing operations or functions • edges expressing data dependencies or • the flow of data • So, graphs are suitable to describe the design flow from • Algorithm to architecture

  21. Design flow example: Sorting idea program (imperative) single assignment code (functional) recurrent relations dependency graph

  22. 8 Sorting: the idea > empty place needed 10 9 8 5 3 2 1 12 > 8 8 5 2 1 3 10 9 12 shifted one position

  23. 8 8 9 3 3 1 8 9 6 1 3 3 8 9 9 9 6 8 6 3 3 1 8 9 9 8 3 6 3 1 8 9 mj-1 mj-1 mj-1 mj-1 mj mj mj mj mj+1 mj+1 mj+1 mj+1 y x y y := mj x x y mj:= x x y x:= y

  24. Sorting: inserting one element if (x>= m[j]) { y = m[j]; m[j] = x; x = y; } if (x>= m[j]) swap(m[j],x); Identical descriptions of swapping m[j],x = MaxMin(m[j],x); Inserting an element into a sorted array of i elements such that the order is preserved: m[i] = -infinite for(j = 0; j < i+1; j++) { m[j],x = MaxMin(m[j],x); }

  25. Sorting: The program Sorting N elements in an array is composed from N times inserting an element into a sorted array of N elements such that the order is preserved. An empty array is ordered. int in[0:N-1], x[0:N-1], m[0:N-1]; for(int i = 0; i < N; i++) { x[i] = in[i]; m[i] = - infinite; } input body for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[j],x[i] = MaxMin(m[j],x[i]);} } output for(int j = 0; j < N; j++) { out[j] = m[j];}

  26. Sorting: Towards ‘Single assignment’ • Single assignment: • Each scalar variable is assigned only once • Why? • Goal is a data dependency graph • - nodes expressing operations or functions • - edges expressing data dependencies or • the flow of data

  27. Sorting: Towards ‘Single assignment’ Single assignment: Each scalar variable is assigned only once Why? Code Nodes Graph x=a+b; x=c*d; a x + b How do you connect these? c x * d

  28. Sorting: Towards ‘Single assignment’ Single assignment: Each scalar variable is assigned only once Why? Code x=a+b; x=c*d; Description already optimized towards implementation: memory optimization. But, fundamentally you produce two different values, e.g. x1 an x2

  29. hence, for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i] = MaxMin(m[i-1,j],x[i]);} } Sorting: Towards ‘Single assignment’ Single assignment: Each scalar variable is assigned only once Start with m[j]: m[j] at loop index i depends on the value at loop index i-1 for(int i = 0; i < N; i++) { for(j = 0; j < i+1; i++) { m[j],x[i] = MaxMin(m[j],x[i]);} }

  30. hence, for(int i = 0; i < N; i++) { for(j = 0; j < i+1; i++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} } Sorting: Towards ‘Single assignment’ x[i] at loop index j depends on the value at loop index j-1 for(int i = 0; i < N; i++) { for(j = 0; j < i+1; i++) { m[i,j],x[i] = MaxMin(m[i-1,j],x[i]);} }

  31. Sorting: The algorithm in ‘single assignment’ input int in[0:N-1], x[0:N-1,-1:N-1], m[-1:N-1,0:N-1]; for(int i = 0; i < N; i++) { x[i,-1] = in[i]; m[i-1,i] = - infinite; } body for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} } output for(int j = 0; j < N; j++) { out[j] = m[N-1,j];} All scalar variables are assigned only once. The algorithm satisfies the single assignment property

  32. Sorting: The algorithm in ‘single assignment’ 0 n-1 n-1 -1 -1 0 m i = 1 j = 0 n-1 n-1 in x out int in[0:N-1], x[0:N-1,-1:N-1], m[-1:N-1,0:N-1]; for(int i = 0; i < N; i++) { x[i,-1] = in[i]; m[i-1,i] = - infinite; } MaxMin for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} }

  33. Sorting: The algorithm in ‘single assignment’ 0 n-1 n-1 -1 -1 0 MM m i n-1 n-1 j for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} }

  34. Sorting: The algorithm in ‘single assignment’ 0 n-1 n-1 -1 -1 0 m MM i n-1 n-1 j for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} }

  35. Sorting: The algorithm in ‘single assignment’ 0 n-1 n-1 -1 -1 0 m i n-1 n-1 j for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} }

  36. Sorting: The algorithm in ‘single assignment’ 0 n-1 n-1 -1 -1 0 m MM i n-1 n-1 j for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} }

  37. Sorting: The algorithm in ‘single assignment’ 0 n-1 n-1 -1 -1 0 m i n-1 n-1 j for(int i = 0; i < N; i++) { for(j = 0; j < i+1; j++) { m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]);} }

  38. Sorting: Recurrent relation A description in single assignment can be directly translated into a recurrent relation in[0:N-1], out[0:N-1], x[0:N-1, -1:N-1], m[-1:N-1, 0:N-1]; declaration x[i,-1] = in[i] m[i-1,i] = - infinite input m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]) body out[j] = m[N-1,j] output 0 <= i < N; 0 <= j < i+1 } area Notice that the order of these relations is arbitrary

  39. j m[i-1,j] x[i,j-1] x[i,j] MaxMin m[i,j] i Sorting: Body in two dimensions m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-1]) body The body is executed for all i and j. Hence two dimensions

  40. j m[i-1,j] 1 x[i,j] 0 x[i,j-1] i  1 0 m[i,j] Sorting: Body implementation body m[i,j],x[i,j] = MaxMin(m[i-1,j],x[i,j-i]) if( m[i-1,j] <= x[i,j-1]) { m[i,j] = x[i,j-1]; x[i,j] = m[i-1,j]; } else { m[i,j] = m[i-1,j]; x[i,j] = x[i,j-1]); }

  41. j m[2,3]= m[1,2]= m[0,1]= m[-1,0]= i Sorting: Implementation N = 4 -1 0 1 2 3 -1 PE = MaxMin x[0,-1] PE 0 PE PE x[1,-1] 1 PE PE PE x[2,-1] 2 PE PE PE PE x[3,-1] 3 m[3,0] m[3,1] m[3,2] m[3,3]

  42. Sorting: Example N = 4 3 1 5 2 5 3 2 1

  43. Tuple : Cartesian product: set of all tuples The number of tuples in the set If Q is a set and P is a subset of Q, then the set of all subsets of Q is The number of subsets of Q is Hence, the set of all subsets of and the number of subsets of Something on functions

  44. Function F is the set of all functions with domain X and co-domain Y F is a function in if and only if Something on functions Each element of the domain of X is mapped by F on a single element of the codomain Y Hence and F can be represented as a set of tuples Hence,

  45. Functions, Arrays, Tuples, Sequences, .... Arrays, tuples and sequences are all representations of the same set of functions in which Dl,uis a closed subset of the set of integers Z and V is some value co-domain So corresponds to Hence, yi, y(i) and y[i] are syntactically different notations for the function value in i.

  46. Functions on more than one variableCurrying A function on two variables can be represented in three different ways:

  47. Functions on more than one variableCurrying

  48. Functions on more than one variableCurrying (Example)

  49. x y F z z time time Linear Time Invariant Systems x and y are streams. Time is represented by the set of integers Z, so F maps functions on functions Obviously, this class of functions also models systems that cannot exist in reality. For example non-causal systems

  50. Adding functions z x and y are streams modeled by functions on Z. time + =

More Related