Specifications

Viewing Explicit Instrumentation
Debugging Program Behavior
5-19
9) Multiply the Max value for processingLoad_STS by 4.
Because you used the CLK_gethtime function to benchmark the
processing load, the statistics for processingLoad_STS are measured in
on-chip timer counter increments. SWI statistics are measured in
instruction cycles. On TMS320C6000 DSPs, the high-resolution time is
incremented every 4 instruction cycles. Therefore, to convert the
processingLoad_STS units to instruction cycles, you multiply by 4.
10) Subtract the resulting processingLoad_STS Max value in instruction
cycles from the processing_SWI Max value. The result should be about
3420
11) instructions. (The actual numbers shown may vary, especially if you are
using a non-generic development board.) These instructions are
performed within the processing function, but not between the calls to
STS_set and STS_delta, as shown below.
For example, if the load is 10, the processingLoad_STS Max is about
2604 and the processing_SWI Max is about 13832. To calculate the
instruction cycles performed within the processing function but outside
the calls to STS_set and STS_delta, the equation is:
13832 - (2604 * 4) = 3416
12) Choose GEL
Application Control
Load. (If you have closed and
restarted Code Composer Studio, you must reload the GEL file.)
13) Change the Load and click Execute.
14) Notice that while both Max values increase, the difference between the
two Max values (after you multiply the processingLoad_STS Max by 4)
stays the same.
processingLoad_STS
/* ======== processing ======== */
Int processing(Int *input, Int *output)
{
Int size = BUFSIZE;
while(size--){
*output++ = *input++ * gain;
}
/* enable instrumentation if TRC_USER0 is set */
if (TRC_query(TRC_USER0) == 0) {
STS_set(&processingLoad_STS, CLK_gethtime());
}
/* additional processing load */
load(processingLoad);
if (TRC_query(TRC_USER0) == 0) {
STS_delta(&processingLoad_STS, CLK_gethtime());
}
return(TRUE);
}
processing_SWI