
Static analysis of execution time and stack usage
Real-time deadline overruns and stack overflows in embedded software can cause costly and dangerous failures. Such run-time problems can be prevented early and safely by static analysis of the embedded program. The Bound-T static analyser tool from Tidorum is available for several microcontroller families, including the ARM7TDMI.
After compiling and linking the embedded program, developers of embedded software can use the Bound-T tool to find bounds on the worst-case execution time (WCET) and worst-case stack usage for chosen functions (subprograms), typically the main functions of each thread. The WCET bounds can be used in a schedulability analysis to show that the threads meet their deadlines. The stack-usage bounds can be used to allocate safe amounts of stack space for each thread.
Bound-T finds the WCET and stack-usage bounds by a static analysis of the machine code. The tool first reads the linked program (from an ELF file, for example), disassembles the machine instructions, and constructs the control-flow graphs and the call graph. Next, the tool analyses the computations in each function to find bounds on the repetition of loops and the uses of the stack. The tool then integrates the results for all called functions to compute overall WCET and stack-usage bounds for the chosen main functions.
Traditionally, developers estimate the execution time and stack usage by running tests on the target hardware, measuring the maximum values, and adding some safety margin. However, there is a risk that the tests have not covered the actual worst case. In contrast, the static analysis in Bound-T covers all possible execution paths. It is not necessary to run or simulate the embedded program on test cases. The analysis is done entirely on a host workstation, not on the embedded target computer. This means that Bound-T can be used early in the development process, by any number of developers, without access to target hardware, and even on incomplete drafts of the code. The analysis can be scripted for automatic re-analysis as development proceeds.
Bound-T can be used on normal PCs running Microsoft Windows, Linux, or Mac OS-X. Size-limited versions of Bound-T are available at no cost.
Bound-T time and stack analyser