Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

DE2-115 DDR2 Controller

Hi everyone!

I'm currently working on an implementation that requires me to store packets into the SDRAM then fetch it when it is optimal to transmit. I am having trouble on making it work though.

The way I understand it, I have two options.

  1. Use NIOS through QSYS then access the memory using C programming.

  2. Use AVALON INTERFACE and MegaWizard to generate the necessary IP.

What I have done so far:

for the nios:

Introduction to the Altera Qsys System Integration Tool

ftp://ftp.altera.com/up/pub/altera_material/12.0/tutorials/introduction_to_the_altera_qsys_tool.pdf -- use this until the part of compilation. stop in the step where altera monitor is being discussed. it is already outdated and is replaced by a built in eclipse.

Using the SDRAM on Altera’s DE2-115 Board with VHDL Designs

ftp://ftp.altera.com/up/pub/altera_material/12.0/tutorials/vhdl/de2-115/using_the_sdram.pdf -- this completes the whole nios system with sdram. problem at this point is how to access the sdram now that it has a controller. tutorial did not give any insights about doing this

i want to extract the data from the memory to a logic outside the nios system. in essence, i am just using the nios to access the memory because this is the easier tutorial that i have found online. however, it lacks the succeeding steps.

for the avalon:

AVALON MEMORY MAP INTERFACE

Chapter 3. Avalon Memory-Mapped Interfaces

http://www.altera.com/literature/manual/mnl_avalon_spec.pdf

Embedded Peripherals IP USER GUIDE

Chapter 2. SDRAM Controller Core

http://www.altera.com/literature/ug/ug_embedded_ip.pdf

External Memory Interface Handbook - Volume 2: Design Guidelines

Chapter 9. Implementing and Parameterizing Memory IP

http://www.altera.com/literature/hb/external-memory/emi_plan.pdf

From this, I have deduced that the SDRAM controls will be handled by the IP built by Altera, and the only thing that I should have problem is utilizing the Avalon-MM Slave Port. This might be a good idea for developers who are already familiar with altera because the Avalon interface is used in many IP but since this is my first time to use such interface, I am lost on how to proceed.

i know that this is a more straight forward approach but i can't find the right timing diagram to create an fsm that will utilize the signals. moreover, i need more information on each control and data signals. on top of that, during the creation of the ip with megawizard, i don't have any idea on what to put into the parameters of the sdram because the de2-115 did not specify what chip it is.

Here are the information that I know about the SDRAM in DE2-115.

  • DDR2 - 128MB

  • 16 data lines shared for both SDRAM making it access 32 bit of data per address locations.

  • It has 13 address lines and 2 address lines for the banks.

  • Address Banks = (2^13) (2^10) (2^2) = 8192 1024 * 4 = 33554432 address locations = 32M

  • 32M words x 32 bits/word = 1028 Mbits = 128MB

I'm glad to have any help from either approach. I've been stuck here for almost two weeks. I tried my best to gather all the information that I can but it is not enough. I hope someone can enlighten me about DDR2 addressing.

Many thanks!

17 Replies