All Projects → ucb-bar → Riscv Mini

ucb-bar / Riscv Mini

Licence: bsd-3-clause
Simple RISC-V 3-stage Pipeline in Chisel

Programming Languages

scala
5932 projects

Labels

Projects that are alternatives of or similar to Riscv Mini

SaxonSoc
SoC based on VexRiscv and ICE40 UP5K
Stars: ✭ 112 (-49.32%)
Mutual labels:  riscv, rtl
Scr1
SCR1 is a high-quality open-source RISC-V MCU core in Verilog
Stars: ✭ 393 (+77.83%)
Mutual labels:  riscv, rtl
tree-core-cpu
A series of RISC-V soft core processor written from scratch. Now, we're using all open-source toolchain( chisel, mill, verilator, NEMU, AM and difftest framework, etc) to design and verify.
Stars: ✭ 22 (-90.05%)
Mutual labels:  riscv, rtl
Dana
Dynamically Allocated Neural Network Accelerator for the RISC-V Rocket Microprocessor in Chisel
Stars: ✭ 160 (-27.6%)
Mutual labels:  riscv, rtl
Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+380.54%)
Mutual labels:  riscv, rtl
Cores Swerv
SweRV EH1 core
Stars: ✭ 406 (+83.71%)
Mutual labels:  riscv, rtl
Quasar
Quasar 2.0: Chisel equivalent of SweRV-EL2
Stars: ✭ 19 (-91.4%)
Mutual labels:  riscv, rtl
Cores Swerv El2
SweRV EL2 Core
Stars: ✭ 79 (-64.25%)
Mutual labels:  riscv, rtl
Riscv Boom
SonicBOOM: The Berkeley Out-of-Order Machine
Stars: ✭ 852 (+285.52%)
Mutual labels:  riscv, rtl
Chipyard
An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
Stars: ✭ 436 (+97.29%)
Mutual labels:  riscv, rtl
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (-65.16%)
Mutual labels:  riscv, rtl
Rocket Chip
Rocket Chip Generator
Stars: ✭ 2,079 (+840.72%)
Mutual labels:  riscv, rtl
Postcss Rtl
PostCSS plugin for RTL-adaptivity
Stars: ✭ 143 (-35.29%)
Mutual labels:  rtl
Fpga readings
Recipe for FPGA cooking
Stars: ✭ 164 (-25.79%)
Mutual labels:  rtl
Riscv Card
An unofficial reference sheet for RISC-V.
Stars: ✭ 140 (-36.65%)
Mutual labels:  riscv
Gentelella Rtl
Free RTL Bootstrap 3 Admin Template
Stars: ✭ 194 (-12.22%)
Mutual labels:  rtl
Chisel3
Chisel 3: A Modern Hardware Design Language
Stars: ✭ 2,290 (+936.2%)
Mutual labels:  rtl
Rvemu For Book
Reference implementation for the book "Writing a RISC-V Emulator in Rust".
Stars: ✭ 141 (-36.2%)
Mutual labels:  riscv
Rustsbi
RISC-V Supervisor Binary Interface (RISC-V SBI) implementation in Rust; runs on M-mode; good support for embedded Rust ecosystem
Stars: ✭ 138 (-37.56%)
Mutual labels:  riscv
Pinlayout
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]
Stars: ✭ 1,870 (+746.15%)
Mutual labels:  rtl

riscv-mini

Author: Donggyu Kim ([email protected])

riscv-mini is a simple RISC-V 3-stage pipeline written in Chisel. It has been a crucial example in various project developments, including Chisel3, FIRRTL, Strober, simulation and verification methodologies. It implements RV32I of the User-level ISA Version 2.0 and the Machine-level ISA of the Privileged Architecture Version 1.7. Unlike other simple pipelines, it also contains simple instruction and data caches.

Note that a real-world processor is not the goal of riscv-mini. It is developed as an intermediate example before diving into rocket-chip.

Datapath Diagram

pipeline

Getting Started

$ git clone https://github.com/ucb-bar/riscv-mini.git
$ cd riscv-mini
$ make            # generate firrtl & verilog files in generated-src

The verilog output file can be used for verilator simulation or the ASIC tool flow.

Running Verilator Simulation

First, generate the verilator binary:

$ make verilator

This will generate VTile in the top-level directory.

Now, you can run verilator simulation for a given hex file as follows:

$ ./VTile <hex file> [<vcd file> 2> <log file>]

<vcd file> and the pipe to <log file> are optional. The waveform is dumped to dump.vcd and the execution trace is printed in the screen by default.

The following command runs the whole test hex files in verilator and dumps the traces and the waveforms to the 'outputs' directory:

$ make run-tests

Unit and Integration Tests with sbt

riscv-mini provides synthesizable unit & integration tests. Theres are six sets of unit tests(ALUTests, BrCondTests, ImmGenTests, CSRTests, CacheTests, DatapathTests), running user-defined test vectors. To execute them, first launch sbt with make sbt and run:

> testOnly mini.[testname]

There are also six sets of integration tests, running the hex files from riscv-tests. To execute them, also launch sbt and run:

> testOnly mini.[Core|Tile][Simple|ISA|Bmark]Tests

Core only contains the datapath and the control unit, while Tile also contains I$ and D$. Simple only runs rv32ui-p-simple, ISA runs the whole ISA tests, and Bmark runs five benchmarks(median, multiply, qsort, towers, vvadd). Note that all tests in a set run in parallel.

Finally, to run all the tests, just in sbt:

> test

Running Your Own Program on riscv-mini

At this point, you may want to implement and exeucte your custom application on riscv-mini. In this case, you need to install RISC-V tools for priv 1.7. This repo provides a script to install the correct version of tools. Run the script as follows:

$ export RISCV=<path to riscv tools for priv 1.7>
$ ./build-riscv-tools

It takes a while to install the toolchain, so please be patient.

This repo also provides a template for your own program in custom-bmark. Add your c or assembly code and edit Makefile. Next, to compile you program, run make in custom-bmark to generate the binary, dump, and the hex files. Finally, run the following command in the base directory:

$ make run-custom-bmark
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].