Part Number: TMS320F28384D
Other Parts Discussed in Thread: SYSCONFIG
Hi Experts,
I initially planned to use the IPC free-running counter, described below per TMS320F2838x technical reference manual, to measure the execution time between two breakpoints.
16.5 Free-Running Counter
A 64-bit free-running counter is present in the device and can be used to timestamp IPC events between processors. The counter is clocked by PLLSYSCLK and reset by SYSRSn. The counter is implemented as two 32-bit registers, IPCCOUNTERH and IPCCOUNTERL. When IPCCOUNTERL is read, the value of IPCCOUNTERH is saved. A subsequent read to IPCCOUNTERH returns this saved value. Therefore, the user must always read IPCCOUNTERL first then read IPCCOUNTERH next. This design prevents race conditions due to IPCCOUNTERL overflowing between reads of the two registers. The free-running counter stops only when emulation is suspended (when debugger hits a breakpoint) on all CPUs. If any core is executing, the counter runs.
My approach was as follows: I first halted both CPUs, then executed the CPU under test until it hit the first breakpoint, recording the value of the free-running counter at that moment. Next, I resumed execution of the CPU independently until it reached the second breakpoint, where I captured the counter value again. Based on my understanding, the difference between the counter values at the first and second breakpoints should represent the time (in CPU cycles) required to execute the instructions between those two points. (I also confirmed that the IPC counter was halted and did not continue counting during the capture of both measurements.)
However, the measured value did not match what I had expected when comparing to the expected frame time. After some further testing, I observed that the counter produced the expected frame time when the CPU was running freely. However, when halting the CPU and measuring the counter using breakpoints, the recorded values deviated from the expected frame time. Is it possible that a delay occurs when halting the CPU with the debugger, relative to when the counter stops, which could be affecting the timing measurements between breakpoints? I would greatly appreciate any insights into the potential cause of this discrepancy or suggestions for alternative approaches to accurately measure the execution time between two breakpoints.
Regards,
Marvin

