FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6056 Discussions

SDRAM Controller - Problems with reading

Altera_Forum
Honored Contributor II
858 Views

Hi,  

 

I have used the SDRAM Controller in SOPC. Now that I am working with the real hardware, I cannot get any data, other than 0x"FFF..F" from my SDRAM.  

 

When simulating with ModelSim, everything works fine.  

I already synchronized in the wait_request signal and the data coming from the SDRAM, but still it won't work.  

 

Thanks for your help! 

 

With kind regards,  

Ahmet
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
104 Views

First off, I'd stick a scope on the signals to the SDRAM, and check they are doing something sane. 

 

You should be able to see the clk running, and the various control signals moving around. 

 

The DQ signals should be moving too. On DDR memory at least you can see which end is driving them because the FPGA tends to have a stronger drive strength than the memory. That will tell you if the read commands are getting to the memory.
Altera_Forum
Honored Contributor II
104 Views

Hi Cajun,  

 

I am already watching several of my own signals and the wait_request coming from the SDRAM Controller.  

I think it's a good idea to watch the SDRAM Controller signals too.  

 

Let me try it. 

 

Kind regards, 

Ahmet
Altera_Forum
Honored Contributor II
104 Views

Hi @ All,  

 

now it looks as if I can read from the SDRAM. But the read_data is always the same as the write_data. => I think it still doesn't read the SDRAM. 

 

The DQ signals are changing. 

 

PS: I had to use the evaluation board to get read_data, as our board also doesn't work. :-(
Altera_Forum
Honored Contributor II
104 Views

After removing the SDRAM component from the board I discovered that I get the same results from the board, even if the SDRAM is missing.  

 

Does anybody know how I can solve the problems reading the SDRAM? 

 

Thanks a lot! 

Ahmet
Altera_Forum
Honored Contributor II
104 Views

Ahmet, I would first write data and then try to read back from the same location. 

 

Are you using Altera's DDR Megafunction? If you are -- they include an example driver with it. I would try to see if that works before anything else.
Altera_Forum
Honored Contributor II
104 Views

I still recommend sticking a scope on all the pins of the SDRAM and checking them against what you are seeing in simulation. 

 

If you don't have access to a quick enough scope, one solution is to start with a working design (easy in the case of the Altera dev. boards) and slowly morph it into your design.
Altera_Forum
Honored Contributor II
104 Views

@ Kitty: It's not a DDRx SDRAM Controller that I used. It's just the SDRAM Controller from SOPC (lowest in list).  

 

I also think it is a good idea to get a working example. Anybody knows where to find some?
Altera_Forum
Honored Contributor II
104 Views

There are no suitable reference designs for SDRAM Controllers. They are either in Verilog (I need VHDL), or I can't see any codes and it does not compile.  

 

When I just write a single address and read it out, it looks good. But when I write about 12 addresses and try reading out, I just get FFF.. instead of the data.  

My code is attached, in case you want to have a look at it (for several read/write cycles).  

 

Next think I want to try is checking the timing, try only 12.5MHz clock and reading the SDRAM Controller Documentation. 

 

What else can I do? Where can I find a working design with an SOPC SDRAM Controller in VHDL? 

 

Thanks in advance!
Altera_Forum
Honored Contributor II
104 Views

Hey,  

 

it worked with half the clock frequency (=> 12.5 MHz). :D 

 

Actually I need 50 MHz, but that's another thing.  

 

Yippiii!
Reply