MIPS 缓存:为什么在数据被逐出时写入较低级别的缓存,因为它已经过时了
我很困惑为什么上层缓存中的数据在被逐出时会写入下层,因为它已经过时了?
I am confused why is data from upper level cache written to lower level when its evicted, since it is already outdated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当来自另一个地址的数据映射到相同的缓存索引和路时,数据被逐出。如果原来在cache line中的数据被修改了,那么需要将修改后的数据写入到内存中,这样修改才不会丢失。
示例:对于 4k 字节直接映射的缓存,地址 0 和地址 4096 都映射到缓存中的同一位置,因此如果修改地址 0,然后修改地址 4096,则必须将地址 0 处修改的数据写回修改前的内存地址4096的数据可以存储在缓存中。如果地址 0 不包含修改数据,则在将地址 4096 的修改数据存储在高速缓存中之前,无需将任何内容写回内存。
Data is evicted when data from another address maps to the same cache index and way. If the data that was originally in the cache line was modified, then the modified data needs to be written to memory so that the modification is not lost.
Example: for a 4k byte direct-mapped cache, address 0 and address 4096 both map to the same location in the cache, so if address 0 is modified and then address 4096 is modified, the modified data at address 0 must be written back to memory before the modified data for address 4096 can be stored in the cache. If address 0 did not contain modified data, then nothing needs to be written back to memory before modified data for address 4096 can be stored in the cache.