Figure 1.17 CCS File header format
It is a very useful tool for analyzing and optimizing DSP code for large complex
projects. In the following experiment, we use the profiling features of the CCS to obtain
statistics about code execution time.
± Open the project exp1 and load the file exp1.out. Open the source file exp1.c
and identify the line numbers on the source code where we like to set profile
marks. For a demonstration purpose, we will profile the entire code within the
while {}loop in the experiment. The profile points are set at line 32 and 46 as
shown below:
while (1)
{
/* <- set profile point here */
... ...
}
/* <- set profile point here */
± From Profiler menu, select Start New Session to open the profile window. Click the
Create Profile Area hot button, and in the Manual Profile Area Creation dialogue
box (see Figure 1.18), enter the number for starting and ending lines. In the mean-
time, make sure the Source File Lines and the Generic type are selected. Finally,
click on the Ranges tab to switch the window that displays the range of the code
segments we just selected.
± The profiler is based on the system clock. We need to select Profile3
±
Enable Clock to enable the system clock before starting the profiler. This clock
counts instruction cycles. The clock setting can also be adjusted. Since the C55x
simulator does not have the connection to real hardware, the profiler of the simu-
lator can only display CPU cycles in the count field (refer to the example given in
Figure 1.18). More information can be obtained by using real DSP hardware such as
the C55x EVMs.
± Run the program and record the cycle counts shown in the profile status
window.
EXPERIMENTS USING CODE COMPOSER STUDIO
31