Dynamic Debug Handler - Intel PXA255 User Manual

Xscale microarchitecture
Hide thumbs Also See for PXA255:
Table of Contents

Advertisement

The handler executes in Debug Mode and can be switched to other modes to access banked
registers. The handler must not enter User Mode; any User Mode registers that need to be
accessed can be accessed in System Mode. Entering User Mode will cause unpredictable
behavior.
10.14.2.3

Dynamic Debug Handler

On the Intel® XScale™ core, the debug handler and override vector tables may reside in the 2 KB
mini instruction cache, separate from the main instruction cache. A "static" Debug Handler is
downloaded during reset. This is the base handler code, necessary to do common operations such
as handler entry/exit, parse commands from the debugger, read/write ARM* registers, read/write
memory, etc.
Some functions may require large amounts of code or may not be used very often. As long as there
is space in the mini-instruction cache, these functions can be downloaded as part of the static
Debug Handler. However, if space is limited, the debug handler also has a dynamic capability that
allows a function to be downloaded when it is needed. There are three methods for implementing a
dynamic debug handler (using the mini instruction cache, main instruction cache, or external
memory). Each method has limitations and advantages.
After Reset"
1. using the Mini IC
The static debug handler can support a command which can have functionality dynamically
mapped to it. This dynamic command does not have any specific functionality associated with
it until the debugger downloads a function into the mini instruction cache. When the debugger
sends the dynamic command to the handler, new functionality can be downloaded, or the
previously downloaded functionality can be used.
There are also variations in which the debug handler supports multiple dynamic commands,
each mapped to a different dynamic function; or a single dynamic command that can branch to
one of several downloaded dynamic functions based on a parameter passed by the debugger.
Debug Handlers that allow code to be dynamically downloaded into the mini instruction cache
must be carefully written to avoid inadvertently overwriting a critical piece of debug handler
code. Dynamic code is downloaded to the way pointed to by the round-robin pointer. Thus, it
is possible for critical debug handler code to be overwritten, if the pointer does not select the
expected way.
To avoid this problem, the debug handler should be written to avoid placing critical code in
either way of a set that is intended for dynamic code download. This allows code to be
downloaded into either way, and the only code that is overwritten is the previously
downloaded dynamic function. This method requires that space within the mini instruction
cache be allocated for dynamic download, limiting the space available for the static Debug
Handler. Also, the space available may not be suitable for a larger dynamic function.
Once downloaded, a dynamic function essentially becomes part of the Debug Handler. If
written in the mini instruction cache, it does not get overwritten by application code. It remains
in the cache until it is replaced by another dynamic function or the lines where it is
downloaded are invalidated.
2. Using the Main IC.
The steps for downloading dynamic functions into the main instruction cache is similar to
downloading into the mini instruction cache. However, using the main instruction cache has its
advantages.
Using the main instruction cache eliminates the problem of inadvertently overwriting static
Debug Handler code by writing to the wrong way of a set, since the main and mini instruction
caches are separate. The debug handler code does not need to be specially mapped out to avoid
Intel® XScale™ Microarchitecture User's Manual
describes how to dynamically load the mini or main instruction cache.
Software Debug
Section 10, "Dynamically Loading IC
10-43

Advertisement

Table of Contents
loading

Table of Contents