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.
Q: How can I calculate how much time a CLA task takes to execute? or How do I profile a CLA task? What overhead should be included?
A:
Using a timer:
One method is to use a free running timer to capture the number of cycles the task execution took. The CLA has access to the PWM timers. As an example you could capture the number of cycles in C as follows:
In C this would look something like:
ct1 = EPwm1Regs.TBCTR; <<< code to be measured here >>>> ct2 = EPwm1Regs.TBCTR; delta_ct = ct2 - ct1;
Using a GPIO pin:
On some devices, the CLA has direct access to GPIO pins. In this case, instead of reading a timer, the CLA could toggle a pin before and after the code to be measured. Monitor the pin using an oscilloscope to measure the delta in time. Refer to the TRM for your specific device.
Overhead:
There will be some overhead due to triggering the CLA task and notifying the C28x that it has completed. In order to test this overhead, you could use a timer on the C28x to time the start and stop of the CLA task.
Also refer to the discussion on this post: https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/738758