• 0

Block Ram to VGA Display


Question

6 answers to this question

Recommended Posts

  • 0

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 post
Share on other sites
  • 0

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 post
Share on other sites
  • 0

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 post
Share on other sites
  • 0

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 post
Share on other sites
  • 0

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

Edited by cristian.ignat
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now