• No results found

Making Dynamic Memory Allocation Static To Support WCET Analyses

N/A
N/A
Protected

Academic year: 2021

Share "Making Dynamic Memory Allocation Static To Support WCET Analyses"

Copied!
13
0
0

Loading.... (view fulltext now)

Full text

(1)

computer science saarland university

Making Dynamic Memory Allocation Static To

Support WCET Analyses

Jörg Herter

Jan Reineke

Department of Computer Science Saarland University

WCET Workshop, June 2009

computer science

saarland

university
(2)

computer science saarland university

Current Situation

What we have ...

1

Precise WCET analysis

2

Dynamic Memory Allocation

I often clearer program structure

I easy memory reuse (e.g. in-situ transformations)

... but can we have both together?

(3)

computer science saarland university

Dynamic Memory Allocation & WCET Analysis

What are the challenges?

...

x = malloc(8);

...

x->data = y->data + 2;

...

How long will

malloc take?

(a) allocation to cache sets unknown! (b) effects of calls to malloc on cache?

Is the access to y

a cache hit?

y = malloc(4);

(4)

computer science saarland university

Approaches

What can be done?

Predictable Allocator

I J. Herter, J. Reineke, R. Wilhelm, 2008

Predictable Hardware

I M. Schöberl, 2009

Replace Dynamic Allocation by Static Allocation

(5)

computer science saarland university

Big Picture

t = malloc( sizeof (list)); ... y = x->data; Original Program

Static Analysis Pre-computation

of Static Addresses CFG & Liveness Informa- tion Program Description t = malloc( sizeof (list)); ... y = x->data; Loop Bounds t = 0xFD2; ... y = x->data; Modified Program

(6)

computer science saarland university

What are

Good

Addresses?

What do we consider good addresses for heap allocated objects?

Good addresses enable a subsequent WCET analysis to calculate

minimal WCET bounds ...

... by minimal memory consumption.

(7)

computer science saarland university

How to find good addresses?

Idea for an algorithm:

1

Compute addresses s.t. memory consumption is minimal

I Can generate an ILP to compute memory-optimal addresses from

liveness information!

2

Compute WCET for current addresses

I Can generate an ILP to compute WCET from control-flow graph,

loop bounds, and basic block information! (IPET, Li&Malik)

3

Select the program block with highest contribution to WCET

4

Modify addresses s.t. WCET contribution of selected block is

minimized

I Can generate an ILP to compute block-optimal addresses from

liveness and basic block information!

(8)

computer science saarland university

How to find good addresses?

Idea for an algorithm:

1

Compute addresses s.t. memory consumption is minimal

I Can generate an ILP to compute memory-optimal addresses from

liveness information!

2

Compute WCET for current addresses

I Can generate an ILP to compute WCET from control-flow graph,

loop bounds, and basic block information! (IPET, Li&Malik)

3

Select the program block with highest contribution to WCET

4

Modify addresses s.t. WCET contribution of selected block is

minimized

I Can generate an ILP to compute block-optimal addresses from

liveness and basic block information!

5

Continue at 2

(9)

computer science saarland university

How to find good addresses?

Idea for an algorithm:

1

Compute addresses s.t. memory consumption is minimal

I Can generate an ILP to compute memory-optimal addresses from

liveness information!

2

Compute WCET for current addresses

I Can generate an ILP to compute WCET from control-flow graph,

loop bounds, and basic block information! (IPET, Li&Malik)

3

Select the program block with highest contribution to WCET

4

Modify addresses s.t. WCET contribution of selected block is

minimized

I Can generate an ILP to compute block-optimal addresses from

liveness and basic block information!

(10)

computer science saarland university

How to find good addresses?

Idea for an algorithm:

1

Compute addresses s.t. memory consumption is minimal

I Can generate an ILP to compute memory-optimal addresses from

liveness information!

2

Compute WCET for current addresses

I Can generate an ILP to compute WCET from control-flow graph,

loop bounds, and basic block information! (IPET, Li&Malik)

3

Select the program block with highest contribution to WCET

4

Modify addresses s.t. WCET contribution of selected block is

minimized

I Can generate an ILP to compute block-optimal addresses from

liveness and basic block information!

5

Continue at 2

(11)

computer science saarland university

How to find good addresses?

Idea for an algorithm:

1

Compute addresses s.t. memory consumption is minimal

I Can generate an ILP to compute memory-optimal addresses from

liveness information!

2

Compute WCET for current addresses

I Can generate an ILP to compute WCET from control-flow graph,

loop bounds, and basic block information! (IPET, Li&Malik)

3

Select the program block with highest contribution to WCET

4

Modify addresses s.t. WCET contribution of selected block is

minimized

I Can generate an ILP to compute block-optimal addresses from

liveness and basic block information!

(12)

computer science saarland university

Heuristics, actually ...

ILPs to compute memory and block optimal addresses can be

replaced by simulated annealing algorithms to cope with

I more complex hardware (more cache sets)

I more complex software (more heap allocated blocks)

(13)

computer science saarland university

Conclusions & Future Work

Algorithm to compute static memory addresses for heap allocated

objects.

Preliminary experiments suggest feasible computational costs for

addresses.

Future Work:

I Static (pre-) analysis to collect needed information. I FullyAutomatic Transformation.

References

Related documents

It is envisaged that by this time, only 200,000 foreign workers will remains in the construction industry.The objectives of this study are; to identify the factors that led

College Strategic Objective(s) addressed: 4.3 Annual assessment of progress on program review, student learning outcome assessment and institutional planning as measured by

Summing up, the simple raw medicinal substances i.e.: non dynamized do not stimulate Biologic Energy as they act in the chemical field and not in the energy field and must be rubbed

 Reserves a block of memory of specified size and returns a pointer of type void.  The return pointer can be type-casted to any

Abbreviations: ISS-N1, Intronic splicing silencer N1; LDI, long-distance interaction; URC, U-rich cluster; ASO, antisense oligonucleotide; 2′-OMe, an ASO with

End October 2008 Consultant submits completed report End November 2008 Project board meeting: Sign off Stage Three End December 2008 Stage 4: Advisory Group: Establishment.

Figure 10 shows the created EViews workfile with pages for solving the deterministic model (MODEL2_HD), for integrating sales forecasts and the pro forma statement model

The material may produce skin sensitisation in predisposed individuals. Care must be taken, when removing gloves and other protective equipment, to avoid all possible skin