RISC-V Simple Core Collection
Go to file
Mario Romero 1b18858d5f
Some checks are pending
continuous-integration/drone/push Build is pending
Rename include folder
2023-02-27 23:26:17 -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
hwinc Add 5 stage pipeline test and move timescale to include 2023-02-27 23:22:34 -03:00
include Rename include folder 2023-02-27 23:26:17 -03:00
rtl Add 5 stage pipeline test and move timescale to include 2023-02-27 23:22:34 -03:00
test Add 5 stage pipeline test and move timescale to include 2023-02-27 23:22:34 -03:00
.devcontainer.json Upgrade dev enviroment ecosystem 2023-02-19 18:08:41 +00:00
.dockerignore Update ignore files 2023-02-19 18:04:17 +00:00
.drone.yml
.gitignore Update ignore files 2023-02-19 18:04:17 +00:00
CMakeLists.txt
compose-dev.yaml Upgrade dev enviroment ecosystem 2023-02-19 17:25:22 +00:00
Dockerfile Add verilator-dev to the package list 2023-02-18 22:45:48 -03:00
README.md Update 'README.md' 2023-02-13 00:34:07 +00:00

Collection of SystemVerilog simple RV32I CPU cores

Table of contents

Core list

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

Directory structure

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

Requirements

  • SystemVerilog simulator
  • CMake
  • 32-bit GNU RISC-V toolchain

If your package manager does not provide the RISC-V GNU toolchain you can compile it from their main repository or for Windows you can download the xPack pre-compiled binaries.

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 pull the image from the container registry and 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 execute CMake in the fw directory specifying the RISC-V toolchain and build the recipe based in your selected generator (make in the following example).

cmake -Bbuild
cmake --build build

This will generate a sandbox.mem file in the /build folder. To load the file in the simulation make sure to add it to your simulator sources and that the memory path matches the path specifies in the memory module.

Tests

ctest --test-dir build

Benchmark

(TODO)