Hello fellow coders,
I am trying to automate performance testing of our system. I have TMS320C28346 target and XDS100v2 debugger. I have been using CCS GUI with following testing procedure:
1. Edit function under inspection to disable all interrupts at the beginning and restore them at the end. This step ensures that higher priority interrupts do not interfere with performance metrics.
2. Fire up CCS and place breakpoint at the beginning of the function.
3. Let the CCS break to the breakpoint.
4. Enable and reset profile clock.
5. Let the function finish.
6. Check cpu cycles spent in the function.
It is easy to understand that this approach is very time consuming. I decided to use DSS to automate everything. Now I am able to setup breakpoints at the beginning and the end of a function. However, disabling interrupts without modifying the code is not working.
I have two javascript function for disabling all interrupt and restoring them:
function DisableAllInterrupts(debugSession) {
var interruptState = debugSession.expression.evaluate("ST1");
debugSession.expression.evaluate("ST1 = ST1 | 0x0001");
//debugSession.expression.evaluate("ST1 = ST1 | 0x0003");
return interruptState;
}
function RestoreAllInterrupts(debugSession, interruptState) {
debugSession.expression.evaluate("ST1 = " + interruptState);
}
The debugSession is com.ti.debug.engine.scripting.DebugSession. Using the old cumbersome method the results are 27 cpu clocks. Using the DSS script the results are 27, 1838 and 11006 cpu cycles. It seems obvious that my javascript functions are not working although they should work as the C counterparts. High priority interrupt are obviously pre-empting the function execution.
Is it possible to disable interrupt and restore them using DSS? My hypothesis is that the debugger does some king of manipulation on ST1 once debugSession.target.run() is called. I've also found interesting function debugSession.clock.runBenchmark() but there is no sensible documentation for it. All help is appreciated! :)
Best Regards,
Henrik