Forum Discussion
Altera_Forum
Honored Contributor
12 years agoSDRAM on DE0-nano board
Hi,
I am still not having any success writing and reading from the SDRAM on on the DE0-nano board from the FPGA. I have built a system in qsys which includes a Nios II and SDRAM controller and downloaded it to the board. The next thing I would like to do is write some code in VHDL or some program for the NIOS that reads and writes to the SDRAM. How exactly does one achieve this? I believe the SDRAM controller takes care of all the control signals etc. so in order to write to it, I must specify the address in RAM first or just write data to the data pins connecting to it? I am having problems understanding how this works. If anyone has more experience with this, I would appreciate your help. Many thanks, Paul23 Replies
- Altera_Forum
Honored Contributor
Use Quartus to generate an archive file (.qar) and email it to me, and I'll take a look.
Cheers, Dave - Altera_Forum
Honored Contributor
--- Quote Start --- I have checked over and over again the pin assignments and qsys settings ... --- Quote End --- The .qar file you sent generates warning messages about unconstrained clocks and paths and TimeQuest fails, so I think that is the root of your problem. Create an .SDC file for your project based on the example I provided. This experience should help you understand that an HDL design consists of (at least); 1. The HDL design files. 2. The device constraints file (device type + pin assignments) 3. The timing constraints file (the .SDC file) Cheers, Dave - Altera_Forum
Honored Contributor
Hi Dave,
I am trying your BeMicro DDR3 example design but for the Bittware S5-PCIE-HQ board. When I select the DDR3 controller in Qsys and under PHY settings, there is no option to "Enable Hard External Memory Interface" as explained and unable to set the "Rate on Avalon-MM interface" to "Full". The “maximum speed grade” that I am able select also is 4. The RAM on the Bittware board is from MICRON and I see that there are different numbers on different chips – 4DE17D9QBJ , 3ZE77D9QBJ and 30E27D9QBJ so I am not sure which DDR device to select from the list on the right. You say to select MICRON MT41J64M16LA-15E. Would that be ok in this case? When I compile the project and use your bemicro_cv.vhd as the top level Entity, I have to remove “ddr_status_local_init_done” , “ddr_status_local_cal_success” and “ddr_status_local_cal_fail” from the the Qsys component as my Qsys system did not generate these ports. Should this matter? I then receive errors on compilation like the following :Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination - Altera_Forum
Honored Contributor
Hi Paul,
--- Quote Start --- I am trying your BeMicro DDR3 example design but for the Bittware S5-PCIE-HQ board. When I select the DDR3 controller in Qsys and under PHY settings, there is no option to "Enable Hard External Memory Interface" as explained and unable to set the "Rate on Avalon-MM interface" to "Full". The “maximum speed grade” that I am able select also is 4. --- Quote End --- Right, that is to be expected. Your particular device needs to support a Hard Memory Controller, otherwise that option will not be available. Given that its not available, your device does not have a hard memory controller, so skip that option. --- Quote Start --- The RAM on the Bittware board is from MICRON and I see that there are different numbers on different chips – 4DE17D9QBJ , 3ZE77D9QBJ and 30E27D9QBJ so I am not sure which DDR device to select from the list on the right. You say to select MICRON MT41J64M16LA-15E. Would that be ok in this case? --- Quote End --- No. You have to find the correct Micron part number. You can use Micron's package marking mapping tool to convert part labels to part numbers. http://www.micron.com/products/support/fbga D9QBJ = MT41K512M8RH-125:E If Bittware have an example design that includes DDR3, open it and see what device parameters they have used, eg., to see if they have modified any of the defaultthe timing parameters. --- Quote Start --- When I compile the project and use your bemicro_cv.vhd as the top level Entity, I have to remove “ddr_status_local_init_done” , “ddr_status_local_cal_success” and “ddr_status_local_cal_fail” from the the Qsys component as my Qsys system did not generate these ports. Should this matter? --- Quote End --- You probably did not click on the exports column to export them. If you synthesize the BeMicro-CV design and then use Qsys to open the qsys_system.qsys file, you will see the exported signals column. --- Quote Start --- I then receive errors on compilation like the following :
--- Quote End --- You have to run the pin constraints file created by the DDR3 IP core. In the BeMicro-CV design, this script is automatically run by the post-flow script. Since you appear to be synthesizing the qsys_system as the top-level design, then you need to run that script manually, via the Tools->Tcl script menu option. Now that you have a sense of what needs to be done to create a DDR3 controller, you need to read the External Memory Interface handbook. http://www.altera.com/literature/lit-external-memory-interface.jsp Cheers, DaveError (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination Error (174068): Output buffer atom "qsys_system:u1|qsys_system_ddr3:ddr3|qsys_system_ddr3_p0:p0|qsys_system_ddr3_p0_memphy:umemphy|qsys_system_ddr3_p0_new_io_pads:uio_pads|qsys_system_ddr3_p0_altdqdqs:dq_ddio.ubidir_dq_dqs|altdq_dqs2_stratixv:altdq_dqs2_inst|extra_output_pad_gen.obuf_1" has port "SERIESTERMINATIONCONTROL" connected, but does not use calibrated on-chip termination - Altera_Forum
Honored Contributor
Dear Dave,
I am trying your script and this is happen in the console, cd de0_nano_sdram source scripts/synth.tcl Synthesizing the DE0-nano 'sdram' design ---------------------------------------- - Quartus Version 14.0.0 Build 200 06/17/2014 SJ Full Version - Creating the Quartus work directory * /home/kanigoro/Desktop/de0_nano_sdram/qwork - Create the project 'de0_nano' * create a new de0_nano project - Applying constraints - Creating the VHDL files list - Generate the Qsys system * creating the Qsys file in the work directory * Tcl-to-Qsys generation for Quartus version 14.0 * generating the Qsys system (please wait) 2014.11.04.13:58:05 Error: Unrecognized switch 2 2014.11.04.13:58:05 Error: Invalid device family '"Cyclone' specified Error: Qsys generation failed Is there something that I am missing?...:D Bayu Kanigoro - Altera_Forum
Honored Contributor
Hi Bayu Kanigoro,
--- Quote Start --- Is there something that I am missing? --- Quote End --- I don't think so. Post#2 shows the output from Quartus 14.0 Build 200, and it ran to completion. I'll download the zip and run the script and confirm it works. Cheers, Dave - Altera_Forum
Honored Contributor
Hi Bayu Kanigoro,
I just noticed the build folder on your machine ... --- Quote Start --- - Creating the Quartus work directory * /home/kanigoro/Desktop/de0_nano_sdram/qwork --- Quote End --- which means you are running the script under Linux. Post#2 was run on a Windows 7 machine. I recall seeing differences with Tcl scripts run under Windows vs Linux. I'll boot a Centos Virtual Machine and see if I can isolate the issue with the Tcl script. I have a good idea of where to look. Cheers, Dave - Altera_Forum
Honored Contributor
Hi Bayu Kanigoro,
Download the zip and try it now. It turns out that Linux did not like quotes in the exec arguments, so I changed them to ...
and now it works fine. Cheers, Dave# synth.tcl set cmd "set quartus_version $qversion" lappend arg_list --cmd=$cmd # synth_qsys.tcl set device "Cyclone IV E" lappend arg_list --system-info=DEVICE_FAMILY=$device - Altera_Forum
Honored Contributor
Thanks Dave for the help. It works on Linux now..:)
Sorry for not to mention before that I was using Ubuntu Linux for running the script. Bayu Kanigoro - Altera_Forum
Honored Contributor
--- Quote Start --- It works on Linux now..:) --- Quote End --- Great! --- Quote Start --- Sorry for not to mention before that I was using Ubuntu Linux for running the script. --- Quote End --- No problem! Cheers, Dave