I am attempting to profile code running on the DSP, essentially seeing how quick or slow a certain section of code runs. Does DspLink provide any timers that may be used to achieve this?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am attempting to profile code running on the DSP, essentially seeing how quick or slow a certain section of code runs. Does DspLink provide any timers that may be used to achieve this?
Hi Ernast,
The DSPLink gives you ability to measure the time for execution of a source code fragment by getting time before and after your code fragment. I suggest you the following example:
time1 = CLK_getltime();
... processing ( your code ) ...
time2 = CLK_getltime();
CPUcycles = (time2 - time1) * CLK_cpuCyclesPerLtime();
/* calculate absolute time in milliseconds */
TimeAbsolute = CPUCycles / GBL_getFrequency();
You can find more details and clarifications about time measuring from the DSP side from the TMS320C6000 DSP/BIOS 5.x Application Programming Interface (API) at the link:
http://www.ti.com/lit/ug/spru403s/spru403s.pdf
Pay attention on the CLK_gethtime(), CLK_getltime(), CLK_cpuCyclesPerLtime() and CLK_cpuCyclesPerHtime() functions from CLK Module.
BR
Tsvetolin Shulev