← All TxHDL articles

Freedoom's first level, with the pistol and the status bar

Doom on the TxHDL Flagship

Freedoom, bare metal on the Vreteno core, shown on HDMI

by Filip Filmar

Doom runs on the TxHDL flagship: the Vreteno RV32IMAC core at 100 MHz on an Alinx AX7A200B board (Artix-7 XC7A200T). The game is doomgeneric with Freedoom 0.13.0 as its data, built bare metal with the pinned RISC-V GCC and newlib. Each 320 by 200 frame is scaled by two into the DDR3 framebuffer, which the scanout shows on HDMI. Keys come over the serial port. The WAD goes to the board over Ethernet with fastboot.

On the board, the demo loop runs at 4.6 to 6.0 frames per second, and the first level at 6.3 to 7.5, by the core’s own cycle counter.

To build and run it from the TxHDL tree:

  • bazel build //demo/doom:doom builds the board image.
  • fastboot boot doom.bin freedoom1.wad sends the program and the WAD to the board.
  • bazel run //demo/doom:host -- <wad> <directory> <frames> plays a scripted game on the host and writes its frames as PNG files.

doomgeneric and Freedoom are fetched at a pinned commit and checksum, and are not copied into the TxHDL tree. A Doom image links doomgeneric, so it is GPL-2.0.

Read the article Source