Verilog VPI (Verilog Procedural Interface) For Image Processing HDL simulation

Robert J. Woodworth

The Verilog VPI is a C-Programming interface to the Verilog HDL (Hardware Description Language). It essentially allows you to write your own Verilog simulator system calls using C/C++.

The VPI modules described here are designed for image processing utilizing the Intel OpenCV libraries. Two modules are provided and fully described. With these modules, one could easily build an image processing system in Verilog and simulate image processing algorithms with real images.

It is not necessary to be familiar with the OpenCV libraries to use these Verilog VPI modules. However, OpenCV can be very useful for developing image processing algorithms and using these modules as a starting point, you can develop your own VPI libraries with OpenCV for Verilog behavioral simulation.

For more information on Intel’s OpenSource Computer Vision Libraries go to the official website:
http://www.intel.com/technology/computing/mtl/index.htm

Official OpenCV Wiki at:
http://opencvlibrary.sourceforge.net

 

Two Verilog modules are included here

  1. An image sensor module, to read a standard image file such as a JPEG or any image file type your OpenCV system can read.

    This module contains one Verilog file sensor.v with one module sensor() and a VPI-C/C++ shared library imageSensor.cpp to be compiled for the simulator.

  2. An image display module, to display on your screen an image that your Verilog has processed.

    This module contains a VPI-C/C++ shared library imageDisplay.cpp to be compiled for the simulator. It will act (in a simple way) like a monochrome VGA type display requiring HSYNC, VSYNC and 8-bit pixel data.

Also included, is a top level testbench Verilog module. This module will allow for a complete simulation to be run so that you can see how these modules work together. The top.v module will instantiate the sensor() Verilog module, provide a system pixel clock and pipe the pixels to the display module. The display module will use the OpenCV GUI tools to display the image on your screen.

Gimme The Code!

HOWTO: