Set-Associative Caches
2 way set associative cache (32 KB)
Cache line: 4 words
Location in the cache:
(memory-address) mod (cache-size)
in this case loc(A(1)) mod 16KB = loc(B(1)) mod 16KB
BUT A DIFFERENT SET!
1
2
1023
1024
Registers
in the CPU
COMMON //A(8192), B(8192)
DO I=1,N
PROD = PROD + A(I)*B(I)
ENDDO
No Thrashing: conflicting cache lines
are stored into a different set
Set select (1bit)
(LRU)
Previous slide
Next slide
Back to first slide
View graphic version