Getting Started with VGA on the Virtex-II Pro Development Board

 by Ian Chan and Kevin Au

What you need:

 

Hooking up the board:


Procedure:

  1. Extract the bitvga-v2p.zip file to a folder of your choosing.
  2. Open the Xilinx ISE 10.1. (Project Navigator)
  3. Click File, Open Project and navigate to the folder that you extracted bitvga-v2p to. Open the VGA_demo.ise.
  4. The first thing you see is a prompt to update your code. Don't worry, it works once its updated. The prompt should look like this:
  5. After your project has loaded, which may take some time, it should look like this:
  6. Now we have to configure the connection to the FPGA, because the computer right now does not know where the device we want to program is.
    1. Open the configure target dropdown.
    2. Right-click the Manage Configuration Device.
    3. Select "Open Without Updating".
  7. Once this loads, it asks how you want to tell the navigator where the device is. Since the default is the option we want, (Boundary-scan), click Finish.
  8. A prompt will appear to ask you to assign a configuration file. Click bypass as we will not be using this part of the hardware for this demo.
  9. Click bypass again.
  10. Now we have the option to assign a configuration file for a device we will use. Select main.bit, and click open.
  11. A prompt will appear to allow you to select other files to go along with this configuration file, but it doesn't matter for this. Click OK.
  12. Now we have the chance to set some options, which we don't care about. Click OK.
  13. Now we want to recompile a new configuration file.
    1. Click processes (outlined in red.)
    2. Double-click Generate Programming File (outlined in blue.) This step takes a LONG time. Roughly 10-20 minutes on the lab machines. Go get a drink.
    3. Then click Boundary Scan (outlined in green.) This ensures we are in the right screen to program the device (finally.)
  14. Right-click xc2vp30, and click Program.
  15. Finally, a prompt appears to inform you that the configuration file has been edited, and that you may wants to reload it. (Modified in ISE is outside of iMPACT...) Click Yes.
  16. Now you should have the VGA demo displaying on your LCD screen or projector.

General Overview

There are 4 major modules, included in the MAIN.v verilog file: CLOCK_GEN, SVGA_TIMING_GENERATION, COLOR_BARS, VIDEO_OUT.

Clock_gen creates the pixel clock based on the system clock, and created a buffered systemclock so everything knows how quickly the system is going.
    -A pixel clock is also referred to as a dot clock. This determines how often a pixel or a dot is drawn on a screen.
SVGA_TIMING_GENERATION instructs the VIDEO_OUT module how to synchronize the colour data it is getting. Essentially, it tells the VIDEO_OUT how big of a screen to draw.
COLOR_BARS is the module created for the purpose of drawing the coloured bars for the video by the creators of this demo. It feeds the colour for a pixel it wants (8-bits for each colour) into video ram (seperated into three parts, red, green and blue). The video ram stores the 3 bytes of colour at an address based on position, so that each pixel has 3 bytes of ram for its colour.
The VIDEO_OUT module basically takes that colour data from the VIDEO_RAM whenever it needs to draw another pixel, which is regulated by the pixel clock.

Our code, which is included below, switched out COLOR_BARS for a SCREEN_BUFFER module, that creates a 2D array (for each of the three colours). Rather than drawing the colour based on position, like in COLOR_BARS, it stores the screen we want drawn into a screen buffer (the 2D array), and then generates the pixel colour based on the pixel position when it is needed.

 

Other Information:

Link to our code: Download


Verilog Notes: