The annotation language of TuBound v0.6Adrian PrantlDecember 16, 2008 |
TuBound [PSK08] is portable tool for high-level worst-case execution time (WCET) analysis of C++ programs developed at Vienna University of Technology. The design philosophy behind TuBound was to increase the productivity of the programmer by allowing for high-level annotations to be placed at the source code and by reducing the need for manual annotation through a strong support of static analysis.
Annotations in TuBound serve two purposes: At first, they provide a programmer-friendly user interface to support the timing analysis with domain-specific knowledge; secondly, they are a textual intermediate representation for automatically generated results generated by the static program analysis component. Since the result of the static analysis is attached to the program source code, the programmer can inspect it and then decide where to manually refine the annotations, thus keeping the amount of human intervention at a minimum.
TuBound uses the #pragma
-directive to embed annotations into
C++ sources. With this mechanism, it is possible to place an
annotation at each sequence point of the program. As of version 1.0,
annotations comprise the following four types:
The annotation consists of a numerical expression that denotes an upper bound for the number of times a loop is executed in relation to the number of times the basic block that dominates the loop entry is executed. By convention, a special loop bound of -1 is used to indicate an endless (main-)loop.
Figure 1 shows an example utilizing different types of annotation mechanisms to express the same fact that the loop construct is executed up to 42 times upon entering the parent scope. The formal EBNF-style grammar of annotation pragmas is given in Figure 2.
{ # pragma wcet_marker(m1) do { # pragma wcet_marker(m2) # pragma wcet_marker(m3) # pragma wcet_scope(m3) # pragma wcet_constraint( m2 =< m1*42 ) // [1] # pragma wcet_constraint( m3 =< 42 ) // [2] # pragma wcet_loopbound(42) // [3] ... } while (!done); }
This document was translated from LATEX by HEVEA.