Compiler-based Extraction of Event Arrival Functions for Real-Time - - PowerPoint PPT Presentation

compiler based extraction of event arrival functions for
SMART_READER_LITE
LIVE PREVIEW

Compiler-based Extraction of Event Arrival Functions for Real-Time - - PowerPoint PPT Presentation

Compiler-based Extraction of Event Arrival Functions for Real-Time Systems Analysis Dominic Oehlert Selma Saidi Heiko Falk Institute of Embedded Systems Hamburg University of Technology firstname.surname@tuhh.de 30th Euromicro Conference on


slide-1
SLIDE 1

Compiler-based Extraction of Event Arrival Functions for Real-Time Systems Analysis

Dominic Oehlert Selma Saidi Heiko Falk

Institute of Embedded Systems Hamburg University of Technology firstname.surname@tuhh.de

30th Euromicro Conference on Real-Time Systems (ECRTS), 2018

slide-2
SLIDE 2

Motivation Background Evaluation Conclusion 1 / 20

slide-3
SLIDE 3

Motivation Background Evaluation Conclusion 1 / 20

slide-4
SLIDE 4

Motivation Background Evaluation Conclusion 2 / 20

slide-5
SLIDE 5

Motivation Background Evaluation Conclusion 2 / 20

slide-6
SLIDE 6

Motivation Background Evaluation Conclusion 200 400 600 800 1,000 1,200 1,400 1,600 1,800 2,000 2,200 2,400 2,600 2,800 3,000 10 20 30 40 ∆t in Cycles Number of Events η+(∆t) η−(∆t) 3 / 20

slide-7
SLIDE 7

Motivation Background Evaluation Conclusion 4 / 20

slide-8
SLIDE 8

Motivation Background Evaluation Conclusion 1,000 2,000 3,000 20 40 ∆t in Cycles Number of Events 4 / 20

slide-9
SLIDE 9

Motivation Background Evaluation Conclusion 1,000 2,000 3,000 20 40 ∆t in Cycles Number of Events 4 / 20

slide-10
SLIDE 10

Motivation Background Evaluation Conclusion 1,000 2,000 3,000 20 40 ∆t in Cycles Number of Events 4 / 20

slide-11
SLIDE 11

Motivation Background Evaluation Conclusion

5 10 15 20 25 t 5 10 15 20 1 2 3 ∆t

5 / 20

slide-12
SLIDE 12

Motivation Background Evaluation Conclusion

5 10 15 20 25 t 5 10 15 20 1 2 3 ∆t

5 / 20

slide-13
SLIDE 13

Motivation Background Evaluation Conclusion int globalData[ 2 ] = -1, 1; volatile int comm; i n t main ( ) { f o r ( i n t i = 0 ; i < 2 0 ; ++i ) { i f ( comm == 0 ) { globalData[ i % 2 ] = -1; } } r e t u r n 0 ; } 500 1,000 1,500 2,000 2,500 3,000 20 40 ∆t in Cycles Number of Events

?

6 / 20

slide-14
SLIDE 14

Motivation Background Evaluation Conclusion int globalData[ 2 ] = -1, 1; volatile int comm; i n t main ( ) { f o r ( i n t i = 0 ; i < 2 0 ; ++i ) { i f ( comm == 0 ) { globalData[ i % 2 ] = -1; } } r e t u r n 0 ; } 500 1,000 1,500 2,000 2,500 3,000 20 40 ∆t in Cycles Number of Events

?

6 / 20

slide-15
SLIDE 15

Motivation Background Evaluation Conclusion int globalData[ 2 ] = -1, 1; volatile int comm; i n t main ( ) { f o r ( i n t i = 0 ; i < 2 0 ; ++i ) { i f ( comm == 0 ) { globalData[ i % 2 ] = -1; } } r e t u r n 0 ; } 500 1,000 1,500 2,000 2,500 3,000 20 40 ∆t in Cycles Number of Events

?

6 / 20

slide-16
SLIDE 16

Motivation Background Evaluation Conclusion

Extracting Curves?

  • Capture traces

⇒ Potentially unsafe

  • Rely on specifications

⇒ Potentially overly pessimistic

  • Extraction based on the low-level representation

7 / 20

slide-17
SLIDE 17

Motivation Background Evaluation Conclusion

Extracting Curves?

  • Capture traces

⇒ Potentially unsafe

  • Rely on specifications

⇒ Potentially overly pessimistic

  • Extraction based on the low-level representation

7 / 20

slide-18
SLIDE 18

Motivation Background Evaluation Conclusion

Extracting Curves?

  • Capture traces

⇒ Potentially unsafe

  • Rely on specifications

⇒ Potentially overly pessimistic

  • Extraction based on the low-level representation

7 / 20

slide-19
SLIDE 19

Motivation Background Evaluation Conclusion

Extracting Curves?

  • Capture traces

⇒ Potentially unsafe

  • Rely on specifications

⇒ Potentially overly pessimistic

  • Extraction based on the low-level representation

7 / 20

slide-20
SLIDE 20

Motivation Background Evaluation Conclusion

Extracting Curves?

  • Capture traces

⇒ Potentially unsafe

  • Rely on specifications

⇒ Potentially overly pessimistic

  • Extraction based on the low-level representation

7 / 20

slide-21
SLIDE 21

Motivation Background Evaluation Conclusion 8 / 20

slide-22
SLIDE 22

Motivation Background Evaluation Conclusion 8 / 20

slide-23
SLIDE 23

Motivation Background Evaluation Conclusion

5 10 15 20 25 t

9 / 20

slide-24
SLIDE 24

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-25
SLIDE 25

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-26
SLIDE 26

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-27
SLIDE 27

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-28
SLIDE 28

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-29
SLIDE 29

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-30
SLIDE 30

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-31
SLIDE 31

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-32
SLIDE 32

Motivation Background Evaluation Conclusion 10 20 30 40 50 60 70 A B E t 20 40 60 80 A C F G ... t 20 40 60 80 A C F H ... t 20 40 60 80 A C F G ... t . . . 10 / 20

slide-33
SLIDE 33

Motivation Background Evaluation Conclusion

Path Analysis for Arrival Functions

  • Explicit path analysis quickly becomes practically infeasible

⇒ Sliding window for all traces

⇒ Adapt path analysis techniques ⇒ Introduce granularity

  • Trade-off between precision and runtime

11 / 20

slide-34
SLIDE 34

Motivation Background Evaluation Conclusion

Path Analysis for Arrival Functions

  • Explicit path analysis quickly becomes practically infeasible

⇒ Sliding window for all traces

⇒ Adapt path analysis techniques ⇒ Introduce granularity

  • Trade-off between precision and runtime

11 / 20

slide-35
SLIDE 35

Motivation Background Evaluation Conclusion

Path Analysis for Arrival Functions

  • Explicit path analysis quickly becomes practically infeasible

⇒ Sliding window for all traces

⇒ Adapt path analysis techniques ⇒ Introduce granularity

  • Trade-off between precision and runtime

11 / 20

slide-36
SLIDE 36

Motivation Background Evaluation Conclusion

Path Analysis for Arrival Functions

  • Explicit path analysis quickly becomes practically infeasible

⇒ Sliding window for all traces

⇒ Adapt path analysis techniques ⇒ Introduce granularity

  • Trade-off between precision and runtime

11 / 20

slide-37
SLIDE 37

Motivation Background Evaluation Conclusion

Path Analysis for Arrival Functions

  • Explicit path analysis quickly becomes practically infeasible

⇒ Sliding window for all traces

⇒ Adapt path analysis techniques ⇒ Introduce granularity

  • Trade-off between precision and runtime

11 / 20

slide-38
SLIDE 38

Motivation Background Evaluation Conclusion

Overview

Motivation Background Evaluation Conclusion

11 / 20

slide-39
SLIDE 39

Motivation Background Evaluation Conclusion

Overview

Motivation Background Evaluation Conclusion

11 / 20

slide-40
SLIDE 40

Motivation Background Evaluation Conclusion

Event Arrival Functions

  • Abstract notion of interfering events (e.g., task activations, shared memory

accesses, ...)

Definition

Let η+

i (∆t) and η− i (∆t) denote for each task i the maximum and minimum number of

events issued within a time window of size ∆t. Their pseudo-inverse counterparts δ+(n) and δ−(n), return the maximum/minimum time interval between the first and the last event in any sequence of n event arrivals.

12 / 20

slide-41
SLIDE 41

Motivation Background Evaluation Conclusion

Event Arrival Functions

  • Abstract notion of interfering events (e.g., task activations, shared memory

accesses, ...)

Definition

Let η+

i (∆t) and η− i (∆t) denote for each task i the maximum and minimum number of

events issued within a time window of size ∆t. Their pseudo-inverse counterparts δ+(n) and δ−(n), return the maximum/minimum time interval between the first and the last event in any sequence of n event arrivals.

12 / 20

slide-42
SLIDE 42

Motivation Background Evaluation Conclusion

Event Arrival Functions

  • Abstract notion of interfering events (e.g., task activations, shared memory

accesses, ...)

Definition

Let η+

i (∆t) and η− i (∆t) denote for each task i the maximum and minimum number of

events issued within a time window of size ∆t. Their pseudo-inverse counterparts δ+(n) and δ−(n), return the maximum/minimum time interval between the first and the last event in any sequence of n event arrivals.

12 / 20

slide-43
SLIDE 43

Motivation Background Evaluation Conclusion

Implicit Path Enumeration Technique

  • Describe all feasible paths by formulating an Integer Linear

Program (ILP) [DAC95]

  • Enforcing complete path through a program using junction rules

13 / 20

slide-44
SLIDE 44

Motivation Background Evaluation Conclusion

Implicit Path Enumeration Technique

  • Describe all feasible paths by formulating an Integer Linear

Program (ILP) [DAC95]

  • Enforcing complete path through a program using junction rules

13 / 20

slide-45
SLIDE 45

Motivation Background Evaluation Conclusion

Implicit Path Enumeration Technique

  • Describe all feasible paths by formulating an Integer Linear

Program (ILP) [DAC95]

  • Enforcing complete path through a program using junction rules

13 / 20

slide-46
SLIDE 46

Motivation Background Evaluation Conclusion

Implicit Path Enumeration Technique

  • Describe all feasible paths by formulating an Integer Linear

Program (ILP) [DAC95]

  • Enforcing complete path through a program using junction rules

13 / 20

slide-47
SLIDE 47

Motivation Background Evaluation Conclusion

Implicit Path Enumeration Technique

  • Describe all feasible paths by formulating an Integer Linear

Program (ILP) [DAC95]

  • Enforcing complete path through a program using junction rules

13 / 20

slide-48
SLIDE 48

Motivation Background Evaluation Conclusion

Adapted IPET

  • First introduced by Jacobs et al. [RTNS15]
  • Introduce “movable” sources and sinks
  • Determine max. (resp. min.) number of events per basic block
  • Maximize (resp. minimize) accumulated number of events over

sub-path

⇒ While accumulated time w ≤ ∆t (resp. w ≥ ∆t)

14 / 20

slide-49
SLIDE 49

Motivation Background Evaluation Conclusion

Adapted IPET

  • First introduced by Jacobs et al. [RTNS15]
  • Introduce “movable” sources and sinks
  • Determine max. (resp. min.) number of events per basic block
  • Maximize (resp. minimize) accumulated number of events over

sub-path

⇒ While accumulated time w ≤ ∆t (resp. w ≥ ∆t)

14 / 20

slide-50
SLIDE 50

Motivation Background Evaluation Conclusion

Adapted IPET

  • First introduced by Jacobs et al. [RTNS15]
  • Introduce “movable” sources and sinks
  • Determine max. (resp. min.) number of events per basic block
  • Maximize (resp. minimize) accumulated number of events over

sub-path

⇒ While accumulated time w ≤ ∆t (resp. w ≥ ∆t)

14 / 20

slide-51
SLIDE 51

Motivation Background Evaluation Conclusion

Adapted IPET

  • First introduced by Jacobs et al. [RTNS15]
  • Introduce “movable” sources and sinks
  • Determine max. (resp. min.) number of events per basic block
  • Maximize (resp. minimize) accumulated number of events over

sub-path

⇒ While accumulated time w ≤ ∆t (resp. w ≥ ∆t)

14 / 20

slide-52
SLIDE 52

Motivation Background Evaluation Conclusion

Adapted IPET

  • First introduced by Jacobs et al. [RTNS15]
  • Introduce “movable” sources and sinks
  • Determine max. (resp. min.) number of events per basic block
  • Maximize (resp. minimize) accumulated number of events over

sub-path

⇒ While accumulated time w ≤ ∆t (resp. w ≥ ∆t)

14 / 20

slide-53
SLIDE 53

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

15 / 20

slide-54
SLIDE 54

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

15 / 20

slide-55
SLIDE 55

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

15 / 20

slide-56
SLIDE 56

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-57
SLIDE 57

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-58
SLIDE 58

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-59
SLIDE 59

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-60
SLIDE 60

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-61
SLIDE 61

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-62
SLIDE 62

Motivation Background Evaluation Conclusion

Automated Extraction

  • Two dimensions of

granularity:

  • Events per basic block
  • Sample rate
  • Adjustable trade-off between

runtime and tightness

  • Albeit, arrival functions will

be safe

2 4 6 15 / 20

slide-63
SLIDE 63

Motivation Background Evaluation Conclusion 100 200 300 400 500 600 700 800 900 1,000 20 40 60 80 ∆t in Cycles Number of Events Binary Search (696 Sample Points) 16 / 20

slide-64
SLIDE 64

Motivation Background Evaluation Conclusion 100 200 300 400 500 600 700 800 900 1,000 20 40 60 80 ∆t in Cycles Number of Events Binary Search (696 Sample Points) 100 Sample Points 16 / 20

slide-65
SLIDE 65

Motivation Background Evaluation Conclusion 100 200 300 400 500 600 700 800 900 1,000 20 40 60 80 ∆t in Cycles Number of Events Binary Search (696 Sample Points) 100 Sample Points 50 Sample Points 16 / 20

slide-66
SLIDE 66

Motivation Background Evaluation Conclusion

Overview

Motivation Background Evaluation Conclusion

16 / 20

slide-67
SLIDE 67

Motivation Background Evaluation Conclusion

Overapproximation Metric

20 40 60 80 100 120 140 160 180 200 220 2 4 6 8 10

Pessimistic Curve Extracted Curve

∆t in Cycles Number of Events

dappr = APess−AExtr

APess

17 / 20

slide-68
SLIDE 68

Motivation Background Evaluation Conclusion

Overapproximation Metric

20 40 60 80 100 120 140 160 180 200 220 2 4 6 8 10

Pessimistic Curve Extracted Curve

∆t in Cycles Number of Events

dappr = APess−AExtr

APess

17 / 20

slide-69
SLIDE 69

Motivation Background Evaluation Conclusion

Evaluation Setup

  • MRTC benchmark suite
  • duff benchmark excluded (due to timing analysis tool incompatibility)
  • Evaluations performed on an Intel Xeon Server (20 cores at 2.3 GHz, 94 GB RAM)
  • ILPs solved using Gurobi 7.5.0
  • Compiled with the WCET-aware C compiler (WCC) using the -O2 flag
  • ARM7TDMI architecture (without caches)
  • Data object access triggers an event

18 / 20

slide-70
SLIDE 70

Motivation Background Evaluation Conclusion a d p c m _ d e c a d p c m _ e n c b i n a r y s e a r c h b s

  • r

t 1 c

  • m

p r e s s d a t a c

  • u

n t n e g a t i v e c r c e d n f d c t ff t 1 fi r i n s e r t s

  • r

t j f d c t i n t l c d n u m l m s l u d c m p m a t m u l t m i n v e r n d e s n s p e t r i n e t q s

  • r

t

  • e

x a m q u r t s e l e c t s q r t s t s t a t e m a t e 0% 10% 20% 30% 40% 50% dappr

  • N. Refined BBs (100 Samples)

Refined BBs (100 Samples) Refined BBs (1000 Samples) Refined BBs (Binary Search) 19 / 20

slide-71
SLIDE 71

Motivation Background Evaluation Conclusion a d p c m _ d e c a d p c m _ e n c b i n a r y s e a r c h b s

  • r

t 1 c

  • m

p r e s s d a t a c

  • u

n t n e g a t i v e c r c e d n f d c t ff t 1 fi r i n s e r t s

  • r

t j f d c t i n t l c d n u m l m s l u d c m p m a t m u l t m i n v e r n d e s n s p e t r i n e t q s

  • r

t

  • e

x a m q u r t s e l e c t s q r t s t s t a t e m a t e 0% 10% 20% 30% 40% 50% dappr

  • N. Refined BBs (100 Samples)

Refined BBs (100 Samples) Refined BBs (1000 Samples) Refined BBs (Binary Search) q u r t s e l e c t s q r t 19 / 20

slide-72
SLIDE 72

Motivation Background Evaluation Conclusion

Overview

Motivation Background Evaluation Conclusion

19 / 20

slide-73
SLIDE 73

Motivation Background Evaluation Conclusion

Conclusion

  • Automated upper and lower event arrival function extraction from code-level

analysis

  • Two adjustable levels of granularity

Outlook

  • Adding calling contexts
  • Optimizations based on the extracted functions

20 / 20

slide-74
SLIDE 74

Motivation Background Evaluation Conclusion

Conclusion

  • Automated upper and lower event arrival function extraction from code-level

analysis

  • Two adjustable levels of granularity

Outlook

  • Adding calling contexts
  • Optimizations based on the extracted functions

20 / 20

slide-75
SLIDE 75

Motivation Background Evaluation Conclusion

Conclusion

  • Automated upper and lower event arrival function extraction from code-level

analysis

  • Two adjustable levels of granularity

Outlook

  • Adding calling contexts
  • Optimizations based on the extracted functions

20 / 20

slide-76
SLIDE 76

Motivation Background Evaluation Conclusion

Conclusion

  • Automated upper and lower event arrival function extraction from code-level

analysis

  • Two adjustable levels of granularity

Outlook

  • Adding calling contexts
  • Optimizations based on the extracted functions

20 / 20

slide-77
SLIDE 77

Motivation Background Evaluation Conclusion

Conclusion

  • Automated upper and lower event arrival function extraction from code-level

analysis

  • Two adjustable levels of granularity

Outlook

  • Adding calling contexts
  • Optimizations based on the extracted functions

20 / 20