Addressing method, storage medium and electronic equipment
The invention provides an addressing method, a storage medium and electronic equipment. The addressing method comprises the following steps: acquiring a main memory address of a main memory, wherein the capacity of the main memory is integral power of 2; acquiring a mark value and an index value of...
Saved in:
Main Authors | , , , , |
---|---|
Format | Patent |
Language | Chinese English |
Published |
13.06.2023
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | The invention provides an addressing method, a storage medium and electronic equipment. The addressing method comprises the following steps: acquiring a main memory address of a main memory, wherein the capacity of the main memory is integral power of 2; acquiring a mark value and an index value of a cache address according to the main memory address and the cache depth of the cache, wherein the capacity of the cache is not integral power of 2; acquiring an offset value of the cache address according to the offset value of the main memory address; and addressing the cache by using the flag value, the index value and the offset value of the cache address. The addressing method can be applied to non-power-of-two caches.
本公开提供寻址方法、存储介质及电子设备。所述寻址方法包括:获取主存的主存地址,主存的容量为2的整次幂;根据所述主存地址和缓存的缓存深度获取缓存地址的标记值和索引值,缓存的容量为非2的整次幂;根据所述主存地址的偏移值获取所述缓存地址的偏移值;以及利用所述缓存地址的标记值、索引值和偏移值对所述缓存进行寻址。所述寻址方法能够适用于非2次幂缓存。 |
---|---|
Bibliography: | Application Number: CN202310072512 |