Docsity

Assignment for Memory Subsystem - Embedded Systems | CS 4833, Assignments of Computer Science

Toggle sidebar
bg1
1
Fall 2008 CS 4833: Embedded Systems 1
Memory Subsystem
(Chapter 4)
CS 4833: Embedded Systems 2
Fall 2008
Review of Last Lecture
aMicroprocessor: Instruction Set View
¾Instruction types: arithmetic/logic, data transfer and flow
control
¾Data transfer instructions and address modes
¾Control flow instructions and execution flow
aRegisters and register operations
¾Basic registers and read and write operations
aRegister Transfer Language (RTL)
aRegister View of Microprocessor
¾Concept of datapath
¾Instruction cycle: fetch, decode, execute, next
aAn example ISA and processor design
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Assignment for Memory Subsystem - Embedded Systems | CS 4833 and more Assignments Computer Science in PDF only on Docsity!

Fall 2008 CS 4833: Embedded Systems 1

Memory Subsystem

(Chapter 4)

Review of Last Lecture

aMicroprocessor: Instruction Set View

¾ Instruction types: arithmetic/logic, data transfer and flow control ¾ Data transfer instructions and address modes ¾ Control flow instructions and execution flow

aRegisters and register operations

¾ Basic registers and read and write operations

aRegister Transfer Language (RTL)

aRegister View of Microprocessor

¾ Concept of datapath ¾ Instruction cycle: fetch, decode, execute, next

aAn example ISA and processor design

Fall 2008 CS 4833: Embedded Systems 3

Outline for this week: JKP Chapter 4

aMemory introduction and different memory types

¾ ROM, SRAM and DRAM etc ¾ Read and write operation timing diagrams

aMemory chip organization and interface design

¾ Address decode and chip selection/enable ¾ Read/write control and signals (refresh for DRAM)

aMemory map and cache: locality of reference

¾ Different cache organizations (direct, fully/set associative) ¾ Problems of cache in embedded systems: non-predictability

aDynamic memory allocation

¾ Swapping and overlays: multiprogramming

aMemory subsystem tests

HW Architecture of Embedded Systems

aThree major

components

¾ Control logic and datapath (CPU) ¾ Memory ¾ Input/output

aMemory

¾ Instructions and program ¾ Data

Fall 2008 CS 4833: Embedded Systems 7

Storage Performance and Write Ability

Write ability and storage permanence of memories, showing relative degrees along each axis (not to scale).

programmerExternal OR in-system,block-oriented writes, 1,000sof cycles

Batterylife ( years)

Write ability

EPROM

Mask-programmed ROM

EEPROM FLASH NVRAM

SRAM/DRAM

Storage permanence

Nonvolatile

programmableIn-system

Ideal memory OTP ROM

fabricationDuring only programmer,External of cycles1,000s

programmer,External one time only programmerExternal OR in-system,1,000s of cycles

In-system, fastwrites, unlimitedcycles

Nearzero

Tens ofyears

productLife of

Simple Memory Model: The Wires

aWord array

aMemory address

aData in/out

aRead/write

aEnable: chip

select (CS)

Fall 2008 CS 4833: Embedded Systems 9

Control Signals for Different Memory

ROM Structures and Operation

Fall 2008 CS 4833: Embedded Systems 13

SRAM Structures: Outside/Inside

a Data is bidirectional, and write control signals ¾ Memory cell uses flip-flop to store bit ¾ Requires 6 transistors ¾ Holds data as long as power supplied ¾ Fast access Æ on chip cache

Timing for SRAM Read/Write Operations

Fall 2008 CS 4833: Embedded Systems 15

DRAM Overview

¾ Memory cell uses MOS transistor and capacitor to store bit ¾ More compact than SRAM ¾ “Refresh” required due to capacitor leak 9 Want larger capacitance ¾ Typical refresh rate 15.625 microsec. ¾ Slower to access than SRAM

DRAM Read/Write Operations

Fall 2008 CS 4833: Embedded Systems 19

Other Terms to Describe Memory

aBlock size

¾ Units of transfer (not just a bit)

aBandwidth

¾ Transmission rate

aLatency

¾ Time to the first word

aBlock access time

Memory Composition

aSingle memory chip may not fit requirements

¾ System needs 4K 16-bit words ¾ Chip size: 1K 8-bit words ¾ Thus, need 4X2 = 8 chips; how to organize?

aMemory composition

¾ Horizontal: increase the word size (more bits) ¾ Vertical: increase the number of word

aAddress lines

¾ Low bits for each chip ¾ High bits for chip selection

Fall 2008 CS 4833: Embedded Systems 21

HM6264 & 27C256 RAM/ROM Chips

a Low-cost low-capacity memory devices

a Commonly used in 8-bit microcontroller-based embedded systems a First two numeric digits indicate device type ¾ RAM: 62 ¾ ROM: 27 a Subsequent digits indicate capacity in kilobits

DeviceHM6264 Access Time (ns)85-100 Standby Pwr. (mW).01 Active Pwr. (mW) 15 Vcc Voltage (V) 5 27C256 90 .5 100 5

22 20

data<7…0> addr<15...0> /OE /WE /CS CS2 HM

11-13, 15- 2,23,21,24,25, 3- 22 27 20 26

data<7…0> addr<15...0> /OE /CS 27C

11-13, 15- 27,26,2,24,25, 3-10 2 3,21,

block diagrams

device characteristics

timing diagrams

data addr OE /CS CS

Read operation data addr WE /CS CS

Write operation

Composing Memory: Horizontal

aHorizontal composition

¾ connect side-by-side to increase width of words ¾ Combine techniques to increase number and width of words

…

2 m^ × 3n RAM 2 m^ × n RAM A (^0) …

enable 2 m^ × n RAM

…

2 m^ × n RAM

…

Q3n-1 Q2n-

… Q 0

…

Am

Increase width of words

Fall 2008 CS 4833: Embedded Systems 25

Read/Write Operation: Wire Sharing

Basic DRAM

a Address bus multiplexed between row and column components

a Row and column addresses are latched in, sequentially, by strobing ras and cas signals, respectively a Refresh circuitry can be external or internal to DRAM device ¾ strobes consecutive memory address periodically causing memory content to be refreshed ¾ Refresh circuitry disabled during read or write operation

Data

In Buffer

Data

Out Buffer

rd/ wr

data

Row

Addr.

Buffer

Col

Addr

. Buffer

address

ras

cas

Bit storage array

Row Decoder

Col Decoder

Refresh Circuit

cas,

ras, clock

Sense Amplifiers

Fall 2008 CS 4833: Embedded Systems 27

DRAM: Refresh Interval

aRefresh interval: 15.36 microseconds

aGenerate refresh interval

¾ 25MHz Æ 0.04 micro second cycle time ¾ 384 count Æ 15.36 microseconds

Basic Memory Map

aAddress each part of

different memory

¾ Nonvolatile RAM ¾ RAM

aSystem memory

aApplication memory

¾ Stack

aMemory mapped I/O

and DMA

Fall 2008 CS 4833: Embedded Systems 31

Cache: Overview

a Usually designed with SRAM

¾ faster but more expensive than DRAM

a Usually on same chip as processor

¾ space limited, so much smaller than off-chip main memory ¾ faster access ( 1 cycle vs. several cycles for main memory)

a Cache operation:

¾ Request for main memory access (read or write) ¾ First, check cache for copy 9 cache hit: copy is in cache, quick access 9 cache miss: copy not in cache, read address and possibly its neighbors into cache

a Several cache design choices

¾ Cache mapping: direct, full-associative and set associative; ¾ Replacement policies: Random, FIFO and LRU ¾ Write techniques: write through and write back

Cache Architecture

aCPU may have different internal caches (L1 & L2)

¾ Can be disabled/enabled

aWant to keep program/data in cache to the greatest

extent

Fall 2008 CS 4833: Embedded Systems 33

Terms and Questions

aCache hit

¾ The desired instruction/data in cache and will be fetched

aCache miss

¾ The desired instruction/data NOT in cache ¾ In memory: need to bring to cache

aQuestions

¾ How do we know if not in cache? What to do if not in? ¾ Which cache is free and can be used? ¾ Which block to replace if no free cache? ¾ Are the cache content be modified?

Cache Block and Implementations

aCache blocks: single word is

not efficient

aBlock size: 64 words or 0.5K

aHow to locate the cache

block containing the data:

three different

implementation

¾ Direct mapping : single fixed location (shared with others) ¾ Full associative : can be anywhere ¾ Set associative : a few locations

Fall 2008 CS 4833: Embedded Systems 37

Associative Mapping: Reduce Cache Miss

aDirect mapping: too many

conflicts Æ high miss rate

aWhat about each memory

block can be in any cache

block: an associative

mapping approach?

¾ How to identify the content Æ which memory block?

aExtended tags

¾ Page number + block number ¾ Tag table: sequential search/compare

Associative Mapping: Block Lookup

Fall 2008 CS 4833: Embedded Systems 39

Cache Replacement Schemes

aWhat if no free cache block?

aFIFO: first in first out

a LRU : least recently used

aMRU: most recently used

aProblem with associative mapping

¾ Long search process

Set-Associative Mapping

aCache blocks are organized into SET

aEach set contain k blocks

¾ K-way set associative