Behavioral Simulation of Convolution of Image using a Kernel
This repository contains the implementation of an image inversion algorithm using Verilog. The image inversion process involves flipping the color values of the pixels in an image, resulting in a negative version of the original image. This can be particularly useful in various image processing applications and analysis.
The repository includes the following files:
-
Verilog Files
top.v
: The top-level module for the image inversion algorithm. It integrates all the other modules and defines the overall structure of the design.tb.v
: The testbench for verifying the functionality of the image inversion algorithm. It provides the necessary stimuli and checks the output against expected results.controller.v
: The controller module responsible for managing the data flow and control signals between the various components of the design.cov_inversion.v
: The core module that performs the actual image inversion. It processes the input image data and produces the inverted output.rowbuffer.v
: The row buffer module used for temporarily storing rows of image data during processing.
-
Image Files
- Input image file(s): The original image(s) to be processed. These files should be in a compatible format that the Verilog modules can read.
- Output image file(s): The resulting image(s) after the inversion process. These files will be generated by the simulation and stored for comparison with the input images.
This repository contains the Verilog design and simulation files for performing a behavioral simulation of an image convolution using a kernel. The project uses FIFO and AXI streaming to process the image data. The design performs pixel inversion as part of the exercise.
This project provides step-by-step instructions for performing a Verilog behavioral simulation on a BMP image. The required design source files perform the image pixel inversion using an inversion operation.
- Create a new project in your preferred Verilog simulation tool.
- Upload the provided Verilog design files to the project.
- From the IP-Catalog (in Project Manager), search for
FIFO Generator
as shown in Figure 1, and double-click on the FIFO Generator to select it. - Change the component name to
FIFO
. Select theAXI Stream
option. - Configure the AXI4-Stream ports by setting
TDATA NUM BYTES
to 1 and all other ports to 0, as illustrated in Figure 3. - Navigate to the
Config
menu, set theFIFO Depth
to 16 (minimum), and configure theData Threshold Parameters
to `Single Programmable Full Threshold Constant. - Click
OK
, and when the pop-up window appears, selectGenerate
to create the FIFO.
- Upload the provided testbench file
tb.v
to the project. - Go to the directory containing your project and navigate to the path:
projectname.sim/sim1/behav/xsim/
. - Place the input
image.bmp
file in this directory. - In Vivado, select
Run Simulation
→Run Behavioral Simulation
. - After running the simulation, an output
image.bmp
will be generated and stored in the same directory.
-
You can verify the output image using Python, which generates the expected output image.
-
The hardware implementation will produce an output image. You can compare both results for verification.
-
Check Output: After the simulation completes, check the generated output image file(s) and compare them with the input image to verify the inversion process.