Wesley Stevens
← Back

Frogger on FPGA: A Verilog Game Engine (DE1-SoC)

A Verilog implementation of Frogger, rendered and played live on an LED matrix dev board.

E E 2712026VerilogModelSim

Overview

A recreation of the classic arcade game Frogger (similar to Crossy Road), written in SystemVerilog and run on a DE1-SoC FPGA board with a 16×16 bi-color LED matrix: the player guides a green frog across lanes of moving red cars using the board's four push buttons. The design was built and compiled in Intel Quartus Prime and verified with ModelSim testbenches before running on hardware. Instead of running as software on a processor, all of the game logic (movement, car traffic, collision detection, and win/loss states) is implemented directly as digital hardware that updates in real time.

How It Works

The four KEY buttons feed User Input modules that turn each press into a
          single move, while a Cars module shifts the red cars along on a ~3 Hz tick. The
          top-level Frogger state machine (play, win, lose) combines both into red and green
          pixel data for the LED matrix and a WIN/LOSE message on the HEX displays.
The four KEY buttons feed User Input modules that turn each press into a single move, while a Cars module shifts the red cars along on a ~3 Hz tick. The top-level Frogger state machine (play, win, lose) combines both into red and green pixel data for the LED matrix and a WIN/LOSE message on the HEX displays.

Implementation

Quartus Prime

The SystemVerilog project in Intel Quartus Prime, fully compiled for the
              DE1-SoC with 0 errors and 0 warnings.
The SystemVerilog project in Intel Quartus Prime, fully compiled for the DE1-SoC with 0 errors and 0 warnings.

ModelSim

A ModelSim testbench waveform showing button presses (KEY) driving the
              frog's movement and the red/green pixel and HEX display outputs.
A ModelSim testbench waveform showing button presses (KEY) driving the frog's movement and the red/green pixel and HEX display outputs.

Demo

Win condition

The frog reaches the far side: the board fills green and the HEX displays show WIN.

Loss condition

A car hits the frog: the board fills red and the HEX displays show LOSE.

Future Improvements

  • One improvement that could be made would be to add levels of difficulty, where the speed of the cars increases depending on the position of the switches on the DE1-SoC board. A further improvement of this implementation would be to make the cars in different lanes move at different speeds, which would make the game more challenging and less predictable. I unfortunately no longer have access to this board so I can't improve upon it, but if I had the time to improve upon this project, that is where I would start.