Hazard3-Doom
Doom running on the Hazard3 RISC-V CPU in an ECP5 FPGA - and a hands-on playground for learning how processors, FPGA logic, memory, video, firmware, and software fit together.
Hazard3-Doom is more than just Doom running on another FPGA board. It is an educational hardware and software ecosystem built around the open-source Hazard3 RISC-V processor and the ULX3S and ULX4M ECP5 FPGA families.
The same Hazard3 CPU used in Raspberry Pi RP2350
Hazard3 is not a one-off processor created for this project. Raspberry Pi’s RP2350 microcontroller contains a pair of open-hardware Hazard3 RISC-V cores, selectable in place of its Arm Cortex-M33 pair, and RP2350 powers the Raspberry Pi Pico 2 family. Hazard3-Doom synthesizes that same open-source Hazard3 processor architecture into the ECP5 FPGA.
The processor configuration is not identical: RP2350 and Hazard3-Doom enable different optional Hazard3 features and ISA extensions for their respective SoCs. The common CPU lineage and RTL make Hazard3-Doom a useful way to study the processor architecture in a system you can rebuild and modify.
The project brings together C and Verilog examples, FPGA board designs, HDMI video and framebuffer support, external memory controllers, SD card access, UART and JTAG debugging, a resident boot monitor, host-side upload tools, and a loadable DoomGeneric application.
You can use Hazard3-Doom simply to play Doom on a RISC-V soft CPU, or dig deeper into the system to see how a complete FPGA-based computer is built. Explore processor integration, memory interfaces, clocking and timing, video generation, peripherals, boot and upload mechanisms, debugging tools, and the boundary between hardware and software.
Whether you are experimenting with RISC-V, learning Verilog, exploring FPGA development, or just curious about what it takes to make Doom run on hardware you can inspect and modify from top to bottom, Hazard3-Doom is designed to give you plenty to explore.
Note
These pages describe the selected documentation version. Features that are still evolving are called out explicitly. The detailed processor architecture pages are additionally anchored to the exact Hazard3 source snapshot named in Hazard3 RISC-V Processor.
Start here
About Hazard3-Doom - understand what the project is, what it teaches, and why ULX4M is useful for modular prototyping.
Quick Start - get a board running with the minimum number of steps.
Building Hazard3-Doom - build the FPGA, resident monitor, and Doom image.
Tiny Tapeout FPGA Builds on ULX3S - build Tiny Tapeout projects for ULX3S ECP5 locally or in GitHub Actions.
ULX4M Hardware Guide - explore the ULX4M board itself: FPGA, clocks, SDR/DDR3, flash, video, SD, SerDes, pin constraints, and revisions.
ECP5 Timing and Seed Sweeps - run local/GitHub ECP5 seed sweeps and interpret live timing results.
Web Device Tool - use the browser device tool for UART, FPGA programming, console firmware loading, H3D/IWAD upload, and screen snip.
FPGA WebUSB Flasher - detailed ULX3S FPGA SRAM programming with WebUSB.
micro-SD Cold Boot - configure standalone cold boot from micro-SD.
I2CDriver HDMI Interface - scan and inspect the SAO I2C bus on HDMI.
JTAG Debugging - debug Hazard3 through OpenOCD/GDB or VisualGDB.
Hazard3 RISC-V Processor - learn the Hazard3 RISC-V processor, pipeline, ISA configuration, CSRs, buses, and debug architecture.
System Architecture - understand how the FPGA, monitor, SDRAM, HDMI, SD, SAO, and ESP32 pieces fit together.
Project Overview
Getting Started
User Guide
Architecture
Reference
- Reference
- Frequently Asked Questions
- ULX3S Board Not Recognized
- Blank HDMI Display
- “monitor” command not supported by this target.
- You can’t do that when your target is
exec - Web Serial reports no compatible devices, but Windows sees my COM port. What should I try first?
- Can OpenOCD use WinUSB on the ULX3S?
- Why does the FPGA WebUSB flasher need WinUSB on Windows?
- Troubleshooting
- WebUSB flasher reports
USBDevice.open(): Access denied - WebUSB flasher reports an unrecognized JTAG ID
- WebUSB flasher reports an FPGA image target mismatch
- Web Serial picker says no compatible devices found
- Doom upload times out
- SD card mounts but files are not found
- SD becomes unreliable when ESP32 firmware runs
- SAO scan finds some devices but not others
i2c guiis reported as an unknown command- I2C GUI scan finds a device but logical trace is blank
- I2C GUI remains on HDMI after exit
- OpenOCD cannot see a working Hazard3 debug module
- ULX4M-LD reports external-memory TIMEOUT
- Build suddenly changes because of submodules
- WebUSB flasher reports
- Contributing Documentation
Project links
Hazard3-libfpga form on ulx-doom branch <https://github.com/ulx3s/Hazard3-libfpga/tree/ulx-doom> _
Hazard3-libfpga upstream <https://github.com/Wren6991/libfpga> _