Raycasting is a computer graphics technique that involves projecting rays from a viewpoint through each pixel of a 2D screen into a 3D scene. This can be used to quickly calculate pixel color and segment sizes, resulting in a render of 3D objects.

I built a raycasting engine using SystemVerilog and ran it on a Spartan-7 FPGA (Field-Programmable Gate Array). Hardware Description Language (HDL), like SystemVerilog, allows for the creation of programmable hardware functions on FPGAs, which I used to create efficient modules that worked together to process I/O and run the raycasting engine itself.

The heart of the engine was a MicroBlaze processor IP, loaded with custom C code via Xilinx Vitis HLS. I then used several custom hardware modules to feed keyboard input from a MAX3421E chip into the processor, and to smoothly output the generated video data. These modules included a double frame buffer, a VGA to HDMI converter, as well as a module to render the generated image segments.

SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver/Transmitter), I2C (Inter-Integrated Circuit), and AXI (Advanced eXtensible Interface) communication protocols were critical to this project. AXI was used to connect IP modules, UART for the keybord input, SPI for communication with the MicroBlaze processor, and I2C for components such as the frame buffer. This project helped develop my skills regarding HDL design decisions, particularly with respect to communication protocols.

I also gained familiarity with SystemVerilog and Xilinx Vivado, including debugging with an ILA core and the Debug Wizard.

Source code can be found at https://github.com/AdityaVersion34/ECE385_FinalProject/tree/main/raycaster_final_v1

Posted in

Leave a comment