一个团队通过一系列技术优化,使自己从逻辑门级别设计的自定义CPU能够在FPGA上流畅运行经典游戏《DOOM》[1]。
该项目基于之前成功运行该游戏的基础进行了深度改进[1]。团队采用了5级流水线架构,并通过实现指令缓存和数据缓存及其仲裁器来应对DDR3内存的高延迟问题[1]。
性能提升经历了显著进展[1]。初期运行帧率仅为0.7 FPS,通过将时钟频率提升至125MHz、优化取指阶段、增加乘法指令集以及调整编译器设置,最终达到了15-20 FPS的流畅水平[1]。
在开发过程中,团队解决了多个关键技术难题[1]。他们发现编译器在处理硬件定时器内存映射I/O指针时进行了不当优化,通过将其标记为volatile得以修复[1]。此外,DDR3初始化中的非零值问题曾导致游戏崩溃,也已被解决[1]。
团队表示,下一步计划引入乱序处理技术以进一步提升性能[1]。
A team of developers successfully optimized their custom CPU design to run Doom at playable frame rates on an FPGA platform [1]. Building on previous work, the team addressed critical technical challenges including DDR3 memory latency and cache conflicts through several key improvements [1].
The custom CPU architecture features a five-stage pipeline with integrated instruction and data caches, along with an arbiter to manage DDR3 memory access [1]. Initial test runs achieved only 0.7 frames per second, but systematic optimization work dramatically improved performance [1]. The team increased the clock frequency to 125 MHz, refined the instruction fetch stage, expanded the instruction set to include the RV32I-ZMMUL multiplication extension, and applied compiler-level optimizations [1]. These efforts culminated in frame rates of 15–20 FPS, delivering a smooth gaming experience [1].
During development, the team discovered and resolved a critical compiler optimization bug: the hardware timer memory-mapped I/O pointer had not been declared volatile, causing the compiler to incorrectly optimize away essential accesses [1]. They also fixed an issue where non-zero DDR3 initialization values were crashing the game [1]. Looking ahead, the team plans to introduce out-of-order execution techniques to further boost performance [1].