

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















Fall 2008 CS 4833: Embedded Systems 1
¾ Instruction types: arithmetic/logic, data transfer and flow control ¾ Data transfer instructions and address modes ¾ Control flow instructions and execution flow
¾ Basic registers and read and write operations
¾ Concept of datapath ¾ Instruction cycle: fetch, decode, execute, next
Fall 2008 CS 4833: Embedded Systems 3
Outline for this week: JKP Chapter 4
¾ ROM, SRAM and DRAM etc ¾ Read and write operation timing diagrams
¾ Address decode and chip selection/enable ¾ Read/write control and signals (refresh for DRAM)
¾ Different cache organizations (direct, fully/set associative) ¾ Problems of cache in embedded systems: non-predictability
¾ Swapping and overlays: multiprogramming
HW Architecture of Embedded Systems
¾ Control logic and datapath (CPU) ¾ Memory ¾ Input/output
¾ 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
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
¾ Units of transfer (not just a bit)
¾ Transmission rate
¾ Time to the first word
Memory Composition
¾ System needs 4K 16-bit words ¾ Chip size: 1K 8-bit words ¾ Thus, need 4X2 = 8 chips; how to organize?
¾ Horizontal: increase the word size (more bits) ¾ Vertical: increase the number of word
¾ 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
¾ 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
¾ 25MHz Æ 0.04 micro second cycle time ¾ 384 count Æ 15.36 microseconds
Basic Memory Map
¾ Nonvolatile RAM ¾ RAM
¾ Stack
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
¾ Can be disabled/enabled
Fall 2008 CS 4833: Embedded Systems 33
Terms and Questions
¾ The desired instruction/data in cache and will be fetched
¾ The desired instruction/data NOT in cache ¾ In memory: need to bring to cache
¾ 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
¾ 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
¾ How to identify the content Æ which memory block?
¾ Page number + block number ¾ Tag table: sequential search/compare
Associative Mapping: Block Lookup
Fall 2008 CS 4833: Embedded Systems 39
Cache Replacement Schemes
¾ Long search process
Set-Associative Mapping
¾ K-way set associative