User manual

STice features UM0036
266/385 Doc ID 7705 Rev 11
window (via the BEM)—but doing so disables the Trace On/Off command in the Trace
Contextual menu.
9.2 Coverage and profiling
Coverage and profiling provides insight into what portions of code are executed, what areas
of memory are accessed, what functions are executed most often and how much time is
spent in each function, thus helping you to:
Obtain reliable data to decide the division of tasks between hardware and software,
and select the appropriate MCU during the planning phase.
Improve critical code and detect unexpected events in the coding and debugging
phase.
Improve time performance, reduce consumption, code size, and RAM size during the
optimization phase.
Detect holes in the test plan and obtain internal metrics during the validation phase.
A major advantage of running coverage and profiling on your application is that it does not
require any code modification and has no impact on performance.
This section first explains the concepts of coverage and profiling, and provides detailed
information on using the STVD graphical user interface to configure these features, to run a
coverage and profiling session, and to understand and use the results:
Section 9.2: Coverage and profiling
Section 9.2.1: Configuring the coverage and profiling settings
Section 9.2.2: Running a coverage and profiling session
Section 9.2.3: Reading coverage and profiling results
Section 9.2.4: Typical examples of use
The code coverage feature helps you identify which parts of code and data are used when
the microcontroller runs your application. The STVD graphical user interface distinguishes
between:
Code coverage: indicates whether an instruction in the source code has been executed
Data coverage: indicates whether a memory area for a variable or data has been
accessed (for read or write)
The code profiling feature helps you identify which parts of code or data are used most
often or least often during execution of your application. The STVD graphical user interface
distinguishes between:
Occurrence profiling: indicates the number of times an instruction is executed or data is
accessed
Time profiling: indicates the instructions on which the processor spends the most time
The coverage and profiling feature in STVD uses counters to gather information from the
application execution. There are two types of counter:
Occurrence counters for instructions and for variables (no unit)
Time counters (in nano-seconds)