English
Language : 

SH7729R Datasheet, PDF (264/855 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer Super RISC engine Family/SH7700 Series
4. When data access (address + data) is specified as a break condition:
The PC value is the start address of the instruction that follows the instruction already executed
when break processing started. When a data value is added to the break conditions, the place
where the break will occur cannot be specified exactly. The break will occur before the
execution of an instruction fetched in the vicinity of the data access where the break occurred.
8.3.7 PC Trace
1. A PC trace is started by setting the PC trace enable bit (PCTE) to 1 in BRCR. When a branch
(branch instruction, repeat, interrupt) occurs, an address that enables the branch source address
to be calculated and the branch destination address are stored in the branch source register
(BRSR) and branch destination register (BRDR). The branch destination instruction fetch
address is stored in BRDR, while the last instruction fetch address before the branch is stored
in BRSR. The branch flag register (BRFR) holds a pointer that indicates the relationship to the
instruction executed immediately before the branch.
2. The address of the instruction executed immediately before the branch can be calculated from
the address stored in BRSR and the pointer stored in BRFR. If the address stored in BRSR is
BSA, the pointer stored in BRFR is PID, and the address prior to the branch is IA, then IA =
BSA – 2 × PID.
With this equation, caution is required in the case where an interrupt (branch) is executed
before the branch destination instruction is executed. In the example in figure 8.2, the address
of instruction “Exec” executed immediately before the branch is calculated using the equation
IA = BSA – 2 × PID. However, if branch “branch” has a delay slot and the branch destination
is address 4n + 2, branch destination address “Dest” specified by the branch instruction is
stored in BRSR. Therefore, the equation IA = BSA – 2 × PID does not apply in this case, and
this PID is invalid. In this case only, BSA is at the 4n + 2 boundary, classified as shown in
table 8.3.
Exec: branch Dest
Dest: instr; Not executed
Interrupt
Int: interrupt routine
Figure 8.2 When Interrupt Occurs before Branch Instruction Is Executed
Rev. 5.0, 09/03, page 218 of 806