Appendix B Instruction Prefetch Side Effects - Hitachi SH7750 Programming Manual

High-performance risc engine superh (sh) 32-bit risc mcu/mpu series
Hide thumbs Also See for SH7750:
Table of Contents

Advertisement

Appendix B Instruction Prefetch Side Effects

The SH4 is provided with an internal buffer for holding pre-read instructions, and always performs
pre-reading. Therefore, program code must not be located in the last 20-byte area of any memory
space. If program code is located in these areas, the memory area will be exceeded and a bus
access for instruction pre-reading may be initiated. A case in which this is a problem is shown
below.
Address
H'03FFFFF8
H'03FFFFFA
Area 0
H'03FFFFFC
H'03FFFFFE
Area 1
H'04000000
H'04000002
Figure B.1 presupposes a case in which the instruction (ADD) indicated by the program counter
(PC) and the address H'0400002 instruction prefetch are executed simultaneously. It is also
assumed that the program branches to an area outside area 1 after executing the following JMP
instruction and delay slot instruction.
In this case, the program flow is unpredictable, and a bus access (instruction prefetch) to area 1
may be initiated.
Instruction Prefetch Side Effects
1. It is possible that an external bus access caused by an instruction prefetch may result in
misoperation of an external device, such as a FIFO, connected to the area concerned.
2. If there is no device to reply to an external bus request caused by an instruction prefetch,
hangup will occur.
Remedies
1. These illegal instruction fetches can be avoided by using the MMU.
2. The problem can be avoided by not locating program code in the last 20 bytes of any area.
.
.
.
.
.
ADD R1,R4
JMP @R2
NOP
NOP
Figure B.1 Instruction Prefetch
PC (program counter)
Instruction prefetch address
Rev. 2.0, 03/99, page 397 of 396

Advertisement

Table of Contents
loading

Table of Contents