Electronic – Verilog VGA simulation

fpgaverilogvga

I am new to FPGA development and to verilog and I am currently working on a project that involves outputting stuff to the screen via VGA port. I only get access to actual FPGA board when I am in class but I like coding when I am at home as well. I was looking for an easy way to test the VGA output but I could not find anything suitable for verilog. Could someone please let me know how can I test my VGA output of my verilog program in simulation?

Thank you.

Best Answer

I'm not sure of any off the shelf test benches for what you want, and generally if there was one it would be expensive IP - somebody, most likely working for a company, would have to have made it.

In terms of what you could do, the best bet would be to write your own test bench to observe the control signals and save the raw RGB data output for each frame to a file. You can relatively easily write a test bench with a couple of counters synchronised with the Vsync/Hsync signals which for each valid pixel save the RGB data in a raw format (see $fwrite which is a Verilog file writing function).

With the saved RGB data, you can view it using either software like MATLAB, or online viewers such as this website. Alternatively you could save the data in ppm image format directly from the testbench as @alex.forencich suggested in the comments which is a nice simple image format.

While not ideal, this should provide a quick way to verify that the RGB data you are generating makes sense. I presume that what you want to test is that if code generating pixel data and feeding a VGA core of some description is feeding the correct data while you don't have hardware. If you are also working in class you will I presume have already been able to verify that the signal generation (VSync/HSync timings, data alignment, etc.) are working, so you can use that to set up and verify a test bench.