Sun Microelectronics
319
Performance Instrumentation
B
B.1 Overview
Up to two performance events can be measured simultaneously in UltraSPARC.
The Performance Control Register (PCR) controls event selection and filtering
(that is, counting user and/or system level events) for a pair of 32-bit Perfor-
mance Instrumentation Counters (PICs).
B.2 Performance Control and Counters
The 64-bit PCR and PIC are accessed through read/write Ancillary State Register
instructions (RDASR/WRASR). PCR and PIC are located at ASRs 16 (10
16
) and 17
(11
16
) respectively. Access to the PCR is privileged. Non privileged accesses will
cause a
privileged_opcode
trap. Non-privileged access to PICs may be restricted by
setting the PCR.PRIV field while in privileged mode. When PCR.PRIV=1, an at-
tempt by non-privileged software to access the PICs causes a
privileged_action
trap.
Event measurements in non-privileged and/or privileged modes can be con-
trolled by setting the PCR.UT and PCR.ST fields.
Two 32-bit PICs each accumulates over 4 billion events before wrapping around
silently. Extended event logging may be accomplished by periodically reading the
contents of the PICs before each overflows. Additional statistics can be collected
using the two PICs over multiple passes of program execution.
Two events can be measured simultaneously by setting the PCR.select fields
along with the PCR.UT and PCR.ST fields. The selected statistics are reflected
during subsequent accesses to the PICs. The difference between the values read
from the PIC on two reads reflects the number of events that occurred between
them for the selected PICs. Software may only rely on read-to-read counts of the
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com