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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BVR_match = byte_select_match && (cmp_in AND NOT(mask)) == DBGBVR[N];<br />

if mismatch then BVR_match = !BVR_match;<br />

Debug Events<br />

// If this is not the first unit of the instruction <strong>and</strong> there is an address match, then<br />

// the breakpoint match is UNPREDICTABLE, except in the “single-step” case where it is a<br />

// mismatch breakpoint without a range set. If there is a match on the first unit of the<br />

// instruction, that will override the UNKNOWN case here. In the single-step case, matches<br />

// on the subsequent units of the instruction are ignored.<br />

if BVR_match && !first then<br />

if mismatch && DBGBCR[N] == ‘00000’ then // Single-step case<br />

BVR_match = FALSE;<br />

else<br />

BVR_match = boolean UNKNOWN;<br />

// Security state<br />

case DBGBCR[N] of<br />

when ‘00’ secure_state_match = TRUE; // Any state (or no Security Extensions)<br />

when ‘01’ secure_state_match = !IsSecure(); // Non-secure only<br />

when ‘10’ secure_state_match = IsSecure(); // Secure only<br />

when ‘11’ UNPREDICTABLE; // Reserved<br />

match = mode_control_match && BVR_match && secure_state_match;<br />

// If linked, check the linked BRP.<br />

if linked then match = match && BRPLinkMatch(UInt(DBGBCR[N]));<br />

elsif DBGBCR[N] != ‘0000’ then unk_match = TRUE;<br />

// When Monitor debug-mode is configured:<br />

// * some types of event are ignored in v6 Debug <strong>and</strong> v6.1 Debug in privileged modes<br />

// * some types of event are UNPREDICTABLE in v7 Debug.<br />

if !mon_debug_ok && DBGDSCR == ‘10’ then<br />

if UInt(DBGDIDR.Version) < 3 then<br />

if CurrentModeIsPrivileged() then return FALSE;<br />

else<br />

if DBGBCR[N] == ‘01’ || DBGBCR[N] == ‘11’ then UNPREDICTABLE;<br />

if unk_match then<br />

return boolean UNKNOWN;<br />

else<br />

return match;<br />

// BRPLinkMatch()<br />

// ==============<br />

boolean BRPLinkMatch(integer M)<br />

assert M

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

Saved successfully!

Ooh no, something went wrong!