MOTOROLA
Chapter 23. Development Support
23-5
Program Flow Tracking
When the CPU is in debug mode, the VF pins equal ‘000’ and the VFLS pins equal ‘11’.
If VSYNC is asserted/negated while the CPU is in debug mode, this information is reported
as the first VF pins report when the CPU returns to regular mode. If VSYNC was not
changed while in debug mode. the first VF pins report will be of an indirect branch taken
(VF = 101), suitable for the rfi instruction that is being issued. In both cases the first
instruction fetch after debug mode is marked with the program trace cycle attribute and
therefore is visible externally.
23.1.3
Sequential Instructions Marked as Indirect Branch
There are cases when non-branch (sequential) instructions may effect the machine in a
manner similar to indirect branch instructions. These instructions include rfi, mtmsr, isync
and mtspr to CMPA-F, ICTRL, ECR and DER.
These instructions are marked by the CPU as indirect branch instructions (VF = 101) and
the following instruction address is marked with the same program trace cycle attribute as
if it were an indirect branch target. Therefore, when one of these special instructions is
detected in the CPU, the address of the following instruction is visible externally. In this
way the reconstructing software is able to evaluate correctly the effect of these instructions.
23.1.4
External Hardware
When program trace is needed, the external hardware needs to sample the status pins (VF
and VFLS) each clock cycle and the address of all cycles marked with the program trace
cycle attribute.
Program trace can be used in various ways. Below are two examples of how program trace
can be used:
Back trace — Back trace is useful when a record of the program trace before some
event occurred is needed. An example of such an event is some system failure.
In case back trace is needed the external hardware should start sampling the status
pins (VF and VFLS) and the address of all cycles marked with the program trace
cycle attribute immediately when reset is negated. If show cycles is programmed out
of reset to show all, all cycles marked with program trace cycle attribute are visible
on the external bus. VSYNC should be asserted sometime after reset and negated
when the programmed event occurs. If no show is programmed for show cycles,
make sure VSYNC is asserted before the Instruction show cycles programming is
changed from show all.
Note that in case the timing of the programmed event is unknown it is possible to
use cyclic buffers.