Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the...

78
Com puterA rchitecture CSE 3322 Lecture 23

Transcript of Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the...

Page 1: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Computer Architecture CSE 3322

Lecture 23

Page 2: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Multilevel Caches

• Microprocessors are getting faster and including a smallhigh speed cache on the same chip

Page 3: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Multilevel Caches

• Microprocessors are getting faster and including a smallhigh speed cache on the same chip

• A Second level cache is off chip that is larger and slowerthat interfaces with the Main Memory

Page 4: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Multilevel Caches

• Microprocessors are getting faster and including a smallhigh speed cache on the same chip

• A Second level cache is off chip that is larger and slowerthat interfaces with the Main Memory

• Same cache techniques can be used

Page 5: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Multilevel Caches

• Microprocessors are getting faster and including a smallhigh speed cache on the same chip

• A Second level cache is off chip that is larger and slowerthat interfaces with the Main Memory

• Same cache techniques can be used

Ave Memory Access Time = Hit time(L1)+ Miss rate (L1) * Miss Penalty( L1)

Page 6: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Multilevel Caches

• Microprocessors are getting faster and including a smallhigh speed cache on the same chip

• A Second level cache is off chip that is larger and slowerthat interfaces with the Main Memory

• Same cache techniques can be used

Ave Memory Access Time = Hit time(L1)+ Miss rate (L1) * Miss Penalty( L1)

Miss penalty (L1) = Hit time (L2) + Miss rate (L2) * Miss Penalty( L2)

Page 7: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Multilevel Caches

• Microprocessors are getting faster and including a smallhigh speed cache on the same chip

• A Second level cache is off chip that is larger and slowerthat interfaces with the Main Memory

• Same cache techniques can be used

Ave Memory Access Time = Hit time(L1)+ Miss rate (L1) * Miss Penalty( L1)

Miss penalty (L1) = Hit time (L2) + Miss rate (L2) * Miss Penalty( L2)

Ave Memory Access Time = Hit time(L1)+ Miss rate (L1) * Hit time (L2)+ Miss rate (L1)*Miss rate (L2) * Miss Penalty( L2)

Page 8: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Ave Memory Access Time = Hit time(L1)

+ Miss rate (L1) * Hit time (L2)

+ Miss rate (L1)*Miss rate (L2) * Miss Penalty( L2)

Ex: Hit time (L1) = 1 clock cycleMiss rate(L1) = 10%Hit time ( L2) = 10 Clock CyclesMiss rate (L2) = 20%Miss penalty (L2) = 100 clock cyles

If no secondary cacheAve Memory Access = 1 + 0.1 * 100 = 11 clock cycles

Page 9: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Ave Memory Access Time = Hit time(L1)

+ Miss rate (L1) * Hit time (L2)

+ Miss rate (L1)*Miss rate (L2) * Miss Penalty( L2)

Ex: Hit time (L1) = 1 clock cycleMiss rate(L1) = 10%Hit time ( L2) = 10 Clock CyclesMiss rate (L2) = 20%Miss penalty (L2) = 100 clock cyles

If no secondary cacheAve Memory Access = 1 + 0.1 * 100 = 11 clock cycles

With secondary cacheAve Memory Access = 1 + 0.1*10 + 0.1*0.2*100

1 + 1 + 2 = 4 clock cycles

Page 10: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Characteristics of programs that makes efficient use of cache memory

Page 11: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Characteristics of programs that makes efficient use of cache memory

• Code has tight loops with lots of reuse

Page 12: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Characteristics of programs that makes efficient use of cache memory

• Code has tight loops with lots of reuse

• Code minimizes jumps and branches to far away

Page 13: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Characteristics of programs that makes efficient use of cache memory

• Code has tight loops with lots of reuse

• Code minimizes jumps and branches to far away

• Data marches through arrays

Page 14: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Processor

Memory Hierarchy

Cache Memory

Main Memory

Transfer in 1 clockcycle

Transfer > 10 clockcycles

SRAM

DRAM

Page 15: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Processor

Virtual Memory Hierarchy

Cache Memory

Main Memory

Transfer in 10 + clock cycles

Transfer > 100,000 clock cycles

DRAM

HardDisk

Page 16: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual MemoryThe Illusion of Unlimited Amount of Memory

1. Invented to allow programmers to use the full addressingcapability of the processor. Not limited by physical RAM

Page 17: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual MemoryThe Illusion of Unlimited Amount of Memory

1. Invented to allow programmers to use the full addressingcapability of the processor. Not limited by physical RAM

2. Enabled Multiprocessing. Computer running multipleprocesses ( programs and environments) each with it’sown address space. ( Time Sharing )

Page 18: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual MemoryThe Illusion of Unlimited Amount of Memory

1. Invented to allow programmers to use the full addressingcapability of the processor. Not limited by physical RAM

2. Enabled Multiprocessing. Computer running multipleprocesses ( programs and environments) each with it’sown address space. ( Time Sharing )

3. Provides a structure for protection. Pages can have restricted use by assigned processes. Types and Levels

of access.

Page 19: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual MemoryThe Illusion of Unlimited Amount of Memory

1. Invented to allow programmers to use the full addressingcapability of the processor. Not limited by physical RAM

2. Enabled Multiprocessing. Computer running multipleprocesses ( programs and environments) each with it’sown address space. ( Time Sharing )

3. Provides a structure for protection. Pages can have restricted use by assigned processes. Types and Levels

of access.

4. Provides simple relocation by mapping to pages inphysical memory

Page 20: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual Address – 4 GB

31 30 29 . . . 14 13 12 11 10 9 8 . . . 2 1 0

Virtual page number Page offset

28 27 26 . . . 14 13 12 11 10 9 8 . . . 2 1 0

Physical page number Page offset

Page = 212 = 4KBTranslation

Physical Address – 512 MB

Page 21: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual Address

Virtual Page No. Page Offset

PageTable Main

Memory

Hard Disk

PhysicalAddress

Page = Block

What is the miss penalty?Called Page Fault

Page 22: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

1. Where can a page ( block) be placed in Main Memory?

Page 23: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

1. Where can a page ( block) be placed in Main Memory?

• The miss penalty is very high, so minimize miss rate

Page 24: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

1. Where can a page ( block) be placed in Main Memory?

• The miss penalty is very high, so minimize miss rate

• The long access time of the hard disk enables the OS to control placing the pages in Main Memory

Page 25: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

1. Where can a page ( block) be placed in Main Memory?

• The miss penalty is very high, so minimize miss rate

• The long access time of the hard disk enables the OS to control placing the pages in Main Memory

• The lowest miss rate results from locating pagesanywhere in Main Memory ( Fully Associative )

Page 26: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

2. How is a page ( block) found if it is in Main Memory?

Page 27: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

2. How is a page ( block) found if it is in Main Memory?

• A page is located by the page table that contains thephysical address of the page in Main Memory inthe entry addressed by the virtual page number.( The index is mapped by the software using the page table and no tag is required.)

Page 28: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

2. How is a page ( block) found if it is in Main Memory?

• A page is located by the page table that contains thephysical address of the page in Main Memory inthe entry addressed by the virtual page number.( The index is mapped by the software using the page table and no tag is required.)

• The page table has an entry for every virtual pagenumber which can be 1 M entries. So, the page table is typically stored in Main Memory.

Page 29: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

2. How is a page ( block) found if it is in Main Memory?

• A page is located by the page table that contains thephysical address of the page in Main Memory inthe entry addressed by the virtual page number.( The index is mapped by the software using the page table and no tag is required.)

• The page table has an entry for every virtual pagenumber which can be 1 M entries. So, the page table is typically stored in Main Memory.

• Accessing Main Memory twice each time takes to long,so another cache must be added.

Page 30: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

3. Which page ( block) should be replaced on a VirtualMemory Miss ( Page Fault )

Page 31: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

3. Which page ( block) should be replaced on a VirtualMemory Miss ( Page Fault )

• Under OS control, so clever algorithms are feasible.

Page 32: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

3. Which page ( block) should be replaced on a VirtualMemory Miss ( Page Fault )

• Under OS control, so clever algorithms are feasible.

• Usually try to approximate least recently used (LRU)replacement strategy.

Page 33: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

3. Which page ( block) should be replaced on a VirtualMemory Miss ( Page Fault )

• Under OS control, so clever algorithms are feasible.

• Usually try to approximate least recently used (LRU)replacement strategy.

• May keep a use bit, which is set whenever a page isaccessed to help estimate LRU.

Page 34: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

4. What happens on a Write?

Page 35: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

4. What happens on a Write?

• Write Through is not feasible due to the very slowspeed of the Hard Disk

Page 36: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

4. What happens on a Write?

• Write Through is not feasible due to the very slowspeed of the Hard Disk

• The write strategy is always Write Back

Page 37: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

4. What happens on a Write?

• Write Through is not feasible due to the very slowspeed of the Hard Disk

• The write strategy is always Write Back

• Write Back# The word is written only to the page in Main

Memory (cache).# The modified page is written to the Hard Disk only when it is replaced. A Dirty Bit

indicates if a page has been altered.

Page 38: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Selecting a Page Size

• Reasons Pages should be larger:1. Minimize miss rate, but too large can get

no improvement or even increase.2. Reduces the size of the page table3. Transfers to / from Hard Disk are more efficient

( also over networks)

Page 39: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Selecting a Page Size

• Reasons Pages should be larger:1. Minimize miss rate, but too large can get

no improvement or even increase.2. Reduces the size of the page table3. Transfers to / from Hard Disk are more efficient

( also over networks)

• Reasons Pages should be smaller:1. Wastes space because each process has several

primary pages required.2. Start up time is longer for small processes.

Page 40: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Selecting a Page Size

• Reasons Pages should be larger:1. Minimize miss rate, but too large can get

no improvement or even increase.2. Reduces the size of the page table3. Transfers to / from Hard Disk are more efficient

( also over networks)

• Reasons Pages should be smaller:1. Wastes space because each process has several

primary pages required.2. Start up time is longer for small processes.

• Page size is 4 KB to 64 KB

Page 41: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual Address

Virtual Page No. Page Offset

PageTable Main

Memory

Hard Disk

PhysicalAddress

Page = Block

Physical Page Address

Valid Use

Dirty

Page TableMaps Virtual PageNo. to Disk Addr

Page 42: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

The Page Table is• Large• Usually in DRAM Main Memory• Too Slow

Page 43: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

The Page Table is• Large• Usually in DRAM Main Memory• Too Slow

So, provide a cache for the Page Table

TLB – translation-lookaside buffer

Page 44: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Page 45: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

Page 46: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside bufferVirtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

Page 47: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside bufferVirtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

Hit

Page 48: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside bufferVirtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

Hit• Read Main Set Use Bit TLB

Page 49: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside bufferVirtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

Hit• Write Main Set Dirty Bit TLB

Page 50: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside bufferVirtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

Miss

Page 51: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside bufferVirtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Page Table Register

+

PhysicalPage Addr

Physical Page Addr

Tag

Valid, Dirty, Use

MissTLB Miss or Page Fault

Page 52: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB Miss –

Page 53: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB Miss –

1. Select entry to be replaced (LRU or Random)

Page 54: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB Miss –

1. Select entry to be replaced (LRU or Random)2. Write Back Use and Dirty Bits to Page Table

replaced entry

Page 55: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB Miss –

1. Select entry to be replaced (LRU or Random)2. Write Back Use and Dirty Bits to Page Table

replaced entry3. Access requested entry in Page Table

If Page is in Main Memory ( Valid), load thetranslation from the Page Table to TLB andtry again

Page 56: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB Miss – 1. Select entry to be replaced (LRU or Random)2. Write Back Use and Dirty Bits to Page Table

replaced entry3. Access requested entry in Page Table

If Page is in Main Memory ( Valid), load thetranslation from the Page Table to TLB andtry again

If Page is not in Main Memory ( Valid), then it isa Page Fault :

Write Back Replaced Page to Disk if DirtyMove page from Disk to Main MemoryUpdate Page Table & TLB and try again

Page 57: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual Address

31 30 29 . . . 14 13 12 11 10 9 . . . . 2 1 0Virtual Page Number Page Offset

==

==

Tag Physical Page Number20

TLB

Hit

Valid

Dirty

To Main Memory

2012

Page 58: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual Address

31 30 29 . . . 14 13 12 11 10 9 . . . . 2 1 0Virtual Page Number Page Offset

==

==

Tag Physical Page Number20

TLB

Hit

Valid

Dirty

To Main Memory

2012

Design GoalsHit Time – 1 clock cycleTLB Miss Penalty – 10 - 20 clock cyclesTLB Miss Rate - < 1%

Page 59: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Virtual Address

31 30 29 . . . 14 13 12 11 10 9 . . . . 2 1 0Virtual Page Number Page Offset

==

==

Tag Physical Page Number20

TLB

Hit

Valid

Dirty

Tag - m Index-k

20 12Block Offset

Byte Offset

Main Memory Cache

PhysicalAddress

Page 60: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Page 61: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Size of page table assuming no disk address and 4 bits V,P,D,U?

Page 62: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Size of page table assuming no disk address and 4 bits V,P,D,U?

14

Page 63: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Size of page table assuming no disk address and 4 bits V,P,D,U?

1426

Page 64: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Size of page table assuming no disk address and 4 bits V,P,D,U?

1426

262

Page 65: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Size of page table assuming no disk address and 4 bits V,P,D,U?

1426

26222

Page 66: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

Size of page table assuming no disk address and 4 bits V,P,D,U?

1426

26222

x 26

Page 67: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

TLB 2-way Associative with 256 entries. Index and Tag?

1426

26222

x 26

Page 68: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

TLB 2-way Associative with 256 entries. Index and Tag?

1426

26222

x 26

Tag Index

Page 69: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

TLB 2-way Associative with 256 entries. Index and Tag?

1426

26222

x 26

Tag Index-8

Page 70: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

TLB 2-way Associative with 256 entries. Index and Tag?

1426

26222

x 26

Tag-18 Index-8

Page 71: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

TLB – translation-lookaside buffer

Virtual Page No. Page Offset

PageTable

MainMemory

Hard Disk

TLB

Physical Page Addr

Tag

Valid, Dirty, Use

Ex: - 40 bit virtual byte address - 16KB pages - 36 bit physical address

TLB 2-way Associative with 256 entries. Index and Tag?

1426

26222

x 26

Tag-18 Index-8

4 18

88

Page 72: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

CPU

TLB

On Chip Cache

Secondary Cache

DRAM Main Memory

Hard Disk

Virtual Address 32-64 bits4KB pages

Microprocessors

Page 73: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

CPU

TLB

On Chip Cache

Secondary Cache

DRAM Main Memory

Hard Disk

Virtual Address 32-64 bits4KB pagesTLB Split Data and Instruction 4-Way Set Associative

64 – 128 entries

Microprocessors

Page 74: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

CPU

TLB

On Chip Cache

Secondary Cache

DRAM Main Memory

Hard Disk

Virtual Address 32-64 bits4KB pagesTLB Split Data and Instruction 4-Way Set Associative

64 – 128 entriesOn Chip Cache Split Data and Instruction 8KB – 16KB each 4-Way Associative 32 Bytes / Block

Microprocessors

Page 75: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Implementing Protection with Virtual Memory

• Add protection bits to the TLB / Page TableRead / Write AccessUser(s) / Supervisor

Page 76: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Implementing Protection with Virtual Memory

• Add protection bits to the TLB / Page TableRead / Write AccessUser(s) / Supervisor

• CPU supplies Read / Write and User / Supervisorsignals for each access

Page 77: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Implementing Protection with Virtual Memory

• Add protection bits to the TLB / Page TableRead / Write AccessUser(s) / Supervisor

• CPU supplies Read / Write and User / Supervisorsignals for each access

• Comparisons can be made in the TLB. Non-comparecan cause an exception

Page 78: Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.

Implementing Protection with Virtual Memory

• Add protection bits to the TLB / Page TableRead / Write AccessUser(s) / Supervisor

• CPU supplies Read / Write and User / Supervisorsignals for each access

• Comparisons can be made in the TLB. Non-comparecan cause an exception

• User programs cannot modify the protectionbits in Page Table / TLB