![]() ![]() | |||
![]() ![]() | ![]() ![]() | ||
| |||
| Home > Program Trace Macrocell Programmer’s Model > PTM counters > Use of PTM counters | |||
Possible uses of the PTM counters include:
Periodic sampling of the PC, using a counter to define the sampling period. Each time the counter reaches zero you enable tracing briefly to output the last waypoint target address. This gives you a low bandwidth PC sampler, that you can use as a simple profiling tool. The cost of each sample point is an I-sync packet and a single atom header or branch address packet, which is between 7 and 11 bytes, or between 8 and 16 bytes if you have enabled cycle-accurate tracing.
Extending the performance counters provided by the processor.
Counting the number of occurrences of a single instruction, for example by programming a SAC to match on the address of the required instruction, and programming a counter to decrement when that SAC matches.