Title: Chapter 5 Microprocessor Caches
1Chapter 5 Microprocessor Caches
- Introduction
- System issues
- Cache organization
- Cache update policies
- Example microprocessor caches
- Cache coherency issues
- Cache design and system performance
2Introduction
- Cache
- A fast RAM-type memory
- Between relatively fast CPU and slower main
memory - Cache hit vs. cache miss hit rate
- Caches improve overall system performance by
- Providing information to the ?P faster than main
memory ( improve read cycle ) - Receiving information from the ?P at a fast rate
and allowing it to continue processing while
the cache independently processes the write to
main memory ( improve write cycle ) - Improving memory bus utilization by reducing the
traffic on the memory bus ( improve bus
utilization )
3Chap. 5 Microprocessor Caches
- Introduction
- System Issues
- Configuration
- External caches
- Virtual and Physical Caches
- Look-through and Look-aside
- Multi-level Caches
- Write Policies
- Organization
- Update Policies
- Coherency Issues
- Design and System Performance
4Cache Configuration
- External caches
- Instruction
- Data
- Unified (both instructions and data)
- Virtual and Physical Caches
- Look-through and Look-aside
- Multi-level Caches
5Unified External Cache
- Intel 80386
- Unified
- External
6Separate External Cache
- MIPSR2000/R3000
- On-chipcachecontroller
- ExternalData CacheusingstandardSRAM
7Separate External Cache w. MMU
- Motorola88100 RISC
- Two separateexternal buses
- data P bus
- instruction P bus
- virtual addressesfor external CMMU
- MMU 16Kup to 8x
8On-Chip Caches
- Motorola 680x0Intel 80486, i860MIPS R4000
- 80486 unifiedothers split-cache
- Managed by hardware
- Fast, onlysystem codecan accessin supervisor
mode
9Virtual and Physical Caches
- Physical (real) caches
- Receive physical addresses
- From MMU, done virtual-to-physical conversion
- Applied to on-chip caches
- Ex 68040, 80486 (on-chip)
- Virtual (logical) caches
- Receive unconverted virtual addresses
- Ex 68020/30, i860, MIPS R4000 (on-chip)
Synonyms/virtual addr.aliases
10Look-through vs. Look-aside
11Look-through operation flowchart
12Look-through time delay
- Miss access cache access main
memory access - System concurrency
- Separate buses decouples the ?P from the rest of
the system - ?P can operate out of its cache while other
master modules use the memory bus to access main
memory
13Disadvantages of Look-through
- Cache miss
- Lookup penalty
- total access time cache access main memory
access - while M.M. is being accessed, the execution flow
of the processor stops - Two buses
- ?P local bus and memory (system) bus
- Makes the cache more complex
- Implement dual-ported memory to allow concurrent
operations on the local and system buses
14Single-Processor look-through
15Dual-Processor look-through
16Look-aside operation flowchart
17Look-aside time delays
- Cache and main memory accesssimultaneously
- Miss access time Main memory access
- Cache hit
- Data ? ?P at cache rates
- Cache controller ? abort main memory access
18Look-aside architecture
- Advantages
- No lookup penalty
- Optional and can be removed at any time
- Simpler cache (support only one addr. bus)
- Disadvantages
- Memory bus and memory subsystem are kept busy
(both of hit and miss) - System concurrency is reduced
19Multi-level Caches
- First level caches are usually smaller (464K)
- Ex the external cache used with the 80386
- Second level caches
- May be external cache used a ?P with on-chip
cache - Typically include all the instructions/data of
the 1st level cache and more - Larger than 1st level (64 512K)
- Ex 80486 with external 485 Turbocache chip
(cache controller SRAM cache)
20Chap. 5 Microprocessor Caches
- Introduction
- System Issues
- Configuration
- Write Policies
- Write-through
- Buffered write-through
- Write-back (or copy-back)
- Organization
- Update Policies
- Coherency Issues
- Design and System Performance
21Write-through
- When should main memory be updated?
- Write-through
- All memory writes are sent to main memory
- Maintains cache coherency
- Any other bus master device have a simpler access
(read main memory directly) - Generates more traffic ?P ? ? main memory
2280486 2nd-level implementation
- PWT 1 write-through on 2nd-level which is
write back - PCD 1 internal cache disable 2nd-level
must also be (case of
shared or non-cacheable data) 0
allows caching of data from that page
(case of non-shared or cacheable
data)
23Buffered write-through
- Write operation of the CPU (1 clock cycle)write
to main memory (several clock cycles) - W/O buffers, a write following another would have
to wait
24Write-back (copy-back)
- Cache hit during memory write
- Cache controller writes to cache
- Cache is flagged with a dirty or modified bit
- Data will be sent to main memory later
- replaced because of a cache miss
- bus not use
- CPU performs context switching
- Most complex policy to implement
- Reduce bus traffic eliminate the bottleneck of
waiting for each memory write