13. 概念介绍
cache
– 作用
• 缓存指令或者数据
• 一级cache,二级cache
更新
物理地址 miss
cache memory
hit
14. 概念介绍
cache—directed mapped
Block address
31 9 4 0
Cache Tag Example: 0x50 Cache Index Byte Select
Ex: 0x01 Ex: 0x00
Stored as part
of the cache “state”
Valid Bit Cache Tag Cache Data
Byte 31 Byte 1 Byte 0 0
:
0x50 Byte 63 Byte 33 Byte 32 1
:
2
3
: : :
Byte 1023 Byte 992 31
:
15. 概念介绍
Cache—N-way associative way
– 例子:2-way组关联cache
• Index->set
• Compare tag
Cache Index
Valid Cache Tag Cache Data Cache Data Cache Tag Valid
Cache Block 0 Cache Block 0
: : : : : :
Adr Tag
Compare Sel1 1 Mux 0 Sel0 Compare
OR
Cache Block
Hit