Что такое кэш и какова его роль

what is cache

Cache is a kind of memory, called cache.
In terms of capacity: CPU《Register》Cache《DDR
In terms of speed: CPU 》Register 》cache 》DDR
The cache exists because the speed difference between registers and DDR is too large. The speed of DDR is far from meeting the needs of registers (it cannot meet the needs of the CPU, so the absence of cache will slow down the overall speed of the entire system)
The CPU supply chain in the entire system consists of: register cache DDR hard disk/flash fourth level. This is the result of a compromise after comprehensive consideration of performance and cost.

The meaning of cache

The meaning of cache is that the instructions are usually placed in the hard disk/flash, and are read into the DDR during operation, and then read from the DDR to the register, and then the register is sent to the CPU. However, the speed of DDR is very different from that of registers (representing the CPU). If the CPU finishes running one sentence and then goes to DDR to read the next sentence, then the speed of the CPU will be completely slowed down by DDR. The solution is icache.
When icache is working, a few instructions next to the instruction our CPU is running will be read into icache in advance (CPU design has a basic principle: when the code is executed, the next sentence will execute the possibility of the code next to the current one. much larger). When the next CPU requests an instruction, the cache first checks whether there is such an instruction in the cache instruction it has prepared in advance. If there is, it will be given to the CPU directly. If not, it will need to be re-read from the DDR and given to the CPU, and at the same time, a series of Actions: clear cache, re-cache.

related suggestion:

4G DTU

    Свяжитесь с нами