I have a TMS570 MCU deve kit (usb stick). I am trying to get some benchmarking information using the emulator. I used the demo program as my baseline and added an additional element to the "switch" statement to call my benchmark code. All runs correctly but I was intending to get timing information by bracketing the benchmart functions with reads of CPU cycles from the emulator via the "clock()" function. It seems like this function always returns a value of 0. Is there any timing or performance monitoring supported? I don't want to invest a huge amount of time in measuring this benchmark.
Thanks in advance
We have forwarded your question to our benchmarking experts and will have an answer for you shortly.
I am also facing same issue,clock function is always returning 0.I am using TI CCS5.0 and Compiler TIv4.9.5
I am using below code
Both the variables(start and stop) are having values of 0.Can you please let me know why the value is 0?
The Cortex R4F core has a build in unit to perform cycle count on different events. (Performance Monitor Unit).
Here is an assembly code that provides the basic routine to initialize the PMU, Start count, Stop Count and Read results. 1667.perf_monitor_r4.asm
The way to use it is easy. See the following example:
int startTime, endTime, execTime = 0;
startTime = Performance_Monitor_Read_CycleCount(0);
Code to be benchmarked;
endTime = Performance_Monitor_Read_CycleCount(0);execTime = endTime - startTime ;
The result in execTime is the number of CPU cycles.
Please have a try and let me know if this is helpful.
For more information on PMU, please refer to ARM TRM and search for PMU.
If my reply answers your question please click on the green button "Verify Answer".
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.