One of the ways people use FPGAs is to have part of the FPGA fabric hold a CPU. That makes sense because CPUs are good at some jobs that are hard to do with an FPGA, and vice versa. Now that the RISC-V architecture is available it makes sense that it can be used as an FPGA-based CPU. [Clifford Wolf] created PicoSOC — a RISC-V CPU made to work as a SOC or System on Chip with a Lattice 8K evaluation board. [Mattvenn] ported that over to a TinyFPGA board that also contains a Lattice FPGA and shows an example of interfacing it with a WS2812 intelligent LED peripheral. You can see a video about the project, below.
True to the open source nature of the RISC-V, the project uses the open source Icestorm toolchain which we’ve talked about many times before. [Matt] thoughtfully provided the firmware precompiled so you don’t have to install gcc for the RISC-V unless you want to write you own software. Which, of course, you will.
The RISC-V isn’t the first SOC available for FPGAs, although some of the ones commonly used have cloudy pedigrees because they emulate some other non-open CPU. The first part of the video covers how to get started with the RISC-V. Then [Matt] explains how he added support for the smart LEDs into his design.
The addition is written in Verilog, so if you don’t read that language, you might want to brush up before you tackle this project. Once that design proved out, he integrated the LED driver with the CPU.
Although SOC hardware and software design isn’t a new idea, it is amazing that you can now do it with open tools like gcc, icestorm, and an open source CPU core. If you want to get started with something a little less daunting, you can always check out our FPGA boot camps. If you’d rather use ARM cores and Xilinx FPGAs, that’s a free — though not open source — option now, too.