LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

Hacks & Buildsrisc-vfpgadoomchip-8retro-console

A Homemade RISC-V CPU Runs DOOM on an FPGA, Sent to the PC at 64x32 Because the Serial Cable Was Too Slow

A retro console built on a DE0-Nano FPGA and a self-designed dual-issue RV32IM core renders DOOM at 35+ FPS, but a 921,600-baud UART turned full frames into a 1.4 FPS slideshow, so the output dropped to Chip-8's 64x32 for a steady 45 FPS.

Drawn as a circuit board, Chris folds a huge glowing game picture down into a small square so it fits through a narrow slot at the board's edge.
Illustration: LockerGnome

The CPU is his own. “The CPU is a dual-issue in-order RV32IM core with a hybrid branch predictor,” running at 50 MHz on the board’s Altera Cyclone IV E, with “32 MB SDRAM, 16-bit bus.” He lists a “CPI 0.727 measured on DOOM,” which means the core averages more than one instruction per clock while running DOOM.

DOOM isn’t the only game. The console carries “32 titles: 7 native and 3D, 6 CP/M 2.2, 19 Chip-8,” and has two screens: a “0.96 inch I2C OLED, 128x64, 32.6 FPS, hardware 2x2 scaler,” and a “64x32 RGB332 framebuffer at 45 FPS over 921,600 baud UART” that goes to a PC through a “Silicon Labs CP2102, 3.3 V logic, 921,600 baud.”

That serial line is where the story turns. The repository’s README says that “even though the dual-issue RISC-V core rendered DOOM internally at 35+ FPS,” “the serial wire bottlenecked the display to a 1.4 FPS slideshow.” His project log does the arithmetic: at 320x200, “a 64,000-byte frame takes 694 ms on the wire.” Halving each side to 160x100 still took 174 ms per frame.

So he went smaller. At 64x32, a frame “crosses the wire in 22.2 ms and gives a steady 45 FPS.” The README puts each 64x32 frame at 2,048 bytes plus a 10-byte header. The number wasn’t arbitrary: “64x32 is the native resolution of the 1977 Chip-8 virtual machine,” the same format his 19 Chip-8 games already draw in.

DOOM runs through doomgeneric with the shareware doom1.wad, and the console code is MIT-licensed. Neither page says whether a faster link than the CP2102’s serial port is next, so for now the core draws frames at 35+ FPS that the PC only ever sees at 64x32.

Hobby CPU projects tend to hit the I/O wall before the compute wall, because a home-built core can get fast long before a cheap serial port does. Expect more of these consoles to pick output formats by link budget first, and more builders to move to faster links once the core outruns the cable.

More Hacks & Builds

Every Hacks & Builds story →