4
Image/Video Processing on Xilinx FPGA Tutorial Created by: Mostofa Noor | [email protected] | 2010/03/04 | v1.0 1 1. Load the reference design located at: C:\Xilinx\10.1\DSP_Tools\sysgen\examles\shared_memory\hardware_cosim\conv5x5\conv5x5_ video_ex.mdl and double click on the System Generator block. 2. Change the option for Compilation to your board’s name under Hardware CoSimulation 3. Choose the interfacing method available for your board, for example: Ethernet > PointtoPoint or JTAG or PCI and USB. Ethernet is the fastest, not sure about PCI.. 4. Change the Target directory to ./hwcosim (this is where all the compiled files will be stored for Hardware CoSimulation purposes, especially the generator model for the HWCoSim library

Image Video Processing Tutorial 1 0

Embed Size (px)

DESCRIPTION

Image Video Processing Tutorial 1 0

Citation preview

Page 1: Image Video Processing Tutorial 1 0

Image/Video Processing on Xilinx FPGA Tutorial  

Created by: Mostofa Noor | [email protected] | 2010/03/04 | v1.0  

1. Load the reference design located at: 

C:\Xilinx\10.1\DSP_Tools\sysgen\examles\shared_memory\hardware_cosim\conv5x5\conv5x5_

video_ex.mdl and double click on the System Generator block. 

 2. Change the option for Compilation to your board’s name under Hardware Co‐Simulation  

 3. Choose the interfacing method available for your board, for example: Ethernet ‐> Point‐to‐Point 

or JTAG or PCI and USB.  Ethernet is the fastest, not sure about PCI..  

4. Change the Target directory to ./hwcosim  (this is where all the compiled files will be stored for 

Hardware Co‐Simulation purposes, especially the generator model for the HW‐CoSim library 

Page 2: Image Video Processing Tutorial 1 0

Image/Video Processing on Xilinx FPGA Tutorial  

Created by: Mostofa Noor | [email protected] | 2010/03/04 | v1.0  

block, the directory name can be anything, just change the default ./netlist to something else 

that does not exist, or else you may get errors during compilation.) 

5. Then click the Generate button to start the compilation process of the hardware.  Since this is an 

unmodified reference design, there should not be any errors during the long compilation 

process.   

6. When completed, there should pop up a Simulink window with the generated (grey colored) 

HW‐CoSim block for your design.   

 7. Load the testbench model file: conv5x5_video_testbench.mdl.  This file is the top level module 

which will provide stimulus to the inputs of your design from Matlab Workspace variables or 

Simulink Sources like Signal Generators, for this model it will be a structure variable in Matlab 

Workspace that will be loaded by the PreLoad function model described at a later step. 

 8. Double‐Click on the FPGA Processing block, there should already be a JTAG Co‐sim block 

instantiated there, select and delete that.  

9. Drag your Co‐Sim block that you generated to the Testbench/FPGA Processing window and 

place it on the light blue placement marker and make sure the gain and offset inputs are 

connected.   

Page 3: Image Video Processing Tutorial 1 0

Image/Video Processing on Xilinx FPGA Tutorial  

Created by: Mostofa Noor | [email protected] | 2010/03/04 | v1.0  

 10. Right‐Click on the Co‐Sim block and click on Block Properties to change the Priority value to 2.  

This is to properly prioritize the runtime block priorities, the Shared Memory Write black has 

first priority, then your HW‐CoSim block is second priority, and then the Shared Memory Read 

block is 3rd priority.   

 11. Then Double‐Click on the HW‐CoSim block, under the Basic tab, change the Clocking option to 

Free running.  This allows the FPGA to run at its fastest speed, which is necessary for real‐time 

simulation.   

12. Next, if you are doing Point‐to‐Point Ethernet HW‐CoSim, in the Ethernet tab, change the Host 

interface to your configured Ethernet adapter.  Your Ethernet adapter should be configured to 

the settings and IP address (192.168.8.2) shown on the User’s Guide for System Generator.  Also 

Winpcap should be installed (found at www.winpcap.org) to allow straight data I/O via Ethernet 

and bypassing the TCP/UDP packet processing overhead.  Make sure you choose the correct 

Page 4: Image Video Processing Tutorial 1 0

Image/Video Processing on Xilinx FPGA Tutorial  

Created by: Mostofa Noor | [email protected] | 2010/03/04 | v1.0  

Ethernet port that you have configured if you have more than one Ethernet ports by verifying 

the MAC address.   

 13. In the Configuration tab, choose your configuration interface, Parallel Cable IV, Platform USB, 

etc.  This interface will be used to download the bitstream and program the FPGA.  Note that 

Parallel JTAG or USB JTAG interface can also be used for runtime data I/O at slower speed than 

Ethernet. 

 14. Click OK to close the configuration window.  Now your testbench is ready to run.  Click on the 

play button on top of the testbench toolbar.  Make sure you turn on your board and connect the 

JTAG and Ethernet cables.  If you get an error saying, “Error evaluating parameter 

‘VariableName’ in ‘conv..’ Undefined function or variable ‘img’.” That means the preload 

function was not run, just load and run conv5x5_video_testbench_PreloadFcn.m script to load 

the variables into the Matlab Workspace and then run your testbench again.