Topic B (Cont d) Dataflow Model of Computation

Size: px
Start display at page:

Download "Topic B (Cont d) Dataflow Model of Computation"

Transcription

1 opic B (Cont d) Dataflow Model of Computation Guang R. Gao ACM ellow and IEEE ellow Endowed Distinguished Professor Electrical & Computer Engineering University of Delaware ggao@capsl.udel.edu 09/07/20 CPEG opic-B-Dataflow-Part2

2 Outline Parallel Program Execution Models Dataflow Models of Computation Dataflow Graphs and Properties hree Dataflow Models Static Recursive Program Graph Dynamic Dataflow Architectures and Evolution of Multithreading 09/07/20 CPEG opic-B-Dataflow-Part2 2

3 Dataflow Models Static Dataflow Model Recursive Program Graphs agged oken Dataflow Model Also known as dynamic 09/07/20 CPEG opic-B-Dataflow-Part2 3

4 Static Dataflow Model...for any actor to be enabled, there must be no tokens on any of its output arcs... So-called: at most one-token-per-arc rule 09/07/20 CPEG opic-B-Dataflow-Part2 4

5 Conditional Expression x y if (p(y)){ f(x,y); else{ g(y); p f g IO 09/07/20 CPEG opic-B-Dataflow-Part2 5

6 Example Power unction long power(int x, int n){ int y = ; for(int i = n; i > 0; --i) y = x; return y; y = x n 09/07/20 CPEG opic-B-Dataflow-Part2 6

7 Power unction x n x f y f i f i>0 return y = x n 09/07/20 CPEG opic-B-Dataflow-Part2 7

8 Power unction 2 3 x f y f i f i>0 return y = /07/20 CPEG opic-B-Dataflow-Part2 8

9 Power unction i>0 return y = /07/20 CPEG opic-B-Dataflow-Part2 9

10 Power unction t t t i>0 2 3 t t t return y = /07/20 CPEG opic-B-Dataflow-Part2 0

11 Power unction t t t i>0 2 2 return 3 y = /07/20 CPEG opic-B-Dataflow-Part2

12 Power unction 2 t t i>0 2 2 return y = /07/20 CPEG opic-B-Dataflow-Part2 2

13 Power unction i>0 2 return y = /07/20 CPEG opic-B-Dataflow-Part2 3

14 Power unction t t t i> t t t return y = /07/20 CPEG opic-B-Dataflow-Part2 4

15 Power unction t t t i> return y = /07/20 CPEG opic-B-Dataflow-Part2 5

16 Power unction 2 t t i>0 4 return y = /07/20 CPEG opic-B-Dataflow-Part2 6

17 Power unction 4 i>0 2 return y = /07/20 CPEG opic-B-Dataflow-Part2 7

18 Power unction t t t i>0 2 4 t t t return y = /07/20 CPEG opic-B-Dataflow-Part2 8

19 Power unction t t t i> return y = /07/20 CPEG opic-B-Dataflow-Part2 9

20 Power unction 2 t t i>0 8 0 return y = /07/20 CPEG opic-B-Dataflow-Part2 20

21 Power unction i>0 2 return y = /07/20 CPEG opic-B-Dataflow-Part2 2

22 Power unction f f f i>0 2 f 8 0 f f return y = /07/20 CPEG opic-B-Dataflow-Part2 22

23 Power unction f f f i>0 8 y = /07/20 CPEG opic-B-Dataflow-Part2 23

24 DG Vector Addition a b NULL 0 N < + Select + Select Assign c for(i = 0; i < N; ++i) c[i] = a[i] + b[i]; 09/07/20 CPEG opic-B-Dataflow-Part2 24

25 Static Dataflow Model eatures One-token-per-arc Deterministic merge Conditional/iteration construction Consecutive iterations of a loop appear to be only subjected to sequential execution (?) A dataflow graph activity templates Opcode of the represented instruction Operand slots for holding operand values Destination address fields oken value + destination 09/07/20 CPEG opic-B-Dataflow-Part2 25

26 Static Dataflow Model eatures Deficiencies: Due to acknowledgment tokens, the token traffic is doubled. Lack of support for programming constructs that are essential to modern programming language no procedure calls, no recursion. Advantage: simple model 09/07/20 CPEG opic-B-Dataflow-Part2 26

27 MI Static Dataflow Processor Architecture and Program Activity emplates Operation units Update unit queue etch unit Activity store a b + Z = (a + b) (c - d) Gao and heobald: he Static Dataflow Enable Memory Chip (fall, 984) c d - z 09/07/20 CPEG opic-B-Dataflow-Part2 27

28 Destination list Instructions in a Static Dataflow Architecture a c mult2 2 3 sub 2 3 ac-bd opcode EC RC operand b d mult2 2 3 operand2 result arc signal arc a d b c mult2 2 3 mult2 2 3 plus 2 3 ad+bc 09/07/20 CPEG opic-B-Dataflow-Part2 28

29 Dataflow Software Pipelining a X[I] [i] Y[I] U[I] b + H[i] + Z[i] for I in [, n] H[i] = a X[i] + Y[i] G[i] = b U[i] + V[i] V[I] + G[i] Z[i]= [i] H[i] + S[i] G[i] S[i] end for 09/07/20 CPEG opic-B-Dataflow-Part2 29

30 Recursive Program Graphs Outlaw iterations : Graph must be acyclic One-token-per-arc-per-invocation Iteration is expressed in terms of a tail recursion 09/07/20 CPEG opic-B-Dataflow-Part2 30

31 ail unction Application ail-procedure application a procedure application that occurs as the last statement in another procedure; ail-function application is a function application (appears in the body expression) whose result value is also returned as the value of the entire functions Consider the role of stack 09/07/20 CPEG opic-B-Dataflow-Part2 3

32 actorial long fact(n){ if(n == 0) return ; else return n fact(n); Normal Recursive ail Recursive long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); 09/07/20 CPEG opic-B-Dataflow-Part2 32

33 actorial he Normal Version n n==0 Hand Simulate fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 33

34 actorial he Normal Version 3 n==0 Hand Simulate fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 34

35 actorial he Normal Version n 3 3 n==0 Hand Simulate fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 35

36 actorial he Normal Version n 3 n==0 Hand Simulate fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 36

37 actorial he Normal Version n 3 n==0 Hand Simulate fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 37

38 actorial he Normal Version n n==0 3 Hand Simulate fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 38

39 actorial he Normal Version n n==0 3 Hand Simulate fact(3) 3 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 39

40 actorial he Normal Version n n==0 Hand Simulate fact(3) 3 2 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 40

41 actorial he Normal Version 2 n==0 3 fact(2) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 4

42 actorial he Normal Version n 2 2 n==0 3 fact(2) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 42

43 actorial he Normal Version n 2 n==0 3 fact(2) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 43

44 actorial he Normal Version n 2 n==0 3 fact(2) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 44

45 actorial he Normal Version n n==0 2 3 fact(2) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 45

46 actorial he Normal Version n n==0 2 3 fact(2) 2 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 46

47 actorial he Normal Version n n==0 3 fact(2) 2 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 47

48 actorial he Normal Version n==0 3 fact(2 fact()) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 48

49 actorial he Normal Version n n==0 3 fact(2 fact()) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 49

50 actorial he Normal Version n n==0 3 fact(2 fact()) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 50

51 actorial he Normal Version n n==0 3 fact(2 fact()) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 5

52 actorial he Normal Version n n==0 3 fact(2 fact()) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 52

53 actorial he Normal Version n n==0 3 fact(2 fact()) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 53

54 actorial he Normal Version n n==0 3 fact(2 fact()) 0 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 54

55 actorial he Normal Version 0 n==0 3 fact(2 fact( fact(0))) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 55

56 actorial he Normal Version n 0 0 n==0 3 fact(2 fact( fact(0))) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 56

57 actorial he Normal Version n 0 n==0 3 fact(2 fact( fact(0))) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 57

58 actorial he Normal Version n 0 n==0 3 fact(2 fact( fact(0))) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 58

59 actorial he Normal Version n n==0 3 fact(2 fact( fact(0))) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 59

60 actorial he Normal Version n n==0 3 fact(2 fact( )) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 60

61 actorial he Normal Version n n==0 3 fact(2 fact( )) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 6

62 actorial he Normal Version n n==0 3 fact(2 ) 2 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 62

63 actorial he Normal Version n n==0 3 fact(2 ) 2 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 63

64 actorial he Normal Version n n== Apply fact 2 long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 64

65 actorial he Normal Version n n== Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 65

66 actorial he Normal Version n n==0 6 Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 6 09/07/20 CPEG opic-B-Dataflow-Part2 66

67 Can you see where is the problem?? 09/07/20 CPEG opic-B-Dataflow-Part2 67

68 actorial he ail Recursion Version n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ Call fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 68

69 actorial he ail Recursion Version 3 n==0 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 69

70 actorial he ail Recursion Version 3 n 3 n==0 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 70

71 actorial he ail Recursion Version 3 n n==0 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 7

72 actorial he ail Recursion Version 3 n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 72

73 actorial he ail Recursion Version n p n==0 3 3 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 73

74 actorial he ail Recursion Version 2 n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ 3 fact_(3,) 09/07/20 CPEG opic-B-Dataflow-Part2 74

75 actorial he ail Recursion Version 2 n==0 3 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ Call fact_(2,3) 09/07/20 CPEG opic-B-Dataflow-Part2 75

76 actorial he ail Recursion Version 2 n 2 n==0 3 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(2,3) 09/07/20 CPEG opic-B-Dataflow-Part2 76

77 actorial he ail Recursion Version 2 n n==0 3 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(2,3) 09/07/20 CPEG opic-B-Dataflow-Part2 77

78 actorial he ail Recursion Version 2 n n==0 3 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(2,3) 09/07/20 CPEG opic-B-Dataflow-Part2 78

79 actorial he ail Recursion Version n p n== long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(2,3) 09/07/20 CPEG opic-B-Dataflow-Part2 79

80 actorial he ail Recursion Version n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ 6 Call fact_ (,6) 09/07/20 CPEG opic-B-Dataflow-Part2 80

81 actorial he ail Recursion Version n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(,6) 09/07/20 CPEG opic-B-Dataflow-Part2 8

82 actorial he ail Recursion Version n n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(,6) 09/07/20 CPEG opic-B-Dataflow-Part2 82

83 actorial he ail Recursion Version n n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(,6) 09/07/20 CPEG opic-B-Dataflow-Part2 83

84 actorial he ail Recursion Version n n==0 6 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(,6) 09/07/20 CPEG opic-B-Dataflow-Part2 84

85 actorial he ail Recursion Version n p n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(,6) 09/07/20 CPEG opic-B-Dataflow-Part2 85

86 actorial he ail Recursion Version 0 n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ 6 fact_(,6) 09/07/20 CPEG opic-B-Dataflow-Part2 86

87 actorial he ail Recursion Version 0 n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ Call fact(0,6) 09/07/20 CPEG opic-B-Dataflow-Part2 87

88 actorial he ail Recursion Version 0 n 0 n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(0,6) 09/07/20 CPEG opic-B-Dataflow-Part2 88

89 actorial he ail Recursion Version 0 n n==0 6 long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ fact_(0,6) 09/07/20 CPEG opic-B-Dataflow-Part2 89

90 actorial he ail Recursion Version n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ 6 fact_(0,6) returns 6 09/07/20 CPEG opic-B-Dataflow-Part2 90

91 actorial he ail Recursion Version n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ 6 fact_(,6) returns 6 09/07/20 CPEG opic-B-Dataflow-Part2 9

92 actorial he ail Recursion Version n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ 6 fact_(3,) returns 6 09/07/20 CPEG opic-B-Dataflow-Part2 92

93 actorial he ail Recursion Version n n==0 p long fact_(n, p){ if(n == 0) return p; else return fact_(n, np); Apply fact_ /07/20 CPEG opic-B-Dataflow-Part2 93

94 Recursive Program Graph eatures Acyclic One-token-per-link-in-lifetime ags No deterministic merge needed Recursion is expressed by runtime copying No matching is needed (why?) 09/07/20 CPEG opic-B-Dataflow-Part2 94

95 A Quiz: y = x ^ n? 09/07/20 CPEG opic-B-Dataflow-Part2 95

96 A Recursive Version of Power (not tail recursive) x n x n x > 0 unction Rec-Power (x, n : integer returns integer) Returns If n = 0 then else x rec-power (x, n - ) endif endfun apply rec-power n Note: tail-recursive = iterations: i.e. the states of the computation are captured explicitly by the set of iteration variables /07/20 CPEG opic-B-Dataflow-Part2 96

97 he power function as a recursive program graph Power x n Rec x y n > 0 x y n apply (Rec) function Rec (x,y,n) if n = 0 then y else Rec (x, xy, n) endif end function Rec (x,,n) X x y n apply (Rec) 09/07/20 CPEG opic-B-Dataflow-Part2 97

98 Dynamic Dataflow Static Dataflow Only one token per arc Problems with unction calls, nested loops and data structures A signal is needed to allow the parent s operator to fire Dynamic Dataflow No limitations on number of tokens per arc okens have tags new firing rules and tag matching he MI tagged token dataflow model 09/07/20 CPEG opic-B-Dataflow-Part2 98

99 he oken in Dynamic Dataflow oken ag + Value [v, <u, s>, d] v : u : s : d : Value activation instance destination actor operand slot Different from Static Dataflow that it needs the tag <u,s> 09/07/20 CPEG opic-B-Dataflow-Part2 99

100 Dynamic Dataflow Loops and function calls Should be executed in parallel as instances of the same graph Arc a container with different token that have different tags A node can fire as soon that all tokens with identical tags are presented in its input arcs 09/07/20 CPEG opic-B-Dataflow-Part2 00

101 ags and Colors Concept of colors In a tag <u,s> - which is the color? When a new color is generated? When an old color is revovered? 09/07/20 CPEG opic-B-Dataflow-Part2 0

102 he Normal Version Dynamic Dataflow n n==0 fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 02

103 he Normal Version Dynamic Dataflow 3 n==0 fact(3) Apply fact long fact(n){ if(n == 0) return ; else return n fact(n); 09/07/20 CPEG opic-B-Dataflow-Part2 03

104 Example of Dynamic Dataflow Example A Example B 09/07/20 CPEG opic-B-Dataflow-Part2 04

105 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator 05

106 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator 06

107 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator 07

108 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator 08

109 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator 09

110 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator 0

111 he Apply Operator q a Apply q a A BEGIN Dataflow graph of Procedure q A END 09/07/20 CPEG opic-B-Dataflow-Apply- Operator

112 Dynamic Dataflow Advantages More Parallelism Handle arbitrary recursion Disadvantages Implementation of the token tag matching unit Associative Memory would be ideal Not cost effective Hashing is used 09/07/20 CPEG opic-B-Dataflow-Part2 2

113 eatures of Data low Computation Model Not history-sensitive Semantics (determinate) Parallelism 9/22/20 \course\eleg652-98f\opic5a.ppt 3

114 u v w x w x +2 - apply() +2 - y X z y X z (a) (b) (c) unction unction G unction G Interpreting function invocation as module substitution 9/22/20 \course\eleg652-98f\opic5a.ppt 4

115 V... V m apply... u u n (a) Notation for apply V... V m V... V m apply... u u n is an (m,n) schema... u u n (b) iring Rule he Apply Actor 9/22/20 \course\eleg652-98f\opic5a.ppt 5

116 Concept of Strictness Intuitive: ormal : a mechanism that requires all arguments to be evaluated before evaluation of the body of a function may begin A function f is strict if f = nonstrict = not strict 9/22/20 \course\eleg652-98f\opic5a.ppt 6

117 Comment on Strict Apply Actor Advantage - Parallelism Call-by-value semantics Disadvantage: Lose substitution property or referential transparency property to avoid it, need strictness analysis 9/22/20 \course\eleg652-98f\opic5a.ppt 7

118 Referential ransparency...he only thing that matters about an expression is its value, and any subexpression can be replaced by any other equal in value......moreover, the value of an expression is, within certain limits, the same when ever it occurs... 9/22/20 \course\eleg652-98f\opic5a.ppt 8

119 Referential ransparency or Property of Substitution Let f,g be two procedures/functions such that f appears as an application inside of g; let g be the procedure obtained from g by substituting the text of f in place of the application; In the languages which are referential transparent, the specification of the function for g will not depend on any terminating property of f, or g=g. 9/22/20 \course\eleg652-98f\opic5a.ppt 9

120 Concept of Non-Strictness Lenient evaluation model Lazy evaluation model 09/07/20 CPEG opic-B-Dataflow-Part2 20

121 Outline Parallel Program Execution Models Dataflow Models of Computation Dataflow Graphs and Properties hree Dataflow Models Static Recursive Program Graph Dynamic Dataflow Architectures: Evolution of Multithreading 09/07/20 CPEG opic-B-Dataflow-Part2 2

122 MI agged oken Dataflow Architecture Processor Wait-Match Unit Waiting token memory (associative) oken Queue Instruction etch Execute OP Program memory orm okens Output o network rom network Wait-Match Unit: okens for unary ops go straight through okens for binary ops: try to match incoming token and a waiting token with same instruction address and context id Success: Both tokens forwarded ail: Incoming token Waiting oken Mem, Bubble (no-op) forwarded

123 Memory Model and Dataflow What is memory in dataflow model? What is memory model under dataflow model? Concept of functional programming Concept of single-assignment and singleassignmen programming languages 09/07/20 CPEG opic-B-Dataflow-Part2 25

124 he I Structures Single Assignment Rule and Complex Data structures Consume the entire data structure after each access he Concept of the I Structure Only consume the entry on a write A data repository that obeys the Single Assignment Rule Written only once, read many times Elements are associated with status bits and a queue of deferred reads 09/07/20 CPEG opic-B-Dataflow-Part2 26

125 I-Structure Memory Extending dataflow abstract Machine model with I-Structure Memory Use a data structure before it is completely defined Incremental creating or reading of data structures 09/07/20 CPEG opic-B-Dataflow-Part2 27

126 Dataflow he I Structures An element of a I-structure becomes defined on a write and it only happens only once At this moment all deferred reads will be satisfied Use a I-structure before it is completely defined Incremental creating or reading of data structures Lenient evaluation model - revisited 09/07/20 CPEG opic-B-Dataflow-Part2 28

127 he I Structures: state transitions States Present: he element of an I- structure (e.g. A[i]) can be read but not written r Absent w w Absent: he element has been attempted to be read but the element has not been written yet (initial state) r Waiting Present w Error r Waiting: At least one read request has been deferred 09/07/20 CPEG opic-B-Dataflow-Part2 29

128 I Structures Elementary Allocate: reserves space for the new I-Structure I-fetch: Get the value of the new I-structure (deferred) I-store: Writes a value into the specified I structure element Used to create construct nodes: SELEC ASSIGN 09/07/20 CPEG opic-B-Dataflow-Part2 30

Topic 4b Program Execution Models Dataflow Model of Computation: A Fine-Grain Kind of PXM. CPEG421/621: Compiler Design

Topic 4b Program Execution Models Dataflow Model of Computation: A Fine-Grain Kind of PXM. CPEG421/621: Compiler Design opic 4b Program Execution Models Dataflow Model of Computation: A ine-grain Kind of PXM CPEG42/62: Compiler Design Most slides taken from Prof. Gao s and J.Manzano s previous courses, with additional material

More information

CPEG 852 Advanced Topics in Computing Systems The Dataflow Model of Computation

CPEG 852 Advanced Topics in Computing Systems The Dataflow Model of Computation CPEG 852 Advanced Topics in Computing Systems The Dataflow Model of Computation Dynamic Dataflow Stéphane Zuckerman Computer Architecture & Parallel Systems Laboratory Electrical & Computer Engineering

More information

CPEG 852 Advanced Topics in Computing Systems The Dataflow Model of Computation

CPEG 852 Advanced Topics in Computing Systems The Dataflow Model of Computation CPEG 852 Advanced Topics in Computing Systems The Dataflow Model of Computation Stéphane Zuckerman Computer Architecture & Parallel Systems Laboratory Electrical & Computer Engineering Dept. University

More information

Computer Architecture: Dataflow/Systolic Arrays

Computer Architecture: Dataflow/Systolic Arrays Data Flow Computer Architecture: Dataflow/Systolic Arrays he models we have examined all assumed Instructions are fetched and retired in sequential, control flow order his is part of the Von-Neumann model

More information

Well-behaved Dataflow Graphs

Well-behaved Dataflow Graphs Well-behaved Dataflow Graphs Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of echnology L21-1 Outline Kahnian networks and dataflow Streams with holes & agged interpretation

More information

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements Programming Languages Third Edition Chapter 9 Control I Expressions and Statements Objectives Understand expressions Understand conditional statements and guards Understand loops and variation on WHILE

More information

Static Dataflow Graphs

Static Dataflow Graphs Static Dataflow Graphs Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of echnology L20-1 Motivation: Dataflow Graphs A common Base Language - to serve as target representation

More information

9/21/17. Outline. Expression Evaluation and Control Flow. Arithmetic Expressions. Operators. Operators. Notation & Placement

9/21/17. Outline. Expression Evaluation and Control Flow. Arithmetic Expressions. Operators. Operators. Notation & Placement Outline Expression Evaluation and Control Flow In Text: Chapter 6 Notation Operator evaluation order Operand evaluation order Overloaded operators Type conversions Short-circuit evaluation of conditions

More information

Portland State University ECE 588/688. Dataflow Architectures

Portland State University ECE 588/688. Dataflow Architectures Portland State University ECE 588/688 Dataflow Architectures Copyright by Alaa Alameldeen and Haitham Akkary 2018 Hazards in von Neumann Architectures Pipeline hazards limit performance Structural hazards

More information

Intermediate representation

Intermediate representation Intermediate representation Goals: encode knowledge about the program facilitate analysis facilitate retargeting facilitate optimization scanning parsing HIR semantic analysis HIR intermediate code gen.

More information

CSC312 Principles of Programming Languages : Functional Programming Language. Copyright 2006 The McGraw-Hill Companies, Inc.

CSC312 Principles of Programming Languages : Functional Programming Language. Copyright 2006 The McGraw-Hill Companies, Inc. CSC312 Principles of Programming Languages : Functional Programming Language Overview of Functional Languages They emerged in the 1960 s with Lisp Functional programming mirrors mathematical functions:

More information

Intermediate Code Generation

Intermediate Code Generation Intermediate Code Generation In the analysis-synthesis model of a compiler, the front end analyzes a source program and creates an intermediate representation, from which the back end generates target

More information

CMSC 330: Organization of Programming Languages. OCaml Higher Order Functions

CMSC 330: Organization of Programming Languages. OCaml Higher Order Functions CMSC 330: Organization of Programming Languages OCaml Higher Order Functions CMSC330 Fall 2017 1 Anonymous Functions Recall code blocks in Ruby (1..10).each { x print x } Here, we can think of { x print

More information

CITS3211 FUNCTIONAL PROGRAMMING. 14. Graph reduction

CITS3211 FUNCTIONAL PROGRAMMING. 14. Graph reduction CITS3211 FUNCTIONAL PROGRAMMING 14. Graph reduction Summary: This lecture discusses graph reduction, which is the basis of the most common compilation technique for lazy functional languages. CITS3211

More information

An introduction to Scheme

An introduction to Scheme An introduction to Scheme Introduction A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize

More information

Control Flow Analysis

Control Flow Analysis Control Flow Analysis Last time Undergraduate compilers in a day Today Assignment 0 due Control-flow analysis Building basic blocks Building control-flow graphs Loops January 28, 2015 Control Flow Analysis

More information

Dataflow Architectures. Karin Strauss

Dataflow Architectures. Karin Strauss Dataflow Architectures Karin Strauss Introduction Dataflow machines: programmable computers with hardware optimized for fine grain data-driven parallel computation fine grain: at the instruction granularity

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

EE382A Lecture 7: Dynamic Scheduling. Department of Electrical Engineering Stanford University

EE382A Lecture 7: Dynamic Scheduling. Department of Electrical Engineering Stanford University EE382A Lecture 7: Dynamic Scheduling Department of Electrical Engineering Stanford University http://eeclass.stanford.edu/ee382a Lecture 7-1 Announcements Project proposal due on Wed 10/14 2-3 pages submitted

More information

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Table of Contents. Chapter 1: Introduction to Data Structures... 1 Table of Contents Chapter 1: Introduction to Data Structures... 1 1.1 Data Types in C++... 2 Integer Types... 2 Character Types... 3 Floating-point Types... 3 Variables Names... 4 1.2 Arrays... 4 Extraction

More information

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square) CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square) Introduction This semester, through a project split into 3 phases, we are going

More information

Expression Evaluation and Control Flow. Outline

Expression Evaluation and Control Flow. Outline Expression Evaluation and Control Flow In Text: Chapter 6 Outline Notation Operator Evaluation Order Operand Evaluation Order Overloaded operators Type conversions Short-circuit evaluation of conditions

More information

Dataflow Processing. A.R. Hurson Computer Science Department Missouri Science & Technology

Dataflow Processing. A.R. Hurson Computer Science Department Missouri Science & Technology A.R. Hurson Computer Science Department Missouri Science & Technology hurson@mst.edu 1 Control Flow Computation Operands are accessed by their addresses. Shared memory cells are the means by which data

More information

Run-time Environments. Lecture 13. Prof. Alex Aiken Original Slides (Modified by Prof. Vijay Ganesh) Lecture 13

Run-time Environments. Lecture 13. Prof. Alex Aiken Original Slides (Modified by Prof. Vijay Ganesh) Lecture 13 Run-time Environments Lecture 13 by Prof. Vijay Ganesh) Lecture 13 1 What have we covered so far? We have covered the front-end phases Lexical analysis (Lexer, regular expressions,...) Parsing (CFG, Top-down,

More information

Functional Programming. Pure Functional Programming

Functional Programming. Pure Functional Programming Functional Programming Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends only on the values of its sub-expressions (if any).

More information

CSE P 501 Compilers. Intermediate Representations Hal Perkins Spring UW CSE P 501 Spring 2018 G-1

CSE P 501 Compilers. Intermediate Representations Hal Perkins Spring UW CSE P 501 Spring 2018 G-1 CSE P 501 Compilers Intermediate Representations Hal Perkins Spring 2018 UW CSE P 501 Spring 2018 G-1 Administrivia Semantics/types/symbol table project due ~2 weeks how goes it? Should be caught up on

More information

CS252 Graduate Computer Architecture Midterm 1 Solutions

CS252 Graduate Computer Architecture Midterm 1 Solutions CS252 Graduate Computer Architecture Midterm 1 Solutions Part A: Branch Prediction (22 Points) Consider a fetch pipeline based on the UltraSparc-III processor (as seen in Lecture 5). In this part, we evaluate

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 3 Thomas Wies New York University Review Last week Names and Bindings Lifetimes and Allocation Garbage Collection Scope Outline Control Flow Sequencing

More information

CSE 504. Expression evaluation. Expression Evaluation, Runtime Environments. One possible semantics: Problem:

CSE 504. Expression evaluation. Expression Evaluation, Runtime Environments. One possible semantics: Problem: Expression evaluation CSE 504 Order of evaluation For the abstract syntax tree + + 5 Expression Evaluation, Runtime Environments + + x 3 2 4 the equivalent expression is (x + 3) + (2 + 4) + 5 1 2 (. Contd

More information

CSc 520 Principles of Programming Languages. 26 : Control Structures Introduction

CSc 520 Principles of Programming Languages. 26 : Control Structures Introduction CSc 520 Principles of Programming Languages 26 : Control Structures Introduction Christian Collberg Department of Computer Science University of Arizona collberg+520@gmail.com Copyright c 2008 Christian

More information

COP4020 Fall 2006 Final Exam

COP4020 Fall 2006 Final Exam COP4020 Fall 2006 Final Exam Name: (Please print) Put the answers on these sheets. You can collect 100 points in total for this exam. 1. Consider the following Ada program fragment: search: loop i := i+1;

More information

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards Language Reference Manual Introduction The purpose of

More information

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.E SECOND SEMESTER CS 6202 PROGRAMMING AND DATA STRUCTURES I TWO MARKS UNIT I- 2 MARKS

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.E SECOND SEMESTER CS 6202 PROGRAMMING AND DATA STRUCTURES I TWO MARKS UNIT I- 2 MARKS DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.E SECOND SEMESTER CS 6202 PROGRAMMING AND DATA STRUCTURES I TWO MARKS UNIT I- 2 MARKS 1. Define global declaration? The variables that are used in more

More information

CMSC 330: Organization of Programming Languages. OCaml Higher Order Functions

CMSC 330: Organization of Programming Languages. OCaml Higher Order Functions CMSC 330: Organization of Programming Languages OCaml Higher Order Functions CMSC 330 - Spring 2017 1 Anonymous Functions Recall code blocks in Ruby (1..10).each { x print x } Here, we can think of { x

More information

Operational Semantics. One-Slide Summary. Lecture Outline

Operational Semantics. One-Slide Summary. Lecture Outline Operational Semantics #1 One-Slide Summary Operational semantics are a precise way of specifying how to evaluate a program. A formal semantics tells you what each expression means. Meaning depends on context:

More information

CMSC 330: Organization of Programming Languages. OCaml Higher Order Functions

CMSC 330: Organization of Programming Languages. OCaml Higher Order Functions CMSC 330: Organization of Programming Languages OCaml Higher Order Functions CMSC 330 - Summer 2017 1 Anonymous Functions Recall code blocks in Ruby (1..10).each { x print x } Here, we can think of { x

More information

UNIT 3

UNIT 3 UNIT 3 Presentation Outline Sequence control with expressions Conditional Statements, Loops Exception Handling Subprogram definition and activation Simple and Recursive Subprogram Subprogram Environment

More information

CSE 401/M501 Compilers

CSE 401/M501 Compilers CSE 401/M501 Compilers Intermediate Representations Hal Perkins Autumn 2018 UW CSE 401/M501 Autumn 2018 G-1 Agenda Survey of Intermediate Representations Graphical Concrete/Abstract Syntax Trees (ASTs)

More information

Object Code (Machine Code) Dr. D. M. Akbar Hussain Department of Software Engineering & Media Technology. Three Address Code

Object Code (Machine Code) Dr. D. M. Akbar Hussain Department of Software Engineering & Media Technology. Three Address Code Code Generation Intermediate Code? Assembly Code Object Code (Machine Code) 1 Intermediate Code P-Code Three Address Code 2 Compiler Construction F6S 1 Intermediate Representation Abstract Syntax Tree

More information

Building a Runnable Program and Code Improvement. Dario Marasco, Greg Klepic, Tess DiStefano

Building a Runnable Program and Code Improvement. Dario Marasco, Greg Klepic, Tess DiStefano Building a Runnable Program and Code Improvement Dario Marasco, Greg Klepic, Tess DiStefano Building a Runnable Program Review Front end code Source code analysis Syntax tree Back end code Target code

More information

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division Fall, 2001 Prof. R. Fateman SUGGESTED S CS 164 Final Examination: December 18, 2001, 8-11AM

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 9: Binary Addition & Multiplication Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Pop Quiz! Using 4 bits signed integer notation:

More information

Lecture 6: Static ILP

Lecture 6: Static ILP Lecture 6: Static ILP Topics: loop analysis, SW pipelining, predication, speculation (Section 2.2, Appendix G) Assignment 2 posted; due in a week 1 Loop Dependences If a loop only has dependences within

More information

High-Level Synthesis

High-Level Synthesis High-Level Synthesis 1 High-Level Synthesis 1. Basic definition 2. A typical HLS process 3. Scheduling techniques 4. Allocation and binding techniques 5. Advanced issues High-Level Synthesis 2 Introduction

More information

CMSC 330: Organization of Programming Languages. OCaml Expressions and Functions

CMSC 330: Organization of Programming Languages. OCaml Expressions and Functions CMSC 330: Organization of Programming Languages OCaml Expressions and Functions CMSC330 Spring 2018 1 Lecture Presentation Style Our focus: semantics and idioms for OCaml Semantics is what the language

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications EE 3170 Microcontroller Applications Lecture 4 : Processors, Computers, and Controllers - 1.2 (reading assignment), 1.3-1.5 Based on slides for ECE3170 by Profs. Kieckhafer, Davis, Tan, and Cischke Outline

More information

CS4215 Programming Language Implementation. Martin Henz

CS4215 Programming Language Implementation. Martin Henz CS4215 Programming Language Implementation Martin Henz Thursday 15 March, 2012 2 Chapter 11 impl: A Simple Imperative Language 11.1 Introduction So far, we considered only languages, in which an identifier

More information

Run-time Environments

Run-time Environments Run-time Environments Status We have so far covered the front-end phases Lexical analysis Parsing Semantic analysis Next come the back-end phases Code generation Optimization Register allocation Instruction

More information

CSE443 Compilers. Dr. Carl Alphonce 343 Davis Hall

CSE443 Compilers. Dr. Carl Alphonce 343 Davis Hall CSE443 Compilers Dr. Carl Alphonce alphonce@buffalo.edu 343 Davis Hall http://www.cse.buffalo.edu/faculty/alphonce/sp17/cse443/index.php https://piazza.com/class/iybn4ndqa1s3ei Announcements Be sure to

More information

Run-time Environments

Run-time Environments Run-time Environments Status We have so far covered the front-end phases Lexical analysis Parsing Semantic analysis Next come the back-end phases Code generation Optimization Register allocation Instruction

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

! Those values must be stored somewhere! Therefore, variables must somehow be bound. ! How?

! Those values must be stored somewhere! Therefore, variables must somehow be bound. ! How? A Binding Question! Variables are bound (dynamically) to values Subprogram Activation! Those values must be stored somewhere! Therefore, variables must somehow be bound to memory locations! How? Function

More information

Donn Morrison Department of Computer Science. TDT4255 ILP and speculation

Donn Morrison Department of Computer Science. TDT4255 ILP and speculation TDT4255 Lecture 9: ILP and speculation Donn Morrison Department of Computer Science 2 Outline Textbook: Computer Architecture: A Quantitative Approach, 4th ed Section 2.6: Speculation Section 2.7: Multiple

More information

Compiler Construction Lecture 05 A Simple Stack Machine. Lent Term, Lecturer: Timothy G. Griffin. Computer Laboratory University of Cambridge

Compiler Construction Lecture 05 A Simple Stack Machine. Lent Term, Lecturer: Timothy G. Griffin. Computer Laboratory University of Cambridge Compiler Construction Lecture 05 A Simple Stack Machine Lent Term, 2015 Lecturer: Timothy G. Griffin Computer Laboratory University of Cambridge 1 Where are we going? When we derived the stack machine

More information

Intermediate Representations

Intermediate Representations Compiler Design 1 Intermediate Representations Compiler Design 2 Front End & Back End The portion of the compiler that does scanning, parsing and static semantic analysis is called the front-end. The translation

More information

Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1)

Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1) Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1) ILP vs. Parallel Computers Dynamic Scheduling (Section 3.4, 3.5) Dynamic Branch Prediction (Section 3.3) Hardware Speculation and Precise

More information

An Introduction to Trees

An Introduction to Trees An Introduction to Trees Alice E. Fischer Spring 2017 Alice E. Fischer An Introduction to Trees... 1/34 Spring 2017 1 / 34 Outline 1 Trees the Abstraction Definitions 2 Expression Trees 3 Binary Search

More information

CS 351 Final Review Quiz

CS 351 Final Review Quiz CS 351 Final Review Quiz Notes: You must explain your answers to receive partial credit. You will lose points for incorrect extraneous information, even if the answer is otherwise correct. Question 1:

More information

Model Checking I Binary Decision Diagrams

Model Checking I Binary Decision Diagrams /42 Model Checking I Binary Decision Diagrams Edmund M. Clarke, Jr. School of Computer Science Carnegie Mellon University Pittsburgh, PA 523 2/42 Binary Decision Diagrams Ordered binary decision diagrams

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 2 Thomas Wies New York University Review Last week Programming Languages Overview Syntax and Semantics Grammars and Regular Expressions High-level

More information

Chapter 6 Control Flow. June 9, 2015

Chapter 6 Control Flow. June 9, 2015 Chapter 6 Control Flow June 9, 2015 Expression evaluation It s common in programming languages to use the idea of an expression, which might be a simple object function invocation over some number of arguments

More information

High-level idea. Abstractions for algorithms and parallel machines. Computation DAG s. Abstractions introduced in lecture

High-level idea. Abstractions for algorithms and parallel machines. Computation DAG s. Abstractions introduced in lecture Abstractions for algorithms and parallel machines Keshav Pingali University of eas, Austin High-level idea Difficult to work directly with tetual programs Where is the parallelism in the program? Solution:

More information

Compiler Theory. (Intermediate Code Generation Abstract S yntax + 3 Address Code)

Compiler Theory. (Intermediate Code Generation Abstract S yntax + 3 Address Code) Compiler Theory (Intermediate Code Generation Abstract S yntax + 3 Address Code) 006 Why intermediate code? Details of the source language are confined to the frontend (analysis phase) of a compiler, while

More information

Topic C Memory Models

Topic C Memory Models Memory Memory Non- Topic C Memory CPEG852 Spring 2014 Guang R. Gao CPEG 852 Memory Advance 1 / 29 Memory 1 Memory Memory Non- 2 Non- CPEG 852 Memory Advance 2 / 29 Memory Memory Memory Non- Introduction:

More information

Compiler construction

Compiler construction Compiler construction Martin Steffen March 13, 2017 Contents 1 Abstract 1 1.1 Symbol tables. 1 1.1.1 Introduction 1 1.1.2 Symbol table design and interface.. 2 1.1.3 Implementing symbol tables 3 1.1.4

More information

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. Part 3: von Neumann Architecture von Neumann Architecture Our goal: understand the basics of von Neumann architecture, including memory, control unit

More information

Instruction Scheduling. Software Pipelining - 3

Instruction Scheduling. Software Pipelining - 3 Instruction Scheduling and Software Pipelining - 3 Department of Computer Science and Automation Indian Institute of Science Bangalore 560 012 NPTEL Course on Principles of Compiler Design Instruction

More information

Scope, Functions, and Storage Management

Scope, Functions, and Storage Management Scope, Functions, and Storage Management Implementing Functions and Blocks cs3723 1 Simplified Machine Model (Compare To List Abstract Machine) Registers Code Data Program Counter (current instruction)

More information

Lecture 19: Instruction Level Parallelism

Lecture 19: Instruction Level Parallelism Lecture 19: Instruction Level Parallelism Administrative: Homework #5 due Homework #6 handed out today Last Time: DRAM organization and implementation Today Static and Dynamic ILP Instruction windows Register

More information

Sorting Pearson Education, Inc. All rights reserved.

Sorting Pearson Education, Inc. All rights reserved. 1 19 Sorting 2 19.1 Introduction (Cont.) Sorting data Place data in order Typically ascending or descending Based on one or more sort keys Algorithms Insertion sort Selection sort Merge sort More efficient,

More information

Recursion. Comp Sci 1575 Data Structures. Introduction. Simple examples. The call stack. Types of recursion. Recursive programming

Recursion. Comp Sci 1575 Data Structures. Introduction. Simple examples. The call stack. Types of recursion. Recursive programming Recursion Comp Sci 1575 Data Structures Outline 1 2 3 4 Definitions To understand, you must understand. Familiar of recursive definitions Natural numbers are either: n+1, where n is a natural number 1

More information

Hardware-Based Speculation

Hardware-Based Speculation Hardware-Based Speculation Execute instructions along predicted execution paths but only commit the results if prediction was correct Instruction commit: allowing an instruction to update the register

More information

ECE 2574: Data Structures and Algorithms - Recursion Part I. C. L. Wyatt

ECE 2574: Data Structures and Algorithms - Recursion Part I. C. L. Wyatt ECE 2574: Data Structures and Algorithms - Recursion Part I C. L. Wyatt Today we will introduce the notion of recursion, look at some examples, and see how to implement them in code. Introduction to recursion

More information

Processor design - MIPS

Processor design - MIPS EASY Processor design - MIPS Q.1 What happens when a register is loaded? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit

More information

Language Reference Manual simplicity

Language Reference Manual simplicity Language Reference Manual simplicity Course: COMS S4115 Professor: Dr. Stephen Edwards TA: Graham Gobieski Date: July 20, 2016 Group members Rui Gu rg2970 Adam Hadar anh2130 Zachary Moffitt znm2104 Suzanna

More information

Chapter 15. Functional Programming Languages

Chapter 15. Functional Programming Languages Chapter 15 Functional Programming Languages Copyright 2009 Addison-Wesley. All rights reserved. 1-2 Chapter 15 Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages

More information

Concurrent Models of Computation

Concurrent Models of Computation Concurrent Models of Computation Edward A. Lee Robert S. Pepper Distinguished Professor, UC Berkeley EECS 219D: Concurrent Models of Computation Fall 2011 Copyright 2011, Edward A. Lee, All rights reserved

More information

Computer Architecture Lecture 15: Load/Store Handling and Data Flow. Prof. Onur Mutlu Carnegie Mellon University Spring 2014, 2/21/2014

Computer Architecture Lecture 15: Load/Store Handling and Data Flow. Prof. Onur Mutlu Carnegie Mellon University Spring 2014, 2/21/2014 18-447 Computer Architecture Lecture 15: Load/Store Handling and Data Flow Prof. Onur Mutlu Carnegie Mellon University Spring 2014, 2/21/2014 Lab 4 Heads Up Lab 4a out Branch handling and branch predictors

More information

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions) By the end of this course, students should CIS 1.5 Course Objectives a. Understand the concept of a program (i.e., a computer following a series of instructions) b. Understand the concept of a variable

More information

Advanced issues in pipelining

Advanced issues in pipelining Advanced issues in pipelining 1 Outline Handling exceptions Supporting multi-cycle operations Pipeline evolution Examples of real pipelines 2 Handling exceptions 3 Exceptions In pipelined execution, one

More information

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 15 Very Long Instruction Word Machines

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 15 Very Long Instruction Word Machines ECE 552 / CPS 550 Advanced Computer Architecture I Lecture 15 Very Long Instruction Word Machines Benjamin Lee Electrical and Computer Engineering Duke University www.duke.edu/~bcl15 www.duke.edu/~bcl15/class/class_ece252fall11.html

More information

Lexical Considerations

Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2010 Handout Decaf Language Tuesday, Feb 2 The project for the course is to write a compiler

More information

Hardware-Software Codesign. 9. Worst Case Execution Time Analysis

Hardware-Software Codesign. 9. Worst Case Execution Time Analysis Hardware-Software Codesign 9. Worst Case Execution Time Analysis Lothar Thiele 9-1 System Design Specification System Synthesis Estimation SW-Compilation Intellectual Prop. Code Instruction Set HW-Synthesis

More information

Instruction Level Parallelism

Instruction Level Parallelism Instruction Level Parallelism The potential overlap among instruction execution is called Instruction Level Parallelism (ILP) since instructions can be executed in parallel. There are mainly two approaches

More information

What Compilers Can and Cannot Do. Saman Amarasinghe Fall 2009

What Compilers Can and Cannot Do. Saman Amarasinghe Fall 2009 What Compilers Can and Cannot Do Saman Amarasinghe Fall 009 Optimization Continuum Many examples across the compilation pipeline Static Dynamic Program Compiler Linker Loader Runtime System Optimization

More information

Lecture 6. Register Allocation. I. Introduction. II. Abstraction and the Problem III. Algorithm

Lecture 6. Register Allocation. I. Introduction. II. Abstraction and the Problem III. Algorithm I. Introduction Lecture 6 Register Allocation II. Abstraction and the Problem III. Algorithm Reading: Chapter 8.8.4 Before next class: Chapter 10.1-10.2 CS243: Register Allocation 1 I. Motivation Problem

More information

Register Allocation in Just-in-Time Compilers: 15 Years of Linear Scan

Register Allocation in Just-in-Time Compilers: 15 Years of Linear Scan Register Allocation in Just-in-Time Compilers: 15 Years of Linear Scan Kevin Millikin Google 13 December 2013 Register Allocation Overview Register allocation Intermediate representation (IR): arbitrarily

More information

SEMANTIC ANALYSIS TYPES AND DECLARATIONS

SEMANTIC ANALYSIS TYPES AND DECLARATIONS SEMANTIC ANALYSIS CS 403: Type Checking Stefan D. Bruda Winter 2015 Parsing only verifies that the program consists of tokens arranged in a syntactically valid combination now we move to check whether

More information

CPS 506 Comparative Programming Languages. Programming Language Paradigm

CPS 506 Comparative Programming Languages. Programming Language Paradigm CPS 506 Comparative Programming Languages Functional Programming Language Paradigm Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming

More information

Compilers and Code Optimization EDOARDO FUSELLA

Compilers and Code Optimization EDOARDO FUSELLA Compilers and Code Optimization EDOARDO FUSELLA Contents Data memory layout Instruction selection Register allocation Data memory layout Memory Hierarchy Capacity vs access speed Main memory Classes of

More information

JVM ByteCode Interpreter

JVM ByteCode Interpreter JVM ByteCode Interpreter written in Haskell (In under 1000 Lines of Code) By Louis Jenkins Presentation Schedule ( 15 Minutes) Discuss and Run the Virtual Machine first

More information

ECE 252 / CPS 220 Advanced Computer Architecture I. Lecture 14 Very Long Instruction Word Machines

ECE 252 / CPS 220 Advanced Computer Architecture I. Lecture 14 Very Long Instruction Word Machines ECE 252 / CPS 220 Advanced Computer Architecture I Lecture 14 Very Long Instruction Word Machines Benjamin Lee Electrical and Computer Engineering Duke University www.duke.edu/~bcl15 www.duke.edu/~bcl15/class/class_ece252fall11.html

More information

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes Chapter 2 Instructions: Language of the Computer Adapted by Paulo Lopes Instruction Set The repertoire of instructions of a computer Different computers have different instruction sets But with many aspects

More information

Exact and Approximate Task Assignment Algorithms for Pipelined Software Synthesis

Exact and Approximate Task Assignment Algorithms for Pipelined Software Synthesis Exact and Approximate Task Assignment Algorithms for Pipelined Software Synthesis Matin Hashemi Soheil Ghiasi Laboratory for Embedded and Programmable Systems http://leps.ece.ucdavis.edu Department of

More information

Compiler construction in4303 lecture 9

Compiler construction in4303 lecture 9 Compiler construction in4303 lecture 9 Code generation Chapter 4.2.5, 4.2.7, 4.2.11 4.3 Overview Code generation for basic blocks instruction selection:[burs] register allocation: graph coloring instruction

More information

Example Scheme Function: equal

Example Scheme Function: equal ICOM 4036 Programming Languages Functional Programming Languages Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming Language: LISP Introduction to

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms Alice E. Fischer Lecture 6: Stacks 2018 Alice E. Fischer Data Structures L5, Stacks... 1/29 Lecture 6: Stacks 2018 1 / 29 Outline 1 Stacks C++ Template Class Functions 2

More information

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University. Instructions: ti Language of the Computer Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Computer Hierarchy Levels Language understood

More information