5.7 Example PMU setup
Two PMU events can be counted at the DEM.
The HN-F, RN-I, and XP PMU features can be used independently or
simultaneously. You can set up just one or the other, or multiple instances of each from
different HN-Fs, RN-Is, and XPs, driving onto different DTBus bits.
The following is an example of the steps that are used to enable the PMU
events to be counted. The example:
- Uses performance counters within an HN-F to count activity within that HN-F.
- Uses the XP watchpoint features to count activity that is passing through an XP.
Select the performance event at the component:
- Write the pmu_event0_id field in the HN-F pmu_event_sel register to
select PMU_HN_CACHE_MISS_EVENT on bit 0 of the HN-F PMU interface.
- Write the dt_config register to write this event on DTB.
Select the watchpoint in the XP:
For each XP, set dt_control.dt_enable = 1, to enable the debug watchpoint and PMU
capability in that XP.
Program the PMU control:
In the pmcr register:
- Write the cntcfg field to configure as 8×32-bit counters, no
- Write the pmu_en bit to enable PMU counting.
- Write 1 to pmsr_req to enable PMU counter snapshot.
- Read the pmevcntsr0 register for the HN-F event counter.
- Read the pmevcntsr1 register for the watchpoint counter.