[ad_1]
Pseudonymous tinkerer “AcqRel” has taken the sport Factorio to a dramatic new conclusion: the power to compile and run a soft-core RISC-V processor in-game, due to a backend connecting it to the Yosys open synthesis suite.
“Ever performed Factorio and thought ‘I want my manufacturing unit had a RISC-V core,'”developer Frans Skarman writes of the trouble, in a Mastodon publish which introduced the undertaking to our consideration. “Introducing Factorio Yosys! It is a undertaking of a pal of mine not on Mastodon, so all credit score to him. He constructed a full Yosys backend for Factorio that may now compile a RISC-V core.”
Unveiled throughout a crowdfunding marketing campaign in 2013 and formally launched in 2020, Wube Software program’s Factorio sees the participant constructing, managing, and automating a manufacturing unit in an effort to construct and launch a rocket — after which the sport is taken into account overwhelmed, although can nonetheless be performed as a sandbox. Quite a lot of in-game applied sciences could be researched to help with the mission, although microprocessors implementing the RISC-V structure aren’t often amongst them.
Within the case of Factorio Yosys, the sport is linked to the free and open Yosys synthesis suite that in flip can ingest {hardware} design language (HDL) initiatives — together with a useful 32-bit RISC-V soft-core processor. “On the technical facet, it is a tremendous spectacular undertaking,” Skarman says. “He formally verified components of the movement and it does an entire bunch of optimizations to make the circuits surprisingly compact. It additionally labored on the primary strive with this RISC-V core! (I discovered extra bugs within the core than he did within the compiler :D)”
Efficiency, as you may anticipate, could be a problem: with the sport locked to a most framerate of 60 frames per second, the processor runs at simply 1.82Hz — although this may be accelerated, Skarman notes, by uncapping the sport’s framerate. “And, in fact, that is arbitrary HDL,” Skarman provides, “so you are able to do different cool stuff [like] a working snake recreation!”
Extra info is out there in Skarman’s Mastodon thread, whereas AcqRel’s supply code has been printed on Sourcehut underneath an unspecified license.
[ad_2]