Docsity

CS 333 Lecture Notes: Memory Hierarchy Design - Part 2, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
Lecture notes for CS 333 - Chapter 5, part 2 3/11/2008
Sarita Adve 1
Chapter 5: Memory Hierarchy Design โ€“ Part 2
Introduction
Caches
Main Memory
Simple main memory
Simple
main
memory
Wider memory
Interleaved memory
Memory Technologies
DRAM, SRAM
Advances in DRAM technology
Virtual Memory
Motivation
Basics
Address translation
Interaction with caches
Protection
Simple Main Memory
Consider a memory with these parameters:
1 cycle to send address
6 cycles to access each word
1 cycle to send word back to CPU/Cache
What's the miss penalty for a 4-word block?
(1 +6 cycles +1 cycle) ร—4 words
= 32 cycles
How can we speed this up?
Wider Main Memory
Make the memory wider
Read out 2 (or more) words in parallel
Memory parameters:
1 cycle to send address
6 cycles to access each doubleword
1 cycle to send doubleword back to CPU/Cache
Miss penalty for a 4-word block:
(1 +6 cycles +1 cycle) ร—2 doublewords
=16cycles
=
16
cycles
Cost
Wider bus
Larger expansion size
Interleaved Main Memory
Organize memory in banks
Subsequent words map to different banks
Word A in bank (A mod M)
Within a bank, word A in location (A div M)
Word address
Bank
Word in Bank
How many banks to include?
pf3
pf4
pf5

Partial preview of the text

Download CS 333 Lecture Notes: Memory Hierarchy Design - Part 2 and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Chapter 5: Memory Hierarchy Design โ€“ Part 2

IntroductionCachesMain Memory

Simple main memorySimple main memoryWider memoryInterleaved memoryMemory Technologies

DRAM, SRAM Advances in DRAM technology Virtual Memory

MotivationBasicsAddress translationInteraction with cachesProtection

Simple Main Memory

Consider a memory with these parameters:

1 cycle to send address6 cycles to access each word1 cycle to send word back to CPU/Cache What's the miss penalty for a 4-word block?

6 cycles

1 cycle)

ร—

4 words

= 32 cycles

How can we speed this up?

Wider Main Memory

Make the memory wider

Read out 2 (or more) words in parallel Memory parameters:

1 cycle to send address6 cycles to access each

doubleword

1 cycle to send doubleword back to CPU/Cache Miss penalty for a 4-word block:

6 cycles

1 cycle)

ร—

2 doublewords

= 16 cycles= 16 cycles

Cost

Wider busLarger expansion size

Interleaved Main Memory

Organize memory in banks

Subsequent words map to different banksWord A in bank (A mod M)Within a bank, word A in location (A div M)Word address

BankWord in Bank

How many banks to include?

Simple interleaving for sequential accesses

(e.g., cache blocks) Complex interleaving for others

Interleaved Main Memory (Cont.)

p^

g

(e.g., requests from non-blocking caches)Alternative:

independent

memory banks

Each bank has separate controller, separate address lines,

and maybe separate data lines

Memory Technologies

Dynamic Random Access Memory (DRAM)

Optimized for density, not speed

One transistor cells Multiplexed address pins

Row Address Strobe (RAS)Column Address Strobe (CAS) Cycle time roughly twice access time

Destructive reads Must refresh every few ms

Access every row Sold as dual inline memory modules (DIMMs)

4 to 16 DRAMs on a board, 8 bytes wide

Memory Technologies, cont.

Static Random Access Memory (SRAM)

Optimized for speed, then density

4-6 transistors per cell

p

Separate address pins Static

No Refresh

Greater power dissipation than DRAMAccess time = cycle time

DRAM Advances โ€“ Page Mode

Normal DRAM

First read entire rowThen select column from rowStores entire row in a buffer Page Mode

Row buffer acts like an SRAMBy changing column address, random bits can be accessed

within a row

Address Translation^ virtual page number

page offsettag + pte

TLB

Compare Incoming & Stored Tags

and Select PTE

... ... ...

...

...

...

...

Fast Path

Translation Lookaside Buffer (TLB, TB)A cache w/ PTEs for dataNumber of entries 32 to 1024

page offset

page frame number

Hit/Miss

virtual page number

page offset

Address Translation / Cache Interaction

Address Translation

PO

VPN

page offset

page frame number

TLB

Cache Lookup

address tag

block offset

index

PFN

PO

BO

IDX

TAG

read tags

m?

m?

hit/miss

Address translation before cache lookup

Small Cache

Large Cache

Sequential TLB Access

PO

VPN

PO

VPN

TLB

read tags

TAG

TLB

read tags

BO POIDX

PFN

PO

PFN

BO

IDX

TAG

m?

m?

m?

m?

Problems

SlowMay increase cycle time, CPI, pipeline depth

Small Cache

Parallel TLB Access

Address translation in parallel with cache lookup

PO

VPN

BO IDX

TLB

read tags

PFN

PO

TAG

BO IDX

m?

m?

Address translation in parallel with cache lookup

Large Cache

Parallel TLB Access

PO

VPN

BO

IDX

TLB

read tags

PFN

PO

TAG

BO

IDX

Index taken from virtual page number

m?

m?

Virtual Address Synonyms

Virtual Address Space

Physical Address Space

V

Tag

Data

V

P

VirtualIndex

V0 V

Solutions to Synonyms

Virtual Address Cache

Address translation after cache miss

TLB

read tags

m?

m?

Needed on misses only

Implies fast-lookup even for large caches Must handle

Virtual-address synonyms (aliases)Virtual-address space changesStatus and protection bit changes