1
1
Lecture 13: Cache Basics and Cache Performance
Memory hierarchy concept, cache design fundamentals, set-associative cache, cache performance, Alpha 21264 cache design
Adapted from UCB CS252 S01
2
A typical memory hierarchy today: Here we focus on L1/L2/L3 caches and main memory
What Is Memory Hierarchy
Proc/Regs L1-Cache L2-Cache Memory Disk, Tape, etc. Bigger Faster L3-Cache (optional)
3
1980: no cache in µproc; 1995 2-level cache on chip (1989 first Intel µproc with a cache on chip)
Why Memory Hierarchy?
µProc 60%/yr. DRAM 7%/yr.
1 10 100 1000
1980 1981 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
DRAM CPU
1982
Processor-Memory Performance Gap: (grows 50% / year)
Performance
“Moore’s Law”
4
Generations of Microprocessors
Time of a full cache miss in instructions executed: 1st Alpha: 340 ns/5.0 ns = 68 clks x 2 or 136 2nd Alpha: 266 ns/3.3 ns = 80 clks x 4 or 320 3rd Alpha: 180 ns/1.7 ns =108 clks x 6 or 648 1/2X latency x 3X clock rate x 3X Instr/clock ⇒ 4.5X
5
Area Costs of Caches
Processor % Area %Transistors (cost) (power) Intel 80386 0% 0% Alpha 21164 37% 77% StrongArm SA110 61% 94% Pentium Pro 64% 88%
2 dies per package: Proc/I$/D$ + L2$
Itanium 92% Caches store redundant data
- nly to close performance gap
6
What Is Exactly Cache?
Small, fast storage used to improve average access time to slow memory; usually made by SRAM Exploits locality: spatial and temporal In computer architecture, almost everything is a cache!
Register file is the fastest place to cache variables First-level cache a cache on second-level cache Second-level cache a cache on memory Memory a cache on disk (virtual memory) TLB a cache on page table Branch-prediction a cache on prediction information? Branch-target buffer can be implemented as cache