An FPGA - that’s a field-programmable gate array, a sort of reconfigurable microchip - has been shown to run a 3D, ray-traced game written in C 50 times more efficiently than an x86 CPU while using a fraction of the energy and perhaps pointing the way to future programming efficiency gains. The claims are made in a white paper [PDF] by Victor Suarez Rovere, a developer from Argentina, and Julian Kemmerer, a systems engineer from Pennsylvania, and brought to our attention by CNX Software.
The FPGA in question is the Arty A7, a Xilinx Artix-7 100T FPGA development board that sells for around $280 and features 101,440 logic cells (an FPGA’s logic cells contain a look-up table that can implement any logic function, giving the chip its programmability) on a 28 nanometer process, and which pulls less than a watt of power. The CPU it was pitted against (without, it must be said, troubling the chip’s iGPU) was a Ryzen 7 4800H, an eight-core 16-thread laptop processor that was built on a 7 nm process and has a default TDP of 45W. That's a laptop chip that's not available on its own, but the R7 4700G is currently available for about $240.
The game that was compiled to run on the two very different platforms is "Sphery Vs Shapes," and doesn’t appear to contain much in the way of plot, characters or actual gameplay, but does have lots of ray-tracing, as a shiny metallic ball bounces its way across a chessboard-like environment, which is reflected in its shiny spherical surface.
Both platforms rendered the game at 1080p and 60 frames per second without a problem, but the FPGA did it using 660 mW, while the R7 needed 35W, a difference of 53x. It is speculated that, were the FPGA to use the same 7nm process as the CPU, this figure could be six times higher.
The keys to the whole thing are Pipeline C, an invention of Kemmerer’s, and CflexHDL from Suarez. You can find them both on GitHub. "The game’s pixel rendering and animation logic is based on floating point and vector math operations. All of the game code is expressed using a clean syntax that translates directly to a digital circuit. The current target of this design is a FPGA board with Full HD digital video output, and the workflow also allows running the game in realtime on a regular PC using the unmodified source," they write in their paper. "This allows for much faster development-test iterations than with traditional hardware design tools. For the same workload, the computing efficiency resulted in more than 50X better than using a modern CPU, in a chip an order of magnitude smaller."
"Sphery Vs Shapes" stands up pretty well as a graphics demo, but what it means for the future of programming is more interesting - especially as FPGAs are going to start appearing in AMD chips. There are plans to port the whole thing to RISC-V, and to design an open-source ASIC (application-specific integrated circuit) that supports the pipeline, and there are possibilities for the world of microcontrollers too." The code can be translated to a logic circuit, run on a[n] off-the-shelf CPU, or on a microcontroller to develop hardware/software peripherals without changes to the code,” Suarez and Kemmerer write in their conclusion. "The results we obtained are readily reproducible, as materials are easy to obtain and not expensive."