•
Smallest & Fastest
•
Located
◦
CPU
◦
between CPU and Main Memory
•
Design Consideration
◦
Size
◦
Mapping Function
◦
Replacement Algorithm
◦
Write Policy
◦
Block Size
◦
Number of Caches
Mapping Techniques
Cache mapping referes to a technique using which we bring the main memory into the cache memory.
Direct Memory Mapping
PROS
•
Simplest & Fast
•
Less expensive
CONS
•
Low performance
•
Easy to miss
PROS
•
Higher hit rate
•
Fast
CONS
•
Expensive
•
Increase heat
Associative Mapping
Set Associative Mapping
PROS
•
More flexible
•
Higher hit rate
CONS
•
Most expensive
•
Increase heat
Types of Cache Misses
1.
Compulsory Miss
a.
Cold Miss
2.
Conflict Miss
a.
Collision Miss
b.
Interference Miss
3.
Capacity Miss
4.
Coherence Miss
5.
Coverage Miss
6.
System Related Miss
Replacement Policy
•
Reduce Cache Misses
•
Minimize Miss Penalty
•
Types
◦
Random Replacement
▪
Not Implemented (Used in ARM architecture in the past)
◦
Recency Based Policies
◦
Frequency Based Policies
◦
Optimal Replacement / Belady’s Optimal Algorithm
▪
Remove the block that won’t be referred for the longest period of time in future
▪
Used in efficiency measuring tool for real Replacement Algorithms
Replacement Policy
Hit:
•
write-through
◦
Write to the Cache & Main Memory
•
write-back
◦
Write only to the Cache
Miss:
•
write-allocate
◦
Bring data to Cache from the Main Memory
◦
Then use either of the Hit Write strategy
•
no-write allocate
◦
Write only to the Main Memory
Terms
•
Hit : a state in which data requested for processing is found in the cache memory
•
Miss : a state where the data requested for processing is not found in the cache memory
•
Hit Time : time required to access data at a given memory level
•
Miss Penalty : time required to process a miss including the time it takes to replace a block of memory plus the time it takes to deliver the data to the processor











