User`s guide

System Stack Profiling
System Stack Profiling
In this section...
“Overview” on page 4-19
“Proling System Stack Use” on page 4-21
Overview
Embedded IDE Link CC software enables you to determine how your
application uses the processor system stack. Using the
profile method, you
can initialize and test the size and usage of the stack. This information can
help you optimize both the size of the stack and how your code uses the stack.
To provide stack proling,
profile writes a known pattern to the addresses
in the stack. After you run your application for a while, and then stop your
application,
profile examines the contents of the stack addresses. profile
counts each address that no longer contains the known pattern as used. The
total number of a ddress that have been used, compared to the total number of
addresses you allocated, becomes the stack usage prole. This prole process
does not tell you how often any address was changed by your application.
You can prole the stack with both the hand written code in a project and
the code you generate from a model.
Note Stack proling always reports 100% stack usage when your project
uses DSP/BIOS.
When you use profile to ini t ia li ze and test the stack op era tio n , the software
returns a report that contains information about stack size, us age, addresses,
and direction. With this i nformatio n, you can m odify your code to u se the
stack efciently. The follow ing program listing shows the stack usage res ults
from running an application on a simulator.
profile(cc,'stack','report')
Maximum stack usage:
4-19