SC-SoC is a design and verification repository for a single-core System on Chip built around an RV32IMF RISC-V CPU and a set of reusable SystemVerilog building blocks. The repository combines RTL design, unit-level verification environments, software test programs, and project documentation in one place so the same codebase can support block bring-up, interface verification, and SoC integration work.
This repository is organized to support both sides of hardware development:
- RTL design of reusable digital blocks such as FIFOs, memories, clocking utilities, and AXI4-Lite peripherals
- verification of those blocks through dedicated SystemVerilog testbenches
- software-side bring-up using small RISC-V assembly and C programs
- integration of an RV32IMF core through the
submodule/rv32imfsubmodule
The build flow is driven by the top-level Makefile and targets Xilinx simulation tools (xvlog, xelab, xsim) for compilation, elaboration, simulation, and optional coverage reporting.
- Develop and verify reusable hardware IP for a single-core SoC
- provide a structured verification flow for unit and subsystem testbenches
- support software-driven validation with simple RISC-V programs
- keep design files, testbenches, and module documentation aligned
| Path | Purpose |
|---|---|
hardware/source/ |
Synthesizable RTL modules for the SoC building blocks |
hardware/interface/ |
SystemVerilog interfaces used by RTL and testbenches |
hardware/include/ |
Shared type definitions, packages, and verification headers |
hardware/testbench/ |
Unit and subsystem testbenches |
hardware/filelist/ |
Compilation file lists, including the RV32IMF submodule file list |
software/source/ |
RISC-V assembly and C test programs |
software/include/ |
Startup code and small support headers/source files |
software/linkers/ |
Linker scripts for software test builds |
document/ |
Design notes, verification notes, and block-level documentation |
submodule/rv32imf/ |
RV32IMF core and related sources brought in as a git submodule |
wcfg/ |
Waveform configuration files for GUI simulation |
The current repository includes, among others, the following reusable modules:
fifo: synchronous valid-ready FIFOmemanddual_port_mem: basic storage blocksaxi4l_memandaxi4l_mem_ctrlr: AXI4-Lite accessible memory subsystemclk_divandclk_mux: clock generation and clock selection utilitiesdelay_gen: programmable delay generation logicdual_edge_reg: dual-edge capture/register utilitybin_2_grayandgray_2_bin: data conversion utilities
Each major block is paired with a matching testbench and markdown documentation under document/.
The checked-in build flow assumes the following tools are available in your environment:
- GNU Make
- Bash-compatible shell
- Xilinx Vivado simulation tools:
xvlog,xelab,xsim - Xilinx coverage tool:
xcrgfor coverage report generation - RISC-V GNU toolchain:
riscv64-unknown-elf-gcc,riscv64-unknown-elf-objcopy,riscv64-unknown-elf-nm,riscv64-unknown-elf-objdump gitwith submodule support- optional:
spikefor ISA-level reference work
On Windows, run the flow from a Unix-like environment such as Git Bash, MSYS2, or WSL so that make, find, grep, sed, awk, and other POSIX utilities used by the Makefile are available.
Clone the repository with submodules:
git clone --recurse-submodules <repo-url>
cd SC-SoCIf the repository was already cloned without submodules, initialize them before simulation:
git submodule update --init --depth 1To see the available build targets:
make helpThe main entry point is:
make simulate TOP=<testbench>Examples:
make simulate TOP=bin_2_gray_tb
make simulate TOP=fifo_tb
make simulate TOP=axi4l_mem_tb GUI=1
make simulate TOP=clk_div_tb COV=1
make simulate TOP=clk_mux_tb COV=1 CC_COV=1| Option | Description | Default |
| --------------- | ------------------------------------------------------- | ------------------------------------------------- | --- |
| TOP=<module> | Top-level module or testbench to elaborate and simulate | hello |
| TEST=<name> | Forwarded to simulation as a +TEST plusarg | default |
| DEBUG=<value> | Forwarded to simulation as a +DEBUG plusarg | unset |
| GUI=0 | 1 | Run headless or open the waveform GUI | 0 |
| COV=0 | 1 | Enable functional coverage collection | 0 |
| CC_COV=0 | 1 | Enable code coverage instrumentation when COV=1 | 0 |
build/: compilation, elaboration, generated plusargs, and software artifactslog/: simulation logs named by top module and test namecoverage_report/: functional and optional code coverage HTML reports
The repository also supports building small RISC-V test programs from software/source/.
Build a software program with:
make test TEST=helloThe test target:
- finds the matching source file in
software/source/ - compiles it for
rv32imf - links it with
software/linkers/core.ld - emits a Verilog hex image and debug artifacts into
build/
Generated software artifacts include:
build/prog.elfbuild/prog.hexbuild/prog.symbuild/prog.dis
Example source programs currently include:
software/source/hello.csoftware/source/addi.S
The top-level flow is set up to reduce unnecessary recompilation:
- hardware source changes are tracked with SHA-256 snapshots under
build/ - elaboration is cached per selected
TOP - the RV32IMF submodule is only recompiled when its submodule commit changes
This keeps iteration faster when working on block-level verification or when switching among testbenches.
Block-level design and verification notes are stored in document/. Useful starting points include:
document/axi4l_mem.mddocument/axi4l_mem_ctrlr.mddocument/fifo.mddocument/mem.mddocument/clk_div.mddocument/clk_mux.mddocument/delay_gen.mddocument/dual_edge_reg.mddocument/bin_2_gray.mddocument/gray_2_bin.md
Verification-oriented documents are also available for several blocks, for example:
document/axi4l_mem_tb.mddocument/fifo_tb.mddocument/mem_tb.mddocument/clk_div_tb.mddocument/bin_2_gray_tb.md
The template document/test_plan_template.md can be used to standardize future verification plans.
- Implement or update RTL under
hardware/source/ - add or update a matching testbench under
hardware/testbench/ - run
make simulate TOP=<tb_name>until the block is stable - enable coverage when needed with
COV=1orCOV=1 CC_COV=1 - document the block behavior and verification strategy under
document/ - build software tests with
make test TEST=<program>when software-driven validation is required
Remove only the build directory:
make cleanRemove build products, logs, and coverage reports:
make clean_fullThe CPU implementation is maintained in submodule/rv32imf/ and is compiled through the top-level flow using hardware/filelist/rv32imf.f. The Makefile automatically initializes the submodule when required and skips recompiling it when the recorded submodule commit has not changed.
This project is licensed under the terms in LICENSE.