Edge-MPSoC: A RISC-V System-on-Chip (SoC) framework for Edge AI including RTL modules, UVM verification, firmware compilation toolchain, register map generation, and open-source simulation infrastructure.
app/: Contains application source files (start.s) and the linker script (sections.lds). These are compiled into executable binaries for SRAM.include/: Contains global SystemVerilog header files (e.g.,typedef.svh).modules/: Contains RTL designs (CPU, interconnects, wrappers, generated registers) and memory models (SRAM).
Ensure the following tools and toolchains are installed on your system:
- Verilator – Verilog/SystemVerilog simulator (v5.020, v5.026, and v5.052 have been confirmed to work with this repo)
- Surfer – Waveform viewer
- PeakRDL – SystemRDL toolchain for register generation
- RISC-V GCC Toolchain – Cross-compiler toolchain for RISC-V target architectures
- liblz4 Install with
sudo apt-get install liblz4-dev
Ensure all required dependencies exist and that common_cells is located inside axi:
- Clone
Edge-MPSoC. - Clone the axi platform repository, commit 808e7b3.
- Update
PULP_AXI_PATHinrun_soc_tb.shto reflect the location ofaxi/. - Clone the common_cells repository inside
axi/, commit 177f07a. - Update the location of data and exec SRAM init files (.Initfile) in
modules/soc_top/soc.sv(firmware compilation steps are below) and for the data ram init file rungen_mem.sh 1024inmodules/sram_node.
For convenience, structure your directories as follows:
Edge-MPSoC/
axi/
└── common_cells/
Use PeakRDL to generate register documentation and AXI4-Lite regblock RTL from SystemRDL specifications:
# Generate HTML documentation
peakrdl html data_sampler_wrapper_regs.rdl -o ./docs/register_map/
# Generate AXI4-Lite register block RTL
peakrdl regblock data_sampler_wrapper_regs.rdl -o generated/ --cpuif axi4-lite-flatCompile start.s into a RISC-V ELF binary using sections.lds:
-
With Standard Libraries:
riscv64-unknown-elf-gcc -march=rv32i -mabi=ilp32 -ffreestanding -nostartfiles -T sections.lds start.s -o firmware.elf
-
Without Standard Libraries:
riscv64-unknown-elf-gcc -march=rv32i -mabi=ilp32 -ffreestanding -nostartfiles -nostdlib -T sections.lds start.s -o firmware.elf
-
Or Compile C file directly to hex:
riscv64-unknown-elf-gcc -march=rv32i -mabi=ilp32 -ffreestanding -nostdlib -Wl,-T,sections.lds start.s main.c -o firmware.elf
Convert the ELF binary into Verilog Hex format for $readmemh memory initialization:
riscv64-unknown-elf-objcopy -O verilog --verilog-data-width=8 firmware.elf firmware.hexInspect disassembly and machine code contents:
riscv64-unknown-elf-objdump -d firmware.elfExecute the SoC testbench runner script:
# Run simulation (without waveform output)
./run_soc_tb.sh
# Run simulation with waveforms (launches Surfer viewer)
./run_soc_tb.sh wfTODOs:
- picorv32 integration test
- axi_spi_slave integration test
- improve UVM flow
- cpu (picorv32) bootup test with sanity checks
- improve c-to-hex flow
- set up nightly regression
- FPGA prototyping
- UART integration and printing output of UART pin in Verilator simulation to a terminal in real time