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.
Theory in plain words
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
On an 8k LUT Tang Nano 9K a PicoRV32 SoC leaves plenty of logic for video and your accelerator.
#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.binQuick quiz
1. A soft core is...
Synthesised into LUTs.
2. Smallest RISC-V core here?
Bit-serial design.