a framework to quantify the overestimations of static wcet … · 2016. 9. 30. · a framework to...
TRANSCRIPT
A Framework to Quantify the Overestimations of Static WCET Analysis Hugues Cassé, Haluk Ozaktas, Christine Rochange
15th Workshop on WCET Analysis – July 7, 2015
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
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)
"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 ?
"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism
Example: cache analysis Future work
flow analysis low-‐level analysis
WCET computa@on
"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism
Example: cache analysis Future work
flow analysis low-‐level analysis
WCET computa@on
"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
"Static analysis overestimates WCET" Static WCET analysis Quantifying pessimism
Example: cache analysis Future work
flow analysis low-‐level analysis
WCET computa@on
"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
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
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-
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
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
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
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-
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
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
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
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
Example: pessimism of cache analysis
Global results (instruction + data caches)
Static WCET analysis Quantifying pessimism
Example: cache analysis Future work
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
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
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?