a framework to quantify the overestimations of static wcet … · 2016. 9. 30. · a framework to...

24
A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas, Christine Rochange 15th Workshop on WCET Analysis – July 7, 2015

Upload: others

Post on 03-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas, Christine Rochange

15th Workshop on WCET Analysis – July 7, 2015

Page 2: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Static WCET analysis

source  code   binary  code  compiler  

B  

C   D  

E  

A  

CFG  building  

flow  analysis  

low-­‐level  analysis  

WCET  computa@on   WCET

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

feasible paths

local WCETs

Page 3: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Static WCET analysis Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

source  code   binary  code  compiler  

B  

C   D  

E  

A  

CFG  building  

flow  analysis  

WCET  computa@on   WCET

linear  p

rogram

     max  T=xA.wA  +  xB.wB+  xC.wC  +  xD.wD  +  xE.wE        xA  =  1  xA  =  xAB      xB  =  xAB  +  xEB  xB  =  xBC  +  xBD      xC  =  xBC  xC  =  xCE      xD  =  xBD  xD  =  xDE      xE  =  xCE  +  xDE  xE  =  1  +  xEB  

   xEB  ≤  255;    xBC  ≤  0.5  xB;    

low-­‐level  analysis  

   wA  =  …;  wB  =  …;  wC  =  …;  wD  =  …;  wE  =  …;  

Implicit Path Enumeration Technique (IPET)

Page 4: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

distribution

execution time

real WCET static WCET estimation

pessimism

observed execution times

pessimism ?

Page 5: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

flow  analysis   low-­‐level  analysis  

WCET  computa@on  

Page 6: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

flow  analysis   low-­‐level  analysis  

WCET  computa@on  

Page 7: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

flow  analysis  

WCET  computa@on  

P T = all the CFG paths

B  

C   D  

E  

A  

source code

binary code user annotations

P + = P T – known-to-be-infeasible paths

P r = really-feasible paths

longest paths

Page 8: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

flow  analysis   low-­‐level  analysis  

WCET  computa@on  

Page 9: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

low-­‐level  analysis  

WCET  computa@on  

initial hardware state

H T = all the theoretically-possible states H + = H T – known-to-be-infeasible states

H r = really-feasible states

Page 10: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

low-­‐level  analysis  

"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

low-­‐level  analysis  

WCET  computa@on  

C T = all the theoretically-possible scenarios C + = C T – known-to-be-infeasible scenarios

C r = really-feasible scenarios

B  

C   D  

E  

A  

Static analysis determines local WCETs (basic blocks) -  abstracts (over-approximates) hardware states -  considers all "maybe-possible" scenarios

Page 11: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Quantifying the pessimism of WCET estimates

Real WCET Static WCET estimation

§  upper bound on the WCET:

§  lower bound on the WCET:

Static WCET analysis Quantifying pessimism Example: cache analysis

Future work

U = WCET+ - WCET-

Page 12: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Quantifying the pessimism of WCET estimates

Static WCET analysis Quantifying pessimism Example: cache analysis

Future work

flow  analysis  

WCET  computa@on  

P T = all the CFG paths

source code

binary code user annotations

P + = P T – known-to-be-infeasible paths

P r = really-feasible paths

P - = known-to-be-feasible paths

Page 13: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Quantifying the pessimism of WCET estimates

Static WCET analysis Quantifying pessimism Example: cache analysis

Future work

low-­‐level  analysis  

WCET  computa@on  

initial hardware state

H T = all the theoretically-possible states H + = H T – known-to-be-infeasible states

H r = really-feasible states

H - = known-to-be-feasible states

Page 14: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

low-­‐level  analysis  

Quantifying the pessimism of WCET estimates

Static WCET analysis Quantifying pessimism Example: cache analysis

Future work

low-­‐level  analysis  

WCET  computa@on  

C T = all the theoreticaly-possible scenarios C + = C T – known-to-be-infeasible scenarios

C r = really-feasible scenarios

B  

C   D  

E  

A  

C - = known-to-be-feasible scenarios or scenarios that cannot produce an execution time that is longer than WCET r

Page 15: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Quantifying the pessimism of WCET estimates

Real WCET Static WCET estimation

§  upper bound on the WCET:

§  lower bound on the WCET:

Static WCET analysis Quantifying pessimism Example: cache analysis

Future work

U = WCET+ - WCET-

Page 16: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Background on static cache analysis

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

B  

C   D  

E  

A  

§  abstract interpretation §  cache state = ages of cache blocks (0..A)

S

S’ Update()

S’’ S’’’ Join() §  May and Must analyses

§  categories assigned to cache accesses -  AlwaysHit -  AlwaysMiss -  Persistent -  NotClassified

D  

Page 17: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Low-level analysis scenarios §  C T = {mmm, mmh,mhm, mhh,

hmm, hmh, hhm, hhh}

§  C + = {hmm, hmh, hhm, hhh}

§  C r = {hmh, hhm, hhh}

§  C - = {hhh}

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

a1    a2      a3  

AlwaysHit

NotClassified

basic block

NotClassified

Page 18: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Experimental methodology §  hardware platform (model):

²  MPC5554-like pipeline ²  4 KB, 4-way associative LRU instruction & data caches

–  infinite write buffer §  benchmarks from the TACLeBench collection (MediaBench)

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

Page 19: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Experimental methodology §  hardware platform (model):

²  MPC5554-like pipeline ²  4 KB, 4-way associative LRU instruction & data caches

–  infinite write buffer §  benchmarks from the TACLeBench collection (MediaBench) §  WCET analysis with the OTAWA toolset (WCET +)

²  we added the computation of WCET -

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

Page 20: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Global results (instruction + data caches)

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

Page 21: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Uncertainty of instruction cache analysis §  with pessimistic data cache analysis

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

Page 22: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Example: pessimism of cache analysis

Uncertainty of data cache analysis §  with pessimistic instruction cache analysis

Static WCET analysis Quantifying pessimism

Example: cache analysis Future work

Page 23: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,

Summary

Framework §  static analysis provides a guaranteed WCET upper bound (WCET+) §  we can compute a lower bound on the WCET (WCET-) §  the real WCET must be between WCET- and WCET+

²  uncertainty U = WCET+ - WCET-

Possible interpretations of U §  is my WCET estimation tight?

²  if not, it might be due to a poor analysis or to a poorly coded application

§  how do two analyses of the same component compare? §  which parts of the application would deserve a more precise analysis?

Page 24: A Framework to Quantify the Overestimations of Static WCET … · 2016. 9. 30. · A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas,