Caching In Depth
1
Caching In Depth 1 Today Quiz Design choices in cache - - PowerPoint PPT Presentation
Caching In Depth 1 Today Quiz Design choices in cache architecture 2 Basic Cache Organization Some number of cache lines each with Dirty bit -- does this data dirty valid Tag Data match what is in memory Valid -- does
1
2
3
Tag valid dirty Data
match what is in memory
anything at all?
the address
4
5
5
5
5
6
6
6
6
7
{tag, index, offset} = address; if (isRead) { if (tags[index] == tag) { return data[index]; } else { l = chooseLine(...); if (l is dirty) { WriteBack(l); } Load address into line l; return data[l]; } }
7
{tag, index, offset} = address; if (isRead) { if (tags[index] == tag) { return data[index]; } else { l = chooseLine(...); if (l is dirty) { WriteBack(l); } Load address into line l; return data[l]; } }
8
{tag, index, offset} = address; if (isWrite) { if (tags[index] == tag) { data[index] = data; // Should we just update locally? dirty[index] = true; } else { l = chooseLine(...); // maybe no line? if (l is dirty) { WriteBack(l); } if (l exists) { data[l] = data; } } }
8
{tag, index, offset} = address; if (isWrite) { if (tags[index] == tag) { data[index] = data; // Should we just update locally? dirty[index] = true; } else { l = chooseLine(...); // maybe no line? if (l is dirty) { WriteBack(l); } if (l exists) { data[l] = data; } } }
8
{tag, index, offset} = address; if (isWrite) { if (tags[index] == tag) { data[index] = data; // Should we just update locally? dirty[index] = true; } else { l = chooseLine(...); // maybe no line? if (l is dirty) { WriteBack(l); } if (l exists) { data[l] = data; } } }
8
{tag, index, offset} = address; if (isWrite) { if (tags[index] == tag) { data[index] = data; // Should we just update locally? dirty[index] = true; } else { l = chooseLine(...); // maybe no line? if (l is dirty) { WriteBack(l); } if (l exists) { data[l] = data; } } }
lower level of the hierarchy.
then modify it.
find it in the hierarchy. Do not bring it “closer”
9
10
11
12
Tag valid dirty Data Set 0 Set 1 Set 2 Set 3 Way 0 Way 1
geometry”
13
14
14
14
14
14
14
15
implement true randomness.
used the longest time ago.
back.
farthest in the future. This is provably optimal. It is also difficult to implement.
16
memory” They embed comparators in the memory
17
18
number of ports
19
20