The meaning, function and realization of TLB.

1. The meaning of
TLB TLB: Translation Lookaside Buffer Page table buffer
Used to store the page table file, that is, the conversion table of the virtual address VA to the physical address PA.
Second, the role
of TLB before the introduction of TLB: After the CPU receives the virtual memory address from the program, it first needs to go to the physical memory to fetch the page table, and then corresponds to the virtual page number from the program, find the corresponding physical page number in the page table In order to access the actual physical memory address, the CPU accesses the physical memory at least twice during the entire process, and may actually be more. Therefore, in order to reduce the number of times the CPU accesses physical memory, TLB is introduced.
After the introduction of TLB: After the CPU receives the virtual memory address from the program, it preferentially addresses in the TLB. TLB is responsible for converting the virtual memory address to the actual physical memory address, and then to access the actual physical memory address.
TLB processing of addresses: address transparent transmission (without processing), address extension (such as 32-bit extension to 36-bit), address conversion (in accordance with certain rules), address protection.
3. Implementation of TLB
3.1 The entry
mapping mechanism must enable a program to assert that an address is in its own process space or address space, and can efficiently convert it to a real physical address to access memory. One method is to use a table (that is, a page table) that contains entries for all pages in the entire space, and each entry contains the correct physical address of the page.
Entry: Each record that records the correspondence between a virtual page and a physical page frame is called a page table entry. The number of entries is generally 16, 32, 64.
3.2 TLB_miss, TLB_hit, TLB_multi_hit
TLB_hit:
When the CPU receives the virtual address from the program, it first searches the corresponding page table data in the TLB. If the required page table is stored in the TLB, it is called a TLB hit.
TLB_multi_hit:
When the CPU receives the virtual address from the program, it first searches the corresponding page table data in the TLB. If the required page table is stored in the TLB and the number is greater than 1, it is called TLB multiple hits unusual phenomenon.
TLB_miss:
After the CPU receives the virtual address from the program, it first searches the corresponding page table data in the TLB. If there is no corresponding page table stored in the TLB, it is called TLB_miss, which is an abnormal phenomenon.
3.3 Realization of
VA: virtual address
PA: physical address
MASK: used to identify and configure the minimum address unit for comparing the input address with VA. It is assumed that all input addresses need to be compared, and the input address at this time is a virtual address.
The read and write channels are separated during TLB conversion.
4. Notes
4.1 When a TLB is configured, the 4k space of the address can be controlled, from 0000 to 1000.
4.2 When verifying TLB integrated functions, it is necessary to verify the location of each entry to ensure that all address translations are correct.

Published 38 original articles · Like 29 · Visits 10,000+

Guess you like

Origin blog.csdn.net/weixin_45270982/article/details/105332081