University ¡of ¡Washington ¡
Memory ¡and ¡Caches ¡II ¡
The ¡Hardware/So<ware ¡Interface ¡
CSE351 ¡Winter ¡2013 ¡
University ¡of ¡Washington ¡
Types ¡of ¡Cache ¡Misses ¡
Cold ¡(compulsory) ¡miss ¡
- Occurs ¡on ¡very ¡first ¡access ¡to ¡a ¡block ¡
Conflict ¡miss ¡
- Occurs ¡when ¡some ¡block ¡is ¡evicted ¡out ¡of ¡the ¡cache, ¡but ¡then ¡that ¡block ¡
is ¡referenced ¡again ¡later ¡
- Conflict ¡misses ¡occur ¡when ¡the ¡cache ¡is ¡large ¡enough, ¡but ¡mulDple ¡data ¡
blocks ¡all ¡map ¡to ¡the ¡same ¡slot ¡
- e.g., ¡if ¡blocks ¡0 ¡and ¡8 ¡map ¡to ¡the ¡same ¡cache ¡slot, ¡then ¡referencing ¡
0, ¡8, ¡0, ¡8, ¡... ¡would ¡miss ¡every ¡Dme ¡
- Conflict ¡misses ¡may ¡be ¡reduced ¡by ¡increasing ¡the ¡associaDvity ¡of ¡
the ¡cache ¡
Capacity ¡miss ¡
- Occurs ¡when ¡the ¡set ¡of ¡acDve ¡cache ¡blocks ¡(the ¡working ¡set) ¡is ¡larger ¡
than ¡the ¡cache ¡(just ¡won’t ¡fit) ¡
Winter ¡2013 ¡
2 ¡
Memory ¡and ¡Caches ¡II ¡
University ¡of ¡Washington ¡
General ¡Cache ¡OrganizaJon ¡(S, ¡E, ¡B) ¡
E ¡= ¡2e ¡lines ¡per ¡set ¡ S ¡= ¡2s ¡sets ¡ set ¡ line ¡
¡ 1 ¡ 2 ¡ B-‑1 ¡ tag ¡ v ¡
valid ¡bit ¡ B ¡= ¡2b ¡bytes ¡of ¡data ¡per ¡cache ¡line ¡(the ¡data ¡block) ¡
cache ¡size: ¡ S ¡x ¡E ¡x ¡B ¡ ¡data ¡bytes ¡
3 ¡
Winter ¡2013 ¡ Memory ¡and ¡Caches ¡II ¡
University ¡of ¡Washington ¡
Cache ¡Read ¡
E ¡= ¡2e ¡lines ¡per ¡set ¡ S ¡= ¡2s ¡sets ¡
¡ 1 ¡ 2 ¡ B-‑1 ¡ tag ¡ v ¡
valid ¡bit ¡ B ¡= ¡2b ¡bytes ¡of ¡data ¡per ¡cache ¡line ¡(the ¡data ¡block) ¡
t ¡bits ¡ s ¡bits ¡ b ¡bits ¡
Address ¡of ¡byte ¡in ¡memory: ¡ tag ¡ set ¡ index ¡ block ¡
- ffset ¡
data ¡begins ¡at ¡this ¡offset ¡
- Locate ¡set ¡
- Check ¡if ¡any ¡line ¡in ¡set ¡
has ¡matching ¡tag ¡
- Yes ¡+ ¡line ¡valid: ¡hit ¡
- Locate ¡data ¡star?ng ¡
at ¡offset ¡
4 ¡
Winter ¡2013 ¡ Memory ¡and ¡Caches ¡II ¡