21264/EV68A Hardware Reference Manual
Privileged Architecture Library Code 6–19
PerformanceCounter Support
The legal range for PCTR0 when writing the IPR is 0:(2**20-16).
The legal range for PCTR1 when writing the IPR is 0:(2**20-4).
6.10.2.2 Operation
1. Setup
The followingIPRs need to be set up by PALcodeinstructions.
2. Count
If PCTR0 andPCTR1 are enabled, will increment according to modes selectedby
SL0 and SL1.
3. Overflow
If PCEN[1:0]is enabled, PC[1:0] is set when PCTR0 or PCTR1 overflows.
4. Hardwareinterrrupt
When PC[1:0]is set, the PALcode interrupt routine is entered. Interrupt is acknowl-
edged and PALcodegenerates an interrupt to the operating system performance
monitoringutility.
5. Operatingsystem interrupt handler
The handlershould read the IPR PCTR_CTL, as shown in Table 6–10, to note
whichcounter overflowed in the handler's data structures. The handler may read the
counter tosee how many events have happened since the overflow.
The handlermay a lsochoose to write the counters to control the frequency of inter-
rupts.
IPRName RelevantFields Meaning
IER_CM PCEN[1:0] EnableInterrupts.
PCTX PPCE EnableProcess Performance Counting or use I_CTL[SPCE].
PCTR_CTL SL0 SelectsAggregate or ProfileMemode; set to 0 for Aggregate mode.
SL1 SelectsPCTR0 and PCTR1 counting modes. See Table6–11 for more infor-
mation.
PCTR0[19:0] Setcounter 0 starting value [0:(2**20-16)]. See Section 6.10.1 for setup
precautions.
PCTR1[19:0] Setcounter 1 starting value [0:(2**20-4)]. See Section 6.10.1 for setup pre-
cautions.
I_CTL SPCE EnableSystem PerformanceCounting or use PCTX[PPCE].
PCT0_EN Enable performancecounter 0.
PCT1_EN Enable performancecounter 1.
Table 6–10 Aggregate Mode Returned IPR Contents
IPR Field Contents
PCTR_CTL PCTR0[19:0] Counter#0 value
PCTR1[19:0] Counter#1 value