System Control Coprocessor
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
3-137
ID012310
Non-Confidential, Unrestricted Access
Access to the Performance Monitor Control Register in User mode depends on the V bit, see
c15, Secure User and Non-secure Access Validation Control Register
on page 3-132. The
Performance Monitor Control Register is always accessible in Privileged modes. Table 3-138
lists the results of attempted access for each mode.
To access the Performance Monitor Control Register read or write CP15 with:
•
Opcode_1 set to 0
•
CRn set to c15
•
CRm set to c12
•
Opcode_2 set to 0.
For example:
MRC p15, 0, <Rd>, c15, c12, 0
; Read Performance Monitor Control Register
MCR p15, 0, <Rd>, c15, c12, 0
; Write Performance Monitor Control Register
If this unit generates an interrupt, the processor asserts the pin
nPMUIRQ
. You can route this
pin to an external interrupt controller for prioritization and masking. This is the only mechanism
that signals this interrupt to the core. When asserted, this interrupt can only be cleared if bit 0 of
the Performance Monitor Control Register is high.
There is a delay of three cycles between an enable of the counter and the start of the event
counter. The information used to count events is taken from various pipeline stages. This means
that the absolute counts recorded might vary because of pipeline effects. This has negligible
effect except in cases where the counters are enabled for a very short time.
In addition to the two counters within the processor, most of the events that Table 3-137 on
page 3-135 lists are available on an external bus,
EVNTBUS
. You can connect this bus to the
ETM unit or other external trace hardware to enable the events to be monitored. If you do not
want this functionality, set the X bit in the Performance Monitor Control Register to 0. In Debug
state, the
EVNTBUS
is masked to zero.
3.2.52
c15, Cycle Counter Register
The purpose of the Cycle Counter Register is to count the core clock cycles.
The Cycle Counter Register:
•
is in CP15 c15
•
is a 32-bit read/write register common to Secure and Non-secure worlds
•
counts up and can trigger an interrupt on overflow.
The Cycle Counter Register bits[31:0] contain the count value. The reset value is 0.
You can use this register in conjunction with the Performance Monitor Control Register and the
two Counter Registers to provide a variety of useful metrics that enable you to optimize system
performance.
Table 3-138 Results of access to the Performance Monitor Control Register
V bit
Secure Privileged
Non-secure Privileged
User
Read
Write
Read
Write
Read
Write
0
Data
Data
Data
Data
Undefined exception
Undefined exception
1
Data
Data
Data
Data
Data
Data