Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
Cyclone® III family devices (Cyclone III and Cyclone III LS devices) support
interfacing to both DDR2 and DDR SDRAM components and modules. Altera®
provides the ALTMEMPHY megafunction to implement robust auto-calibrating
interfaces to DDR2 and DDR SDRAM devices. You can configure this megafunction to
support either a full-rate or a half-rate controller.
This application note describes Altera’s recommended design flow to implement
DDR2 SDRAM memory interface using Cyclone III family devices. This application
note also describes how to use the design flow to generate a design example featuring
a DDR2 SDRAM memory interface that uses the data path provided with the Altera
ALTMEMPHY megafunction. You can also use the same design flow for
DDR SDRAM interfaces.
Table 1 and Table 2 show the maximum clock frequencies for DDR2 and
DDR SDRAM interfaces supported by Cyclone III family devices for half-rate
controller.
Table 1. Cyclone III Devices Maximum Clock Rate Support for External Memory Interface with Half-Rate Controller (Note 1),
(2), (3), (4)
Commercial Industrial Automotive
–6 Speed Grade –7 Speed Grade –8 Speed Grade –7 Speed Grade –7 Speed Grade
(MHz) (MHz) (MHz) (MHz) (MHz)
Wraparound Mode
Wraparound Mode
Wraparound Mode
Wraparound Mode
Wraparound Mode
Column I/O Banks
DDR2 SSTL-18 200 167 167 167 150 133 167 133 125 167 150 133 167 133 125
SDRAM Class I/II
DDR SSTL-2 167 150 133 150 133 125 133 125 100 150 133 125 133 125 100
SDRAM Class I/II
Notes to Table 1:
(1) Column I/O banks refer to top and bottom I/Os. Row I/O banks refer to right and left I/Os. Wraparound mode refers to the combination of
column and row I/Os.
(2) The values apply for interfaces with both single-rank modules and components.
(3) The supported operating frequencies listed here are memory interface maximums for the Cyclone III devices. The actual achievable
performance of your design is based on design- and system-specific factors, as well as static timing analysis of the completed design.
(4) For the required DDR2 memory device speed grade for external memory interface to achieve the performance shown in Table 1, refer to Table 5
on page 4.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 2 Introduction
Table 2. Cyclone III LS Maximum Clock Rate Support for External Memory Interfaces with Half-Rate PHY Controller
(Note 1), (2), (3), (4)
EP3CLS70/EP3CLS100 EP3CLS150/EP3CLS200
Wraparound Mode
Wraparound Mode
Wraparound Mode
Wraparound Mode
Wraparound Mode
Wraparound Mode
Column I/O Banks
Table 3 displays the maximum clock rate support for external memory interfaces with
full-rate controller in Cyclone III devices.
Table 3. Cyclone III Devices Maximum Clock Rate Support for External Memory Interfaces with Full-Rate
Controller (Note 1), (2), (3), (4), (5) (Part 1 of 2)
Commercial Industrial Automotive
–6 Speed Grade –7 Speed Grade –8 Speed Grade –7 Speed Grade –7 Speed Grade
(MHz) (MHz) (MHz) (MHz) (MHz)
Column I/O Banks
Memory I/O
Standard Standard
DDR2 SSTL-18 200 167 167 150 167 133 167 150 167 133
SDRAM Class I/II
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Introduction Page 3
Table 3. Cyclone III Devices Maximum Clock Rate Support for External Memory Interfaces with Full-Rate
Controller (Note 1), (2), (3), (4), (5) (Part 2 of 2)
Commercial Industrial Automotive
–6 Speed Grade –7 Speed Grade –8 Speed Grade –7 Speed Grade –7 Speed Grade
(MHz) (MHz) (MHz) (MHz) (MHz)
Table 4 shows the maximum clock rate support for external memory interfaces with
full-rate controller in Cyclone III LS devices.
Table 4. Cyclone III LS Devices Maximum Clock Rate Support for External Memory Interfaces with Full-Rate
Controller (Note 1), (2)
EP3CLS70/EP3CLS100 EP3CLS150/EP3CLS200
C7 Speed
C7 Speed C8 Speed I7 Speed Grade C8 Speed I7 Speed Grade
Grade (MHz) Grade (MHz) Grade (MHz) (MHz) Grade (MHz) (MHz)
Column I/O Banks
Memory I/O
Standard Standard
DDR2 SSTL-18 150 150 133 133 150 150 133 133 133 133 133 133
SDRAM Class I/II
DDR SSTL-2 150 133 133 125 150 133 133 125 133 125 133 125
SDRAM Class I/II
Notes to Table 4:
(1) These numbers are preliminary until characterization is final.
(2) The values apply for interfaces with both single-rank modules and components.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 4 Introduction
Table 5 shows the required DDR2 memory device speed grade for the external
memory interface in Cyclone III devices.
Table 5. Required DDR2 Memory Device Speed Grade for External Memory Interface in Cyclone III Devices. (Note 1), (3)
Temperature and I/O Standard Memory Speed Grade Interface fmax
Speed Grade Interface location SSTL-18 (MHz) (MHz)
C6 Class I 267
Top/Bottom 200
Class II 333
Left/Right Class I/II 200 167
Wraparound Class I/II 267 167
C7 Top/Bottom Class I/II 200 167
Left/Right Class I/II 200 150
Wraparound Class I/II 200 133
C8 Top/Bottom (2) Class I/II 267 167
Left/Right Class I/II 200 133
Wraparound Class I/II 200 125
I7 Top/Bottom Class I/II 267 167
Left/Right Class I/II 200 150
Wraparound Class I/II 200 133
A7 Top/Bottom Class I 267 167
Class II 333
Left/Right Class I/II 200 133
Wraparound Class I/II 200 125
Notes to Table 5:
(1) For DDR2 SDRAM write timing performance on Column I/Os for C8 and A7 devices, 97.5° phase offset is required.
(2) For a Q240 C8 device with 167 MHz performance on Top/Bottom interface, a 333-MHz DDR2 memory device is required.
(3) Column I/O banks refer to top and bottom I/Os. Row I/O banks refer to right and left I/Os. Wraparound mode refers to the combination of column
and row I/Os.
Table 6 shows the required DDR2 memory device speed grade for the external
memory interface in Cyclone III LS devices.
Table 6. Required DDR2 Memory Device Speed Grade for External Memory Interfacing with Cyclone III LS Devices (Note 1),
(2) (Part 1 of 2)
Temperature & Interface I/O Standard Memory Speed Interface fmax
Device Speed Grade location SSTL-18 Grade (MHz) (MHz)
Top/Bottom Class I/II 200 167
C7 Left/Right Class I/II 200 150
Wraparound Class I/II 200 125
Top/Bottom Class I/II 267 167
EP3CLS70/EP3CLS100 C8 Left/Right Class I/II 200 133
Wraparound Class I/II 200 100
Top/Bottom Class I/II 267 167
I7 Left/Right Class I/II 200 150
Wraparound Class I/II 200 125
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Cyclone III Device Family Design Flow Page 5
Table 6. Required DDR2 Memory Device Speed Grade for External Memory Interfacing with Cyclone III LS Devices (Note 1),
(2) (Part 2 of 2)
Temperature & Interface I/O Standard Memory Speed Interface fmax
Device Speed Grade location SSTL-18 Grade (MHz) (MHz)
Top/Bottom Class I/II 200 167
C7 Left/Right Class I/II 200 133
Wraparound Class I/II 200 125
Top/Bottom Class I/II 267 150
EP3CLS150/EP3CLS200 C8 Left/Right Class I/II 200 125
Wraparound Class I/II 200 100
Top/Bottom Class I/II 267 167
I7 Left/Right Class I/II 200 133
Wraparound Class I/II 200 125
Notes to Table 6:
(1) These numbers are preliminary until characterization is final.
(2) Column I/O banks refer to top and bottom I/Os. Row I/O banks refer to right and left I/Os. Wraparound mode refers to the combination of
column and row I/Os.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 6 Cyclone III Device Family Design Flow
Figure 1. Design Flow for Implementing External Memory Interfaces in Cyclone III Family Devices
Start Design
Select Device
Adjust Constraints
Does
Simulation Give Yes Add Constraints
Expected Results?
No
Optional (1)
Debug Design
Yes Yes
Yes
No
Is Design Working? Debug Design
Yes
Design Done
Note to Figure 1:
(1) Although these steps are optional, Altera recommends following these steps.
The efficiency is the percentage of time the data bus is transferring data. It is
dependent on the type of memory. For example, in memory interfaces that have
separate write and read ports, the efficiency is 100% when there is an equal amount of
reads and writes on these memory interfaces.
After calculating the bandwidth of the memory interface, you must determine which
memory and Cyclone III family devices to use.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Cyclone III Device Family Design Flow Page 7
f For more information on selecting different memory types, refer to the Selecting the
Right High-Speed Memory Technology for Your System white paper.
Cyclone III family devices support various data widths for different memory
interfaces. Because the memory interface support for device density and package
combination is different, Altera recommends that you determine which device
density and package combination of the Cyclone III device family is best for your
application.
f For more information on memory type selection, memory type differences, and
Cyclone III device family density and package support for different memory types,
refer to the External Memory Interfaces in Cyclone III Devices chapter in volume 1 of the
Cyclone III Device Handbook.
Testbench
Example Instance
SDRAM
Controller
and PHY
Ref_CLK PLL
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 8 Cyclone III Device Family Design Flow
There are two ways you can instantiate the components needed for the external
memory interface:
■ With DDR2 or DDR SDRAM High-Performance Controller MegaCore function,
which builds the controller, instantiates the ALTMEMPHY megafunction to build
the data path or PHY, and instantiates the phase-locked loop (PLL).
■ With the ALTMEMPHY megafunction to build the PHY and instantiate the PLL.
You can create your own controller to work with the ALTMEMPHY megafunction.
Altera provides an easy and fast way to create your memory interface design with the
DDR2 or DDR SDRAM High-Performance Controller MegaWizard™ Plug-In
Manager, which instantiates the ALTMEMPHY megafunction for the PLL and data
path. The MegaWizard Plug-In Manager also generates an example driver for you to
test your design. You can also use the example driver as a reference and create your
own driver based on the example driver.
Altera recommends using the ALTMEMPHY megafunction when instantiating the
PHY as a standalone logic for your memory interface. The ALTMEMPHY
megafunction features a license-free physical interface that you can use with the
standard Altera controller or your own custom controller. The ALTMEMPHY
megafunction has the auto-calibration feature that automates timing closure for
memory interfaces and adjusts timing-over-process, voltage, and temperature (PVT)
variations.
There are two ways to instantiate the ALTMEMPHY megafunction:
■ With the ALTMEMPHY MegaWizard Plug-In Manager
■ With DDR2 or DDR SDRAM High-Performance Controller MegaWizard Plug-In
Manager, which already includes the ALTMEMPHY megafunction
1 To use your own controller, Altera recommends that you first create a design using
Altera’s High-Performance Controller and subsequently replace the Altera controller
with your own controller. This way, you get a design example that you can simulate
and verify.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Cyclone III Device Family Design Flow Page 9
You can set the Quartus II software to perform a simulation of your design using the
generated testbench with third-party simulators. This is performed through the
NativeLink feature of the Quartus II software.
1 Use these simulation model output files for simulation purposes only. Using these
simulation model output files for synthesis or any other purposes creates a
non-functional design.
f For more information on generating simulation model in the Quartus II software and
simulating your design, refer to the DDR and DDR2 SDRAM High-Performance
Controller User Guide.
1 These script files are based on the design name used when instantiating the
ALTMEMPHY megafunction. To use your own top-level design, you must edit the
script files to match your custom top-level design.
Table 7 displays the memory interface pin connections between DDR2 SDRAM and
Cyclone III family devices.
Table 7. Memory Interface Pin Connections Between DDR2 SDRAM and Cyclone III Family Devices
Interface Pin Description Pin on Memory Device Pin on Cyclone III Family Device
Write strobes DQS DQS
Read and write data DQ DQ
Data mask DM DQ
Memory clocks CK, CK# Any Adjacent User I/O (1), (2)
Address A Any User I/O (2)
Control signals CS#, RS#, CAS#, WE# Any User I/O (2)
Notes to Table 7:
(1) Altera recommends using differential I/O (DIFFIO) pair for CK/CK# implementation.
(2) Altera recommends placing these pins in the same I/O bank as the DQ/ DQS pins.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 10 Cyclone III Device Family Design Flow
f For more information on creating, generating, and setting the constraints for your
design, refer to the External Memory PHY Interface Megafunction User Guide
(ALTMEMPHY).
1 By executing the task, you can get the timing report for different paths, such as write
data, read data, command/address, DQS vs CK, mimic, and core (entire interface)
timing paths in your design.
f For more information on the timing analysis and reporting using the ALTMEMPHY
megafunction, refer to the AN 438: Constraining and Analyzing Timing for External
Memory Interfaces in Stratix IV, Stratix III, Arria II GX and Cyclone III Devices.
f For more information on the clocks used in the ALTEMEMPHY megafunction, refer to
the External Memory PHY Interface Megafunction User Guide (ALTMEMPHY).
f For more information on understanding the different effects on signal integrity, refer
to the AN 408: DDR2 Memory Interface Termination, Drive Strength and Loading Design
Guidelines.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 11
f For more information on understanding the different effects on signal integrity, refer
to the AN 408: DDR2 Memory Interface Termination, Drive Strength and Loading Design
Guidelines.
f For more information on using SignalTap II, refer to the Design Debugging Using the
SignalTap II Embedded Logic Analyzer chapter in volume 3 of the Quartus II Handbook.
1 This design example targets a 167-MHz DDR2 SDRAM memory interface because the
development kit uses an EP3C120F780 device. This device is only available in –7 and
–8 speed grades. You can only achieve higher clock rate up to 200 MHz for
DDR2 SDRAM device if you select –6 speed grade devices from the
Cyclone III devices.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 12 Walkthrough Example for 167-MHz DDR2 SDRM Interface
f For more information on the DQ/DQS bus groups for different densities, packages,
and sides of the Cyclone III device family, refer to the External Memory Interfaces in
Cyclone III Devices chapter in volume 1 of the Cyclone III Device Handbook.
After creating the Quartus II project, instantiate the DDR2 SDRAM controller. This
example uses the DDR2 SDRAM High-Performance Controller, which automatically
instantiates the ALTMEMPHY megafunction. Select the DDR2 SDRAM
High-Performance Controller in the Interfaces section of the MegaWizard Plug-In
Manager. Name the controller “DDR2”, as shown in Figure 4.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 13
1 DDR2 is the prefix file name for the subsequent files mentioned in this document that
are generated by the MegaWizard and other project files.
Figure 4. Running the DDR2 SDRAM High-Performance Controller Using the MegaWizard Plug-In Manager
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 14 Walkthrough Example for 167-MHz DDR2 SDRM Interface
Figure 5. Configuring the DDR2 SDRAM High-Performance Controller for the DDR2 Memory Interface
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 15
Figure 7 shows the PHY Settings tab. In the PHY Settings tab, you must input the
Board Skew under Board Timing Parameters. The specified skew is across all
memory interface signal types including data, strobe, clock, address and command,
and is used to generate the PHY timing constraints for all paths. The default value is
set to 20 ps. Because this number is used to calculate the overall system timing
margin, therefore you must update this number based on your board specifications.
The DDR2 SDRAM component uses CK and CK# signals to clock the command and
address signals into the memory. The controller names the CK and CK# signals as
mem_clk and mem_clk_n, respectively. The skew between the CK or CK# and the
DDR2 SDRAM-generated DQS signal is specified as tDQSCK in the DDR2 SDRAM data
sheet. The DDR2 SDRAM has a write requirement (tDQSS) that states the positive edge
of the DQS signal on writes must be within ± 25% (± 90°) of the positive edge of the
DDR2 SDRAM clock input. tDQSS is defined as the time between the DQS latching edge
to its associated clock edge. The controller generates the mem_clk and mem_clk_n
signals using the DDR registers in the input/output element (IOE) to match the DQS
signal and reduce any variations across process, voltage, and temperature. The
positive edge of the DDR2 SDRAM clock, mem_clk, is aligned with the DQS write to
satisfy tDQSS.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 16 Walkthrough Example for 167-MHz DDR2 SDRM Interface
1 The settings in the Auto-Calibration Simulation Options section are only for register
transfer level (RTL) simulation.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 17
Specify your preference in the Local Interface Settings in the Controller Settings page.
a. Turn on the Enable error detection and correction logic check box to enable
error correction coding (ECC).
b. Turn on Enable user auto-refresh controls check box to optimize latency by
controlling when the controller issues refreshes to the memory.
c. Turn on the Enable auto-precharge control check box to quickly access the
same bank. This feature is useful for applications that require fast random
access.
d. Turn on the Enable power down controls check box to set the external memory
device in power-down mode.
e. Turn on the Enable self-refresh controls check box to set the external memory
device in self-refresh mode.
f. Under the Local Interface Protocol for the memory interface section, the
default interface is the Avalon Memory-Mapped Interface that allows you to
easily connect to other Avalon® Memory-Mapped peripherals.
g. Under the Controller/PHY Interface Protocol, the recommended setting is
AFI. The frequencies are easier to achieve in AFI mode compared to the
non-AFI mode.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 18 Walkthrough Example for 167-MHz DDR2 SDRM Interface
f For more information on the AFI, refer to the External Memory PHY Interface
Megafunction User Guide (ALTMEMPHY).
Figure 9 shows the EDA page. The MegaWizard Plug-In Manager generates the
simulation model to simulate the memory controller in Verilog HDL or VHDL.
If you are synthesizing your design with a third-party EDA synthesis tool, turn on the
Generate netlist check box in the Timing and Resource Estimation section.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 19
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 20 Walkthrough Example for 167-MHz DDR2 SDRM Interface
Design Example
Control
Logic
(Encrypted)
DDR2 SDRAM
Example Interface
Pass or Fail DDR2 SDRAM
Driver
ALTMEMPHY
Megafunction
(1)
DDR2 SDRAM
High-Performance
Controller
f For more information on the different files generated by the DDR2 SDRAM
High-Performance Controller, refer to the DDR and DDR2 SDRAM High-Performance
Controller User Guide.
You can simulate the memory interface with the MegaWizard Plug-In
Manager-generated IP functional simulation model. Altera recommends using this
model with your own driver or the testbench generated by the MegaWizard Plug-In
Manager that issues read and write operations. The memory model file is also
automatically generated by the MegaWizard Plug-In Manager in the testbench.
Use the functional simulation model with any Altera-supported VHDL or Verilog
HDL simulator. This walkthrough uses the Quartus II NativeLink feature to run
ModelSim–Altera software edition, to perform the simulation.
f For more information on how to set up the simulation in Quartus II software using
NativeLink feature, refer to the DDR and DDR2 SDRAM High-Performance Controller
User Guide.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 21
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 22 Walkthrough Example for 167-MHz DDR2 SDRM Interface
Figure 13. Specifying the Timing Constraint .sdc File to the Design Example
Figure 14. Running Pin Assignment Constraint Script in the .tcl Script Page
After running the DDR2_pin_assignments.tcl file, you can assign the I/O locations
based on the Cyclone III device family development kit board by running the
Altera-provided EP3C120F780_DevKit_DDR2_PinLocations.tcl file or manually
assign I/O locations by using the Pin Planner or Assignment Editor. The 32-bit
interface is located at the bottom I/O banks of the device.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 23
4. From the Category list, click Fitter Settings and set the Fitter effort. To adjust the
fitter optimization effort to minimize compilation time while achieving the design
timing requirements, you can set the fitter effort to Auto Fit, as shown in
Figure 16.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 24 Walkthrough Example for 167-MHz DDR2 SDRM Interface
You are now ready to compile your design. To compile your design, perform the
following steps:
1. On the Processing menu, click Start Compilation.
2. After compilation is successful, on the Tools menu, select TimeQuest Timing
Analyzer.
3. Generate the timing margin report for your memory interface design by executing
the Report DDR function from the Tasks pane of the TimeQuest timing analyzer
window, as shown in Figure 17.
Executing the Report DDR task automatically runs the
<variation_name>_phy_report_timing.tcl timing margin report script generated by the
MegaWizard Plug-In Manager when the megafunction variation was created.
f For more information on the TimeQuest timing analyzer, refer to the Quartus II
TimeQuest Timing Analyzer chapter in volume 3 of the Quartus II Handbook.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 25
Figure 18 shows the output of the Report DDR task. The Report page contains a new
DDR folder with detailed timing information on the most critical paths and a timing
margin summary similar to the one reported on the TimeQuest timing analyzer
console.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 26 Walkthrough Example for 167-MHz DDR2 SDRM Interface
Figure 18. DDR2 Report Page and Timing Margin in TimeQuest Timing Analyzer
The report timing script provides the following margins and paths information:
■ Address/command setup and hold margin
■ Half-rate address/command setup and hold margin
■ Core setup and hold margin
■ Core reset/removal setup and hold margin
■ DQS vs CK setup and hold margin
■ Mimic path
■ Write setup and hold margin
■ Read capture setup and hold margin
f For more information on the timing analysis, refer to AN 438: Constraining and
Analyzing Timing for External Memory Interfaces in Stratix IV, Stratix III, Arria II GX, and
Cyclone III Devices.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 27
Figure 19. Path Summary for the Address and Command Datapath
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 28 Walkthrough Example for 167-MHz DDR2 SDRM Interface
Figure 20. Waveform View for the Address and Command Datapath
The report indicates that clk2 of the PLL is clocking the address and command
registers. Go to the PLL megafunction and change the phase setting of clk2. For this
design, the initial phase setting of clk2 is set to -90° with reference to the system
clock. By adjusting clk2 to later than -90° (meaning to launch the address and
command later), the setup margin is decreased and the hold margin is increased.
After modifying the clk2 phase setting to -55°, recompile your design for the new
PLL setting to take effect. Run the report timing script again.
Figure 21 shows the timing margin reported in the Quartus II software after adjusting
the phase setting of clk2. The address and command datapath now has a more
balanced 2.117 ns setup and 2.128 ns hold margin.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Walkthrough Example for 167-MHz DDR2 SDRM Interface Page 29
f For more information on the available settings for the ODT and output driver
impedance features, and the timing requirements for driving the ODT pin in
DDR2 SDRAM, refer to the respective memory data sheets.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 30 Walkthrough Example for 167-MHz DDR2 SDRM Interface
For this design walkthrough that targets the Cyclone III device family development
kit, drive-strength setting is used together with Class I termination. Using Class I
termination allows a higher maximum DDR2 SDRAM clock frequency and reduces
the number of external resistors required on the board. You can adjust the current
strength for the output pin of the Cyclone III device family according to your board
setup. If the current strength is too high, you might see excessive overshoot and
undershoot of your signal. Use the oscilloscope to check the signal overshoot and
undershoot.
Figure 22 shows the setup for write operation to the DDR2 SDRAM memory with
Class I termination together with the drive-strength setting of the Cyclone III device
family. In this setup, the output impedance of the driver (Cyclone III device family)
matches that of the transmission line, resulting in optimal signal transmission to the
DDR2 SDRAM memory. On the receiver (DDR2 SDRAM memory) side, it is properly
terminated with matching impedance to the transmission line, through the external
pull-up resistor to VTT to eliminate any ringing or reflection.
Figure 22. Write Operation to DDR2 SDRAM Memory with Class I Termination
VTT = 0.9 V
Cyclone III device DDR2 Component
family
12 mA RT = 56
Driver Driver
50
VREF VREF = 0.9 V Receiver
3" Trace Length
Receiver
Figure 23 shows the setup for read operation from the DDR2 SDRAM memory.
Figure 23. Read Operation from DDR2 SDRAM Memory with Class I Termination
RT = 56
Driver Driver
50
Receiver VREF = 0.9 V VREF Receiver
3" Trace Length
If you choose not to use the drive-strength setting, use the RS OCT feature of the
Cyclone III device family instead.
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Conclusion Page 31
Finally, the loading seen by the Cyclone III device family during writes to the memory
is different between a system using DIMMs versus a system using components. The
additional loading from the DIMM connector can reduce the edge rates of the signals
arriving at the memory, thus affecting the available timing margin.
f For more information on the RS OCT of the Cyclone III device family, refer to the
Cyclone III Device I/O Features chapter in volume 1 of the Cyclone III Device Handbook.
Conclusion
Cyclone III family devices have dedicated circuitry to interface with DDR2 SDRAM
components. The advanced clocking features available in Cyclone III family devices
allow a high-performance, versatile interface to DDR2 and DDR SDRAM. For
applications requiring lower power consumption and greater memory bandwidth
offered by DDR2 and DDR SDRAM, Altera offers a complete memory solution for
Cyclone III family devices.
Referenced Documents
This application note references the following documents:
■ AN 361: Interfacing DDR and DDR2 SDRAM with Cyclone II Devices
■ MT47H32M16 DDR2 SDRAM Data Sheet, Micron Technology, Inc
■ ALTMEMPHY Megafunction User Guide
■ AN 408: DDR2 Memory Interface Termination, Drive Strength and Loading Design
Guidelines
■ AN 438: Constraining and Analyzing Timing for External Memory Interfaces in
Stratix IV, Stratix III, Arria II GX and Cyclone III Devices
■ AN 462: Implementing Multiple Memory Interfaces Using the ALTMEMPHY
Megafunction
■ Cyclone III Device I/O Features chapter in volume 1 of the Cyclone III Device
Handbook
■ DDR and DDR2 SDRAM Controller Compiler User Guide
■ DDR and DDR2 SDRAM High-Performance Controller User Guide
■ Design Debugging Using the SignalTap II Embedded Logic Analyzer chapter in volume
3 of the Quartus II Handbook
■ External Memory Interfaces in Cyclone III Devices chapter in volume 1 of the
Cyclone III Device Handbook
■ Selecting the Right High-Speed Memory Technology for Your System white paper
■ The Quartus II TimeQuest Timing Analyzer chapter in volume 3 of the
Quartus II Handbook
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 32 Document Revision History
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Design Checklist Page 33
Design Checklist
This section contains a design checklist that you can use when implementing DDR2
and DDR2 SDRAM memory interfaces in Cyclone III family devices. Use the checklist
to verify that you have followed the guidelines for each stage of your design.
© June 2009 Altera Corporation AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices
Page 34 Design Checklist
AN 445: Design Guidelines for Implementing DDR and DDR2 SDRAM Interfaces in Cyclone III Devices © June 2009 Altera Corporation
Done N/A Board-Level Considerations
8 Have you selected the termination scheme and drive-strength settings for all the
memory interface signals on the memory side and the Cyclone III device family
side?
Ensure that appropriate termination and drive strength settings are applied on all the
memory interface signals, and verified using board-level simulations.
Cyclone III family devices support RS OCT Altera recommends the calibrated parallel
RS OCT 50 setting for unidirectional input signals from the memory, and the
calibrated series RS OCT 50 setting for unidirectional output signals to the memory.
When using the RS OCT feature on Cyclone III family devices, the programmable
drive-strength feature is unavailable. If there are multiple loads on certain Cyclone III
device family output pins (for example, if the address bus is shared across many
memory devices), use of maximum drive-strength setting may be preferred over the
series RS OCT setting. Use board-level simulations to pick the optimal setting for
best signal integrity.
On the memory side, Altera recommends the use of external parallel termination on
input signals to the memory (write data, address, command, and clock signals).
9 Have you performed board-level simulations to ensure electrical and timing margins
for your memory interface?
Ensure you have a sufficient eye opening using simulations. Be sure to use the latest
Cyclone III device family and memory IBIS models, board trace characteristics, drive
strength and termination settings in your simulation.
Any timing uncertainties at the board level that you calculate using such simulations
must be used to adjust the input timing constraints to ensure the accuracy of the
Quartus II timing margin reports.
Copyright © 2009 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company, the stylized
Altera logo, specific device designations, and all other words and logos that are identified as trademarks and/or service
marks are, unless noted otherwise, the trademarks and service marks of Altera Corporation in the U.S. and other
countries. All other product or service names are the property of their respective holders. Altera products are protected
101 Innovation Drive under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrants
San Jose, CA 95134 performance of its semiconductor products to current specifications in accordance with Altera's standard warranty,
www.altera.com but reserves the right to make changes to any products and services at any time without notice. Altera assumes no
Technical Support responsibility or liability arising out of the application or use of any information, product, or service
www.altera.com/support described herein except as expressly agreed to in writing by Altera Corporation. Altera customers are
advised to obtain the latest version of device specifications before relying on any published
information and before placing orders for products or services.