Jump to content
  • 0

Block Ram to VGA Display


hilarikas

Question

6 answers to this question

Recommended Posts

make a simple VGA scan logic, takiing care of the sychronization and then output RGB value. 

since your image is not some standard resulution, can you make your image 800x600 and put the image in the center? you can use fifo to fill it.

Link to comment
Share on other sites

Hilarikas,

Have you decided how your devices will interact with each other on chip?  All of my code uses a wishbone bus, so as a result anything that can interface with the bus can interface with my memory.  Other folks in this forum tend to use an AXI bus.  You can find the memory code I use (Verilog) here that interacts with the wishbone bus.

Realistically, what you really probably want are the demo files that Xilinx offers for interacting with block RAM.  I find their white paper "HDL Coding Practices to Accelerate Design Performance" quite useful.  On page 11 you can see several examples, both in VHDL and Verilog, of how they recommend you interact with block RAM.  If your code matches their templates, it will use block RAM.

Dan

 

Link to comment
Share on other sites

Hello,

In order to display your pixels on the screen, you should interogate your horizontal address (HA) and vertical address (VA). If your address is the same as your wanted displayed pixel then you should send the pixel to VGA. 

For example, if you want to display the BRAM data between X and X + 99 for Horizontal and Y and Y +  99 for Vertical, then you should interrogate your HA and VA. If HA = X and VA = Y then you should send to VGA the BRAM data from address (0,0), if HA = X + 1 and VA = Y => BRAM address = (0,1) and so on.

Cristian

Link to comment
Share on other sites

Christian,

Hilarikas would like to display a 100x100 pixel image, IIRC.  (Please feel free to correct me if wrong ...)  The difficult part of your approach is what happens when you wish to calculate the address for (1,0) in your scheme.  If you find yourself using a multiply, you are working too hard.

As an alternative, the pixel memory address could be reset at the beginning of every video frame, and incremented for every pixel output.  The logic then looks like:

always @(posedge i_clk)
  if (new_frame)
    pixel_address <= first_address;
  else if (the_pixel_being_drawn_is_an_image_pixel)
    pixel_address <= pixel_address + 1;

Of course, it'll need to be offset for proper pipelining and such, but that's the general idea and concept.  It's actually really easy--once you can identify the new frame and which pixels are being drawn on each frame.

Dan

Link to comment
Share on other sites

Hi,

The easiest way to implement a VGA component is to use 2 counters, one for Horizontal and one for Vertical scanning. The output signals for the VGA component should be also the HA and VA. That means that you know the current VGA address. You can find a VGA component, in VHDL, in attachment. The resolution for this component is 640x480 pixels but you can change this if you are using the correct timing. Please see link

Cristian

vga.vhd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...