MPC563XM Reference Manual, Rev. 1
Freescale Semiconductor
921
Preliminary—Subject to Change Without Notice
HALT address must be executed, regardless if the software breakpoint is removed (replacing HALT by the
original microinstruction) or not. Follows the procedure to resume execution from a software breakpoint:
1. restore the original instruction in SCM (replace HALT).
2. force a jump with flush to the original instruction (see
).
3. if the software breakpoint must be kept: single-step and replace the original instruction with a
HALT.
4. let the flow continue, issuing a GO command (leaving halt state).
Special care must be taken if HALT is followed by another HALT, and the second HALT is removed when
microengine was halted by the first one. In this case, replacing the second HALT with the original
microinstruction is not enough to remove the second breakpoint, because the second HALT was already
prefetched and would be executed anyway when halt was suspended. The debugger must also do a forced
execution of unconditional branch with flush to the original microinstruction address. That will clear the
pipeline, replacing the prefetched instruction with a NOP, and load PC with the address of the removed
breakpoint. So, when halt state is suspended, the original microinstruction will be fetched while NOP is
executed, and program flow continues normally from then on.
NOTE
A HALT instruction placed after a no-flushing branch, dispatch or return
may be a problem from the debugger application standpoint: after the HALT
is executed, the eTPU debug interface informs the address of the
branch/dispatch/return destination, and the debugger application has no
direct way to identify which HALT instruction was executed, if multiple
HALTs lead to the same address. This can be solved if the debug support
block (NDEDI) has a register holding the address of the last instruction
executed, otherwise one should forbid non-flushed HALT instructions. See
the
NDEDI Block Guide
.
Software breakpoint setting and removal is possible only with SCM RAM implementations or ROM
implementations with SCM RAM emulation (see
Section 23.4.10.2.11, “SCM Emulation
one way of inserting software breakpoints into SCM RAM: writing bit VIS=1 in register ETPUMCR, and
then accessing SCM as an ordinary RAM from the Skyblue bus. This can be done only if both Engines are
halted or stopped.
23.4.10.2.6
Single-step Execution
When microengine is already in halt_exec state, it can run the next microinstruction in the normal program
flow and get back to halt state. PC is incremented, or assigned the BAF value in a branch with satisfied
condition. Note that the executed instruction was already prefetched in the instruction pipeline, and a new
microinstruction is fetched during its execution. The prefetched instruction may be cleared during halt
state by the forced execution of a branch with flush (see
Section 23.4.10.2.7, “Forced Microinstruction
”), making single-step execute a NOP instead of the next instruction in the program flow.
Single-step execution is controlled by the debug interface, and is a feature available from Nexus if eTPU
is connected to the NDEDI block (see
eTPU Integration Guide
and
NDEDI Block Guide
).The