Profile clock in CCS
From Texas Instruments Embedded Processors Wiki
Contents |
Introduction
This page describes how to set up and use the profile clock in CCS to count instruction cycles between two points in the code. Since the CCS Profiler has some limitations when profiling on hardware, the profile clock is one of the suggested alternate options.
Note: The below screenshots are for CCSv5. In CCSv4, the clock will be under menu Target instead of menu Run.
Enable the Profile Clock
In the debug perspective go to menu Run->Clock->Enable. This will add a clock icon and count to the status bar.

Setup the Profile Clock
In the debug perspective go to menu Run->Clock->Setup. This will bring up the Clock Setup dialog.

- Count: In the Clock Setup dialog box, you can specify the event you want to count in the drop-down list of the Count field. Depending on your device, Cycles may be the only option listed. However, some device drivers make use of the on-chip analysis capabilities and may allow profiling other events. The simulator will only display the Cycles parameter in the Count field, since it does not profile other events via its interface with a simulated target.
- Reset Option: Use the Reset Option parameter to determine how the clock value is accumulated. If you select the Manual radio button, the clock variable accumulates instruction cycle counts without resetting the clock. If you select the Auto radio button, the clock variable is automatically reset (set to 0) before running or stepping the target processor. Therefore the clock only displays the cycles since the last run or step.
Reset the Profile Clock
Double-click on the clock value in the status bar to reset it to 0.
Measure cycles
To measure cycles between two lines of code using profile clock:
- Set breakpoints at the lines between which you want to measure cycle count
- Run to the first breakpoint
- Double click on the clock to reset its value
- Run to the second breakpoint
- The clock will display the cycle count between those two points in the code
Convert Cycles to actual time
If the target is running, for example, at 300MHz and the Profile clock cycle count for a routine is 1000, then the time consumed by the routine would be = 1000 * (1/300M)= 3.3 usec.
Leave a CommentComments
Comments on Profile clock in CCS

What is the definition of a cycle count? I am using an XDS510 with an OMAP L138 DSP core running at 300 MHz and I get about 20000000 cycle counts per assembly step in the debugger disassembly window.
--Keithhall 08:32, 9 February 2012 (CST)