Problem accessing SDRAM memory from VHDL code

Guest #7218454
Rate this post
• ▲ useful
▼ not useful
Hello everyone,

I am currently working on a FPGA system where a VGA controller is feeded 
with pixel data using a section of the SDRAM memory of a Nios II/e 
system. This should give the ability to flush pixel data in C. I am 
however, stuck on one problem. Whenever I try to increase the memory 
address used for addressing in VHDL the memory_out data does not seem to 
change.

The VHDL code should constantly loop through the memory and send the 
data of the pixels into the VGA controller.

The code is pretty big so I have attached it as a vhdl file.

This is the C code running on the Nios:
1
int main(void) {
2
u8* addr = MEMORY_BASE; //Starting point of the video buffer
3
  *addr = 255;
4
*(addr+1) = 0;
5
*(addr+2) = 0;
6
*(addr+3) = 255;
7

8
while(1){}
9
}
I have also attached a picture of the the screen looks like when using 
this setup.

As is visible in the picture, the pixels on the screen keep having the 
same pattern of the first 4 pixels that are set in the C code: white, 
black, black, white. I suspect that the memory is not properly adjusting 
to the change of the frame_buf_addr in the VHDL code.

Does anyone know any solutions to this problem? This is for my first 
VHDL course so my apologies for any uncertainties or mistakes!

Thank!
Attached files:

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.