05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Note<br />

<strong>ARM</strong> recommends that an implementation that supports sample-based profiling:<br />

implements both DBGPCSR <strong>and</strong> DBGCIDSR<br />

implements DBGPCSR as register 40<br />

Sample-based Profiling<br />

also implements DBGPCSR as register 33, for backwards compatibility with implementations that<br />

implement it only as register 33.<br />

C8.1.2 Reads of the Program Counter sampling registers<br />

A read of the DBGPCSR:<br />

Normally:<br />

— returns the address of an instruction recently executed by the processor<br />

— sets the DBGCIDSR, if implemented, to the current value of the CONTEXTIDR.<br />

For more information about the CONTEXTIDR, see:<br />

— c13, Context ID Register (CONTEXTIDR) on page B3-153, for a VMSA implementation<br />

— c13, Context ID Register (CONTEXTIDR) on page B4-76, for a PMSA implementation.<br />

Alternatively, when any of the following is true, returns 0xFFFFFFFF <strong>and</strong> sets the DBGCIDSR, if<br />

implemented, to an UNKNOWN value:<br />

— non-invasive debug is disabled<br />

— the processor is in a mode or state where non-invasive debug is not permitted<br />

— the processor is in Debug state.<br />

If the DBGCIDSR is implemented, reading it returns the last value to which it was set.<br />

Note<br />

The <strong>ARM</strong> architecture does not define recently executed. The delay between an instruction being executed<br />

by the processor <strong>and</strong> its address appearing in the DBGPCSR is not defined. For example, if a piece of code<br />

reads the DBGPCSR of the processor it is running on, there is no guaranteed relationship between the<br />

program counter for that piece of code <strong>and</strong> the value read. The DBGPCSR is intended only for use by an<br />

external agent to provide statistical information for code profiling.<br />

The value in the DBGPCSR always references a committed instruction. An implementation must not sample<br />

values that reference instructions that are fetched but not committed for execution.<br />

If DBGPCSR is implemented, it must be possible to sample references to branch targets. It is<br />

IMPLEMENTATION DEFINED whether references to other instructions can be sampled. <strong>ARM</strong> recommends that<br />

a reference to any instruction can be sampled.<br />

The branch target for a conditional branch instruction that fails its condition code check is the instruction<br />

that follows the conditional branch instruction. The branch target for an exception is the exception vector<br />

address.<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. C8-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!