![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_184.png)
CHAPTER 2 V
R
4120A
184
Preliminary User’s Manual S14767EJ1V0UM00
(2) TLB invalid exception
(a) Cause
The TLB Invalid exception occurs when the TLB entry that matches with the virtual address to be referenced is
invalid (the V bit is set to 0). This exception is not maskable.
(b) Processing
The common exception vector is used for this exception. The TLBL or TLBS code in the ExcCode field of the
Cause register is set. If this exception has been caused by an instruction reference or load operation, TLBL is set.
If it has been caused by a store operation, TLBS is set.
When this exception occurs, the BadVAddr, Context, Xcontext, and EntryHi registers contain the virtual address
that failed address translation. The EntryHi register also contains the ASID from which the translation fault
occurred. The Random register normally stores a valid location in which to place the replacement TLB entry. The
contents of the EntryLo register are undefined.
When the MIPS16 instruction is disabled, the EPC register contains the address of the instruction that caused the
exception. However, if this instruction is in a branch delay slot, the EPC register contains the address of the
preceding jump or branch instruction, and the BD bit of the Cause register is set to 1.
When the MIPS16 instruction is enabled, the EPC register contains the address of the instruction that caused the
exception, and the least significant bit stores the ISA mode in which an exception occurs. However, if this
instruction is in a branch delay slot or is the instruction following the Extend instruction, the EPC register contains
the address of the preceding jump or Extend instruction, and the BD bit of the Cause register is set to 1.
(c) Servicing
Usually, the V bit of a TLB entry is cleared in the following cases:
—
—
—
When a virtual address does not exist
When the virtual address exists, but is not in main memory (a page fault)
When a trap is required on any reference to the page (for example, to maintain a reference bit)
After servicing the cause of a TLB Invalid exception, the TLB entry is located with a TLBP (TLB Probe) instruction,
and replaced by an entry with its V bit set to 1.
(3) TLB modified exception
(a) Cause
The TLB Modified exception occurs when the TLB entry that matches with the virtual address referenced by the
store instruction is valid (V bit is 1) but is not writable (D bit is 0). This exception is not maskable.
(b) Processing
The common exception vector is used for this exception, and the Mod code in the ExcCode field of the Cause
register is set.
When this exception occurs, the BadVAddr, Context, Xcontext, and EntryHi registers contain the virtual address
that failed address translation. The EntryHi register also contains the ASID from which the translation fault
occurred. The contents of the EntryLo register are undefined.