previous | start | next

TLB Lookup

The VPN is the index into the page table for the current process.

However, the page table is in memory.

We do not want to have to access memory just to translate the virtual address!

So first see if the page table entry we need is in the TLB cache in the CPU.

      VPN = 00001111 = TLBT : TLBI = 000011 : 11
   

There are 4 sets: 0,1,2,3. The right 2 bits of the VPN form the TLB index, which is the same as the set number.

So the TLBI = 11 (binary) = 3 (in decimal).

The TLB tag must be compared with the 4 entries in set 3.

(Remember that the TLB is a 4-way-associative cache of page table entries.)

      TLBT = 000011 = 00 0011 = 0x03
   

The four tags for set 3 are

      Tag PPN Valid
      07   -    0
      03   0D   1
      0A   34   1
      02   -    0
   

So the physical page number, PPN= 0x0D.

This information is also in the page table in memory, but if we have a TLB hit, we avoid having to access memory for the PTE.



previous | start | next