[Hardware Architecture SOC] TLB function, working process and application scenarios

TLB function, working process and application scenarios

foreword

In the previous incident, I came into contact with Allwinner’s embedded software recruitment. One question in the offline written test was to talk about the role of TLB. For this purpose, I checked the information on the Internet and made a summary based on my own experience.

TLB introduction, function

​ The page table is generally large and stored in the memory, so after the processor introduces the MMU, it needs to access the memory twice to read instructions and data: first, obtain the physical address by querying the page table, and then access the physical address to read instructions, data. In order to reduce the processor performance degradation caused by the MMU, TLB is introduced. TLB is the abbreviation of Translation Lookaside Buffer , which can be translated as " Address Translation Lookaside Buffer " or "Fast Table". Simply put, the TLB is the Cache of the page table, which stores the page table entries that are most likely to be accessed at present, and its content is a copy of some page table entries. Only when the TLB cannot complete the address translation task, it will query the page table in the memory, thus reducing the performance degradation of the processor caused by the page table query.

  • TLB is the abbreviation of translation lookaside buffer. Be part of the SOC

  • Reduced processor performance degradation caused by page table lookups .

  • The TLB is the Cache of the page table, which reduces the performance degradation of the processor caused by the MMU .

TLB working process

After joining the TLB, the CPU reads the address process:

​ The TLB can be queried:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-OLKnetqh-1680060498420)(image/embedded linux/v2-784d18a4bd78f880e68069ac6e10bf48_r.jpg)]

TLB failed to look up:[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-eHpoYuwq-1680060498422)(image/embedded linux/v2-d33cdb237600ee156ac17f79807a38f9_r.jpg)]

Application scenarios of TLB

  • In power management, when SDRAM is in self-refresh mode, CPU cannot read code from SDRAM, and uses TLB to cache page table and cache to cache code before sleep .

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-jByPnfYs-1680060498423)(image/embedded linux/1680057267787.png)]

References

(85 messages) The role and working process of TLB_In the arm storage management unit, what is the use of tlb_Yannick_J's blog-CSDN blog

The role and working principle of TLB - AlanTu - Blog Park (cnblogs.com)

A story to understand the TLB of the CPU - Zhihu (zhihu.com)

TLB principle - Zhihu (zhihu.com)

Guess you like

Origin blog.csdn.net/m0_61737429/article/details/129833552