+ All Categories
Home > Documents > HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’...

HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’...

Date post: 28-Jun-2020
Category:
Upload: others
View: 14 times
Download: 0 times
Share this document with a friend
50
HEPTANE (Hades Embedded Processor Timing ANalyzEr) A Modular Tool for Sta>c WCET Analysis ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April 2016 Damien Hardy
Transcript
Page 1: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HEPTANE  (Hades  Embedded  Processor  Timing  ANalyzEr)  

A  Modular  Tool  for  Sta>c  WCET  Analysis  

ALF research group, IRISA/INRIA Rennes

TuTor’16, Vienna, April 2016

Damien  Hardy  

Page 2: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

About  HEPTANE  •  Developed  at  IRISA/University  of  Rennes  

•  Stable  research  prototype  •  Licenced  under  GPL  •  C++  code  •  Supported  architectures  

–  MIPS  –  Par>ally:  ARM  v7,  Patmos  (under  construc>on)  –  Not  supported  anymore:  Power  PC  

•  The  first  version  has  been  designed  around  2000  •  Many  updates  since  then!  •  Available  online  

 hTps://team.inria.fr/alf/soVware/heptane/  

2

Page 3: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Developers  over  the  ages  –  Isabelle  Puaut  –  Antoine  Colin  –  Jean-­‐François  Deverge  –  Thomas  Piquet  –  Damien  Hardy  –  Benjamin  Lesage  –  Erven  Rohou  –  François  Joulaud  – MaThieu  Avila  –  Nicolas  Kiss  –  Loïc  Besnard  

3

Page 4: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Research  based  on  Heptane  

•  Cache  analysis  (cache  hierarchies,  mul>-­‐cores)  •  Branch  predic>on  (analysis,  compiler-­‐directed)  •  Cache  locking,  par>>oning  •  Scratchpad  management  •  CRPD  es>ma>on  •  Sta>c  probabilis>c  WCET  •  Traceability  of  flow  informa>on  

4

Page 5: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Outlines  –  Quick  overview    

•  Framework  •  Installa>on  

–  How  to  use  it    •  HeptaneExtract  •  HeptaneAnalysis  

–  Low  level  analysis  –  High  level  analysis  –  Extra  analysis  

–  Inside  Heptane  •  build  your  analysis  •  Source  •  Cfglib  •  Useful  func>ons  

5

Page 6: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Heptane  Framework  

•  CFG  Library  –  Extensible  program  representa>on  

•  Program,  CFG,  Loop,  basic  block,  instruc>on…  

•  HeptaneExtract  –  CFG  building  from  the  binary  –  Loops  extrac>on  

•  HeptaneAnalysis  –  Mul>ple  analyses  step  –  Interface  to  define  new  analyses  

CFG LIBRARY

Analysis 1

Analysis 2

Analysis 3 Based on

1&2

6

Page 7: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Function: Multiply

loop [maxiter=20]

loop [maxiter=20]

loop [maxiter=20]

@0x400330 (BB)

@0x400224 (BB) @0x40033c (BB)

@0x40032c (BB)

@0x400320 (BB)

@0x40022c (BB)

@0x40031c (BB)

@0x400310 (BB)

@0x40025c (BB)

@0x40020c (BB)

Heptane  toolchain  

.c file

& loops bounds

Compiler (gcc/LLVM)

CFG extraction

Binary

XML file

Low-Level Analysis

High-Level Analysis

•  WCET •  WCEP •  Statistics •  HTML

7

HeptaneExtract

HeptaneAnalysis

Page 8: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Installa>on  (1/2)  

•  Requirements  –  OS:  Linux  or  Mac  OS  X  –  Libxml2  –  ILP  solver  (lp-­‐solve,  cplex)  

•  Op>onal  –  Doxygen  –  Dot  –  epstopdf  

8

Page 9: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Installa>on  (2/2)  •  For  the  tutorial  

– Virtual  machine    hTps://tutor2016.inria.fr/heptane  

•  Otherwise  –  Script:  install.sh  

System  dependent  

Part  to  install  

9

Page 10: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Outlines  –  Quick  overview    

•  Framework  •  Installa>on  

–  How  to  use  it    •  HeptaneExtract  •  HeptaneAnalysis  

–  Low  level  analysis  –  High  level  analysis  –  Extra  analysis  

–  Inside  Heptane  •  build  your  analysis  •  Source  •  Cfglib  •  Useful  func>ons  

10

Page 11: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

How  to  use  it  

•  Source  code  in  C    –  With  annota>on  for  the  loops  bounds:  ANNOT_MAXITER(cst)  

Include  needed  

ANNOT_MAXITER  for  each  loop  

Some  restric>ons  – No  pointers  – No  malloc  – Natural  loops  – No  recursion  

11

Page 12: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

How  to  use  it:  HeptaneExtract  

.c file

& loops bounds

configuration file (.xml)

Compiler (gcc/LLVM)

CFG extraction

Binary

HeptaneExtract

CFG

.xml

+ optional files (binary, objdump…)

12

Page 13: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneExtract:  configura>on  file  

Compiler configuration

Target

Binutils configuration

13

Page 14: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneExtract:  configura>on  file  

in/tmp/out directories

Output files and information

14

Page 15: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneExtract:  configura>on  file  

Program to extract

15

Page 16: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneExtract:  Good  news!  

•  Automa>c  configura>on  (for  simple  cases)  –  In  the  directory  benchmarks  

•  configExtract_template.xml  •  extract.sh  

./extract.sh  <benchmark_name>  

16

Page 17: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

CFG.xml  

17

Page 18: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

How  to  use  it:  HeptaneAnalysis  

configuration file (.xml)

Low Level

Analysis

High Level

Analysis

HeptaneAnalysis

CFG

.xml

•  WCET •  WCEP •  Statistics •  HTML

18

Page 19: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  configura>on  file    

Directory of the program

Architecture information

LRU/PLRU/FIFO/MRU/RANDOM

19

Page 20: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  configura>on  file    

20

Page 21: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  Good  news!  

•  Automa>c  configura>on    –  In  the  directory  config_files:  configWCET_template.xml  –  analysis.sh:  ./analysis.sh  <benchmark_name>  –  Or:  ./bin/HeptaneAnalysis  <configWCET.xml>  

21

Page 22: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  Analyses  

•  Each  analysis  can  be  seen  as  a  pass  –  Performed  in  the  order  of  declara>on  in  the  config  file  

•  Each  analysis  extends  the  XML  file  (CFG)  –  Informa>on  added  with  aTributes  

•  Program,  CFG,  Node,  Loop,  Edge,  Instruc>on  

•  3  steps  per  analysis  –  CheckInputATributes  –  PerformAnalysis  –  RemovePrivateATributes  

22

Page 23: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  common  parameters  

23

Input file Keep results in memory Output file

Page 24: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Analyses  

•  Low-­‐level  analysis:  Timing  informa>on  per  basic  block  

•  High-­‐level  analysis:  WCET  es>ma>on  –  Implicit  Path  Enumera>on  Technique  (IPET)  –  No  Tree  based  method  anymore  

•  Extra  analysis:  sta>s>cs  &  some  informa>on  

24

Address Analysis

Cache Analysis

Pipeline Analysis

Page 25: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Address  analysis  (1/2)  

•  Instruc>on  address  analysis  –  Performed  during  the  CFG  extrac>on  (OUTPUTCODEADDRESS)  

•  Data  address  analysis  –  Contextual  analysis  (calling  context)  –  Performed  at  the  basic  block  granularity  –  Pointers  not  supported  (currently)  

25

Initial stack pointer address

Page 26: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Address  analysis  (2/2)  •  For  each  func>on:  stack  informa>on  per  context  

•  For  each  access  

26

Page 27: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Cache  analysis  

•  Instruc>on  &  data  caches  –  Contextual  analysis  (calling  context)  –  Based  on  abstract  interpreta>on  (must,  may,  persistence)  – Mul>-­‐level  non  inclusive  cache  hierarchies    

•  write-­‐through  no-­‐write  allocate  data  caches  –  Input  aTributes:  instruc>on  &  data  addresses  

27

Page 28: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Cache  analysis:  inside

•  Computa>on  of  Abstract  Cache  States  (ACS)  –  Contains  all  possible  cache  contents  considering  “all”  possible  execu>on  paths    

•  3  Analyses  (Fixpoint  computa>on)  – Must,  May  and  Persistence  – Modifica>on  of  ACS  

•  Update:  at  every  reference  •  Join:  at  every  path  merging  point  

•  Access  categoriza>on  from  ACS  –  Cache  Hit  Miss  Classifica>on  (CHMC)  

•  Always  hit,  Always  miss,  First  miss,  Not-­‐classified    

28

Page 29: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Must analysis

Age +

Join Intersection + max age

a b c d b e d a

{} b {} d,a

Update Apply replacement policy (ex: LRU)

a b c d

e a b c

[e]

ACS  contain  all  program  lines  guaranteed  to  be  in  the  cache  at  a  given  point  

29

Age + Age +

Page 30: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Cache  analysis:  Mul>-­‐level •  Filtering  informa>on  between  cache  levels  

–  Cache  Access  Classifica>on  (CAC)  •  Always,  Never,  Uncertain  

•  Modifica>on  of  the  update  func>on  –  Always:  the  ACS  is  updated  as  before  –  Never:  no  modifica>on  of  the  ACS  –  Uncertain  

30

Classification

Cache analysisLevel L+1

Cache analysisLevel L

Filtering

referencesMemory

FilteringCache Hit/MissClassificationCache Access

Always access

out

inACS

Update Identity

Join function

Update function for uncertain accessm

Never access

ACS

Page 31: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Cache  analysis:  output  

31

Page 32: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Pipeline  analysis  •  Pipeline  analysis:  compute  the  >ming  of  basic  blocks  

–  Contextual  analysis  (calling  context)  –  Input  aTributes:  CHMC  of  I$  and  D$  

32

Page 33: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Pipeline  analysis:  inside  

Principle  :  parallelism  between  instruc>ons  •  Intra  basic-­‐block  

 

•  Inter  basic-­‐block  

33

Time

Time

Fetch Decode Execute Memory Write Back

Time

IF ID EX ME WB

Time

33

Page 34: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Analyses  

•  Low-­‐level  analysis:  Timing  informa>on  per  basic  block  

•  High-­‐level  analysis:  WCET  es7ma7on  –  Implicit  Path  Enumera>on  Technique  (IPET)  –  No  Tree  based  method  anymore  

•  Extra  analysis:  sta>s>cs  &  some  informa>on  

34

Address Analysis

Cache Analysis

Pipeline Analysis

Page 35: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

IPET  analysis  

•  IPET  analysis:  final  WCET  computa>on  –  Contextual  analysis  (calling  context)  –  Input  aTributes:  CHMC  of  I$  and  D$  or  >ming  of  basic  blocks  

35

METHOD_CACHE_NOPIPELINE METHOD_CACHE_PIPELINE METHOD_NOCACHE_NOPIPELINE

Solver: lp_solve or cplex

Page 36: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Integer Linear Programming (ILP)

–  Constant: Ti Variable: fi –  Objective function: max: f1T1+f2T2+…+fnTn –  Structural constraints

∀ bbi : fi = Σ aj = Σ ak

f1 = 1

–  Extra flow information ∀ bbi in loop, fi ≤ k (loop bound) fi + fj ≤ 1 (mutually exclusive paths – not in loop) fi ≤ 2 fj (relations between execution freqs.)

IPET: inside

aj∈In(bbi) ak∈Out(bbi)

T1

T2

T3

T4 T5

T6

T7

36

Page 37: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Analyses  

•  Low-­‐level  analysis:  Timing  informa>on  per  basic  block  

•  High-­‐level  analysis:  WCET  es>ma>on  –  Implicit  Path  Enumera>on  Technique  (IPET)  –  No  Tree  based  method  anymore  

•  Extra  analysis:  sta7s7cs  &  some  informa7ons  

37

Address Analysis

Cache Analysis

Pipeline Analysis

Page 38: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Extra  analysis:  sta>s>cs  (1/2)  

•  Cache  sta>s>cs  –  Contextual  analysis  (calling  context)  –  Input  aTributes:  CHMC  of  caches  &  WCET  computa>on  

38

Page 39: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Extra  analysis:  sta>s>cs  (2/2)  

•  Codeline  &  htmlprint  –  Input  aTributes:  WCET  computa>on  

39

Page 40: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Extra  analysis:  some  informa>ons  (1/2)    •  Dotprint  

40

Function: Multiply

loop [maxiter=20]

loop [maxiter=20]

loop [maxiter=20]

@0x400330 (BB)

@0x400224 (BB) @0x40033c (BB)

@0x40032c (BB)

@0x400320 (BB)

@0x40022c (BB)

@0x40031c (BB)

@0x400310 (BB)

@0x40025c (BB)

@0x40020c (BB)

Page 41: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Extra  analysis:  some  informa>ons  (2/2)    •  Simpleprint  

41

Page 42: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

For  the  aVernoon  session  

•  Heptane  u>liza>on  –  HeptaneExtract  –  HeptaneAnalysis  

•  Build  your  own  analysis  –  Percentage  of  load/store  instruc>ons  in  a  program  

1.  Number  of  instruc>ons  2.  Number  of  load/store  3.  Contextual  analysis  (calling  context)  

42

Page 43: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Build  your  analysis  

•  Inheritance:  Analysis.h  –  �CheckInputATributes,  �PerformAnalysis,  �RemovePrivateATributes  

•  Generic/config.cc  –  Parsing  of  the  parameters  –  Instanciate  the  analysis  

•  Good  news:  DummyAnalysis  ��Heptane/src/HeptaneAnalysis/src/Specific/DummyAnalysis/  <DUMMYANALYSIS/>  in  the  configura>on  file  

43

Page 44: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Inside  Heptane:  Source    

•  Common  –  cfglib  –  ArchitectureDependent,  GlobalATributes,  Utl  

•  HeptaneExtract  •  HeptaneAnalysis  

–  Generic:  context,  AnalysisHelper,  Analysis.h  …  –  SharedATributes:  name  of  Serialisable  ATributes  (SharedATributes.h)  

–  Specific:  a  directory  for  each  analysis  

44

Page 45: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

CFG  library  (1/3)  

•  Hierarchical  structure  –  Program  

•  CFG  –  Node  

•  Instruc>on  –  Edge  –  Loop  

•  Func>ons  to  manipulate  the  program  representa>on  –  �/home/user/Desktop/Heptane/src/cfglib_install/doc/generated-­‐doc/html/index.html  

45

GetProgram GetAllNodes/GetAllLoops… GetPredecessors/GetSuccessors

Page 46: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

CFG  library  (2/3)  •  Informa>on  added  with  aTributes  

–  Program,  CFG,  Node,  Loop,  Edge,  Instruc>on  

•  ATributes:  Serialisable  &  non  serialisable  –  �[Non]Serialisable[Type]ATribute  

•  Type:  Integer,  String,  Float,  UnsignedLong  

•  New  aTributes  –  Inheritance:  �NonSerialisableATribute  /  SerialisableATribute  

•  SerialisableATribute  for  Heptane  –  Func>ons:  �WriteXml  &  ReadXml  –  �Declara>on  of  the  aTribute  in  main.cc  (func>on  main  of  HeptaneAnalysis)  

46

Page 47: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

CFG  library  (3/3)  

•  Generic  func>ons  (ATributed.h)  �bool  HasATribute      (std::string  ATributeName);  �void  SetATribute    (std::string  ATributeName,  ATribute  &aTribute);  �void  RemoveATribute    (std::string  ATributeName)  ;  �ATribute  &GetATribute  (std::string  ATributeName)  ;    

47

Page 48: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  useful  func>ons  (1/2)  

•  Generic  func>ons  �applyToAllNodesRecursive  (Program  *  p,  t_node_func>on  *  f,  void  *param);  

48

Page 49: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

HeptaneAnalysis:  useful  func>ons  (2/2)  •  Context  (aTached  to  cfgs)  

�AnalysisHelper::computeContext  (Program*  p);  

•  Context  manipula>on  

GetContextualPredecessors/�GetContextualSuccessors  Return:  Vector<ContextualNode>  

49

Page 50: HEPTANE’ - Inria · HEPTANE’ (HadesEmbeddedProcessorTiming ANalyzEr) A Modular’Toolfor’ Stac WCET Analysis’ ALF research group, IRISA/INRIA Rennes TuTor’16, Vienna, April

Ques>ons?      

             

hTps://team.inria.fr/alf/soVware/heptane/  [email protected]  [email protected]  


Recommended