Friday, April 15, 2011

DRAM'ed if you do, DRAM'ed if you don't

I'm getting ready to expand my project to be able to use the 1 GB DDR2 667 MHz SDRAM (SO-DIMM card) that came with the DE3 board. ("DDR2 SDRAM" just means the 2nd version of the standards specification for interfacing to double data rate synchronous dynamic random access memory.)

First, looking at instructions in the DE3 user manual. It says that due to a limitation of SOPC Builder, only 256MB of the DRAM can be accessed if SOPC Builder is used. The demo is limited to 256 MB. So, if I want to use the full 1 GB DRAM, I might have to first learn how to build the project without SOPC Builder (using command-line tools, I assume). However, it might make more sense to first just limit the size of my memory buffer to 256 MB. That will take about 27 seconds to fill at 10 Msps, at 1B/sample. Actually, it might be wise to time the OCXO's falling edges as well; so then that's 20 Msps, and the memory will fill up in about 13 seconds (assuming we can write it that fast).

First, I'm copying the entire DE3_Demonstrations\150 folder from C:\Users\Public\Documents\AlteraDE3boardCD to C:\LOCAL\, so that I can access it a little more conveniently.

Opening the DE3_DDR2_Q8.qpf Quartus project in Quartus 9.1. (Sometime I should perhaps upgrade to Quartus 10, but for now - if it ain't broke, don't fix it. :) Looking at the SOPC Builder design. It looks like it uses a couple of PIOs to communicate with the DDR2 controller. There is also an "altmemddr" device. That dialog is pretty complicated! There are also some Tcl scripts you have to run to set up the controller IP, the source code of which is not viewable.

Also viewing the Nios 2 code. Looks like I modified it slightly earlier (just to print a message, to make sure I could modify it).

Recompiling the Quartus project now, just to make sure I can (in the new location).

OK, my modified software is loaded and running. However, the memory test seems to be taking a while... Several minutes just to test 256MB? It's running at half speed, but that doesn't fully explain it... Oh, maybe it is the slow clock speed of the Nios 2 that's the problem...

Meanwhile, regenerating the SOPC system, to make sure I can do that... Yes.

The run still seems to be stuck, recompiling the software now, to test that and so I can run in debugger...

Time to go to Gainesville, but we will continue this next Monday...

No comments:

Post a Comment