4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de...

45
4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 [email protected] 1
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    212
  • download

    0

Transcript of 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de...

Page 1: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

4 July 2005

overview

Traineeship: Mapping of data

structures in multiprocessor

systemsNick de [email protected]

1

Page 2: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Content

1. Introduction

2. Problem definition

3. Approach

4. Implementation

5. To do list

6. Future work

2

Page 3: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Content

1. Introduction

2. Problem definition

3. Approach

4. Implementation

5. To do list

6. Future work

3

Page 4: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

• Why this project?

– Mapping of data structures in multiprocessor

systems

• Chips are getting memory dominated

• Upcoming of multiprocessor systems

4

Page 5: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

• Estimations: > 90% chip area is memory in 2010!

• Chips are increasingly becoming memory

dominated:

– Logic scales faster with chip technology then

memory

– Increasing memory requirements of

multimedia applications

5

TriMedia 32A200 Mhz0.18u 16.9 mm2

Page 6: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

• Power consumption is (becoming) the bottleneck

in chip design

• Power consumption is crucial in embedded

systems!!!

6

Page 7: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

Solution: multiprocessor system-on-chip!

100 MHz 50 MHz 50 MHz

P1 = f C V1 P2 = 2 f/2 C V2

[simplified]If V2 < V1 then P2 < P1

7

Page 8: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

2005 Intel developer forum, San Francisco 8

Page 9: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

http://www.amd.com/us-en/Corporate/VirtualPressRoom/0,,51_104_608,00.html 9

Page 10: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

IntroductionMemory spaces seen by an application:

– Stack: stores local data structures

– Heap: holds dynamically allocated memory

– Global data space: stores global (and static) data

structures

• System-on-chips of the future incorporate many IP

cores and memories: need for memory re-use!

• A designer sees all these memories... How and which

data structures of the application will (s)he put in

what memory ?

10

Page 11: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Introduction

In order to map the data structures onto the available

memories,

a designer needs to know:

1. What are the data structures that are used in the

application?

2. What are the memory requirements of the

application?

11

Page 12: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Content

1. Introduction

2. Problem definition

3. Approach

4. Implementation

5. To do list

6. Future work

12

Page 13: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Problem definition• Memory requirements application:

– Stack size requirements

– Memory required for global data structures

– Heap not considered:

• Dynamic memory allocation is hardly

used in embedded systems

• Applications in C-programming language

– THE programming language for embedded

systems

– Stack size requirements only accurate

without compiler optimisations

13

Page 14: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Problem definition

Multiprocessor template:

Local memory

Remote memory

14

Page 15: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Problem definition

Calculating stack size requirements, example:

Scope tree

15

Page 16: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Problem definition

But, what happens if the C-code changes to this?

16

Page 17: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Problem definition

Scope tree

17

Page 18: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Problem definition

• Problem: not every function call in the application

code is executed in practice due to control flow

and data flow, how to deal with them ?!

18

Page 19: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Content

1. Introduction

2. Problem definition

3. Approach

4. Implementation

5. To do list

6. Future work

19

Page 20: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

•An automated memory requirements calculator

only ‘sees’ the function call graph!

• F C G: nodes are functions; arrows represents the

call of another function

20

Page 21: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

Intermezzo: Let’s introduce some notations!

21

Page 22: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

Define the following sets:

In this context: a string represents a sequence of function calls.

For example: Alphabet F = {main, foo1, foo2, foo3} F

= (main, foo1, foo3)

22

Page 23: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

23

Page 24: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

• Writing out a recursive cycle as a string can be quite a

job…

• Let’s introduce a shorthand notation based on logical

expressions:

24

Page 25: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach• A recursive cycle written as a logical expression can

contain nested recursive cycles

• Length, prefix and concatenation also operate on strings

written as logical expression

• Example:

= foo_1, foo_2, foo_1, foo_2, foo_1, foo_2

= (foo_1, foo_2)3

• Example:

25

Page 26: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

Q: Why are these strings required?

A1:

– The automated memory size calculator does not take control flow and data flow into account!

– It only ‘knows’ the function call graph

• For instance, recall

26

Page 27: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

Or, more abstract:

Bound by FCG

Tighter bound due control + dataflow

27

Page 28: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

Q: Why are these strings required?

A2:

– The user must limit the observed space to

only contain the feasible region!

– The user specifies the sequences of function

calls that are feasible as strings to the

memory requirements calculator!

28

Page 29: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

ApproachSpecifying strings for an application:

– Use logical expression to capture recursive cycles efficiently

– Use prefix strings to re-use common parts in strings

For example, the following sequences can appear in an application:

( s1 =  main, foo_3, foo_1, foo_2, foo_1, foo_2, foo_2, foo_2

s2 = main, foo_3, foo_1, foo_2, foo_1, foo_3, foo_3,foo_3.

s3 = main, foo_3, foo_3.

Prefix strings are:

prefix1 = main, foo_3 prefix2 = prefix1, foo_1, foo_2, foo_1

The user specifies:

s1 = prefix2, (foo_2)3

s2 = prefix2, (foo_1)3

s3 = prefix1, foo_3

29

Page 30: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Approach

Optimisations are possible!

30

Page 31: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Content

1. Introduction

2. Problem definition

3. Approach

4. Implementation

5. To do list

6. Future work

31

Page 32: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

ImplementationImplemented tool statesize:

– Linux, C++

– Based on SUIF Compiler system

– Evaluates: C-programs

– Calculates memory requirements of applications

– Detects used global variables in the functions + global

memory requirements

User input:

– All allowed sequences of functions as strings

– Strings written as logical expressions in XML input file

• XML provides high level of re-use

– Supports use of: prefix, logical expressions

32

Page 33: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

Stack size calculation algorithm (pseudo code):

33

Page 34: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

Path + function

Valid / invalid

Is implemented

34

Page 35: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

ImplementationExample:

Path = main, foo_3, foo_1Function = foo_3

s1 = main, foo_3, foo_1, (foo_2)10

s2 = main, foo_3, foo_2

35

Page 36: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

Path + function

Recursion = foo_2Repeat = 10

Path = main, foo_3, foo_1Function = foo_2

s1 = main, foo_3, foo_1, (foo_2)10

s2 = main, foo_3, foo_2

Not implemented yet

36

Page 37: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

ImplementationExample XML input file and

FCG:

37

Page 38: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

Example program output:

38

Page 39: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

39

Page 40: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

40

Page 41: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

41

Page 42: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Implementation

Statesize:

– Calculates stack size requirements

• With / without function calls

– Calculates global memory requirements

• Detects which global data structures are

used

• Directly / indirectly

– Parses user specified ‘strings’ (XML input file)

42

Page 43: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Content

1. Introduction

2. Problem definition

3. Approach

4. Implementation

5. To do list

6. Future work

43

Page 44: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

To do list• Statesize enhancements:

– Implement optimisations

– Command line option: write out all detected

(nested) recursion cycles to XML file

– ? FCV: add suffix checking [e.g. * foo3, foo1] ?

• Report:

– Problem definition: add section

– Implementation: spec. FCV, spec. user input

– Write ‘Case study’ and ‘Future Work’

• Case study

– Test on real multimedia application

44

Page 45: 4 July 2005 overview Traineeship: Mapping of data structures in multiprocessor systems Nick de Koning 0513849 a.h.m.d.koning@student.tue.nl 1.

Future work

• Add function overloading support:

– Pre processing pass

– Embed in statesize [uglier]

• Full support regular expressions in XML input file

– In functions: foo_*

– In strings: prefix, *, suffix

45