Locality
Level
字組: word
位元組: byte
Direct mapping
Cache
Set associative mapping
Multilevel
AMAT
In disk:
page
In memory:
page table
special cache:
(TLB) Translation lookaside Buffer
If the address do not miss, step by step.
CPU
\(
\rightarrow
\)
TLB
\(
\rightarrow
\)
Cache
\(
\rightarrow
\)
CPU
Virtual Memory
TLB
miss 來源分類
強迫性失誤(Compulsory misses) :
此block從未被使用,這種情況是在第一次讀記憶體時會發生,
因為一定不在cache之中,這也稱為冷開機失誤
(cold-start misses)
容量性失誤(Capacity misses):
process執行時,若cache容量不足以包含process所需要
read的block時,就會發生cache miss。發生原因為block不斷的被替換,需要時又要被重新被擷取。
衝突性失誤(Conflict misses)
也稱為碰撞失誤(collision misses) :
在direct-mapping和set associative的cache中,
不同block mapping 到cache的同一個位置中,導致
cache miss。
而fully set associative mapping 是不會有Conflict misses發生的。
Reference
張凡 - 計算機組織與結構重點直擊