09.06.2013 Views

DDI0419C_arm_architecture_v6m_reference_manual

DDI0419C_arm_architecture_v6m_reference_manual

DDI0419C_arm_architecture_v6m_reference_manual

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.

ARMv6-M Debug<br />

case DWT_FUNCTION[N].FUNCTION of<br />

when '0000' valid = FALSE; // Comparator disabled<br />

when '0100' valid = FALSE; // See InstructionAddressMatch()<br />

when '0101' valid = read;<br />

when '0110' valid = !read;<br />

when '0111' valid = TRUE;<br />

otherwise UNPREDICTABLE; // Reserved settings<br />

if valid then<br />

mask = ZeroExtend(Ones(UInt(DWT_MASK[N].MASK)), 32);<br />

if !IsZero(DWT_COMP[N] AND mask) then UNPREDICTABLE;<br />

case size<br />

when 1 comp = DWT_COMP[N];<br />

when 2 comp = DWT_COMP[N]:'0';<br />

when 4 comp = DWT_COMP[N]:'00';<br />

match = ((Daddr AND NOT(mask)) == comp);<br />

else<br />

match = FALSE;<br />

return match;<br />

C1.7.2 Program counter sampling support<br />

The DWT Program Counter Sampling Register, DWT_PCSR, is an IMPLEMENTATION DEFINED option in<br />

ARMv6-M. The register is defined so that a debugger can access it without changing the behavior of any<br />

code currently executing on the device. This provides a mechanism for coarse-grained non-intrusive<br />

profiling of code executing on the processor.<br />

The DWT_PCSR is a word-accessible read-only register. Writes to the register are ignored. Byte or<br />

halfword reads are UNPREDICTABLE. When the register is read it returns one of the following:<br />

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

• 0xFFFFFFFF if DWT_PCSR is implemented and any of the following apply:<br />

— the processor is in Debug state<br />

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

— the address of a recently-executed instruction is not available.<br />

• RAZ/WI if DWT_PCSR is not implemented.<br />

Note<br />

• There is no architectural definition of recently executed. The delay between an instruction being<br />

executed by the processor and its address appearing in the DWT_PCSR is not defined. There is no<br />

guaranteed relationship between the program counter for a piece of code designed to read the<br />

DWT_PCSR and the value read. The DWT_PCSR is intended only for use by an external agent to<br />

provide statistical information for code profiling. Read accesses made to the DWT_PCSR directly by<br />

the ARM processor can return an UNKNOWN value.<br />

C1-344 Copyright © 2007-2008, 2010 ARM Limited. All rights reserved. ARM DDI 0419C<br />

Non-Confidential ID092410

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

Saved successfully!

Ooh no, something went wrong!