Video Processing Using VHDL and ZYBO Board

(Last Updated On: March 10, 2018)

Here I will explain, how to create a starting project for video processing using the FPGA and VHDL language in Vivado. This is a continuation of the post: “Video Processing with Zybo using the FPGA“, where I explain a bit the basics and background of this project.

C:\Users\Alberto\AppData\Local\Microsoft\Windows\INetCache\Content.Word\DSC00604.jpg

Sorry for the size of some of the images, this tutorial was before in instructables (because of regulations of a design-contest) and now move-back to my web-site. I have to re-update all the original pictures I should have somewhere…

Step 1: Create a New Vivado Project

After opening Vivado, first you need to create a new project on your workspace you want to work in.

Later name your project and choose the project location.

Choose Zybo as a target board or another Zynq board you want to use.

Step 2: Create a Block Diagram With Basic

Add a new Zynq_Processing_system diagram. Clicking on the block properties you can delete the AXI GPO interface and set the clock output of the PS to 200 MHz.

Also add the IPs from Digilent Dvi2rgb and rgb2vga and connect them like the last picture

Resuming: The block diagram shown in the Picture was made to interconnect different modules. The following main IPs were inserted

  • Dvi2rgb: It converts the HDMI input into RGB raw video. From Digilent library.
  • Rgb2vga: it converts the raw video into VGA output. From Digilent library.
  • Processing_system7: This is an special block, that contains the configuration of the processing system of the Zynq. In this case only the clock output signal will be used from the processing unit.
  • VideoProcessing: A self-made VHDL block. Here the user-application code should be inserted and modified. (Explaination on the next step)

Additional to these blocks two constants are used to configure the HDMI port as a sink.

Step 3: Insert a VHDL Resource

Now the user application block should be created, or imported. Therefore press ctrl+A or right click on the sources and select “add sources”.add a new source file.

Create a new file with VHDL with some name, for example VideoProcessing.

Here Vivado ask you to insert the input and output of your block. This can be defined later, but it is good to create at least one input in order to Vivado recognize it as a block and let you instanciate without modifying. The inputs and outputs can be always modified later on the VHDL file.

After that the new module can be on the block diagram instanciated. Right click on the empty diagram and select “add Module…”

One the module is instanciated, pressing the key F7 you can edit the VDHL code.

Step 4: Add Additional Onboard Perifericals Like Leds, Buttons or Sliders (optional)

To include some complementary options the sliders, buttons and leds are routed to the application block. The new block diagram should look like the picture.

Step 5: Now You Can Insert Your VHDL Code on the Application Block

Once added the VideoProcessing module, pressing F7 (or searching it on the sources) you can edit the code. An example of a minimal code can be found on the attached module.

 Download the full code here: VHDL-minimal-code

    Step 6: Create a Wrap

    Create a new wrap before synthetise the block diagram.

    Step 7: Synthesis, Implementation and Bitstream Generation

    Add the constraints file attached.

    Now you can run the synthesis and when it finalices without errors, you can open the synthetized design and check if all the pins are connected right, specially if you named the output pins differently.

    Then run the implementation and after that generate the bitstream.

     Download the pin descriptions file: pin_descriptions.xdc

      Step 8: Export Hardware and Launch SDK

      Export the Hardware as shown in the pictures and launch SDK.

      Step 9: Create a New Board Support Package and a New Application

      Now create a board support package as the pictures show.

      After that make a new application as a hello word template.

      Program the FPGA and run (or debug) the hello word example

      Step 10: Program FPGA and Run the Hello World Code

      https://www.youtube.com/watch?v=s6YoaqllQ4U

      In this small example, the color channels are exchanged. Now the blue input is green and so on.

      If problems let me know and see what we can improve.

      Leave a Reply

      Your email address will not be published. Required fields are marked *

      Scroll to top