xcore.ai - Can it run Doom?

XCore Project reviews, ideas, videos and proposals.
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1170
Joined: Thu May 27, 2010 10:08 am

xcore.ai - Can it run Doom?

Post by infiniteimprobability »

This is an old project (started by a former compiler engineer in XMOS who did most of the original porting work 11 years ago) has finally come to fruition.. Thanks to xcore.ai and it's ability to directly address external LPDDR we can now target the chip and run an old favourite in real time.

Here's the video https://www.youtube.com/watch?v=YO4567j831c.

Some details:

  • Runs on the XCORE-AI-EXPLORER board with xcore.ai chip.
  • Uses USB video class as the screen (the frame buffer is sent to the host). Needed to do colour space conversion from 16b RGB to YUV2 as webcams use that format
  • Uses ~2MB of LPDDR for heap, all other code and data in on-chip RAM
  • Manages about 30 FPS peak, 25 average when not loading WADs
  • Loads WAD files over fileio from host (this is the cause of the stutters)
It works though and definitely recognisable!

So yes, it can run Doom.

Screenshot from 2025-07-11 10-05-40.png
This is a home project so going slowly but I would love to get audio working and perhaps look at adding a MIDI synth as the background music is a big part of this game. Controls would be nice too to make it human playable and I have a PS/2 keyboard on its way which should be fairly easy to hook up.

If anyone fancies collaboarting, let me know. Code is a bit of a mess at the moment as I wanted to get to this stage and may have taken a few short cuts! I'd like to tidy that in time. Current TODO list:
  • Store the WAD files in flash (I'm working on this already). Warning - smallest WAD is 4.2MB and flash is default 4MB so I have put a bigger FLASH on my board
  • Replace USB video class with 320x240 colour LCD. I have ordered a cheap SPI one from ali-express which I'll try out!
  • Get PCM samples playing - orginal samples are 11kHz/8b so need SRC to 48kHz and pushed to the DAC
  • Find and port a MIDI synth which can play the MIDI/MUS files and mix into the DAC output
  • General tidy
You do not have the required permissions to view the files attached to this post.
Engineer at XMOS
CiaranW
Verified
Member
Posts: 13
Joined: Tue Jun 28, 2022 10:58 am

Post by CiaranW »

Wow, that's very cool!
User avatar
fabriceo
Respected Member
Posts: 263
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

So cool!
Only white hair guys can understand and appreciate the size of the effort and its beauty. Amazing. Can you point what strength of the core.ai were useful?(vpu?)
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1170
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

It's not using any of the really fancy features of xcore.ai such as VPU but it does benefit from the ability to run at 800MHz - that gives us 160MHz thread speed for n <=5. The main thing that was needed was the LPDDR memory which is used for the heap. I am sure there is plenty of scope for speeding things up with MIMO but the code was written using integer/fixed point so appreciates a good compiler and fast scalar operations.

It's nice to have spare threads to do things like the video controller though! I'd love to get some audio playing too.
Engineer at XMOS
User avatar
Ross
Verified
XCore Legend
Posts: 1223
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Image
Technical Director @ XMOS. Opinions expressed are my own