DDR2SOFT DDR2 Memory Controller VHDL SOURCE CODE OVERVIEW



Similar documents
DDR2 Specific SDRAM Functions

Technical Note DDR2 Offers New Features and Functionality

ADQYF1A08. DDR2-1066G(CL6) 240-Pin O.C. U-DIMM 1GB (128M x 64-bits)

Features. DDR SODIMM Product Datasheet. Rev. 1.0 Oct. 2011

Table 1: Address Table

Address Summary Table: 128MB 256MB 512MB 1GB 2GB Module

Technical Note. Initialization Sequence for DDR SDRAM. Introduction. Initializing DDR SDRAM

DDR2 SDRAM SODIMM MT16HTF12864H 1GB MT16HTF25664H 2GB

GR2DR4B-EXXX/YYY/LP 1GB & 2GB DDR2 REGISTERED DIMMs (LOW PROFILE)

USB - FPGA MODULE (PRELIMINARY)

are un-buffered 200-Pin Double Data Rate (DDR) Synchronous DRAM Small Outline Dual In-Line Memory Module (SO-DIMM). All devices

DDR SDRAM SODIMM. MT9VDDT1672H 128MB 1 MT9VDDT3272H 256MB MT9VDDT6472H 512MB For component data sheets, refer to Micron s Web site:

User s Manual HOW TO USE DDR SDRAM

V58C2512(804/404/164)SB HIGH PERFORMANCE 512 Mbit DDR SDRAM 4 BANKS X 16Mbit X 8 (804) 4 BANKS X 32Mbit X 4 (404) 4 BANKS X 8Mbit X 16 (164)

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

DDR2 SDRAM SODIMM MT8HTF3264HD 256MB MT8HTF6464HD 512MB MT8HTF12864HD 1GB For component data sheets, refer to Micron s Web site:

DDR SDRAM SODIMM. MT8VDDT3264H 256MB 1 MT8VDDT6464H 512MB For component data sheets, refer to Micron s Web site:

DDR SDRAM UDIMM MT16VDDT6464A 512MB MT16VDDT12864A 1GB MT16VDDT25664A 2GB

DDR2 SDRAM SODIMM MT8HTF6464HDZ 512MB MT8HTF12864HDZ 1GB. Features. 512MB, 1GB (x64, DR) 200-Pin DDR2 SODIMM. Features

LogiCORE IP AXI Performance Monitor v2.00.a

Modeling Latches and Flip-flops

DDR2 SDRAM SODIMM MT4HTF6464HZ 512MB. Features. 512MB (x64, SR) 200-Pin DDR2 SODIMM. Features. Figure 1: 200-Pin SODIMM (MO-224 R/C C)

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

DDR2 SDRAM SODIMM MT16HTF12864HZ 1GB MT16HTF25664HZ 2GB MT16HTF51264HZ 4GB. Features. 1GB, 2GB, 4GB (x64, DR) 200-Pin DDR2 SDRAM SODIMM.

1.55V DDR2 SDRAM FBDIMM

DDR2 Device Operations & Timing Diagram DDR2 SDRAM. Device Operations & Timing Diagram

DDR3 SDRAM UDIMM MT8JTF12864A 1GB MT8JTF25664A 2GB

DDR SDRAM SODIMM MT16VDDF6464H 512MB MT16VDDF12864H 1GB

DDR2 SDRAM UDIMM MT18HTF6472AY 512MB MT18HTF12872AY 1GB MT18HTF25672AY 2GB MT18HTF51272AY 4GB. Features

JEDEC STANDARD DDR2 SDRAM SPECIFICATION JESD79-2B. (Revision of JESD79-2A) JEDEC SOLID STATE TECHNOLOGY ASSOCIATION. January 2005

Note: Data Rate (MT/s) CL = 3 CL = 4 CL = 5 CL = 6. t RCD (ns) t RP (ns) t RC (ns) t RFC (ns)

DDR2 SDRAM SODIMM MT8HTF12864HZ 1GB MT8HTF25664HZ 2GB. Features. 1GB, 2GB (x64, SR) 200-Pin DDR2 SDRAM SODIMM. Features

Standard: 64M x 8 (9 components)

Computer Architecture

Features. DDR3 Unbuffered DIMM Spec Sheet

SDLC Controller. Documentation. Design File Formats. Verification

DDR2 SDRAM UDIMM MT16HTF6464AY 512MB MT16HTF12864AY 1GB MT16HTF25664AY 2GB MT16HTF51264AY 4GB. Features

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

DDR3(L) 4GB / 8GB UDIMM

White Paper Utilizing Leveling Techniques in DDR3 SDRAM Memory Interfaces

CHAPTER 11: Flip Flops

Features. DDR3 SODIMM Product Specification. Rev. 1.7 Feb. 2016

Dual DIMM DDR2 and DDR3 SDRAM Interface Design Guidelines

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Mobile SDRAM. MT48H16M16LF 4 Meg x 16 x 4 banks MT48H8M32LF 2 Meg x 32 x 4 banks

Achieving High Performance DDR3 Data Rates

Modeling Registers and Counters

TIP-VBY1HS Data Sheet

DDR SDRAM Small-Outline DIMM MT16VDDF6464H 512MB MT16VDDF12864H 1GB

Tuning DDR4 for Power and Performance. Mike Micheletti Product Manager Teledyne LeCroy

Source-Synchronous Serialization and Deserialization (up to 1050 Mb/s) Author: NIck Sawyer

Memory Module Specifications KVR667D2D4F5/4G. 4GB 512M x 72-Bit PC CL5 ECC 240-Pin FBDIMM DESCRIPTION SPECIFICATIONS

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

8254 PROGRAMMABLE INTERVAL TIMER

SOLVING HIGH-SPEED MEMORY INTERFACE CHALLENGES WITH LOW-COST FPGAS

Memory Module Specifications KVR667D2D8F5/2GI. 2GB 256M x 72-Bit PC CL5 ECC 240-Pin FBDIMM DESCRIPTION SPECIFICATIONS

A New Paradigm for Synchronous State Machine Design in Verilog

AXI Performance Monitor v5.0

Chapter 9 Latches, Flip-Flops, and Timers

Tuning DDR4 for Power and Performance. Mike Micheletti Product Manager Teledyne LeCroy

A N. O N Output/Input-output connection

DDR2 SDRAM Unbuffered DIMM MT9HTF3272A 256MB MT9HTF6472A 512MB MT9HTF12872A 1GB

Jerry Chu 2010/07/07 Vincent Chang 2010/07/07

DDR3 SDRAM UDIMM MT16JTF25664AZ 2GB MT16JTF51264AZ 4GB MT16JTF1G64AZ 8GB. Features. 2GB, 4GB, 8GB (x64, DR) 240-Pin DDR3 UDIMM.

DDR2 SDRAM FBDIMM MT36HTF25672F 2GB MT36HTF51272F 4GB. Features. 2GB, 4GB (x72, DR) 240-Pin DDR2 SDRAM FBDIMM. Features

Design and Implementation of Vending Machine using Verilog HDL

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Microprocessor & Assembly Language

DDR SDRAM RDIMM MT36VDDF GB MT36VDDF GB

ADATA Technology Corp. DDR3-1600(CL11) 240-Pin VLP ECC U-DIMM 4GB (512M x 72-bit)

DDR2 SDRAM FBDIMM MT18HTF12872FD 1GB MT18HTF25672FD 2GB. Features. 1GB, 2GB (x72, DR) 240-Pin DDR2 SDRAM FBDIMM. Features

Fairchild Solutions for 133MHz Buffered Memory Modules

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

LLRF. Digital RF Stabilization System

Manchester Encoder-Decoder for Xilinx CPLDs

ThinkServer PC DDR2 FBDIMM and PC DDR2 SDRAM Memory options boost overall performance of ThinkServer solutions

JEDEC STANDARD. Double Data Rate (DDR) SDRAM Specification JESD79C. (Revision of JESD79B) JEDEC SOLID STATE TECHNOLOGY ASSOCIATION MARCH 2003

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

PLL Dynamic Reconfiguration Author: Karl Kurbjun and Carl Ribbing

DDR2 SDRAM FBDIMM MT9HTF6472F 512MB MT9HTF12872F 1GB. Features. 512MB, 1GB (x72, SR) 240-Pin DDR2 SDRAM FBDIMM. Features

DDR3 SDRAM SODIMM MT16JSF25664HZ 2GB MT16JSF51264HZ 4GB. Features. 2GB, 4GB (x64, DR) 204-Pin Halogen-Free DDR3 SODIMM. Features

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

IS42/45R86400D/16320D/32160D IS42/45S86400D/16320D/32160D

DDR3 DIMM Slot Interposer

DDR subsystem: Enhancing System Reliability and Yield

M25P05-A. 512-Kbit, serial flash memory, 50 MHz SPI bus interface. Features

PT973216BG. 32M x 4BANKS x 16BITS DDRII. Table of Content-

Wiki Lab Book. This week is practice for wiki usage during the project.

DDR3 SDRAM SODIMM MT8JSF25664HDZ 2GB. Features. 2GB (x64, DR) 204-Pin DDR3 SODIMM. Features. Figure 1: 204-Pin SODIMM (MO-268 R/C A)

LatticeECP3 High-Speed I/O Interface

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Memory unit. 2 k words. n bits per word

Embedded Multi-Media Card Specification (e MMC 4.5)

Creating a Controllable Oscillator Using the Virtex-5 FPGA IODELAY Primitive Author: Martin Kellermann

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

TS555. Low-power single CMOS timer. Description. Features. The TS555 is a single CMOS timer with very low consumption:

Transcription:

Overview The DDR2SOFT is a generic DDR2 memory controller core (including the VHDL source code) designed to interface DDR2 memory modules and memory ICs with low-cost FPGAs. This generic code does not use any hardware-based memory controller block (MCB). It is therefore slower but free of keyt MCB constraints (data bus width, number of instantiations). In particular, this component allows Xilinx Spartan-6 FPGAs to interface with 64-bit wide DDR2 DIMM/SODIMM, for streaming throughputs up to 16 Gbps. The binary (.ngc) component is free for use on ComBlock FPGA development platforms. The VHDL source code is sold separately. The component s very efficient implementation makes it suitable for multiple instantiations within a small FPGA. The object-oriented code structure provides two levels of abstraction: - The DDR2 core controller makes many low-level tasks invisible to the user: refresh, initialization and most timing. Its simple interface accepts burst read and burst write commands. - The DDR2 wrapper provides another layer of abstraction by optimizing memory access for maximum throughput or minimum latency. Users can interface with their own clock, different than the DDR2 controller clock. Key features include: Concurrent read/write at the user interface. Independent clocking for user data and DDR2. Optimized for efficient data streaming: DDR2SOFT DDR2 Memory Controller VHDL SOURCE CODE OVERVIEW o Address auto-increment o Start/Stop address boundaries o Continuous/Single-shot modes Compliant with DDR2 SDRAM standard JESD79-2F (Nov. 2009) Support for low-power self-refresh mode. Automatic banks management (multiple banks can be opened simultaneously). Automatic calibration to cancel the round-trip delay FPGA SDRAM FPGA and sample the read data at the center of the eye diagram. Block Diagram to/from User Elastic Buffer Elastic Buffer Speed Intelligent Scheduler SDRAM Write SDRAM Read Configuration & Status DDR2 wrapper simple burst read/ burst write interface MSS 18221-A Flower Hill Way Gaithersburg, Maryland 20879 U.S.A. Telephone: (240) 631-1111 Facsimile: (240) 631-1676 www.comblock.com MSS 2010 Issued 9/22/2010 DDR2 Core Controller to/from DDR2 SDRAM FPGA Clock (max) Read/Write streaming throughput Spartan-6-2 130 MHz = 260 MTransfers/s 16-bit IC: 4 Gbit/s 8/16/32/64 DDR2 SDRAM Interface 64-bit SODIMM 16 Gbits/s

Target Hardware The code is written in generic VHDL so that it can be ported to a variety of FPGAs. The code was developed and tested on a Xilinx Spartan-6 XC6SLX FPGA. It can be easily ported to any Xilinx Virtex-5, Virtex-6, Spartan-6 FPGAs and other FPGAs capable of running at or above the minimum DDR2 clock frequency of 125 MHz. Please note that the target FPGA must be capable of - Creating programmable input delays at the SDRAM interface. - Generating a low-jitter SDRAM clock using a true PLL (DCM are not recommended), or using an external lowjitter clock. Device Utilization Summary Device: Xilinx Spartan-6, Core DDR2 SDRAM controller only FPGA resources 16-bit DDR2 data width LUTs 665 820 Flip Flops 350 741 (in slices) RAMB16BWERs 0 0 DSP48A1s 0 0 GCLKs 4 4 DCMs 1 1 64-bit DDR2 DIMM /SODIMM data width Device: Xilinx Spartan-6, Complete controller, including wrapper. FPGA resources 16-bit DDR2 data width Flip Flops LUTs RAMB16BWERs 2 8 DSP48A1s 0 0 GCLKs 2 2 DCMs 0 0 64-bit DDR2 DIMM/SODIMM data width Core Controller Interface USER INTERFACE CLK_DDR2_REF ASYNC_RESET CLOCKS CLK_DDR2G_OUT DATA_IN(127/63/31/15:0) DATA_IN_CTS WRITE DATA DATA_OUT(127/63/31/15:0) READ DATA_OUT_EN DATA START_ADDR(31:0) CONTROLs TRANSACTION_REQ(1:0) TRANSACTION_REQ_NO(3:0) TRANSACTION_REQ_ACQ SELF_REFRESH_REQ SDRAM_READY NSDRAM_BYTES CONFIG ADDRESS_MAP CLOCK_CYCLES (Presynthesis) DDR2_CLK_FREQ RTDELAY_COARSE DDR2 INTERFACE SDRAM_DQ(63/31/15/7:0) SDRAM_DQS_P(7/3/1/0:0) SDRAM_DQS_N(7/3/1/0:0) SDRAM_ODT(1:0) SDRAM_CK0_P SDRAM_CK0_N SDRAM_CKE0 SDRAM_CK1_P SDRAM_CK1_N SDRAM_CKE1 SDRAM_CASN SDRAM_RASN SDRAM_WEN SDRAM_S0N SDRAM_S1N SDRAM_DM(7/3/1/0:0) SDRAM_A(15:0) SDRAM_BA(2:0) On the controller DDR2 interface side, all signals connect directly to the external DDR2 SDRAM. The controller user interface side comprises four signal groups: (a) Clocks: The user sets the DDR2 SDRAM speed by providing a reference frequency as CLK_DDR2_REF. The controller internally generates a global clock CLK_DDR2G_OUT for use by the user code. (b) Controls for the two elementary transactions: burst read and burst write. Each burst comprises 4 words, the word size being determined by the DDR2 SDRAM data width (8/16/32 or 64 bits). User data is transferred two-words at a time to match the DDR2 SDRAM throughput. (c) Configuration parameters are set at the time of VHDL synthesis (i.e. cannot be modified at run-time). All user-side signals are clock synchronous with the user-selected clock CLK_DDR2G_OUT. The best way to generate the DDR2 SDRAM reference clock is by using a PLL as illustrated in the clkgen_pll.vhd example. 2

Core Controller Transactions Burst Read The user declares its intent to read a 4-word burst by simultaneously (a) Changing the transaction request number TRANSACTION_REQ_NO (b) Setting the transaction request to burst read TRANSACTION_REQ = 01 (c) Setting the burst start address START_ADDR, expressed as integer multiple of words, not bytes. The controller will send a 1-CLK wide pulse acknowledgement TRANSACTION_REQ_ACK as soon as it can process the transaction request. The acknowledgement indicates that this transaction was accepted and processing has just started. The user can now send the next request (even while the current transaction is in progress). Note: When possible, the controller will send the acknowledgement pulse very quickly, within the same clock period as the user request. CLK TRANSACTION_REQ_NO TRANSACTION_REQ START_ADDR TRANSACTION_REQ_ACQ CLK XX Request is latched in at the rising edge of CLK. Can be changed thereafter. N N + 1 XX 01 addr Transaction request acknowledgement can be immediate Burst Read Request Read data words Wi/Wi+1 at the rising edge of CLK when DATA_OUT_EN = '1' DATA_OUT W0/W1 W2/W3 DATA_OUT_EN Data latency from the request ack TRANSACTION_REQ_ACQ is fixed but depends on hardware Burst Read Data following request The 4 words read from the SDRAM are returned, packed two words at a time in DATA_OUT while DATA_OUT_EN = 1. Burst Write The user declares its intent to write a 4-word burst by simultaneously (a) Changing the transaction request number TRANSACTION_REQ_NO (b) Setting the transaction request to burst write TRANSACTION_REQ = 10 (c) Setting the burst start address START_ADDR, expressed as integer multiple of words, not bytes. The controller will send a 1-CLK wide pulse acknowledgement TRANSACTION_REQ_ACK as soon as it can process the transaction request. The acknowledgement indicates that this transaction was accepted and processing has just started. Following the transaction acknowledgement, the controller will tell the user when to provide the data by setting DATA_IN_CTS to 1 exactly two clocks before the data is due at the DATA_IN input. IMPORTANT: input data must be provided exactly at the right time: 2 CLKs after the DATA_IN_CTS pulse. This interface is perfect for interfacing with an external dual-port block RAM (since it takes up to 2 CLKs to read data from a RAMB). The user must pack DATA_IN with two words at a time. Request is latched in at the rising edge of CLK. Can be changed thereafter. CLK TRANSACTION_REQ_NO TRANSACTION_REQ START_ADDR TRANSACTION_REQ_ACQ CLK N N + 1 XX XX 10 addr Transaction request acknowledgement can be immediate Burst Write Request Write data words Wi/Wi+1 at the rising edge of CLK two clocks after DATA_IN_CTS DATA_IN W0/W1 W2/W3 DATA_IN_CTS Data latency from the request ack TRANSACTION_REQ_ACQ is fixed but depends on hardware 3

Configuration The user can set the following controls at run-time: DDR2 Controller Description Configuration SELF_REFRESH_REQ 1 = User requests the controller to enter the Self refresh mode to reduce power consumption. The SDRAM data is retained. This low-power mode is typically used for long-term idle periods (for example when the memory is in standby mode). Exiting from this mode takes 200 CLKs. 0 = Normal mode. Read and Write is allowed. The user can set the following controls prior to synthesis in the generic section of the DDR2 component instantiation. Physical Configuration NSDRAM _BYTES ADDRESS _MAP Description DDR2 interface data width, expressed in bytes. Also defines the user interface data width (which is always twice as large). 1 = 8-bit word (IC) 2 = 16-bit word (IC, e.g. COM-1600) 4 = 32-bit word (ICs or partial DIMM/SODIMM) 8 = 64-bit word (DIMM/SODIMM, e.g. COM-1500) The logical to physical address mapping can vary depending on the hardware. See the DDR2 SDRAM hardware specifications. The most common mappings are described below: 00000: 1Gb x8 IC, column A[9:0], 8 banks BA[2:0], 1 rank S[1:0], row A[13:0] 00001: 1Gb x16 IC, column A[9:0], 8 banks BA[2:0], 1 rank S[1:0], row A[12:0] 00010: 2Gb x8 IC, column A[9:0], 8 banks BA[2:0], 1 rank S[1:0], row A[14:0] 00011: 2Gb x16 IC, column A[9:0], 8 banks BA[2:0], 1 rank S[1:0], row A[13:0] 0xxxx: other ICs, reserved for future use 10000: 1GB DIMM/SODIMM, column A[9:0], 8 banks BA[2:0], 2 CLOCK _CYCLES RTDELAY _COARSE ranks S[1:0], row A[12:0] 10001: 2GB DIMM/SODIMM, column A[9:0], 8 banks BA[2:0], 2 ranks S[1:0], row A[13:0] 10010: 4GB DIMM/SODIMM, column A[9:0], 8 banks BA[2:0], 2 ranks S[1:0], row A[14:0] 1xxxx: other DIMM/SODIMMs, reserved for future use CL - trcd - trp (CAS latency) - (RAS-CAS-Delay time) - (RAS precharge time) See DDR2 SDRAM hardware specifications. 3 = 3-3-3 DDR2-400 4 = 4-4-4 DDR2-533 5 = 5-5-5 DDR2-667 6 = 6-6-6 DDR2-800 Round-trip delay in the path FPGA -> SDRAM -> FPGA, rounded up to the nearest integer multiple of clock periods. Example Spartan-6 125 MHz: Output delay for SDRAM_CKx: 9ns Input delay for SDRAM_DQSy: 4ns RTDELAY_COARSE = 13ns*2*125MHz = 3.25 rounded up to 4. In addition, less frequently used timing parameters can be customized as VHDL constants in the --// TIMERS section of the source code instead of using the default worst case. For example, the refresh to command timer trfc can be shortened in the case of smaller memories. Another example is the adjusting of the periodic refresh time trefi for extended temperature (85-95C) operation. The list of customizable timers, using the JEDEC standard notation, is as follows: trfc, trefi, twr Other DDR2 configuration parameters are fixed in the source code: Normal mode Burst length BL = 4 ODT enabled, 75 Ohm Rtt DQS# enable RDQS disable Output buffer enabled Optional duty cycle corrector disabled OCD calibration is not used 4

Wrapper Interface Exclusions This software does not support the following features: - Serial Presence-Detect (best handled by a microprocessor) Software Licensing The DDR2SOFT is supplied under the following key licensing terms: 1. A nonexclusive, nontransferable license to use the VHDL source code internally, and 2. An unlimited, royalty-free, nonexclusive transferable license to make and use products incorporating the licensed materials, solely in bitstream format, on a worldwide basis. The complete VHDL/IP Software License Agreement can be downloaded from http://www.comblock.com/download/softwarelicense.pdf Reference documents [1] DDR2 SDRAM Specification, JEDEC Standard No. 79-2F [2] ComBlock COM-1600 FPGA + ARM + USB2.0+ DDR2 + NAND development platform www.comblock.com/com1600.html [3] COM-1600 development platform schematics 5

Configuration Management The current software revision is 1. [a] VHDL source code in directory DDR2_rev\src [b] Xilinx ISE project files DDR2_rev\DDR2_ISE114.xise DDR2_rev\DDR2_ISE122.xise [c].ucf constraint file DDR2_rev\src\DDR2.ucf [d] VHDL testbenches in directory DDR2_rev\sim [e].ngc binary for use in conjunction with the COM-1600 module DDR2_rev\bin\DDR2.ngc Xilinx-specific code The VHDL source code is written in generic VHDL with few Xilinx primitives. No Xilinx CORE is used. The Xilinx primitives are: - IBUF - IBUFG - BUFG (global clocks) - IDDR2 - ODDR2 - IODELAY2 to delay the read data and data strobe - IOBUFDS differential input/output buffer - Dual-port RAM block: RAMB16BWERs Top-Level VHDL hierarchy where rev is the current revision number. VHDL development environment The VHDL software was developed using the following development environment: (a) Xilinx ISE 11.4 with XST as synthesis tool (b) Xilinx ISE 12.2 with XST as synthesis tool (c) Xilinx ISE Isim as VHDL simulation tool Important: The FPGA SDRAM interface is timecritical. It is therefore important to ask the tools (Synthesis, Map) to pack the flip-flops in IOBs. Ready-to-use Hardware The binary component (.ngc) is freely available for use on the following ComBlock hardware modules: COM-1600 FPGA + ARM + DDR2 + NAND + USB2 development platform COM-1500 FPGA + DDR2 SODIMM socket + ARM + NAND + USB2 development platform See the following code templates: TBD The schematics are available in this CD. The design consists primarily of two components: - A core controller component (DDR2_SDRAM_CONTROLLER.vhd) and - A wrapper (DDR2_WRAPPER.vhd) The code is stored with one, and only one, component per file. The core component DDR2_SDRAM_CONTROLLER.vhd operates at the DDR2 SDRAM clock. It performs the SDRAM power-up initialization, refresh, low-power selfrefresh mode, round-trip delay fine calibration, active banks/rows management and burst read/write transactions. The user can request a burst read or a burst write transaction. All transactions transfer exactly 4 * NSDRAM_BYTES bytes. The core component s usage is described in the operation section above. An optional wrapper (DDR2_WRAPPER.vhd) comprises the transmit and receive elastic buffers, user-clock to memory-clock domains translation, read/write sequencing and data segmentation into bursts. DDR2_SDRAM_CONTROLLER_TEST.vhd is an optional component aimed at hardware verification such as board post-assembly tests. The components 6

writes and reads-back pseudo-random data at addresses within the specified address range. Additional components are used for simulation purposes: tbddr2_sdram_controller_test.v hd is a simulation testbench for the test component. It simulates propagation delay between external SDRAM and FPGA. DDR2_MODULE.v is a SODIMM Verilog simulation module (from Micron). Verilog define statements at the top of file help select the memory type. Calibration The FPGA - DDR2 SDRAM interface timing can quite challenging at higher clock speeds. The core controller code is written with two timing principles: (a) FPGA to DDR2 SDRAM direction: signals and synchronous clocks propagate in the same direction, with little timing variation through the IOBs. No problem is expected here. (b) DDR2 SDRAM to FPGA direction: the controller automatically calibrates out the round-trip delays so as to sample the input signals in the FPGA at the optimum time. The automatic calibration is only capable of performing fine delay compensation in the range 0 to ½ clock period. It is up to the user to specify the coarse delay RTDELAY_COARSE, expressed as an integer number of ½ clock periods rounded up. Since the signal round-trip delay (FPGA->SDRAM->FPGA) is designdependent, the user must find out the round-trip delay for its design. The fine delay (fraction of a ½ clock period) is removed automatically by the built-in calibration circuit. Calibration is triggered automatically at power up or after reset. Once the calibration is complete, the controller will set the SDRAM_READY flag high. The controller ignores user-generated Read/Write transaction requests issued before the SDRAM is ready. 7

Machine The DDR2 memory controller state machine is described by the SDL flowchart below: 0 idle DDR2 Power-up and Initialization (1/3) 3 Reset EMRS EMR(2) start clock 1 200us 4 tmrd EMRS EMR(3) NOP +CKE high tmrd 400ns 5 2 EMRS EMR(1) Enable DLL PRE ALL tmrd trp 6 3 8

6 DDR2 Power-up and Initialization (2/3) 9 MRS DLL reset REF second refresh tmrd Timer2 200 CLKs trfc 7 10 PRE ALL Precharge all MRS initialize device operation without DLL reset trp tmrd 8 11 Timer2 both and Timer2 expired REF first refresh EMRS EMR(1) set OCD calibration default trfc tmrd 9 12 9

12 DDR2 Power-up and Initialization (3/3) EMRS EMR(1) set OCD calibration default tmrd 13 Timer2 trefi 16 DDR2 SDRAM is now ready for normal operation 10

16 DDR2 controller ready Refresh Power-Down Read/Write Timer2 Refresh has priority over read/write PD=1 user requests power-down user requests a burst read or write PRE ALL precharge all PRE ALL all banks idle 26 trp trp Timer2 trefi 21 17 ODT OFF Timer2 taofd REF 22 trfc Timer2 both timers expired 18 REF + turn CKE off = self refresh minimum Self refresh duration tcke 16 23 11

DDR2 Refresh / Read / Write / Power-Down (2/3) Exit Self-Refresh 23 24 PD=0 user-directed exit from power-down / self refresh CKE = 1 re-enable CKE txsrd clear Timer2 to force a refresh ASAP (better safe) 25 16 12

DDR2 Burst Read / Write, Banks management (3/3) 26 (a) n bank open? y (b) n row active? (c) y a burst read/write ACT Activate PRE close bank row R/W? trcd trp READ WRITE 27 CL + 1 29 30 ACT Activate trcd 16 26 user requests a burst read before previous read transaction is complete 28 Burst read transaction is complete. All data read prior to next command. a 13

Simulations All simulations below are conducted in the following environment: DDR2-400, 200 MHz clock, burst length = 4 Auto-Refresh Timer 2 schedules a refresh cycle once every trefi = 7.8us. Refresh transaction details 14

Burst read 4 successive burst read requests, burst length = 4, CL = 3 Burst read, DDR2 SDRAM side Burst read, user side. Burst write 4 successive burst write requests, burst length = 4, CL = 3 Burst write, DDR2 SDRAM side 15

Burst write, user side ComBlock Compatibility List FPGA development platform COM-1600 FPGA + ARM + DDR2 + USB2 + NAND development platform COM-1500 FPGA + DDR2 SODIMM socket + ARM + USB2 + NAND development platform ComBlock Ordering Information DDR2SOFT DDR2 MEMORY CONTROLLER, VHDL SOURCE CODE Contact Information MSS 18221-A Flower Hill Way Gaithersburg, Maryland 20879 U.S.A. Telephone: (240) 631-1111 Facsimile: (240) 631-1676 E-mail: info@comblock.com 16