CacheAddressingBasics CS654 September27,2001 WhatisaCache? - - PowerPoint PPT Presentation

cache addressing basics
SMART_READER_LITE
LIVE PREVIEW

CacheAddressingBasics CS654 September27,2001 WhatisaCache? - - PowerPoint PPT Presentation

CacheAddressingBasics CS654 September27,2001 WhatisaCache? SmallmemoryclosetoCPU TypicallySRAM Hencefast Henceexpensivetoo! Processor memorygap


slide-1
SLIDE 1

CacheAddressingBasics

CS654– September27,2001

slide-2
SLIDE 2

WhatisaCache?

  • SmallmemoryclosetoCPU
  • TypicallySRAM

– Hencefast – Henceexpensivetoo!

  • Processor– memorygap
  • Principleoflocality– makethecommon

casefast!

slide-3
SLIDE 3

MemoryHierarchy

Registers Cachelevels Mainmemory Disk(Virtualmemory) Eachlevelisa‘cache’forlowerlevels

slide-4
SLIDE 4

Placement

  • Unitsoftransfer– ‘blocks’or‘lines’
  • ‘Hit’and‘Miss’
  • Fullyassociative,Directmapped,Set

associative

  • Cachesize=bytes/line*lines/set*

sets/cache(somenumericalexamples)

  • Whythesetypes?– speed/hitratetradeoff
slide-5
SLIDE 5

Terminology(digression!)

  • Replacement– LRU,random
  • Writeback/Writethrough
  • Writeallocate,nowriteallocate
slide-6
SLIDE 6

Addressmakeup

  • Tag,indexandoffset

BlockAddressBlock Tag Index

  • ffset
slide-7
SLIDE 7

Typicalorganization

TagIndex Cache data (sets) Cache tags MUX

slide-8
SLIDE 8

Someexamples

  • 128Mphysicalmemory

– 64Kdirectmappedwith64bytelines – 16K4-waywith32bytelines

slide-9
SLIDE 9

VirtualMemory

  • Protection,addressspaces,virtualmemory
  • Pagingandsegmentation
  • Similaritywithcaches
  • Addresstranslation
  • TLB– cacheofthetranslation(why?)
slide-10
SLIDE 10

Organization

VirtualpagenumberOffset TLB PhysicalpagenumberOffset

slide-11
SLIDE 11

PhysicalAddresswithTLB

  • Virtualvsphysicalindexing
  • Virtualindexphysicaltag!

BlockAddressBlock Tag Index

  • ffset

PagenumberOffset

slide-12
SLIDE 12

Someexamples

  • 32bitvirtualaddress,128MBmain

memory,128entryfullyassociativeTLB, 64Kcache,64bytelines