Hourly ·
Students Build a Custom CPU From Scratch, Port DOOM to Run at 20 FPS
Armaan Gomes and a friend designed a pipelined RISC-V CPU with DDR3 memory, cache, and VGA output on an FPGA — then ported the classic 1993 shooter DOOM to it. Starting at 0.7 frames per second, they optimized through clock bumps, instruction additions, and compiler tricks to achieve a playable 15-20 FPS. A 9-second demo video racked up 2 million views on Instagram.
Two undergraduate students have demonstrated that the legendary challenge of running DOOM on anything now includes hardware built from the ground up.
Armaan Gomes and his collaborator Liam designed a custom 5-stage pipelined RISC-V CPU at the logic-gate level, implementing instruction fetch, decode, register read, execute, and writeback stages on an FPGA. They added a DDR3 memory controller with two independent caches (instruction and data), a memory arbiter to prevent deadlocks, and a VGA controller for video output — all in hardware description language.
The CPU started with just 1 MB of FPGA Block RAM, but DOOM's shareware WAD file alone is 14 MB. The team integrated off-chip DDR3 memory, implemented a direct-mapped cache with 2,048 lines, and built clock-domain crossing bridges to make it all work on real silicon.
Porting DOOM was a brutal debugging experience. The game would crash in hardware but not in simulation. After days of head-scratching, they discovered the culprit: uninitialized DDR3 memory contained random values, while the simulation assumed zeroed-out RAM. DOOM's code was making assumptions about memory state that held in sim but broke on the real FPGA.
Starting at a slideshow-like 0.7 FPS, the pair methodically optimized their way up: bumping the clock from 100 MHz to 125 MHz (+20%), fixing an inefficient fetch stage (3× improvement), adding hardware multiplication instructions, and switching from a buffered framebuffer to direct VGA writes. The biggest win came from enabling compiler optimizations — but only after discovering they'd forgotten to mark a memory-mapped I/O pointer as volatile, causing the compiler to optimize away the hardware timer entirely.
The final result: DOOM running at a smooth 15-20 FPS on a homebrew CPU, with out-of-order execution planned next. The team posted a 9-second clip to Instagram that hit 2 million views. Commenters on Hacker News praised the deep systems engineering on display, with several noting it as one of the cleanest "DOOM on X" projects in recent memory.
Sources: Armaan Gomes Blog Hacker News Discussion
学生从零构建定制CPU,并将DOOM移植至每秒运行20帧
阿玛南·戈梅斯和他的一个朋友在FPGA上设计了一个流水线RISC-V CPU,集成DDR3内存[K 、缓存和VGA输出;然后将经典1993年的射击游戏DOOM移植到上面。从每秒0.7帧开始,[K 他们通过时钟调整、指令添加和编译器技巧优化到了可玩的15-20 FPS。一个9秒的演示[K 视频在Instagram上积累了2百万观看量。
← Hourlies Hourly · 2026-07-21 12:00 UTC 学生自建从零的定制CPU,将DOOM移植[K 至每秒运行20帧 Armaan Gomes 和一个朋友在 FPGA 上设计了一个带有 DDR3 内存、缓[K 存和 VGA 输出的有流水线 RISC-V CPU;然后将经典 1993 年的射击游戏 DOOM 转移到[K 该系统上。从每秒 0.7 帧开始,他们通过时钟提升、指令添加以及编译器技巧优化,[K 最终实现了每秒运行 20 帧的效果。
More Hourlies Stories
Content on Anagnorisis is summarized, paraphrased, and editorialized from publicly available sources for length and clarity. Original sources are linked where available. All trademarks belong to their respective owners.
