Large and Fast: Exploiting Memory Hierarchy: Computer Organization and Design
Large and Fast: Exploiting Memory Hierarchy: Computer Organization and Design
Large and Fast: Exploiting Memory Hierarchy: Computer Organization and Design
RISC-V
Edition
The Hardware/Software Interface
Chapter 5
Large and Fast:
Exploiting Memory
Hierarchy
Learning Outcomes
Upon completion of this chapter, students will be able to:
compute the total bits for a Direct-Mapped (or N-way set
How do we know if
the data is present?
Where do we look?
#Blocks is a
power of 2
Use low-order
address bits
0 0 miss Mem[0]
8 0 miss Mem[8]
0 0 miss Mem[0]
6 2 miss Mem[0] Mem[6]
8 0 miss Mem[8] Mem[6]
0 0 miss Mem[0]
8 0 miss Mem[0] Mem[8]
0 0 hit Mem[0] Mem[8]
6 0 miss Mem[0] Mem[6]
8 0 miss Mem[8] Mem[6]
Fully associative
Block Hit/miss Cache content after access
address
0 miss Mem[0]
8 miss Mem[0] Mem[8]
0 hit Mem[0] Mem[8]
6 miss Mem[0] Mem[8] Mem[6]
8 hit Mem[0] Mem[8] Mem[6]
optimization for
memory access
older accesses
new accesses
Unoptimized Blocked
Service interruption
Deviation from
specified service
Hardware caches
Reduce comparisons to reduce cost
Virtual memory
Full table lookup makes full associativity feasible
Benefit in reduced miss rate
31 14 13 4 3 0
Tag Index Offset
18 bits 10 bits 4 bits
Read/Write Read/Write
Valid Valid
32 32
Address Address
32 Cache 128 Memory
CPU Write Data Write Data
32 128
Read Data Read Data
Ready Ready
Multiple cycles
per access
Could partition
into separate
states to
reduce clock
cycle time
3 CPU A writes 1 to X 1 0 1