8.1 EJTAG on-chip debug unit
Programming the MIPS32® 74K™ Core Family, Revision 02.14
104
A CPU with a suitable probe attached can be set up so the debug exception entry point is in the “dmseg” region, run-
ning instructions provided by the probe itself. With no probe attached, the debug exception entry point is in the ROM
or potentially from an alternate memory location - see
.
8.1.3 Exceptions in debug mode
Software debuggers will probably be coded to avoid causing exceptions (testing addresses in software, for example,
rather than risking address or TLB exceptions).
While executing in debug mode many conditions which would normally cause an exception are ignored: interrupts,
debug exceptions (other than that caused by executing
sdbbp
), and CP0 watchpoint hits.
But other exceptions are turned into “nested debug exceptions” when the CPU is in debug mode - a facility which is
probably mostly valuable to debuggers using the EJTAG probe.
On such a nested debug exception the CPU jumps to the debug exception entry point, remaining in debug mode. The
Debug[DExcCode]
field records the cause of the nested exception, and
DEPC
records the debug-mode-code restart
address. This will not be survivable for the debugger unless it saved a copy of the original
DEPC
soon after entering
debug mode, but it probably did that! To return from a nested debug exception like this you don’t use
deret
(which
would inappropriately take you out of debug mode), you grab the address out of
DEPC
and use a jump-register.
8.1.4 Single-stepping
When control returns from debug mode with a
deret
and the single-step bit
Debug[SSt]
is set, the instruction
selected by
DEPC
will be executed in non-debug context
25
; then a debug exception will be taken on the program’s
very next instruction in sequence.
Since at least one instruction is run in normal mode it can lead to a non-debug exception; in that case the “very next
instruction in sequence” will be the first instruction of the exception handler, and you’ll get a single-step debug
exception whose
DEPC
points at the exception handler.
8.1.5 The “dseg” memory decode region
EJTAG needs to use memory space both to accommodate lots of breakpoint registers (too many for CP0) and for its
probe-mapped communication space. This memory space pops into existence at the top of the CPU’s virtual address
map when the CPU is in debug mode, as shown in
The MIPS trace solution provides software the ability to access the on-chip trace memory. The TCB Registers are
mapped to drseg space and this allows software to directly access the on-chip trace memory using load and store
instructions.
25. If
DEPC
points to a branch instruction, both the branch and branch-delay instruction will be executed normally.
Содержание MIPS32 74K Series
Страница 1: ...Document Number MD00541 Revision 02 14 March 30 2011 Programming the MIPS32 74K Core Family...
Страница 10: ...Programming the MIPS32 74K Core Family Revision 02 14 10...
Страница 20: ...1 4 A brief guide to the 74K core implementation Programming the MIPS32 74K Core Family Revision 02 14 20...
Страница 28: ...2 2 PRId register identifying your CPU type Programming the MIPS32 74K Core Family Revision 02 14 28...
Страница 54: ...3 8 The TLB and translation Programming the MIPS32 74K Core Family Revision 02 14 54...
Страница 83: ......
Страница 86: ...6 5 FPU pipeline and instruction timing Programming the MIPS32 74K Core Family Revision 02 14 86...
Страница 101: ...The MIPS32 DSP ASE 101 Programming the MIPS32 74K Core Family Revision 02 14...
Страница 134: ...8 4 Performance counters Programming the MIPS32 74K Core Family Revision 02 14 134...
Страница 154: ...C 3 FPU changes in Release 2 of the MIPS32 Architecture Programming the MIPS32 74K Core Family Revision 02 14 154...