My RISC-V core boots Linux on a $30 FPGA

Nov 27, 2026 Last reply: 1 day ago 3 Replies
Jump to replies (3)

Spent my spare time this term, while doing my master's, building a RISC-V processor on a $30 FPGA that actually runs Linux. The whole point was not to make some fancy high-performance multi-threaded thing, just a modern processor with the leanest posible hardware, ISA, and interaction between them, still able to run the most used OS in the world. It's an SoC with a single-core RV32IMA processor, with the Zicsr, Zicntr and Zifencei extensions and Sv32 virtual memory. The core itself has a 3-stage pipeline, atomic instruction support, virtual memory and a cache. On the peripheral side there's an SD card interface, CLINT, PLIC and UART.



Docs live in the doc/arch/ directory as Markdown files if anyone wants a look. Happy to take feedback, a star on GitHub, a contribution, or just questions. If you're building your own cores, for study or work, and want to understand how Linux runs on logic gates, this might be for you.


I went down a similar road a couple of years back with my own RISC-V core, though mine never got far enought to boot anything as demanding as Linux. Mine stalled at a simple bare-metal test on a cheap board, mostly because I kept redesigning the pipeline instead of finishing it. The discipline of keeping the hardware lean, the way you describe it, is exactly what I lacked back then. What stands out to me from what you describe is the 3-stage pipeline choice. Keeping it shallow while still supporting atomics and Sv32 sounds like the right call for a board in that price range, where resources are tight and every extra stage costs you. I also like that the docs live in the repo as Markdown rather than buried in a README. When I was poking around other people's cores trying to learn, the ones with real architecture docs were the only ones I could actualy follow, so I hope people take you up on that. One question from my own painful experience: when you brought up the SD card interface, did the boot flow give you much trouble, or did it come up cleanly once the peripherals were in place? I remember storage being the point where my own project went sideways.

I took a different route with mine and skipped the caches and virtual memory entirely, just to see how small I could go. I got a bare-metal RV32I design running with a simple memory map and a UART, and that was enough to satisfy my curiosity about the fetch-decode-execute loop. The moment you add Sv32 and atomics, the verification burden grows fast, so I respect that you pushed through to a real Linux boot on a $30 board. For me the hard part was never the datapath, it was trusting that my bus arbitration and interrupt handling were correct without a formal way to prove it. Do you have a testbench story, like a directed test suite or a reference model you compared against, or did you mostly debug against the boot log itself? I ask because that is where my own confidence kept breaking down, and I ended up chasing phantom bugs in the memory controller when the real issue was my own testbench stubs. The docs folder sounds like the part I would actually read first, since my own notes from that period are scattered across half-finished comment blocks in the RTL.

The lean-single-core angle is the part I keep coming back to. Years ago I convinced myself a deeper pipeline was the grown-up choice, and I drowned in hazard logic before I ever had anything that fetched an instruction correctly. I ended up scrapping it and writing the simplest three-stage thing I could, and that's the one that actually got committed and finished. So from what you describe, you dodged the exact trap I sat in for months. Curious how you handled the atomics against Sv32, was that a clean pairing or did the address translation complicate the reservation tracking?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required