MOTOROLA
5-18
CENTRAL PROCESSING UNIT
MC68331
USER’S MANUAL
5
causing a change in program flow. In the trace mode, a trace exception is gener-
ated after an instruction is executed, allowing a debugger program to monitor the
execution of a program under test.
Breakpoint Instruction — An emulator may insert software breakpoints into the target
code to indicate when a breakpoint has occurred. On the MC68010, MC68020,
MC68030, and CPU32, this function is provided via illegal instructions, $4848–
$484F, to serve as breakpoint instructions.
Unimplemented Instruction Emulation — During instruction execution, when an at-
tempt is made to execute an illegal instruction, an illegal instruction exception oc-
curs. Unimplemented instructions (F-line, A-line,...) utilize separate exception
vectors to permit efficient emulation of unimplemented instructions in software.
5.10.2 Background Debugging Mode
Microcomputer systems generally provide a debugger, implemented in software, for
system analysis at the lowest level. The background debugging mode (BDM) on the
CPU32 is unique in that the debugger has been implemented in CPU microcode.
BDM incorporates a full set of debugging options: registers can be viewed or altered,
memory can be read or written to, and test features can be invoked.
A resident debugger simplifies implementation of an in-circuit emulator. In a common
setup (see
Figure 5-7
), emulator hardware replaces the target system processor. A
complex, expensive pod-and-cable interface provides a communication path between
the target system and the emulator.
By contrast, an integrated debugger supports use of a bus state analyzer (BSA) for in-
circuit emulation. The processor remains in the target system (see
Figure 5-8
) and the
interface is simplified. The BSA monitors target processor operation and the on-chip
debugger controls the operating environment. Emulation is much “closer” to target
hardware, and many interfacing problems (e.g., limitations on high-frequency opera-
tion, AC and DC parametric mismatches, and restrictions on cable length) are mini-
mized.
Figure 5-7 Common In-Circuit Emulator Diagram
1128A
TARGET
SYSTEM
IN-CIRCUIT
EMULATOR
TARGET
MCU