Showing results for 
Search instead for 
Did you mean: 
836 Discussions

Design Example - Stratix III QDRII SRAM UniPHY 333MHz

Design Example - Stratix III QDRII SRAM UniPHY 333MHz

Last Major Update

Initial Release - Jan 05th 2012 – Stratix III QDRII+ SRAM x18 333MHz, Quartus II v11.1 QDR II and QDR II+ SRAM Controller with UniPHY, Stratix III development board. 

Design Overview

 This design is meant as a demo style lab. It very briefly covers the steps required to successfully get a QDRII+ SRAM interface working with a Stratix III FPGA using a single component on the Stratix III development board. The purpose of the lab is for the reader to get a basic feel for what steps are involved in getting an external memory working with an Altera FPGA and the UniPHY IP. The lab will not cover any of the steps in detail but simply show an overview of the design process. Volume 6 of the External Memory Interface Handbook should be used for a more thorough walkthrough. 

The lab creates a 18bit 333MHz QDRII+ SRAM external memory PHY and controller using Altera’s QDR II and QDR II+ SRAM Controller with UniPHY IP. The IP also generates an example top level file, an example driver, and a test bench including an external memory model. All these will be used to demonstrate the QDRII+ SRAM functionality 


Design Specifications

The table below lists the specifications for this design:

Quartus versionQuartusII v11.1
KitStratix III Development board
Memory deviceQDRII+ SRAM (CY7C1263V18)
Memory speed400MHz
Memory topologysingle component, x18
IP usedQDR II and QDR II+ SRAM Controller with UniPHY and generated example top Quartus project


Lab Steps

The lab uses Quartus II v11.0 and has Modelsim set up via NativeLink for simulation. The lab assumes the reader is a competent user of these tools and many of their features. 

Four files have been pre-designed for this lab to save time.

  • A pin location assignments tcl script
  • A signal tap file for debug of the interface design that has been created
  • A board trace model assignments script
  • A virtual pins assignments script for this design

A Quartus archive for the final project is also included for reference. 

Files for this lab are located in this zip file –

Create a new folder for the project and place the files in it


Design Generation

1. Use the Megawizard Plug-in Manager to generate a RLDRAM II Controller with UniPHY 

Start Quartus, open MegaWizard Plug-In Manager and create a new variation

  •  In the Megawizard GUI, set device family to be Stratix III
  •  The IP is located under the folders Interfaces/External Memory/QDRII and QDRII+, choose QDR II and QDR II+ SRAM Controller with UniPHY
  •  If your license for ModelSim can not support multiple HDL languages then chose verilog as output file type
  •  For the name of the output file, browse to the folder you created above, give the instance the name “qdrii_uniphy”, click Open, click Next to open the IP GUI

2. Set parameters for Memory Controller with UniPHY 

On the right of the GUI are some Memory Presets, click CY7C1263V18-400 and apply

  • General Settings Tab

       - Set Speed Grade to 2

      - Set Memory Clock Frequency to 400MHz 

      - Set PLL Reference Clock Frequency to 125MHz 

      - For Full or half rate on Avalon-MM interface, select Half. This option allows you to choose between the full-rate and half-rate controller, and define the bus data width between the controller and the PHY.

      - For Additional Address/Command clock phase, select 0.

  • Advanced Settings

   - Select 64 for maximum Avalon-MM burst length

   - Select 1.8V HSTL for I/O standard

   - Turn on Master for PLL/DLL sharing to instantiate its own PLL. If the Master for PLL/DLL sharing option is disabled, the PLL clock shares with other identical UniPHY core.

   -Under Example Testbench Simulation Options, turn on Skip memory initialization to reduce simulation time.

  • Controller Settings Tab – Select 1 for Controller Latency
  • Board Settings Tab - Users should do board simulation for proper values in this page

      - Set INI parameters to 0ps for single chip select.

       - Set the Board Skews parameters to the specified values below:

           Maximum delay difference between devices: 0ps 

           Maximum skew within K group: 20ps 

           Maximum skew between K groups: 0ps 

           Average delay difference between Address/Command and K: 1ps

           Average delay difference between Data and K: 3ps 

          Average delay difference between Data and CQ: 9ps 

          Maximum skew within Address/Command bus: 81ps

  • Click “Finish” to start IP generation. Check important messages during generation. After IP is successfully generated, click Exit to close GUI

3. Open the example project generated by the Megawizard 

The Megawizard generates a Quartus example top project. This project connects an example driver to the controller interface so users can quickly compile and test their UniPHY IP configuration on hardware.

  • Open the example project located in <variation_name>_example_design/example_project. If the device you are using does not match the device in the example project, change the device in the project.


4. Perform Analysis and Synthesis 

This step is required so Quartus can determine the names of the external ports connected to the UniPHY for when the I/O assignments are created in the next step

5. Assign the pin and DQ group settings 

Run the tcl script qdrii_uniphy_pin_assignments.tcl to assign the pin and DQ group assignments. This tcl script is generated for you by the IP megawizard

  • Verify in the Assignment Editor that pin assignments have been created successfully

6. Assign the pin locations Pin locations for external memory systems are not automatically created.

  • Run the SIII_qdrii_pin_location.tcl script to assign pin locations for the targeted kit
  • Run the SIII_qdrii_exdriver_vpin.tcl script to assign virtual pins
  • Verify in Pin Planner or Assignment Editor that pin locations have been created successfully

7. Do a Full Compile

This should take about 10 minutes depending on the compiling PC.

Design Analysis

 1. Timing Analysis results

  • In the Compilation Report, Time Quest Timing Analyzer folder expand the three VT model folders, and the Report DDR folder

     - Check the summary at the bottom of that report

     - Check that all set up and hold timings pass 

Note: there will be some unconstrained paths in the design. These are associated with the example driver that will not be part of a fully integrated HP controller design. 

2. On board debug with Signal Tap 

Open the Signal Tap file and reset the .sof file to the one just created with the full compilation

  • Program the kit FPGA with the .sof
  • Run Signal Tap Analysis

   - Restart the driver

   - Ensure that test complete goes high (signal tap is trigger on this), this is the end of the driver testing, check the driver's pass signal is high. 

- Also check that calibration was successful and that the PLL is locked 

 Design Simulation

The Quartus II software creates a complete design example for functional simulation in the <variation_name>_example_design/simulation/ directory. To run the RTL simulation with NativeLink, perform the following steps:

  •  Open the generated example project for the design example simulation, <variation_name>_example_design/simulation/<variation_name>_ example_sim.qpf. 
  • Select Tools -> Tcl Scripts... -> generate_sim_verilog_example_design.tcl and click "Run". 
  • Open Modelsim. 
  • Move into the directory ./verilog/mentor or ./vhdl/mentor.
  • Start Modelsim and run the "" script: in Modelsim, enter "do".
  • The simulation will stop once the test complete signal goes high in the test bench 
  • CLICK “NO” WHEN ASKED IF YOU WANT TO FINISH, otherwise simulation will be reset 
  • Observe the results in the ModelSim Wave window  


Update History

1. Initial Release - Jan 05th 2012 - SIII QDRII+ SRAM x18 333MHz, QuartusII v11.1, UniPHY , SIII FPGA development kit.

See Also

1. List of designs using Altera External Memory IP

External Links

1. Altera's External Memory Interface Solutions Center 

2. Altera's External Memory Interface Handbook

Key Words

UniPHY, QDRII SRAM, QDRII+ SRAM, Design Example, External Memory

Version history
Last update:
‎06-27-2019 04:51 PM
Updated by: