Encoding:

POOL32A

000000

0000000000

TLBWI

0010001101

POOL32Axf

111100

6

10

10

6

Format:

TLBWI 

microMIPS

Write Indexed TLB Entry

Purpose:

Write Indexed TLB Entry

To write or invalidate a TLB entry indexed by the Index register.

Description:

If Config4IE == 0 or EntryHiEHINV=0:

The TLB entry pointed to by the Index register is written from the contents of the EntryHi, EntryLo0, EntryLo1, and PageMask registers. It is implementation dependent whether multiple TLB matches are detected on a

TLBWI. In such an instance, a Machine Check Exception is signaled.

In Release 2 of the Architecture, multiple TLB matches may only be reported on a TLB write. The information written to the TLB entry may be different from that in the EntryHi, EntryLo0, and EntryLo1 registers, in that:

If Config4IE >= 1 and EntryHiEHINV = 1:

The TLB entry pointed to by the Index register has its VPN2 field marked as invalid. This causes the entry to be ignored on TLB matches for memory accesses. No Machine Check is generated.

Restrictions:

The operation is UNDEFINED if the contents of the Index register are greater than or equal to the number of TLB entries in the processor.

If access to Coprocessor 0 is not enabled, a Coprocessor Unusable Exception is signaled.

Release 6: Processors that include a Block Address Translation (BAT) or Fixed Mapping (FM) MMU (ConfigMT = 2 or 3), the operation of this instruction causes a Reserved Instruction exception (RI).

Operation:

i = Index
if (Config4IE >= 1) then 
   TLB[i]VPN2_invalid = 0
   if ( EntryHIEHINV=1 ) then
      TLB[i]VPN2_invalid = 1
      break
   endif
endif
TLB[i]Mask = PageMaskMask
TLB[i]R = EntryHiR
TLB[i]VPN2 = EntryHiVPN2 and not PageMaskMask # Implementation dependent
TLB[i]ASID = EntryHiASID
TLB[i]G = EntryLo1G and EntryLo0G
TLB[i]PFN1 = EntryLo1PFN and not PageMaskMask # Implementation dependent
TLB[i]C1 = EntryLo1C
TLB[i]D1 = EntryLo1D
TLB[i]V1 = EntryLo1V
TLB[i]PFN0 = EntryLo0PFN and not PageMaskMask # Implementation dependent
TLB[i]C0 = EntryLo0C
TLB[i]D0 = EntryLo0D
TLB[i]V0 = EntryLo0V

Exceptions:

Coprocessor Unusable, Machine Check