308
Evaluating and Programming the 29K RISC Family
data and instruction address translation, the DA and FZ bits in the CPS register must
also be cleared. Clearing these bits disables Am29000 special register freezing and
enables traps to be taken.
When the MMU does not contain a match for the current address translation, a
trap is taken by the processor. This also happens for valid translations not meeting
permission requirements. The software executed by the trap handler must construct a
TLB entry for the
failing
address from page table entries (PTEs) stored in memory.
The TLB registers simply act as a cache for the currently–needed translations stored
in off–chip data memory.
Many CISC–type processors have algorithms in the chip microcode for auto-
matically updating the MMU hardware from more extensive data located in external
data memory. Because the Am29000 does not implement this function in hardware,
the user is free to construct a software algorithm for TLB reloading which best suits
the memory management architecture. This increased flexibility outweighs any re-
duction in TLB register reload time that may occur for some configurations. The
flexibility is what makes possible the software controlled cached described later.
When the Am29000 takes a trap the processor enters Supervisor mode with fro-
zen critical support registers. This is known as Freeze mode. A more complete ex-
planation is given in Chapter 4
(Interrupts and Traps
). The frozen special registers
describe the state of the processor at the time of the address translation failure. Ex-
amining these registers enables the trap handler software to determine the necessary
action and eventually restart the instruction in execute when the trap occurred. After
the
trapware
routines have constructed the required TLB entry, the faulting instruc-
tion will be able to complete execution.
Later sections will deal with the trapware in detail for the example software con-
trolled cache system. The interesting details of the trapware will be covered then.
Since the code is memory architecture specific, the operation of the software con-
trolled cache needs to be discussed first. This discussion is in the later section entitled
Software Controlled Cache Memory Architecture
(section 6.4).
6.3
PERFORMANCE EQUATION
Performance has been considered in terms of average number of cycles per
instruction execution. This is a useful metric when considering memory system ar-
chitectures. Figure 6-1, Figure 6-2 and Figure 6-4 give average cycles per user
instruction execution (A
C/I
). However, if a TLB miss occurs during instruction
execution, a number of Supervisor mode trapware instructions will be required to
prepare the TLB registers before the user’s code can continue. If TLB trapware is ac-
tivated in support of too many instructions, then the effective number of cycles re-
quired per application instruction will increase.
The effective average cycles per instruction is given by: A
effective
= P A
C/I
where
A
C/I
is the average number of cycles per instruction for the program running in physi-