Running DOOM On A Custom CPU Built From Scratch

Running DOOM on weird obscure hardware is a fun hacker pastime that’s been around for a long time now. It’s always enjoyable to see someone port it to an egg timer, or a hat, or whatever else. But what about running the iconic shooter on a CPU of your very own? [Armaan] and [Liam] have done just that.

The CPU in question was designed at the logic gate level, deployed on to an FPGA, and hooked up with the necessary peripherals to run as a going concern. Early testing of the CPU involved running straightforward code to generate Mandelbrot sets and to play a simple game of Pong. But [Armaan] and [Liam] had bigger goals: to port the game that everybody ports to everything. Doing that took some work.

To get DOOM running, the CPU had to get faster, and it needed many tweaks to how memory was handled. There was also work to be done to create a keyboard interface, an HDMI video output, and a hardware timer. From there, the game itself had to then be ported to the custom CPU’s architecture. Eventually, the duo had the game running… at a glacial 0.7 FPS. A success, but not the magical end result that was desired. A bump to clock speed and further optimizations and compiler tweaks eventually got the game up to an impressive 15-20 FPS. The goal for future work is to push it to an entirely-playable figure of 30 FPS or better.

It’s worth checking out the (apparently unembeddable) videos on Instagram to see the CPU in action. We’ve also featured plenty of fun DOOM ports before, too. If you’re brewing up custom CPUs or DOOM ports of your own, keep them coming to the tipsline. The latter in particular is often a wonderful milk run for the writer that happens across it. Happy hacking out there!

13 thoughts on “Running DOOM On A Custom CPU Built From Scratch

    1. I thought it was a good read! Nicely talks through some basic CPU architecture in (what seems like) a fairly understandable way, shows an example of the board doing things, and decently documents their optimization experience. If you read to the end, they even specify where and how they use AI (they explicitly state they didn’t have AI write the blog post).
      I would recommend you take another stab at it!

  1. I wasted 5 minutes of my life looking for the details how he build a custom C compiler for his custom CPU.

    A custom CPU it is not, just a RISC-V implementation, barely mentioned, so no need for custom C compiler.

  2. Exactly, this is not a custom CPU, and it’s barely mentioned (in several of the blog posts) that it’s a RISC-V implementation. It’s completely different to design a CPU from scratch than to implement an already documented ISA.

    I couldn’t find out which exact part of the RISC-V ISA is implemented, so I can safely guess that it’s only the RV32I unprivileged base spec without any of the extensions.

    1. It’s a student project.

      The text makes it look like something special. The website is purple. But it is still a student project, and it is nice.

      The blog post however, if not written by LLM, is a sign of something worse, because it really feels like an LLM wrote it in style and form.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.