18 ms·
Quake on an FPGA (MRISC32 CPU) [video]
- mips_r4300i 3y agoCongrats on your achievement. I have seen many, many softcores run on FPGA (usually from a beginner to HDL and unoptimized as a result) however I have never seen a softcore impl this performant, enough to run quake at 40fps. For logic usage I see you have about 12k LEs on a Max10 running up to 100mhz with FPU. This is really good. I have looked at many, including NiosII/f. What chip are you running for the demo? It looks like a DE1 but I can't quite tell. I would be curious to see how your Fmax increases when moving to a slightly more modern chip like the Cyclone V (from 60nm to 28)
- mbitsnbites 3y agoSo the demo is actually running on a DE0-CV, with a Cyclone V. A key thing for running Quake at acceptable speeds is to have a proper FPU, and most hobby softcores tend to exclude those. I actually expect the CPU to run even faster (same clock, but fewer stalls), once I get around to improving a few things. I am seeing roughly 2 CPI in Quake right now, and I hope that there is potential to get closer to 1 CPI. BTW, I fake-it-til-I-make-it with timing. I usually blow the timing budget when I go above 70 MHz, but I just run it 100+ MHz anyway (i.e. I'm effectively "overclocking"). As you may tell I'm a beginner myself (this is my first proper FPGA project, except for a master thesis project a couple of decades ago).
- lightedman 3y agoThis is interesting and makes me wonder how long it will be before we see older games made natively in hardware alone.
- simne 3y agoYou are not alone. I also wonder, when most old classic games become hardware :)
- mbitsnbites 3y agoThat would be closing the circle. Back in the 1970's some video games were more or less purely implemented in hardware (e.g. I believe Pong was originally implemented with discrete TTL chips, and a later hone version was implemented in a single VLSI chip).
- simne 3y agoYou are very close to truth. Before, many games implemented using chips, but not all chips was logic, some things was analog. Even in consoles/arcades, loong later appear some hybrid things. For example, I hear about one arcade which was based on z80, but have analog sprite scale unit. I think, nearly completely digital world become only after appeared Nvidia TNT, which was cheap enough and produced in huge numbers. But to be honest, I don't have enough info about hardware used in Nokia NGage and other portables, so I could assume, even later hardware could have analog parts.
- xcv123 3y agoThat's right. All of the early arcade games used TTL discrete logic. The first arcade game implemented with a microprocessor was released in 1975 https://en.wikipedia.org/wiki/Gun_Fight https://en.wikipedia.org/wiki/Gun_Fight
- rbanffy 3y agoThis is a softcore running a Quake port. Cool, but not quite what you want.
- thot_experiment 3y agoDon't get me wrong, this is very fucking cool. I have long yearned for a world where an FPGA PCIe add-in card is something practically useful and every year I gain a bit of hope that we're slowly plodding along toward that future. But what I really want to see is quake running on quake specific hardware, with everything burned into the logic elements running at some thousands of FPS, rather than quake running on a softcore. While we're on the subject, the real thing that's holding back broader adoption of FPGA programming is the fucking tooling. I cannot wait till we have something FOSS like clang/gcc for verilog/vhdl that can be reasonably relied upon. Quartus is... quartus is something else. (ok maybe the real thing holding back adoption is that it's extremely fucking niche that you actually need FPGA latency, but let me dream)
- mbitsnbites 3y agoThere are efforts to bring FOSS FPGA tooling. Check out Yosys (still far from as mature as LLVM though). But yes, I agree...
- beebeepka 3y agoLove the idea of Quake specific hardware. We're still a few years away from having 1khz oled (or faster) displays but i am sure they'll arrive by the time I won't be able to make use of them due to old age. But I want to see it. If course, all that goodness would be for nothing if we don't bake a proper version of the game. It's been a while but I think Quake server tickrate is likely to be on the low side. Quick searching confirms that. From https://speeddemosarchive.com/quake/qdq/articles/WallHug/framerate.htm https://speeddemosarchive.com/quake/qdq/articles/WallHug/fra... "In normal Quake, the server framerate is controlled by a console variable called sys_ticrate. This measures the amount of time each frame should last, and its default value is 0.05 (that is, twenty frames per second.) Most server administrators don't bother to change this." I say someone should take your idea, fix Quake 3 to run at 1khz on both the client and the server, then bake that into fpga. I would buy it
- rbanffy 3y ago> We're still a few years away from having 1khz oled (or faster) displays Fine. We can always go with 240 fps AR with 8K HDR 180-degree FoV instead.
- 0xf00ff00f 3y agoWow, how crazy is this? This guy: * Designed a 32-bit ISA with vector instructions [0] * Implemented it on an FPGA * Wrote a gcc backend for his ISA [1] * Ported Quake, and it seems to run pretty well (Quake required a high-end Pentium back in the day) Now this is a full-stack developer. [0] https://www.bitsnbites.eu/the-mrisc32-a-vector-first-cpu-design/ https://www.bitsnbites.eu/the-mrisc32-a-vector-first-cpu-des... [1] https://gitlab.com/mrisc32/mrisc32-gnu-toolchain https://gitlab.com/mrisc32/mrisc32-gnu-toolchain
- mbitsnbites 3y agoThe things you do in order to play Quake ;-) (BTW, recently started eyeing Quake 2 - but will have to work more on the CPU performance first)
- dosshell 3y agoTalking about fullstack. How far away is network support? Like hosting bitsnbites.eu on it?
- mbitsnbites 3y agoHaha! Infinitely far away (not on my horizon). Thought has crossed my mind, but there are so many other things I want to do first (e.g. audio, superscalar CPU, ...).
- rustybolt 3y agoThat looks surprisingly smooth for something not running on a GPU. What clock speed is it running on? Also, what resources can you recommend for writing your own GCC backend?
- mbitsnbites 3y ago110 MHz
- tomxor 3y ago
- varispeed 3y agoSo impressive! Btw. I remember preferring low resolution games and now when I think about it, I think my brain was "upscaling" them filling in the missing details in sort of subconscious and pleasant way. Once games around that era no longer supported low resolution in wake of early GPUs I kind of lost interest. The games looked sterile and boring.
- kolinko 3y agoThere is another thing - low res games were played on a CRT monitor that had a natural smoothing of pixels. If you launch any old game on any modern monitor it will look way worse than it used to be.
- simne 3y agoTo be honest, I seen many systems, which have hardware smoothing of pixels, some monitors have this tech and some notebooks. And I don't know, why now this tech is become so rare - Shaders do smoothing of pixels very well and it is easy to implement, and usually, have enough spare hardware. It is looking strange in cases of GUI with many details, but in old games it work mostly ok. And unfortunately it was unavoidable, because many old games don't accept modern "wide" resolutions, in best case just cut screen, so wide "ears" remain unused. But with hardware smoothing, it is possible to run with top strip cut, which is sometimes better than with black "ears" and with unused screen space.
- mbitsnbites 3y agoYes. I run Quake at 320x180 (16:9), but the VGA signal is 1920x1080, so the video HW scales the framebuffer using nearest neighbor interpolation, and then it's all displayed on a super-crisp modern monitor. So the pixels are very sharp and visible.
- sigmonsays 3y agois there a way to disable the sign into google popup?
- jmngomes 3y agouBlock Origin did it for me: https://ublockorigin.com/ https://ublockorigin.com/
- orthecreedence 3y agoIf you figure it out please let me know because I find the SIgN InTo GoOGLe popups one of the most frustrating things about the modern internet experience. It's like if the same person followed you around all day asking for cash over and over and over and over. If I wanted to log in, I'd click the fucking login button.
- zamadatix 3y agouBlock Origin seems to block them for me. Turn it off and I get a page with the login box, turn it back on and I don't. Note: I have the "annoyances" filters all enabled in the uBlock settings, not sure if it's part of that or covered in the default lists.
- fulladder 3y agoYeah, I couldn't figure out what the parent was even talking about until I realized uBlock Origin was what was allowing me to just browse the page unimpeded!
- orthecreedence 3y agoOH! I re-read your comment. I'll try the annoyances filters. Thank you for pointing this out.
- orthecreedence 3y agoI've done this like 3 times now. I'm guessing ublock origin only blocks that element on one site? The problem is that EVERY site, even the ones nobody would ever bother logging into, plasters LOGIN WITH GOOGLE!!!!!!!!1 on the screen when I'm trying to read some stupid blog post.
- Konwar 3y agoHell