Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

ModelSim testbench for an 'image processing' task

Altera_Forum
Honored Contributor II
1,481 Views

I have used a verilog script that does a Sobel edge detection (see attached folder - Sobel_DE2_Cam.v and a few Megawizard generated files) by running it on a video stream coming from a camera attached to my DE2 board, and 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' after clicking Simulate Sobel_DE2_Cam.  

 

My input is a 10-bit value, out of which I will pick up the top 8 bits (in_data[9:2]). The 10-bit thing was because of the VGA but really I just need 8-bit values, i.e unsigned integer values 0-255. 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? 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 if there are any generic ways of simulating an image processing task in modelsim/verilog, please send links to them. 

 

Thanks
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
698 Views

hi for this program how to assign the pins in verilog altera DE2 kit....

0 Kudos
Reply