Professional Documents
Culture Documents
10 Caches Detail
10 Caches Detail
Today
Quiz
Design choices in cache architecture
dirty
valid
Tag
Data
Practice
cache lines. 32 Bytes per line.
1024
bits:
Index
bits:
Tag
off set bits:
Practice
cache lines. 32 Bytes per line.
1024
bits: 10
Index
bits:
Tag
off set bits:
Practice
cache lines. 32 Bytes per line.
1024
bits: 10
Index
bits:
Tag
off set bits: 5
Practice
cache lines. 32 Bytes per line.
1024
bits: 10
Index
bits:
17
Tag
off set bits: 5
Practice
cache.
32KB
64byte lines.
Index
Offset
Tag
Practice
cache.
32KB
64byte lines.
9
Index
Offset
Tag
Practice
cache.
32KB
64byte lines.
9
Index
Offset
Tag 17
Practice
cache.
32KB
64byte lines.
9
Index
6
Offset
Tag 17
different decisions.
Where to write data?
What to evict?
contended.
How can we deal with this?
10
Associativity
Associativity means providing more than
(set)
one place for a cache line to live.
level of associativity is the number of
The
possible locations
set associative
2-way
4-way set associative
group of lines corresponds to each index
One
it is called a set
11
Associativity
dirty
valid
Tag
Data
Way 0
Set 0
Way 1
Set 1
Set 2
Set 3
12
Cache lines = L
Cache line size = B
Address length = A (32 bits in our case)
Associativity = W
Index bits = log2(L/W)
Offset bits = log2(B)
Tag bits = A - (index bits + offset bits)
13
Practice
32KB, 2048 Lines, 4-way associative.
size:
Line
Sets:
bits:
Index
bits:
Tag
Offset bits:
14
Practice
32KB, 2048 Lines, 4-way associative.
size:
16B
Line
Sets:
bits:
Index
bits:
Tag
Offset bits:
14
Practice
32KB, 2048 Lines, 4-way associative.
size:
16B
Line
512
Sets:
bits:
Index
bits:
Tag
Offset bits:
14
Practice
32KB, 2048 Lines, 4-way associative.
size:
16B
Line
512
Sets:
bits:
9
Index
bits:
Tag
Offset bits:
14
Practice
32KB, 2048 Lines, 4-way associative.
size:
16B
Line
512
Sets:
bits:
9
Index
bits:
Tag
Offset bits: 4
14
Practice
32KB, 2048 Lines, 4-way associative.
size:
16B
Line
512
Sets:
bits:
9
Index
bits:
19
Tag
Offset bits: 4
14
Full Associativity
15
16
17
Increasing Bandwidth
single, standard cache can service only one
Aoperation
at time.
would like to have more bandwidth,
We
especially in modern multi-issue processors
are two choices
There
Extra ports
Banking
18
Extra Ports
Uniformly supports multiple accesses
Pros:
Any N addresses can be accessed in parallel.
in terms of area.
Costly
Remember: SRAM size increases quadratically with the
number of ports
19
Banking
independent caches, each assigned one
Multiple,
part of the address space (use some bits of the
address)
Pros: Efficient in terms of area. Four banks of
size N/4 are only a bit bigger than one cache of
size N.
Cons: Only one access per bank. If you are
unlucky you dont get the extra.
20