Cache Review Flashcards

1
Q

What is temporal locality?

A

If we have accessed an address recently, we are likely to access it again soon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is spatial locality?

A

If we have accessed an address recently, we are likely to access addresses around it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is AMAT?

A

Average Memory Access Time. Metric to evaluate how fast our cache is. AMAT = (hit time) + (miss rate) * (miss penalty)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a cache’s miss penalty?

A

The time it takes to access main memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What fields are in the cache table?

A

Index (bits of address), data, validity bit (is the real or garbage?)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is block size and what’s another name for it?

A

The number of bytes that we are storing in each line. Must be a power of 2. Also called line size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a cache line?

A

An entry in the cache table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a fully associative cache?

A

any block from memory can be in any cache line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a direct-mapped cache?

A

for any block, there is only one line where that block can go. Index bits tell us which line, remaining upper bits tell us if it’s a match

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the pros/cons of a direct-mapped cache?

A

(+) fast, cheap, and energy efficient because we only have to check one spot for a hit
(-) could have multiple blocks that map to the same location (== worse miss rate)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a set-associative cache?

A

there are n lines where a block can be located. index bits tell us which set, tag is remaining bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the cons of LRU replacement policy?

A

(-) requires a lot of bits to keep track of LRU, must update each entry for every hit or miss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is write-allocate?

A

On a write miss, we bring the entire block into the cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is no-write-allocate?

A

On a write miss, we do not bring the entire block into the cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is write-through?

A

On write hit, we write to the cache and to memory at the same time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is write-back

A

On write hit, we only write to the cache, write to memory when block is replaced in the cache. Requires write-allocated