Home / Learn Chip Programming / Soft-Core CPUs: PicoRV32, VexRiscv, MicroBlaze, Nios II

Soft-Core CPUs: PicoRV32, VexRiscv, MicroBlaze, Nios II

Run C code on a processor that lives inside the FPGA fabric.

In shortRun C code on a processor that lives inside the FPGA fabric.

Theory in plain words

A tiny SoCRISC-V core (PicoRV32 / VexRiscv)Memory-mapped busBlock RAM (program + data), UART, GPIO, timerYour custom accelerator block
A tiny SoC

What it is

A soft core is a CPU written in HDL and synthesised into FPGA logic. Open options: PicoRV32 and VexRiscv (RISC-V), NEORV32, SERV (smallest). Vendor options: MicroBlaze (Xilinx), Nios II (Intel).

Why we use it

You get the best of both worlds: software for control and hardware accelerators for speed, in one chip.

How it works

Instantiate the core, connect RAM, UART and GPIO with a bus (Wishbone, AXI-lite, simple memory-mapped), compile C with riscv-gcc, load into block RAM.

Where it is used

  • System-on-chip designs
  • Retro computers and Linux-capable FPGAs
  • Custom peripherals controlled by software

Core comparison

Choose a soft coreTry it Yourself

On an 8k LUT Tang Nano 9K a PicoRV32 SoC leaves plenty of logic for video and your accelerator.

Software side (C for the soft core)
#define UART_TX  (*(volatile uint32_t *)0x10000000)
#define LED      (*(volatile uint32_t *)0x10000010)
void putc_(char c) { UART_TX = c; }
int main(void) {
    for (;;) { LED ^= 1; for (volatile int i = 0; i < 1000000; i++) ; putc_('*'); }
}
// riscv32-unknown-elf-gcc -march=rv32imc -nostdlib -T link.ld -o fw.elf start.S main.c && objcopy -O binary fw.elf fw.bin
Tip:LiteX generates complete SoCs (CPU, RAM, UART, Ethernet, DDR) for many boards with a few Python commands: the fastest way to a Linux-capable FPGA system.

Quick quiz

1. A soft core is...

2. Smallest RISC-V core here?