RISC-V Simple Core Collection
Go to file
Mario1159 03c30636e9
Some checks are pending
continuous-integration/drone/push Build is pending
Merge branch 'main' of https://git.1159.cl/Mario1159/RVSCC
2023-03-02 16:57:58 -03:00
cmake Rename include folder 2023-02-27 23:26:17 -03:00
fw Change name scheme and add tests 2023-02-26 20:26:11 -03:00
include Rename include folder 2023-02-27 23:26:17 -03:00
rtl Update cache 2023-03-02 16:56:34 -03:00
scripts Update cache 2023-03-02 16:56:34 -03:00
test Update cache 2023-03-02 16:56:34 -03:00
.devcontainer.json Upgrade dev enviroment ecosystem 2023-02-19 18:08:41 +00:00
.dockerignore
.drone.yml
.gitignore
CMakeLists.txt
compose-dev.yaml
Dockerfile
README.md Update 'README.md' 2023-03-01 15:11:23 +00:00

RISC-V Simple Core Collection

Collection of SystemVerilog RV32I cores and modules

Table of contents

Features

  • Single cycle processor
  • 5-Stage pipelined processor with hazard detection
  • N-Way associative cache memory

Directory structure

.
├── fw                   # Firmware
│   ├── sandbox          # C/Assembly sandbox firmware source
│   └── test             # Assembly programs used for testbenchs
├── include              # SystemVerilog include directory
├── rtl                  # SystemVerilog RTL modules
└── test                 # SystemVerilog testbenchs

Requirements

  • Verilator or another SystemVerilog simulator
  • CMake
  • 32-bit GNU RISC-V toolchain

If your package manager does not provide the RISC-V GNU toolchain you can either download the binaries from the xPack GNU RISC-V Embedded GCC package or it can be compiled from their main repository. Also you can take a look to the docker enviroment provided.

Docker enviroment

There is a docker enviroment image with all the dependencies already pre-installed. For getting docker check their installation instruction site.

Tip: If you run into problems running docker make sure you have:

  • WSL2 installed in case of Windows
  • Secure Boot disabled and Virtualization enabled in your BIOS settings

To set up the enviroment you can create a dev enviroment pointing to this repository or you can pull the image directly from the container registry and then run it:

docker pull git.1159.cl/mario1159/rvscc
docker run -it git.1159.cl/mario1159/rvscc

Build

To build the firmware that will be loaded in the instruction memory and the simulation testbenchs execute CMake in the project root directory using your system default toolchain (the CMake toolchain file will search automatically for a RISC-V toolchain to build the firmware).

cmake -Bbuild
cmake --build build

This will generate a sandbox.mem file in the /build folder. For other simualtors than verilator make sure to add the firmware it to your simulator sources and that the memory path matches the path specified in the memory module.

Tests

After building, test can be runned using CMake CTest.

ctest --test-dir build