Tiny RISC-V SoC for learning, experimentation, and FPGA prototyping! This SoC is built around a FemtoRV32 CPU, with memory, GPIO, and UART peripherals. The design is simulation-ready using Icarus Verilog and runs simple firmware compiled via GCC.
picoSoC_v3 is your gateway to understanding hardware design! It's a minimal yet fully functional RISC-V SoC that you can simulate, learn from, and expand. Perfect for students, hobbyists, and engineers exploring the world of chip design.
┌─────────────────────────────────────────┐
│ 🖥️ picoSoC_v3 System │
├─────────────────────────────────────────┤
│ ⚙️ RV32I CPU Core │
│ 💾 Memory Module (ROM/RAM) │
│ 📡 UART Peripheral │
│ 💡 GPIO Controller │
│ 🔌 Memory-Mapped I/O Bus │
└─────────────────────────────────────────┘
| Component | Description |
|---|---|
| 🧠 CPU Core | RV32I-based processor with instruction pipeline |
| 💾 Memory | Flash/ROM initialization from hex firmware |
| 📡 UART | Serial communication for debugging & data transfer |
| 💡 GPIO | LED control & digital I/O operations |
| 🔧 Bus System | Clean memory-mapped peripheral access |
| 🧪 Testbench | Complete simulation environment included |
Memory Write → [Address Decoder] → GPIO Register → LEDs 💡
- Memory-mapped registers for instant hardware control
- Write mask support for selective bit updates
- Read-back capability for GPIO state monitoring
- Integrated via
device_selectlogic intop.v
CPU ←→ [UART Registers] ←→ TX/RX Lines ←→ 🖥️ Terminal
- Byte-oriented TX/RX operations
- Status registers for ready/busy polling
- Interrupt support (configurable)
- Auto-generated register map via Corsair
Corsair transforms simple descriptions into production-ready RTL!
📝 YAML Description
↓
🔮 Corsair Generator
↓
📦 Verilog RTL + C Headers- 🎯 Consistency - RTL and firmware always in sync
- ⚡ Speed - Generate peripherals in seconds
- 🛡️ Reliability - No manual offset calculations
- 📚 Documentation - Auto-generated register maps
- Define UART/GPIO registers in YAML
- Run Corsair generator
- Get Verilog modules + C header files (
*_regs.h) - Include headers in firmware for instant peripheral access
┌─────────────────────────────────────┐
│ 0x00000000 ┌─────────────────┐ │
│ │ 🔒 Boot ROM │ │
│ │ (Firmware) │ │
│ 0x00001000 ├─────────────────┤ │
│ │ 💾 RAM │ │
│ │ (Data/Stack) │ │
│ 0x10000000 ├─────────────────┤ │
│ │ 💡 GPIO │ │
│ 0x10001000 ├─────────────────┤ │
│ │ 📡 UART │ │
│ 0x10002000 └─────────────────┘ │
└─────────────────────────────────────┘
Linker Script (sections.lds) ensures:
- ✅ Code lands in ROM region
- ✅ Variables live in RAM
- ✅ Peripherals mapped to correct addresses
- ✅ Interrupt vectors properly placed
┌──────────────────────────────────┐
│ CPU Core 🧠 │
└────────────┬─────────────────────┘
│
┌────────┴────────┐
│ Device Select │ 🚦
│ Logic │
└────────┬────────┘
│
┌────────────┼────────────┐
│ │ │
┌────▼───┐ ┌───▼────┐ ┌───▼────┐
│ Memory │ │ GPIO │ │ UART │
│ 💾 │ │ 💡 │ │ 📡 │
└────────┘ └────────┘ └────────┘
Clean separation of concerns:
- Memory accesses → Memory block
- I/O accesses → Peripheral blocks
device_selectroutes based on address ranges
| Tool | Purpose | Icon |
|---|---|---|
| Icarus Verilog | HDL simulation | 🔬 |
| GTKWave | Waveform viewer | 📊 |
| RISC-V GCC | Firmware compiler | ⚙️ |
| Python 3 | Helper scripts | 🐍 |
| Make | Build automation | 🏗️ |
sudo apt update
sudo apt install iverilog gtkwave build-essential \
python3 python3-pip makeFor RISC-V toolchain: Download from SiFive or build from source
cd firmware
make
# Generates: firmware.elf & firmware.hexcd /home/iraj/LearnSoC/picoSoC_v3
iverilog -g2012 src/*.v tb_processor.v -o prog
vvp proggtkwave wave.vcd🎬 Expected Output:
💡 LED blinks in simulation
📡 UART transmits "Hello World!"
✅ All tests pass
- 🔗 I2C peripheral (sensor interfaces)
- 🔄 SPI peripheral (flash memory, SD cards)
- 🔌 Interrupt controller (enhanced responsiveness)
- 🎮 FPGA deployment (real hardware testing)
- 🏭 ASIC flow integration (OpenLane/Qflow)
- 📐 GDS generation for tapeout-ready design
| Issue | Solution |
|---|---|
| ❌ Elaboration errors | Check for use-before-declare in Verilog |
| ❌ Firmware won't build | Verify RISC-V toolchain path |
| ❌ No waveform output | Ensure testbench has $dumpfile() |
| ❌ Peripheral not responding | Check address mapping in linker script |
- FemtoRV32/PicoRV32 teams for compact core inspiration
- Corsair project for register generation tools
- RISC-V Foundation for the open ISA
- Open-source community for EDA tools
📖 Documentation → /docs
🔧 Examples → /firmware/examples
🧪 Testbenches → /testbench
🎨 Scripts → /scripts
Made with ❤️ for the hardware hacking community
🔗 Report Bug • 💡 Request Feature • 📧 Contact