• No results found

Timing Analysis of Real-Time Software

N/A
N/A
Protected

Academic year: 2021

Share "Timing Analysis of Real-Time Software"

Copied!
31
0
0

Loading.... (view fulltext now)

Full text

(1)

Timing Analysis of

Real-Time Software

Raimund Kirner

Vienna University of Technology

Austria

This is joint work with Peter Puschner and the CoSTA and ForTAS project teams.

(2)

2

From RTS Design to Implementation

T1

T4

T2 T3

t

Task set with precedence constraints and deadline

T1 T2 T3 T4

t

Task sequence: execution times, response time

(3)

WCET: Timing Analysis Abstraction

T1 T2 T3 T4

T1 T2 T3 T4

t

In general it is infeasible to model all possible execution scenarios and combinations of task execution times

T1 T2 T3 T4 T1 T3 T2 T4

WCET analysis abstracts the different execution times of each task to one single value Ö WCET bound

Ti Ti

xt < WCET xt = WCET

(4)

4

WCET vs. calculated WCET bound

BCET WCET

t

frequency

(5)

Remarks on WCET Analysis

• Computes upper bounds

• Bounds are application-dependent

• Assesses time that processor is actually executing

the code

• WCET result is hardware-dependent

Ö WCET bounds must be safe Ö WCET bounds should be tight

(6)

6

Requirements on WCET Analysis Tools

Find feasible abstractions and analysis methods such that: 1. development effort of WCET tool is affordable

2. the calculated WCET estimates are sufficiently precise

3. analysis problems are tractable with acceptable resource requirements, and

4. the WCET tool is easy to use

Acceptance depends on application domain…

Tradeoffs required: there is no single WCET analysis

(7)

The Path Problem

• The path problem: calculate a description or enumeration of the (in)feasible paths of a program

• Any brute-force approaches like executing or simulating the program with all possible input data are intractable

(the different values of input data are even more than different paths exist)

• Problem is shifted to the user: request for manual path descriptions (requires experts, high effort, is error-prone)

• Program analyzes with right abstractions help to reduce the needed manual code annotations.

(8)

8

Program Annotations for WCET Analysis

• Explicit flow information required to guide WCET analysis:

– intractable program complexity

– description of execution modes or input data

scope {

for (i=0; i<N; i++) { maximum N iterations; for (j=0; j<i; j++) { maximum N iterations; marker m1; … } } restriction m1 == N ∗ (N+1) / 2; } 1 • fm1 == [N•(N+1)/2] • fSCOPE flow variable linear flow constraint

loop bound

(9)

Challenge: Correctness of Flow

Information after Code Optimization

for (i=0; i<N; i++)

maximum 10 iterations

{

f(i); }

for (i=0; i<(N-2); i=i+3) {

f(i); f(i+1); f(i+2); }

for (;i<N; i++) {

f(i); }

loop unrolling (unrolling factor 3)

Q: what flow information is known of the transformed code?

additional knowledge assumed: N≤10

(flow fact given as code annotation)

(10)

10

Challenge: Correctness of Flow Information after

Code Optimization

for (i=0; i<N; i++)

maximum 10 iterations

{

f(i); }

scope {

for (i=0; i<(N-2); i=i+3)

maximum 3 iterations

{

marker m1;

f(i); f(i+1); f(i+2); }

for (;i<N; i++)

maximum 2 iterations { marker m2; f(i); } restriction 3*m1 + m2 <= 10; } loop unrolling (unrolling factor 3)

Automatic update of flow information in parallel to code transformation additional knowledge

assumed: N≤10 (flow fact given as

code annotation)

linear flow constraint flow variable

flow variable

loop bound loop bound

(11)

Universal Flow-Information Update

• We developed a framework that allows to update flow

information for arbitrary code transformations using rules composed of the following operations:

– Update of loop bound information ( ):

(create, modify, or delete loop bound information)

– Update of flow constraints ( ):

(transform terms of the form “const • flowvariable” of a linear flow constraint into a new term respectively a sum of terms, creation of new flow constraints)

R

(12)

12

Example: Loop Unrolling (3 Times)

B1 C’ D E A’ S B3 B4 C S B A L1 L1 L2 B2 0:10 ?:? ?:?

(13)

Example: Loop Unrolling (3 Times)

B1 C’ D E A’ S B3 B4 C S B A L1 L1 L2 B2 = Σ 3 0:10 0:2 0:3 n·fAS R n·fDS R 〈L1,0:10〉 L 〈L1,0:3〉, 〈L2,0:2〉

(14)

14

Universal Flow-Information Update

Advantages:

• Manual code annotations:

Reduced cognitive complexity

(no need anymore to annotate machine code)

• Automatic calculation of flow information:

Platform-independent calculation with reduced effort (information more explicit available at source code)

(15)

The State Explosion Problem

• Processor behavior modeling faces the problem of

state explosion

– instruction timing depends on context

(execution history)

– caches, pipelines, etc.

– even, when using the

timing relevant dynamic

processor state

(

TRDPS

)

• The desired solution:

decompose the timing analysis problem using

“divide and conquer”

(16)

16

Series Decomposition

• Analysis on control-flow graphs instead on the set of execution traces

(17)

Parallel Composition

• The execution time T(I,s) of an instruction sequence I depends on the TRDPS s:

(18)

18

Parallel Composition (TRDPS Partitioning)

Partitioning the TRDPS

between HW component A

and HW component B:

TRDPS: A × B

Example:

A … cache state

B … pipeline state

(19)

Example of Timing Anomalies

Is it that simple?

Using Newton’s world view together with

an inadequate observation system may

cause underestimation of the timing

effects at a local system!

(20)

20

(21)
(22)

22

(23)
(24)

24

(25)

Example of TA-S-A and TA-P-A

(26)

26

Example of TA-S-I and TA-P-I

(27)

Our Contribution so far against the

State Explosion Problem

• Providing a precise definition of Timing Anomalies

(formal but without unnecessary details)

• Formalizing the different types of decomposition

techniques for WCET analysis

• Proofs of which types of TAs are incompatible with

which type of decomposition technique

(28)

28

Measurement-Based Timing Analysis

• Research project: ForTAS (Formal Timing Analysis Suite)

• Cooperation with TU Darmstadt

• Learning the Hardware Timing Model by

systematic execution time measurements

(29)

The ForTAS Refinement Loop

• Testing for Timing Analysis

SUT Environment Model Program Measured Timed System (MTS) Test Cases Expected Time System (ETS) 0.3 0.2 0.4 0.7

(30)

30

The Next Steps:

Getting Out of the Complexity Mess

• Take a pro-active approach to advance timing

analysis: construction of embedded systems that

support:

– Predictability (with reasonable margins)

– Composability

– Scalability

• Predictable access to shared resources

• Timing-predictability requires a HW/SW co-design

(“

patterns of predictability

”).

(31)

Thank You!

References

Related documents

• Translation: It is a fast-sweeping tuned or wideband radio receiver that displays relative signal amplitudes (and optionally phases) when compared to a reference at

As there have not been highly effective solutions for automatic intrusion detection, es- pecially for detecting newly emerging attacks, network traffic visualiza- tion has become

While we may not share our anonymized NetFlows with any party (because there is more sensitive data in a NetFlow than just IP addresses and attacks can exploit other unanonymized

Emotion model categorical vs dimensional Granularity &amp; topic: language style and data type.. + : posts on social media, dialogues - : news,

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

Prema utvrđenim koeficijentima korelacije između fizikalno kemijskih svojstava svih istraživanih uzoraka i plastičnosti utvrđena je vrlo značajna korelacija (P=0,01)

Over the past 40 years, Purafil has provided corrosion control filtration media, filters and filtration systems to help data center and telecom facilities maintain their

For 90% powered trials with a small standardised effect size of 0.2 (using the NCT approach) the existing rules of thumb could lead to an extra 48 participants over the