Viewing Code Coverage data

Click the Code Coverage link to view to view the code coverage data.

The following diagram shows an example of the Code Coverage data.
Figure 1. Code Coverage viewer

The Code Coverage data displays the summarized data of a function in a tabular form. The columns are movable; you can drag and drop the columns to move them according to your requirements. It displays data into two views; the top view displays the summary of the functions, and the bottom view displays the statistics for all the instructions executed in a particular function. Click on a hyperlinked function in the top view of the Code Coverage viewer to view the corresponding statistics for the instructions executed in that function.

The below table explains the various fields of the Summary table.

Table 1. Code Coverage Summary Table fields description table
Field Description
File/Function Displays the name of the function that has executed.
Address Displays the start address of the function.
Covered ASM % Displays the percentage of number of assembly instructions executed from the total number of assembly instructions per function or per source file
Not Covered ASM % Displays the percentage of number of assembly instructions not executed from the total number of assembly instructions per function or per source file.
Total ASM instructions Displays the total number of assembly instructions per function and per source file.
ASM Decision Coverage % Displays the decision coverage computed for direct and indirect conditional branches. It is the mean value of the individual decision coverages. So if a function has two conditional instructions, one with 100% and another with 50% decision coverage, the decision coverage would be (100 + 50) / 2 = 75%. It is calculated only for assembly instructions and not for C source code.
Time (Microsecond) Displays the total number of clock cycles that the function takes
Size Displays the number of bytes required by each function.

The below table describes the fields of the statistics of the code coverage data.

Table 2. Code Coverage Details Table fields description table
Field Description
Line/Address Displays either the line number for each instruction in the source code or the address for the assembly code.
Instruction Displays all the instructions executed in the selected function.
Coverage % For C source lines, displays the percentage of number of assembly instructions executed from the total number of assembly instructions corresponding to the source line. For assembly source lines, it shows if the instructions were executed or not.
ASM Decision Coverage Displays the decision coverage computed for direct and indirect conditional branches. It is the mean value of the individual decision coverages. So if a function has two conditional instructions, one with 100% and another with 50% decision coverage, the decision coverage would be (100 + 50) / 2 = 75%. It is calculated only for assembly instructions and not for C source code.
ASM Count Displays the number of times each instruction is executed.
Time (CPU Cycles) Displays the total time taken by each instruction in the function.
Note: In the Code Coverage viewer, all functions in all files associated with the project are displayed irrespective of coverage percentage. However, the 0% coverage functions do not appear in the Performance and Call Tree viewers because these functions are not considered to be computed and are not a part of caller-called pair.

When you double-click in Details table on an instruction, it opens (if available) the source file and highlights the instruction line. If the source is not available, you can Locate the file.

Click on the column header to sort the code coverage data by that column. However, you can only sort the code coverage data available on the top view. The icons available in the summary view of the Code Coverage tab allow you to perform the following actions:

You can perform the following actions on the Details table: