29 September 1997 – Subject To Change
Internal Architecture
2–7
21164PC Microarchitecture
The RET, JSR_COROUTINE, and HW_REI instructions predict the next PC by
using the index from the subroutine return stack. The upper bits of the PC are formed
from the data in the Icache tag at that index. These predictions are checked against
the actual PC in exactly the same way that JMP and JSR predictions are checked.
The branch-prediction stack never predicts a target address in PALmode. This pre-
vents the possibility of nonprivileged code accessing privileged modes through
incorrect stack predictions (for example, by underflow/overflow of the stack). This
implies that PALcode libraries should avoid using instructions such as RET and
JSR_COROUTINE for internal jumps with PALmode targets, as the 21164PC will
always mispredict the target address.
2.1.1.4 Instruction Translation Buffer
The IDU includes a 48-entry, fully associative instruction translation buffer (ITB).
The buffer stores recently used Istream address translations and protection informa-
tion for pages ranging from 8KB to 4MB and uses a not-last-used replacement algo-
rithm.
PALcode fills and maintains the ITB. Each entry supports all four granularity hint bit
combinations, so that any single ITB entry can provide translation for up to 512 con-
tiguously mapped 8KB pages. The operating system, using PALcode, must ensure
that virtual addresses can only be mapped through a single ITB entry or superpage
mapping at one time. Multiple simultaneous mapping can cause UNDEFINED
results.
While not executing in PALmode, the 43-bit virtual PC is routed to the ITB each
cycle. If the page table entry (PTE) associated with the PC is cached in the ITB, the
protection bits for the page that contains the PC are used by the IDU to do the neces-
sary access checks. If there is an Icache miss and the PC is cached in the ITB, the
page frame number (PFN) and protection bits for the page that contains the PC are
used by the IDU to do the address translation and access checks.
The 21164PC’s ITB supports 128 address space numbers (ASNs) (MAX_ASN=127)
by means of a 7-bit ASN field in each ITB entry. PALcode uses the hardware-spe-
cific HW_MTPR instruction to write to the architecturally defined ITB_IAP register.
This has the effect of invalidating ITB entries that do not have their ASM bit set.
The 21164PC provides two optional translation extensions called superpages.
Access to superpages is enabled using ICSR<SPE> and is allowed only while exe-
cuting in privileged mode.