External Memory Interface Handbook Volume 2: Design Guidelines: For UniPHY-based Device Families
ID
683385
Date
3/06/2023
Public
1. Planning Pin and FPGA Resources
2. DDR2 and DDR3 SDRAM Board Design Guidelines
3. Dual-DIMM DDR2 and DDR3 SDRAM Board Design Guidelines
4. LPDDR2 SDRAM Board Design Guidelines
5. RLDRAM II and RLDRAM 3 Board Design Guidelines
6. QDR II/II+ SRAM Board Design Guidelines
7. Implementing and Parameterizing Memory IP
8. Simulating Memory IP
9. Analyzing Timing of Memory IP
10. Debugging Memory IP
11. Optimizing the Controller
12. PHY Considerations
13. Power Estimation Methods for External Memory Interfaces
1.1.1. Estimating Pin Requirements
1.1.2. DDR, DDR2, and DDR3 SDRAM Clock Signals
1.1.3. DDR, DDR2, and DDR3 SDRAM Command and Address Signals
1.1.4. DDR, DDR2, and DDR3 SDRAM Data, Data Strobes, DM/DBI, and Optional ECC Signals
1.1.5. DDR, DDR2, and DDR3 SDRAM DIMM Options
1.1.6. QDR II and QDR II+ SRAM Clock Signals
1.1.7. QDR II and QDR II+ SRAM Command Signals
1.1.8. QDR II and QDR II+ SRAM Address Signals
1.1.9. QDR II and QDR II+ SRAM Data, BWS, and QVLD Signals
1.1.10. RLDRAM II and RLDRAM 3 Clock Signals
1.1.11. RLDRAM II and RLDRAM 3 Commands and Addresses
1.1.12. RLDRAM II and RLDRAM 3 Data, DM and QVLD Signals
1.1.13. LPDDR2 Clock Signal
1.1.14. LPDDR2 Command and Address Signal
1.1.15. LPDDR2 Data, Data Strobe, and DM Signals
1.1.16. Maximum Number of Interfaces
1.1.17. OCT Support
1.1.16.1. Maximum Number of DDR SDRAM Interfaces Supported per FPGA
1.1.16.2. Maximum Number of DDR2 SDRAM Interfaces Supported per FPGA
1.1.16.3. Maximum Number of DDR3 SDRAM Interfaces Supported per FPGA
1.1.16.4. Maximum Number of QDR II and QDR II+ SRAM Interfaces Supported per FPGA
1.1.16.5. Maximum Number of RLDRAM II Interfaces Supported per FPGA
1.1.16.6. Maximum Number of LPDDR2 SDRAM Interfaces Supported per FPGA
1.2.1. General Pin-out Guidelines for UniPHY-based External Memory Interface IP
1.2.2. Pin-out Rule Exceptions for ×36 Emulated QDR II and QDR II+ SRAM Interfaces in Arria II, Stratix III and Stratix IV Devices
1.2.3. Pin-out Rule Exceptions for RLDRAM II and RLDRAM 3 Interfaces
1.2.4. Pin-out Rule Exceptions for QDR II and QDR II+ SRAM Burst-length-of-two Interfaces
1.2.5. Pin Connection Guidelines Tables
1.2.6. PLLs and Clock Networks
1.2.5.1. DDR3 SDRAM With Leveling Interface Pin Utilization Applicable for Arria V GZ, Stratix III, Stratix IV, and Stratix V Devices
1.2.5.2. QDR II and QDR II+ SRAM Pin Utilization for Arria II, Arria V, Stratix III, Stratix IV, and Stratix V Devices
1.2.5.3. RLDRAM II CIO Pin Utilization for Arria II GZ, Arria V, Stratix III, Stratix IV, and Stratix V Devices
1.2.5.4. LPDDR2 Pin Utilization for Arria V, Cyclone V, and MAX 10 FPGA Devices
1.2.5.5. Additional Guidelines for Arria V GZ and Stratix V Devices
1.2.5.6. Additional Guidelines for Arria V ( Except Arria V GZ) Devices
1.2.5.7. Additional Guidelines for MAX 10 Devices
1.2.5.8. Additional Guidelines for Cyclone V Devices
1.2.6.1. Number of PLLs Available in Intel® Device Families
1.2.6.2. Number of Enhanced PLL Clock Outputs and Dedicated Clock Outputs Available in Intel® Device Families
1.2.6.3. Number of Clock Networks Available in Intel® Device Families
1.2.6.4. Clock Network Usage in UniPHY-based Memory Interfaces—DDR2 and DDR3 SDRAM (1) (2)
1.2.6.5. Clock Network Usage in UniPHY-based Memory Interfaces—RLDRAM II, and QDR II and QDR II+ SRAM
1.2.6.6. PLL Usage for DDR, DDR2, and DDR3 SDRAM Without Leveling Interfaces
1.2.6.7. PLL Usage for DDR3 SDRAM With Leveling Interfaces
2.1. Leveling and Dynamic Termination
2.2. DDR2 Terminations and Guidelines
2.3. DDR3 Terminations in Arria V, Cyclone V, Stratix III, Stratix IV, and Stratix V
2.4. Layout Approach
2.5. Channel Signal Integrity Measurement
2.6. Design Layout Guidelines
2.7. Package Deskew
2.8. Document Revision History
3.2.1. Overview of ODT Control
3.2.2. DIMM Configuration
3.2.3. Dual-DIMM Memory Interface with Slot 1 Populated
3.2.4. Dual-DIMM with Slot 2 Populated
3.2.5. Dual-DIMM Memory Interface with Both Slot 1 and Slot 2 Populated
3.2.6. Dual-DIMM DDR2 Clock, Address, and Command Termination and Topology
3.2.7. Control Group Signals
3.2.8. Clock Group Signals
7.2.1.1. DDR2 SDRAM Controller with UniPHY Intel FPGA IP Interfaces
7.2.1.2. DDR3 SDRAM Controller with UniPHY Intel FPGA IP Interfaces
7.2.1.3. LPDDR2 SDRAM Controller with UniPHY Intel FPGA IP Interfaces
7.2.1.4. QDR II and QDR II+ SRAM Controller with UniPHY Intel FPGA IP Interfaces
7.2.1.5. RLDRAM II Controller with UniPHY Intel FPGA IP Interfaces
7.2.1.6. RLDRAM 3 UniPHY Intel FPGA IP Interface
7.2.3.1. PHY Settings for UniPHY IP
7.2.3.2. Memory Parameters for LPDDR2, DDR2 and DDR3 SDRAM Controller with UniPHY Intel FPGA IP
7.2.3.3. Memory Parameters for QDR II and QDR II+ SRAM Controller with UniPHY Intel FPGA IP
7.2.3.4. Memory Parameters for RLDRAM II Controller with UniPHY Intel FPGA IP
7.2.3.5. Memory Timing Parameters for DDR2, DDR3, and LPDDR2 SDRAM Controller with UniPHY Intel FPGA IP
7.2.3.6. Memory Timing Parameters for QDR II and QDR II+ SRAM Controller with UniPHY Intel FPGA IP
7.2.3.7. Memory Timing Parameters for RLDRAM II Controller with UniPHY Intel FPGA IP
7.2.3.8. Memory Parameters for RLDRAM 3 UniPHY Intel FPGA IP
8.2.1. Simulation Scripts
8.2.2. Preparing the Vendor Memory Model
8.2.3. Functional Simulation with Verilog HDL
8.2.4. Functional Simulation with VHDL
8.2.5. Simulating the Example Design
8.2.6. UniPHY Abstract PHY Simulation
8.2.7. PHY-Only Simulation
8.2.8. Post-fit Functional Simulation
8.2.9. Simulation Issues
9.1. Memory Interface Timing Components
9.2. FPGA Timing Paths
9.3. Timing Constraint and Report Files for UniPHY IP
9.4. Timing Analysis Description
9.5. Timing Report DDR
9.6. Report SDC
9.7. Calibration Effect in Timing Analysis
9.8. Timing Model Assumptions and Design Rules
9.9. Common Timing Closure Issues
9.10. Optimizing Timing
9.11. Timing Deration Methodology for Multiple Chip Select DDR2 and DDR3 SDRAM Designs
9.12. Performing I/O Timing Analysis
9.13. Document Revision History
9.4.1.1. Address and Command
9.4.1.2. PHY or Core
9.4.1.3. PHY or Core Reset
9.4.1.4. Read Capture and Write
9.4.1.5. Read Resynchronization
9.4.1.6. DQS versus CK—Arria II GX and Cyclone IV Devices
9.4.1.7. Write Leveling tDQSS
9.4.1.8. Write Leveling tDSH/tDSS
9.4.1.9. DK versus CK (RLDRAM II with UniPHY)
9.4.1.10. Bus Turnaround Time
9.9.1. Missing Timing Margin Report
9.9.2. Incomplete Timing Margin Report
9.9.3. Read Capture Timing
9.9.4. Write Timing
9.9.5. Address and Command Timing
9.9.6. PHY Reset Recovery and Removal
9.9.7. Clock-to-Strobe (for DDR and DDR2 SDRAM Only)
9.9.8. Read Resynchronization and Write Leveling Timing (for SDRAM Only)
10.1. Resource and Planning Issues
10.2. Interface Configuration Performance Issues
10.3. Functional Issue Evaluation
10.4. Timing Issue Characteristics
10.5. Verifying Memory IP Using the Signal Tap II Logic Analyzer
10.6. Hardware Debugging Guidelines
10.7. Categorizing Hardware Issues
10.8. EMIF Debug Toolkit Overview
10.9. Document Revision History
10.3.1. Correct Combination of the Quartus Prime Software and ModelSim* - Intel® FPGA Edition Device Models
10.3.2. Intel® IP Memory Model
10.3.3. Vendor Memory Model
10.3.4. Insufficient Memory in Your PC
10.3.5. Transcript Window Messages
10.3.6. Passing Simulation
10.3.7. Modifying the Example Driver to Replicate the Failure
10.6.1. Create a Simplified Design that Demonstrates the Same Issue
10.6.2. Measure Power Distribution Network
10.6.3. Measure Signal Integrity and Setup and Hold Margin
10.6.4. Vary Voltage
10.6.5. Use Freezer Spray and Heat Gun
10.6.6. Operate at a Lower Speed
10.6.7. Determine Whether the Issue Exists in Previous Versions of Software
10.6.8. Determine Whether the Issue Exists in the Current Version of Software
10.6.9. Try A Different PCB
10.6.10. Try Other Configurations
10.6.11. Debugging Checklist
11.2.1. DDR2 SDRAM Controller
11.2.2. Auto-Precharge Commands
11.2.3. Additive Latency
11.2.4. Bank Interleaving
11.2.5. Command Queue Look-Ahead Depth
11.2.6. Additive Latency and Bank Interleaving
11.2.7. User-Controlled Refresh
11.2.8. Frequency of Operation
11.2.9. Burst Length
11.2.10. Series of Reads or Writes
11.2.11. Data Reordering
11.2.12. Starvation Control
11.2.13. Command Reordering
11.2.14. Bandwidth
11.2.15. Efficiency Monitor
8.2.2. Preparing the Vendor Memory Model
You can replace the Intel-supplied memory model with a vendor-specific memory model. In general, you may find vendor-specific models to be standardized, thorough, and well supported, but sometimes more complex to setup and use.
Note: Intel does not provide support for vendor-specific memory models. If you do want to replace the Intel-supplied memory model with a vendor-supplied memory model, you should observe the following guidelines:
- Ensure that you have the correct vendor-supplied memory model for your memory device.
- Disconnect all signals from the default memory model and reconnect them to the vendor-supplied memory model.
- If you intend to run simulation from the Quartus Prime software, ensure that the . qip file points to the vendor-supplied memory model.
When you are using a vendor-supplied memory model instead of the generated functional simulation model, you must modify the vendor memory model and the testbench files by following these steps:
- Obtain and copy the vendor memory model to the \<variation_name>_example_design\simulation\<variation_name>_sim\ submodules directory. For example, obtain the ddr2.v and ddr2_parameters.vh simulation model files from the Micron website and save them in the directory.
- The auto-generated generic SDRAM model may be used as a placeholder for a specific vendor memory model.
- Some vendor DIMM memory models do not use data mask (DM) pin operation, which can cause calibration failures. In these cases, use the vendor’s component simulation models directly.
- Open the vendor memory model file in a text editor and specify the speed grade and device width at the top of the file. For example, you can add the following statements for a DDR2 SDRAM model file:
'define sg25
'define x8
The first statement specifies the memory device speed grade as –25 (for 400 MHz operation). The second statement specifies the memory device width per DQS.
- Check that the following statement is included in the vendor memory model file. If not, include it at the top of the file. This example is for a DDR2 SDRAM model file:
`include "ddr2_parameters.vh"
- Save the vendor memory model file.
- Open the simulation example project file <variation_name>_example_sim.qpf, located in the <variation_name>_example_design\simulation directory.
- On the Tools menu, select TCL scripts to run the generate_sim_verilog_example_design.tcl file, in which generates the simulation example design.
- To enable vendor memory model simulation, you have to include and compile the vendor memory model by adding it into the simulation script. Open the .tcl script, msim_setup.tcl, located in the <variation_name>_example_design\simulation\verilog\mentor directory in the text editor. Add in the following line in the '# Compile the design files in correct order' section:
vlog +incdir+$QSYS_SIMDIR/submodules/ "$QSYS_SIMDIR/submodules/<vendor_memory>.v" -work <variation_name>_example_sim_work
- Open the simulation example design, <variation_name>_example_sim.v, located in the <variation_name>_example_design\simulation\verilog directory in a text editor and delete the following module:
alt_mem_if_<memory_type>_mem_model_top_<memory_type>_mem_if_dm_pins_en_mem_if_dqsn_en
Note: The actual name of the pin may differ slightly depending on the memory controller you are using. - Instantiate the downloaded memory model and connect its signals to the rest of the design.
- Ensure that the ports names and capitalization in the memory model match the port names and capitalization in the testbench.
Note: The vendor memory model may use different pin names and capitalization than the generated functional simulation model.
- Save the testbench file.
The original instantiation may be similar to the following code:
alt_mem_if_ddr2_mem_model_top_mem_if_dm_pins_en_mem_if_dqsn_en #( .MEM_IF_ADDR_WIDTH (13), .MEM_IF_ROW_ADDR_WIDTH (12), .MEM_IF_COL_ADDR_WIDTH (8), .MEM_IF_CS_PER_RANK (1), .MEM_IF_CONTROL_WIDTH (1), .MEM_IF_DQS_WIDTH (1), .MEM_IF_CS_WIDTH (1), .MEM_IF_BANKADDR_WIDTH (3), .MEM_IF_DQ_WIDTH (8), .MEM_IF_CK_WIDTH (1), .MEM_IF_CLK_EN_WIDTH (1), .DEVICE_WIDTH (1), .MEM_TRCD (6), .MEM_TRTP (3), .MEM_DQS_TO_CLK_CAPTURE_DELAY (100), .MEM_IF_ODT_WIDTH (1), .MEM_MIRROR_ADDRESSING_DEC (0), .MEM_REGDIMM_ENABLED (0), .DEVICE_DEPTH (1), .MEM_INIT_EN (0), .MEM_INIT_FILE (""), .DAT_DATA_WIDTH (32) ) m0 ( .mem_a (e0_memory_mem_a), // memory.mem_a .mem_ba (e0_memory_mem_ba), // .mem_ba .mem_ck (e0_memory_mem_ck), // .mem_ck .mem_ck_n (e0_memory_mem_ck_n), // .mem_ck_n .mem_cke (e0_memory_mem_cke), // .mem_cke .mem_cs_n (e0_memory_mem_cs_n), // .mem_cs_n .mem_dm (e0_memory_mem_dm), // .mem_dm .mem_ras_n (e0_memory_mem_ras_n), // .mem_ras_n .mem_cas_n (e0_memory_mem_cas_n), // .mem_cas_n .mem_we_n (e0_memory_mem_we_n), // .mem_we_n .mem_dq (e0_memory_mem_dq), // .mem_dq .mem_dqs (e0_memory_mem_dqs), // .mem_dqs .mem_dqs_n (e0_memory_mem_dqs_n), // .mem_dqs_n .mem_odt (e0_memory_mem_odt) // .mem_odt );
Replace the original code with the following code:
ddr2 memory_0 ( .addr (e0_memory_mem_a), // memory.mem_a .ba (e0_memory_mem_ba), // .mem_ba .clk (e0_memory_mem_ck), // .mem_ck .clk_n (e0_memory_mem_ck_n), // .mem_ck_n .cke (e0_memory_mem_cke), // .mem_cke .cs_n (e0_memory_mem_cs_n), // .mem_cs_n .dm_rdqs (e0_memory_mem_dm), // .mem_dm .ras_n (e0_memory_mem_ras_n), // .mem_ras_n .cas_n (e0_memory_mem_cas_n), // .mem_cas_n .we_n (e0_memory_mem_we_n), // .mem_we_n .dq (e0_memory_mem_dq), // .mem_dq .dqs (e0_memory_mem_dqs), // .mem_dqs .rdqs_n (), // .mem_dqs_n .dqs_n (e0_memory_mem_dqs_n), // .mem_dqs_n .odt (e0_memory_mem_odt) // .mem_odt);
If you are interfacing with a DIMM or multiple memory components, you need to instantiate all the memory components in the simulation file.