1.01k likes | 2.49k Views
DDR SDRAM Memory Interface. Agenda. Why DDR? DDR vs. SDR Understanding DDR SDRAM Bus timing CoolRunner-II and DDR SDRAM demo board CoolRunner-II DDR SDRAM design. Why DDR?. DDR = Double Data Rate Provides ability to read or write two pieces of information in each clock cycle
E N D
Agenda • Why DDR? • DDR vs. SDR • Understanding DDR SDRAM • Bus timing • CoolRunner-II and DDR SDRAM demo board • CoolRunner-II DDR SDRAM design
Why DDR? • DDR = Double Data Rate • Provides ability to read or write two pieces of information in each clock cycle • Doubles the bandwidth of the device without increasing the clock speed or bus width
DDR vs. SDR Functionality • Memory core of DDR and SDR are the same • Addressing scheme • Command control interface • Memory bank array structure • Refresh requirements • The main difference is in the data interface: • SDR is fully synchronous (posedge of clk) • DDR is true source-synchronous meaning data is captured twice per clock cycle, with a bi-directional data strobe (DQS)
Strobe-Based Data Bus • To allow for higher data rates, data strobe signals were added to DDR devices: • DDR data strobes (DQS) are non-free-running signals that are driven by the device which is driving the data signals • Controller drives DQS for WRITE operations • DDR SDRAM drives DQS for READ operations
DDR Enhancements • DDR utilizes a differential pair for the system clock (CLK and CLK#) • Data is transmitted on both positive and negative edges of the clock • DDR devices incorporate an on-chip delay locked loop (DLL) • Data strobes are added to improve data capture reliability • SSTL_2 signaling techniques are used • DDR utilizes a 2n-prefetch architecture • Internal data bus is twice the size of external data bus
Parameter SDR DDR DQM Yes No DM (Data Mask) No Yes DQS (Data Strobe) No Yes CK# (System Clock) No Yes Vref No Yes VDD and VDDQ 3.3V 2.5V Signal Interface LVTTL SSTL_2 Data Rate 1x Clock 2x Clock Architecture Synchronous Source-Synchronous SDR vs. DDR Summary
2.5 V VREF Out Micro Linear ML6554 Bus Terminator LP3964 1.8 V VTT Out LP3964 Micron 128 Mb DDR MT46V16M8 Xilinx CR-IIXC2C256 CLK CR-II / DDR Demo Board VTT & VREF Generation 2.5V/1.8V Regulator CR-II & DDR SDRAM
VTT VTT RT RT RS RS + ZO = 50 Ohm - VREF VTT RT RS + ZO = 50 Ohm - VREF SSTL_2 Termination
ZO = 50 Ohm CR-II / DDR Termination VTT VTT VTT 128 Mb DDR SDRAM ZO = 50 Ohm VREF
CPLD Design • DDR SDRAM controller design fits into a XC2C256 (~50% utilization for DDR) • Includes the following: • Initialization state machine • DDR controller • Refresh logic • Test read/write logic (LFSR) • Board interface
CPLD Block Diagram 12 8-bit LFSR ddr_a Refresh Logic 2 ddr_ba 8 ddr_dq rfsh_flag DDR Controller State Machine ddr_dqs int_cmd ddr_cke Initialization / Test Logic State Machine ddr_cs int_data ddr_ras int_addr ddr_cas ddr_we ddr_clk ddr_clkn Board Logic
NOP Deselect DDR SDRAM. No new commands executed. LOAD MODE REGISTER Defines operating mode of SDRAM. ACTIVE Opens row in specified bank for access. READ Initiates burst read operation. WRITE Initiates burst write operation. BURST TERMINATE Terminates a burst read. PRECHARGE Deactivates open row in specified bank. AUTO REFRESH Retains data in SDRAM. DDR Commands
SDRAM Addressing • 23-bit system address bus = 128 MB memory • SDRAM data is organized into banks • Each bit location is specified with a row and column address BankAddress Row Address Column Address 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Load Mode Register Data
Wait for stable power & clock inputs Wait 200 Clock Cycles NOP Precharge All Addresses Precharge All Addresses Execute 2 Auto Refresh Commands Extended Mode Register Write (Enable DLL) Mode Register Write (Reset DLL) Mode Register Write (Set CAS & burst) Initialization Sequence
cmd = AUTO_REFRESH cmd = PRECHARGE PRECHARGE AUTO_RFS IDLE cmd = LOAD MR cmd = READ or WRITE LOAD_MR ACTIVE WRITE READ BRST_TERM cnt < CAS_LAT cnt < BURST_LEN WR_DATA CAS_LAT cmd = BURST_TERM RD_DATA cnt < BURST_LEN Controller State Machine
Vcc T ddr_clk Q sys_clk 2.5V OUT OBUF 3.3V IN GCK RST Vcc T ddr_clkn Q sys_clk 2.5V OUT OBUF 3.3V IN GCK PRE DDR Clock Generation
DDR Clock Timing T = 7.5 ns sys_clk tCO = 5 ns ddr_clk ddr_clkn T = 15 ns 7.5 ns DDR Clock Period 15 ns (133 MHz) (66.67 MHz)
DDR Clock Generation (TCO) sys_clk ddr_clk ddr_clkn
DDR Clock Generation (VMP) sys_clk ddr_clk ddr_clkn
Bank/Row Activation • Prior to a READ/WRITE operation the specific bank/row must be activated
Typical Write Burst • DQS generated by CPLD • DQS must be center aligned with DQ
Typical Read Burst • DQS is edge aligned to DQ • Read interrupted with BURST TERMINATE command
Data Valid Read Window sys_clk ddr_clk ddr_clkn ddr_dq D1 D0 ddr_dqs DVW DVW CPLD captures data DVW = tCK/2 - tAC(max) + tAC(min) = 7.5 ns - (0.75 ns) + (-0.75 ns) = 6 ns
Data Valid Window ddr_dqs ddr_dq(0) ddr_dq(1) ddr_dq(2)
Read & Write (Burst 2) ddr_clk ddr_dqs ddr_dq(0) ddr_dq(1)
Read & Write (Burst 4) ddr_clkn ddr_clk ddr_dqs ddr_dq(0)
Read & Write (Burst 8) ddr_clkn ddr_clk ddr_dqs ddr_dq(0)
Precharge Operation • Precharge deactivates the open row in a particular bank or all banks • After a precharge, the specific row address must be activated with an ACTIVE command prior to use • Auto PRECHARGE : A10 specifies precharge after current READ/WRITE operation • Self PRECHARGE: separate command (must wait tRP)
Refresh Requirements • Refresh is required at intervals of 15.625 µs • Only one refresh command is required • Option to issue up to 8 refresh commands every 140.6 µs
DDR SDRAM Vendors • Memory vendors providing DDR SDRAM: • Micron, Infineon, Cypress, Samsung, Hitachi, Fujitsu, Hyundai, IDT, Mitsubishi, SiberCore, Toshiba...
Conclusion • Reference board works up to 100 MHz on DDR SDRAM • Current DDR design can be modified for SDR SDRAM applications • Check out application note XAPP384 on DDR & CoolRunner-II reference design
Demo Burst = 2 8-bit LFSR Test Control Logic 8 8 Upper Byte int_data[15:0] Lower Byte DDR Control Logic ddr_dq[7:0]
Demo Data read from DDR Data wrote to DDR MSB … LSB MSB … LSB
DQM (SDR only) Internal Data Bus Col0 (DDR only) SDRAM Core
DDR Interface Col0
DDR Write Logic 8-bit LFSR int_data (TEST SM Logic) D lfsr_clk (TEST SM Logic) Q ddr_dq[7:0] T Q ddr_clk DualEdge DDR SM Logic D ddr_write_en Q ddr_clk ddr_dqs_t T ddr_dqs Q ddr_clk DualEdge
DDR Read Logic DDR SM Logic ddr_read_en T Q ddr_clk DualEdge ddr_dqs CE ddr_dq[7:0] D int_data_rd[15:8] Q sys_clk LED Board Logic ddr_dqs CE ddr_dq[7:0] D int_data_rd[7:0] Q sys_clk