samviva72
Newbie level 5

I started learning verilog and FPGA a few weeks ago and I have used a verilog script that does a Sobel edge detection by running it on a video stream coming from a camera attached to my development board. The code worked fine as I can see the edges being picked up on the VGA display. I didn't simulate it before-hand because I found these verilog files online from another working project. But now I want to learn how to do it the proper way, i.e. simulate prior to testing on hardware. So following ModelSim tutorials, I reached upto the stage of 'Objects Window'.
Now as my input is an image of size 640 x 480, I don't think I can enter these 307,200 values one by one (unless I have a lot of time to waste). Could someone please guide me on how to write a testbench for my purpose? The header of my code is as follows:
Is it possible to have the input data saved in a text file and then use some sort of 'read' command in the testbench? Or are any generic ways of simulating an image processing task in modelsim/verilog? I would appreciate any help, advice or code on how to achieve this.
Thanks.
Now as my input is an image of size 640 x 480, I don't think I can enter these 307,200 values one by one (unless I have a lot of time to waste). Could someone please guide me on how to write a testbench for my purpose? The header of my code is as follows:
Code:
module sobel_operator_eight_bit (clk, reset, data_in, data_en,data_out);
input clk;
input reset;
input [7:0] data_in;
input data_en;
output [7:0] data_out;
Is it possible to have the input data saved in a text file and then use some sort of 'read' command in the testbench? Or are any generic ways of simulating an image processing task in modelsim/verilog? I would appreciate any help, advice or code on how to achieve this.
Thanks.