Introduction
This example demonstrates the usage of the R5 PMU Driver. The PMU supports three event counters in additional to the cycle counter. So in total we could profile a block of code / or a function for four metrics. The cycle counter is a dedicated counter, but the other three are configurable for various PMU events. In this example, we configure the counters to count these events:
- ICache Miss
- DCache Miss
- DCache Access
After profiling the above events, we can change events to following events to count these events:
- Branch instructions executed
- Branch Misses
- Instructions executed
Supported Combinations
Parameter | Value |
CPU + OS | wkup-r5fss0-0 freertos |
Toolchain | ti-arm-clang |
Board | am62px-sk |
Example folder | examples/drivers/pmu/pmu_multievent |
Steps to Run the Example
See Also
UART
Sample Output
Shown below is a sample output when the application is run, Please note that application prints in both CCS and UART console.
UART Console:
[PMU Multievent] Starting...
Icache miss, Dcache access, Dcache miss...
CRC Value: 37090
Profile Point: Fxn2
Cycle Count: 94343
ICache Miss Count: 37
DCache Access Count: 5042
DCache Miss Count: 25
Profile Point: Fxn1
Cycle Count: 4018
ICache Miss Count: 6
DCache Access Count: 1041
DCache Miss Count: 0
Profile Point: Fxn2
Cycle Count: 94343
ICache Miss Count: 37
DCache Access Count: 5042
DCache Miss Count: 25
Profile Point: Fxn3
Cycle Count: 10361
ICache Miss Count: 5
DCache Access Count: 2323
DCache Miss Count: 0
Branch instructions executed, Branch Misses, Instructions executed...
CRC Value: 37090
Profile Point: Fxn2
Cycle Count: 92352
Branch instructions executed Count: 2709
Branch Misses Count: 347
Instructions executed Count: 15069
Profile Point: Fxn1
Cycle Count: 3844
Branch instructions executed Count: 531
Branch Misses Count: 15
Instructions executed Count: 3141
Profile Point: Fxn2
Cycle Count: 92352
Branch instructions executed Count: 2709
Branch Misses Count: 347
Instructions executed Count: 15069
Profile Point: Fxn3
Cycle Count: 10222
Branch instructions executed Count: 1349
Branch Misses Count: 132
Instructions executed Count: 8237
[PMU Multievent] Done...
All tests have passed!!