When Code Fails To Time
There are cases when the analysis completes, i.e. routes are created, but the worstcase time for the routes cannot be determined. The following sections describe the main causes of these failures and how to diagnose and resolve them.
Unresolved
When the XTA tool finds a branch instruction whose branch target is unknown it has to report that the time is Unresolved.
In order to determine which instruction is causing the issue the tool can be instructed to print an instruction trace. This will show the worst-case path ending with the unresolved instruction.
In xTIMEcomposer Studio, a trace can be printed by right clicking on the route in the top panel of the Routes View and selecting Trace in console.
On the console, type:
print trace -
To resolve this issue the XTA tool needs to be told the target of the branch instruction. This is done through either the .xtabranch assembler directive or the console command:
add branch <from BRANCH> [<to INSTRUCTION>]+
Recursion
The tool does not support timing of recursive functions. The tool reports that the path contains recursion and the timing will therefore fail.
The location at which the recursion occurs can be determined by printing the instruction trace as for the case of unresolved branches.
Since this is a current limitation of the tool it is not possible to time this path. If the code has to be timed then it should be re-factored into an iterative function. If the recursive path is not of interest then it can be excluded so that the rest of the route can be timed.
Infinite
If the tool encounters an infinite loop (for example while(1)) it reports that the timing is infinite.
To determine where the infinite loop is use the console command:
print structure <route id>
or examine the route structure in the lower panel of the Routes View or the Structure tab of the Visualizations View.
Since the infinite loop never terminates it cannot be timed. The tool can time how long it takes to execute each iteration of the loop. To time the loop, analyze a path with the to and from endpoints set to the same point in the loop, or use the analyse loop functionality.
Illegal
If an illegal instruction is found in a path then the time cannot be determined. The location of the illegal instruction can be found by printing a worst-case trace of the route.
It is impossible for the tool to time illegal instructions. Therefore, in order to get a valid timing result the path with the illegal instruction must be excluded.