How to view the program running clock period in CCS

Source: Internet
Author: User

1. Enter the CCS environment, load the existing project, load the generated. Out file, and find the code to view the code execution cycle. 1.

Figure 1

1. Select enable clock in profiler of the CCS menu ,.

Figure 2

2. select the clock setup sub-menu under the profiler menu, and enter your DSP clock cycle in instruction cycle. The unit is nanoseconds. For example, 2407 of the system clock is 40 MHz, you should fill in 25. If the 2812 system clock is 150 MHz, fill in 6.67ns. Other configurations will not change, and then confirm. 3.

Figure 3

3. Select the start new session sub-menu under the profiler menu. the dialog box shown in Figure 4 is displayed. You can change the name or not change the name. In this example, if you do not change the name, click OK.

Figure 4

4. After the fourth step is set, a form shown in Figure 5 is displayed.
 
There are four tabs in this form, where files lists statistics based on source files, the functions tab is used to analyze functions in the program, ranges is used to parse a continuous piece of code, and setup is used to set the start and end points, used to analyze discontinuous code.
The buttons on the left of the form are described as follows)
Analyzes all functions.
Create a profiling area.
Set the start point.
Set the end point.

The profiling data in the form contains a table circled in red. The field names of each table are as follows:

  • Code size: the size of the profiling code, measured in the smallest addressable unit of the program memory. This value remains unchanged during the profiling process.
  • Incl. Count: Number of times the program runs into the profiling code segment during statistics
  • Incl. total: analyzes all the clock periods consumed by code segments in the statistical project. (If the clock period is counted, CCS can also count other counts such as subprogram calls, statistics on other features show the corresponding value ).
  • Incl. maximum: Execute the profiling code segment once (including calling a subroutine in the profiling code segment) to consume the maximum clock cycle (because each time you enter the profiling code segment, the initial conditions are different, and so on, the clock cycle consumed by each running profiling code segment may be different );
  • Incl. Minimum: Minimum clock cycle consumed by performing profiling code segments once (including calling subprograms in profiling code segments)
  • Incl. Average: analyzes the average clock cycle consumed by code segments that are executed once (including calling subprograms In the profiling code segment. -- The above three are the clock periods of code execution that users are concerned about.
  • Excl. Count: Number of times the program runs into the profiling code segment during the statistical process, which is the same as the value of incl. Count.
  • Excl. Maximum: The maximum clock cycle consumed by profiling code segments that are executed once (not including calls to subprograms in profiling code segments.
  • Excl. Minimum: Minimum clock cycle consumed by profiling code segments that are executed once (not including calls to subprograms in profiling code segments.
  • Excl. Average: analyzes the average clock cycle consumed by a code segment to execute it once (not including calling a subroutine in the profiling code segment.

5. Take the profiling function as an example, find the function, place the cursor on the Function Name of the function, select the create profiling area button, and use the red box button in the figure. 6.

Figure 6.

6. the dialog box appears, as shown in 7, because we are doing a function, so we don't need to modify it. If we are doing a piece of code, you just need to change the function in the drop-down menu to range.

Figure 7

7. Click OK. As shown in figure 8, each field has been assigned an initial value.

Figure 8

8. Run the program to analyze the execution cycle of the selected code .. These values are dynamically displayed as the program runs.
 
Figure 9

It is worth noting that the figure shows the clock cycle, not the time. It depends on the time. Multiply the clock cycle by the previously set NS value, for example, 6.67ns, it is the time for final function execution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.