2
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ You might actually be able to dump ppm format directly with fwrite and then just open that in an image viewer. \$\endgroup\$ Commented Nov 20, 2016 at 5:14
  • \$\begingroup\$ @alex.forencich quite possibly, yes. I didn't know about ppm, the simplest I could think of was bmp but that you have to generate line counts and other formatting so I figured dumping the raw data was simpler, but ppm seems like a nice simple image format. \$\endgroup\$ Commented Nov 20, 2016 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.