Keil Logo

COVERAGE

The command COVERAGE shows statistics about the executed code of an application or parts of an application. Refer to Fully Qualified Symbols for details about the syntax of modules.

Syntax Description
COVERAGE Displays coverage information of the whole application.
COVERAGE \module [DETAILS]
Displays coverage information for the selected module. The option DETAILS provides additional information about conditional instruction execution.
COVERAGE \module\func [DETAILS] Displays coverage information for symbols of function func contained in module. The option DETAILS provides additional information about conditional instruction execution.
COVERAGE ASM Displays coverage information including assembly instructions of the whole application. The output format has the form:

<qualifier> | <addr> <opcode> <assembly code>

The values below lists the possible qualifiers:

NE Not executed.
EX Executed.
AT Always taken. Conditional instruction which was always taken (condition always true).
NT Not Taken. Conditional instruction which was never taken (condition always false).
FT Fully Taken. Conditional instruction which was each taken and not taken for at least one time.
COVERAGE CLEAR Clear all code coverage information.
COVERAGE FLOW filespec Prints program execution flow information to a file specified by filespec. Available only in Simulation mode.
COVERAGE LOAD path\filename Load the code coverage information from a file. This allows to merge code coverage information of previous sessions with the current session and therefore multi-session testing of an application.
COVERAGE SAVE path\filename Save the code coverage information to a file. 
Example

The following example were created using the MEASURE example program of the C51 Compiler package.

\\Measure\MEASURE\{CvtB} - 32% of 52 instructions executed
\\Measure\MEASURE\{CvtB} - 0% of 127 instructions executed
\\Measure\MEASURE\{CvtB} - 100% of 1 instructions executed
\\Measure\MEASURE\{CvtB} - 100% of 6 instructions executed
\\Measure\MEASURE\{CvtB} - 0% of 595 instructions executed
\\Measure\MEASURE\{CvtB} - 0% of 5 instructions executed
\\Measure\MEASURE\{CvtB} - 100% of 1 instructions executed
\\Measure\MEASURE\SAVE_CURRENT_MEASUREMENTS - 0% of 46 instructions executed
\\Measure\MEASURE\TIMER0 - 72% of 94 instructions executed
\\Measure\MEASURE\READ_INDEX - 0% of 64 instructions executed
\\Measure\MEASURE\CLEAR_RECORDS - 100% of 24 instructions executed
\\Measure\MEASURE\MAIN - 31% of 215 instructions executed
\\Measure\MCOMMAND\{CvtB} - 0% of 74 instructions executed
\\Measure\MCOMMAND\MEASURE_DISPLAY - 100% of 44 instructions executed
\\Measure\MCOMMAND\SET_TIME - 0% of 58 instructions executed
\\Measure\MCOMMAND\SET_INTERVAL - 0% of 101 instructions executed
\\Measure\GETLINE\GETLINE - 78% of 51 instructions executed
\\Measure\TOUPPER\{CvtB} - 100% of 18 instructions executed
\\Measure\TOUPPER\{CvtB} - 51% of 91 instructions executed
\\Measure\TOUPPER\{CvtB} - 0% of 0 instructions executed

Note

  • The options ASM, CLEAR, DETAILS, LOAD, and SAVE are valid for some drivers only.
  • Use the command LOG to copy code coverage information to a log file.
  • The Code Coverage Window also shows coverage information.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.