Back-annotation

The most novel feature in Clepsydra is its ability to annotate every statement in the source code with its worst-case execution time. By conducting the analysis at this high level, developers of real-time systems no longer must switch periodically between source language and assembly language. They can remain focused on the original code rather than the sometimes cryptic output of a WCET analysis tool.

Figure 4.6 provides an overview of how Clepsydra accomplishes this process, known as back-annotation. Analysis begins when the developer supplies a Java source file, which is immediately fed into a WCET annotation-aware Java compiler. The bytecode output of this compiler is then reconstructed into source form by the JODE decompiler. Next, Cascade translates the internal structures of the decompiler into a control flow tree. Finally, Clepsydra performs the actual analysis and produces worst-case timing values for every statement and compound structure in the decompiled source code. The dotted line in the figure represents a simple mapping between the Clepsydra output and the source code.

Figure 4.6.  An overview of the back-annotation process in Clepsydra.

Clepsydra flow chart

The easiest way to use Clepsydra's back-annotation feature is via the getBackAnnotations method. It returns a map between lines of source code and the WCET for that line. Note that this method always uses the TreeAnalysisStrategy and cannot be configured to use other analysis strategies.