lect11-cache-replacement

lect11-cache-replacement - Cache Replacement Policies Cache

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Cache Replacement Policies Cache Replacement Policies Prof. Mikko H. Lipasti University of Wisconsin-Madison ECE/CS 752 Spring 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2005 Mikko Lipasti 2 Cache Design: Four Key Issues Cache Design: Four Key Issues These are: Placement Where can a block of memory go? Identification How do I find a block of memory? Replacement How do I make space for new blocks? Write Policy How do I propagate changes? Consider these for caches Usually SRAM Also apply to main memory, disks
Background image of page 2
© 2005 Mikko Lipasti 3 Placement Placement Memory Type Placement Comments Registers Anywhere; Int, FP, SPR Compiler/programmer manages Cache (SRAM) Fixed in H/W Direct-mapped, set-associative, fully-associative DRAM Anywhere O/S manages Disk Anywhere O/S manages
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2005 Mikko Lipasti 4 Placement Placement Address Range Exceeds cache capacity Map address to finite capacity Called a  hash Usually just masks high-order  bits Direct-mapped Block can only exist in one  location Hash collisions cause problems SRAM Cache Hash Address Index Data Out Index Offset 32-bit Address Offset Block Size
Background image of page 4
© 2005 Mikko Lipasti 5 Identification Identification Fully-associative Block can exist anywhere No more hash collisions Identification How do I know I have the  right block? Called a  tag check Must store address tags Compare against address Expensive! block SRAM Cache Hash Address Data Out Offset 32-bit Address Offset Tag Hit Tag Check ?= Tag
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2005 Mikko Lipasti 6 Placement Placement Set-associative Block can be in  a   locations Hash collisions:  a  still OK Identification Still perform  tag  check However, only  a  in  parallel SRAM Cache Hash Address Data Out Offset Index Offset 32-bit Address Tag Index a Tags a Data Blocks Index ?= ?= ?= ?= Tag
Background image of page 6
© 2005 Mikko Lipasti 7 Replacement Replacement Cache has finite size What do we do when it is full? Analogy: desktop full? Move books to bookshelf to make room Bookshelf full? Move least-used to library Etc. Same idea: Move blocks to next level of cache
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Cache Miss Rates: 3 C’s [Hill] Cache Miss Rates: 3 C’s [Hill] Compulsory miss or Cold miss First-ever reference to a given block of memory Measure: number of misses in an infinite cache model Capacity Working set exceeds cache capacity Useful blocks (with future references) displaced Good replacement policy is crucial! Measure: additional misses in a fully-associative cache
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/02/2012 for the course ECE 752 taught by Professor Profgurisohi during the Spring '09 term at Wisconsin.

Page1 / 23

lect11-cache-replacement - Cache Replacement Policies Cache

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online