Professional Documents
Culture Documents
Acknowledgements:
Nathan Ickes, Rex Min, Yun Wu Lecture material adapted from J. Rabaey, A. Chandrakasan, B. Nikolic, Digital Integrated Circuits: A Design Perspective Copyright 2003 Prentice Hall/Pearson.
Read-Write Memory
Random Access
Mask-Programmed
SRAM DRAM
2L-K
Bit Line Storage Cell 2L-K row by K column Mx2 cell array
Row Decode
AK AK+1
Word Line
AL-1
M.2
Sense Amps/Driver
A0 AK-1
Column Decode
Input-Output (M bits)
Register Memory
Negative latch Positive latch
D Q
QM
D Q G
CLK
CLK
Works fine for small memory blocks (e.g., small register files) Inefficient in area for large memories density is the key metric in large memory circuits
BL WL Q
WL
M3 BL
Write: set BL and BL to 0 and VDD or VDD and 0 and then enable WL (i.e., set to VDD) Read: Charge BL and BL to VDD and then enable WL (i.e., set to VDD). Sense a small change in BL or BL
State held by cross-coupled inverters (M1-M4) Static Memory - retains state as long as power supply turned on Feedback must be overdriven to write into the memory
L7: 6.111 Spring 2006 Introductory Digital Systems Laboratory 5
Address pins drive row and column decoders Data pins are bidirectional and shared by reads and writes
Row Decoder
Read Logic
Output Enable gates the chips tristate driver Write Enable sets the memorys read/write mode Chip Enable/Chip Select acts as a master switch
6
Same (bidirectional) data bus used for reading and writing Chip Enables (E1 and E2)
E1 must be low and E2 must be high to enable the chip MCM6264C
8
Data DQ[7:0]
On the inside:
A2 A3 A4 A5 A7 A8 A9 A11
Row Decoder DQ[7:0]
When low (and chip is enabled with W=0), the data bus is driven with the value of the selected memory location
E1 E2
A0 A1 A6 A10 A12
W G
Pinout
G
Bus enable time Bus tristate time
Data
(Tristate)
Data Valid
Read cycle begins when all enable signals (E1, E2, G) are active Data is valid after read access time
Access time is indicated by full part number: MCM6264CP-12 12ns
E1 G
Bus enable time Bus tristate time Data 2 Data 3
Data
Data 1
Can perform multiple reads without disabling chip Data bus follows address bus, after some delay
W
Data setup time Data hold time Data Valid E2 and G are held high
Data
Clock/E1 G W Address Data Drive data bus only when clock is low
Ensures address are Clock stable for writes Control Prevents bus (write, read, reset) contention Write data Minimum clock period Read data is twice memory Address access time
Address for write Data for write Write occurs here, when E1 goes high VCC Address for read Data read Data can be latched here
FPGA
ext_chip_enable ext_write_enable
E2 E1 W G Data[7:0]
FSM
ext_output_enable int_data
D Q D Q D Q
SRAM
ext_data ext_address
Address[12:0]
11
VDD
FSM
data_sample int_data
D Q Q D
G_b data_oen
E2 E1 W G
SRAM
Data[7:0]
ext_data
Address[12:0]
ext_address
address/data stable
address/data stable
13
1/4
2/4
14
3/4
4/4
15
Testing Memories
Common device problems
Bad locations: rare for individual locations to be bad Slow (out-of-spec) timing(s): access incorrect data or violates setup/hold Catastrophic device failure: e.g., ESD Missing wire-bonds/devices (!): possible with automated assembly Transient Failures: Alpha particles, power supply glitch
Approach
Device problems generally affect the entire chip, almost any test will detect them Writing (and reading back) many different data patterns can detect data bus problems Writing unique data to every location and then reading it back can detect address bus problems
16
An Approach
An idea that almost works
1. 2. 3. 4. 5.
Write 0 to location 0 Read location 0, compare value read with 0 Write 1 to location 1 Read location 1, compare value read with 1 Suppose the memory was missing (or output enable was disconnected)
0 0 Read 1 Write
1 1 Read 2 Write
2 2 Read 2
3 2 Read
Write
Data bus is undriven but wire capacitance briefly maintains the bus state: memory appears to be ok!
L7: 6.111 Spring 2006 Introductory Digital Systems Laboratory 17
Write 0 to address 0 Write 1 to address 1 Write (n mod 256) to address n Read address 0, compare with 0 Read address 1, compare with 1 Read address n, compare with (n mod 256)
Comparator
Reset counter
Counter
Read address <counter>
Matched?
Report success
<counter> = last address?
SRAM
Data Address Control
Report failure
18
Address Pins
Memory matrix
difference between read and write timings creates wasted cycles (wait states) R1 R2 W3
Data Pins
Read Logic
Output Enable
R4
W5
19
ZBT (zero bus turnaround) memories change the rules for writes
On a write, data is set up after the clock edge (so that it is read on the following edge) Result: no wait states, higher memory throughput
R1 R2 W3 R4 W5
20
Address Pins
Data Pins
Read Logic Output Enable
A1
A2 one-cycle latency...
A3 Q1
A4 Q2
A5 D3
(ZBT write to A3)
Q4
D5
(ZBT write to A5) 21
10 V S
5V
20 V
5V S
0V
2.5 V S
Avalanche injection
EPROM Cell
Courtesy Intel
FSM
Introductory Digital Systems Laboratory
WL
M1
CS
GND
BL
VDD VDD/2
sensing
CBL
VDD /2
[Rabaey03]
To Write: set Bit Line (BL) to 0 or VDD & enable Word Line (WL) (i.e., set to VDD ) To Read: set Bit Line (BL) to VDD /2 & enable Word Line (i.e., set it to VDD )
DRAM relies on charge stored in a capacitor to hold state Found in all high density memories (one bit/transistor) Must be refreshed or state will be lost high overhead
L7: 6.111 Spring 2006 Introductory Digital Systems Laboratory 24
Row
Col
Clever manipulation of RAS and CAS after reads/writes provide more efficient modes: early-write, read-write, hidden-refresh, etc. (See datasheets for details)
L7: 6.111 Spring 2006 Introductory Digital Systems Laboratory 25
Maps 16-bit address space to 8, 13-bit segments Upper 3-bits of address determine which chip is enabled
SRAM 1
SRAM 2
EPROM
~G ~W ~E1
~G ~W ~E1
[12:0]
138
A ~G2B
Y5 Y4 Y3 Y2 Y1 Y0
Bus Enable
+5V
~G2A G1
[2:0]
Memory Map
15 14 13
C B
Y7 Y6
[12:0]
ADC
ADC
Introductory Digital Systems Laboratory
Analog Input
[12:0]
~E1
~G
Non-Volatile Memory
Fast Read, but very slow write (EPROM must be removed from the system for programming!) Holds state even if the power supply is turned off
Memory Internals
Has quite a bit of analog circuits internally -- pay particular attention to noise and PCB board integration
Device details
Dont worry about them, wait until 6.012 or 6.374
27
control signals such as Write Enable should be registered a multi-cycle read/write is safer from a timing perspective than the single cycle read/write approach it is a bad idea to enable two tri-states driving the bus at the same time an SRAM does not need to be refreshed while a DRAM does an EPROM/EEPROM/FLASH cell can hold its state even if the power supply is turned off a synchronous memory can result in higher throughput
28