• Stars
    star
    641
  • Rank 67,417 (Top 2 %)
  • Language
    Scala
  • License
    Other
  • Created almost 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

educational microarchitectures for risc-v isa

About The Sodor Processor Collection

Note: This repo has been updated to be used with the Chipyard SoC Generator. For the old self-contained version of Sodor (which is no longer maintained), see https://github.com/ucb-bar/riscv-sodor/tree/sodor-old.

Diagrams: Sodor Github wiki

More documentation: Librecores Sodor wiki

Downstream development: Librecores Sodor

This repo has been put together to demonstrate a number of simple RISC-V integer pipelines written in Chisel:

  • 1-stage (essentially an ISA simulator)
  • 2-stage (demonstrates pipelining in Chisel)
  • 3-stage (uses sequential memory; supports both Harvard and Princeton versions)
  • 5-stage (can toggle between fully bypassed or fully interlocked)
  • "bus"-based micro-coded implementation

All of the cores implement the RISC-V 32b integer base user-level ISA (RV32I) version 2.0. None of the cores support virtual memory, and thus only implement the Machine-level (M-mode) of the Privileged ISA v1.10 .

All processors talk to a simple scratchpad memory (asynchronous, single-cycle), with no backing outer memory (the 3-stage is the exception - its scratchpad is synchronous). Programs are loaded in via JTAG or TSI, scratchpads 3-port memories (instruction, data, debug).

This repository is set up to use the Verilog file generated by Chisel3 which is fed to Verilator along with a test harness in C++ to generate and run the Sodor emulators.

This repo works great as an undergraduate lab (and has been used by Berkeley's CS152 class for 3 semesters and counting). See doc/ for an example, as well as for some processor diagrams. Be careful though - admittedly some of those documents may become dated as things like the Privileged ISA evolve.

Getting the repo and Building the processor emulators

This repo is NOT a self-running repository. Please follow the instruction in https://chipyard.readthedocs.io/en/latest/ to set up Chipyard and simulate Sodor cores.

FAQ

What is the goal of these cores?

First and foremost, to provide a set of easy to understand cores that users can easily modify and play with. Sodor is useful both as a quick introduction to the RISC-V ISA and to the hardware construction language Chisel3.

Are there any diagrams of these cores?

Diagrams of some of the processors can be found either in the Sodor Github wiki, in doc/, or in doc/lab1.pdf. A more comprehensive write-up on the micro-code implementation can be found at the CS152 website.

How do I generate Verilog code for use on a FPGA?

Chisel3 outputs verilog by default which can be generated by

cd emulator/rv32_1stage
make generated-src/Top.v

I want to help! Where do I go?

You can participate in the Sodor conversation on gitter. Downstream development is also taking place at Librecores. Major milestones will be pulled back here. Check it out! We also accept pull requests here!

TODO

Here is an informal list of things that would be nice to get done. Feel free to contribute!

  • Reduce the port count on the scratchpad memory by having the HTIF port share one of the cpu ports.
  • Provide a Verilog test harness, and put the 3-stage on a FPGA.
  • Add support for the ma_addr, ma_fetch ISA tests. This requires detecting misaligned address exceptions.
  • Greatly cleanup the common/csr.scala file, to make it clearer and more understandable.
  • Refactor the stall, kill, fencei, and exception logic of the 5-stage to be more understandable.
  • Update the u-code to properly handle illegal instructions (rv32mi-p-illegal) and to properly handle exceptions generated by the CSR file (rv32mi-p-csr).

More Repositories

1

chipyard

An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
Scala
1,415
star
2

gemmini

Berkeley's Spatial Array Generator
Scala
665
star
3

chisel-tutorial

chisel tutorial exercises and answers
Scala
643
star
4

riscv-mini

Simple RISC-V 3-stage Pipeline in Chisel
Scala
488
star
5

chisel2-deprecated

Scala
387
star
6

fpga-zynq

Support for Rocket Chip on Zynq FPGAs
Tcl
378
star
7

berkeley-hardfloat

Scala
264
star
8

hammer

Hammer: Highly Agile Masks Made Effortlessly from RTL
Python
228
star
9

berkeley-softfloat-3

SoftFloat release 3
C
208
star
10

dsptools

A Library of Chisel3 Tools for Digital Signal Processing
Scala
206
star
11

chiseltest

The batteries-included testing and formal verification library for Chisel-based RTL designs.
Scala
198
star
12

riscv-torture

RISC-V Torture Test
Scala
152
star
13

constellation

A Chisel RTL generator for network-on-chip interconnects
Scala
143
star
14

hwacha

Microarchitecture implementation of the decoupled vector-fetch accelerator
Scala
139
star
15

esp-llvm

UCB-BAR fork of LLVM! NOT UPSTREAM RISCV LLVM
C++
123
star
16

midas

FPGA-Accelerated Simulation Framework Automatically Transforming Arbitrary RTL
Scala
91
star
17

testchipip

Scala
74
star
18

sha3

Verilog
73
star
19

onnxruntime-riscv

Fork of upstream onnxruntime focused on supporting risc-v accelerators
C++
68
star
20

cosa

A scheduler for spatial DNN accelerators that generate high-performance schedules in one shot using mixed integer programming (MIP)
Python
66
star
21

ccbench

Memory System Microbenchmarks
C
57
star
22

zscale

Z-scale Microarchitectural Implementation of RV32 ISA
C
51
star
23

gemmini-rocc-tests

Fork of seldridge/rocket-rocc-examples with tests for a systolic array based matmul accelerator
C
48
star
24

chisel-gui

A prototype GUI for chisel-development
Scala
45
star
25

berkeley-testfloat-3

TestFloat release 3
C
42
star
26

hwacha-template

Template for projects using the Hwacha data-parallel accelerator
C
33
star
27

barstools

Useful utilities for BAR projects
Scala
31
star
28

RoSE

A unified simulation platform that combines hardware and software, enabling pre-silicon, full-stack, closed-loop evaluation of your robotic system.
Python
30
star
29

autophase

Python
27
star
30

cva6-wrapper

Wrapper for ETH Ariane Core
Scala
20
star
31

riscv-benchmarks

C
18
star
32

nvdla-wrapper

Wraps the NVDLA project for Chipyard integration
Verilog
17
star
33

MoCA

Scala
17
star
34

riscv-blas

Custom BLAS and LAPACK Cross-Compilation Framework for RISC-V
Fortran
16
star
35

libgloss-htif

A libgloss replacement for RISC-V that supports HTIF
C
16
star
36

esp-isa-sim

Custom extensions to the RISC-V isa simulator for the UCB-BAR ESP project
C
16
star
37

asyncqueue

Lightweight re-packaging of AsyncQueue library from rocket-chip
Scala
15
star
38

fpga-spartan6

Support for zScale on Spartan6 FPGAs
Verilog
15
star
39

shuttle

A Rocket-based RISC-V superscalar in-order core
Scala
13
star
40

chisel-awl

Scala
13
star
41

protoacc

Scala
11
star
42

midas-examples

Simple MIDAS Examples
Scala
10
star
43

firrtl-transform-tutorial

A template for developing custom FIRRTL transforms
Scala
10
star
44

vaesa

Learning A Continuous and Reconstructible Latent Space for Hardware Accelerator Design
Python
9
star
45

esp-tools

Shell
9
star
46

hammer-cadence-plugins

Hammer plugins for Cadence tools
Python
9
star
47

fpga-images-zedboard

prebuilt images for zedboard zynq fpga
9
star
48

context-dependent-environments

A Scala library for Context-Dependent Evironments
Scala
9
star
49

firrtl-uclid

Scala
8
star
50

chisel-sift

Scala
8
star
51

hammer-synopsys-plugins

Hammer plugins for synopsys tools
Python
8
star
52

rocket-dsp-utils

Tools for integrating DspTools components into a rocket-chip
Scala
8
star
53

midas-release

MIDAS Public Release
Scala
8
star
54

midas-top-release

MIDAS RocketChip Template
Scala
7
star
55

riscv-docker-images

Curated set of DockerFiles for RISC-V projects
Dockerfile
7
star
56

FFTGenerator

Scala
7
star
57

plsi-mdf

Macro description format
Scala
7
star
58

spec2017-workload

FireMarshal workload for SPEC2017
Python
7
star
59

midas-zynq

A zynq host-platform shell for midas generated simulators.
Tcl
7
star
60

maltese-smt

Archived! All relevant features are now part of the firrtl smt backend or the chiseltest library.
Scala
7
star
61

nvdla-workload

Base NVDLA Workload for FireMarshal
Shell
5
star
62

hwacha-net

C
5
star
63

dosa

DOSA: Differentiable Model-Based One-Loop Search for DNN Accelerators
Python
5
star
64

compress-acc

Scala
5
star
65

fixedpoint

Chisel Fixed-Point Arithmetic Library
Scala
5
star
66

esp-tests

Custom extensions to the RISC-V tests for the UCB-BAR ESP project
C
5
star
67

chipyard-toolchain-prebuilt

Pre-built riscv-gnu-toolchain binaries. You should most likely only shallow clone this.
Makefile
4
star
68

pwm-chisel-example

pwm-chisel-example for risc-v summer 2016 workshop
Scala
4
star
69

cs152-lab4

CS152 Lab 4
C
4
star
70

riscv-tools-feedstock

Shell
4
star
71

stac-top

The SRAM timing analysis chip for verifying SRAMs generated by SRAM22
Scala
3
star
72

opencl-kernels

OpenCL kernels for ucb-bar hardware
C
3
star
73

bits

Firebox Benchmarks
Python
3
star
74

chipper-tutorial

tutorial for chipper
C++
3
star
75

coremark-workload

FireMarshal workload for CoreMark EEMBC
Shell
3
star
76

spike-devices

Collection of device models for spike
C++
3
star
77

2023-winter-demo-project-power-aka-bora

Python
3
star
78

rerocc

Scala
3
star
79

riscv-v-spec

Working draft of the proposed RISC-V V vector extension
3
star
80

vcd2step

Converts a VCD file to a Chisel tester input file
C++
2
star
81

pocl

C
2
star
82

firrtl2

UC Berkeley Copy of the FIRRTL Compiler
Scala
2
star
83

chisel-torture

A tool that generates Chisel torture tests
C++
2
star
84

fpga-images-zybo

2
star
85

ibex-wrapper

Wrapper for lowRISC Ibex
Scala
2
star
86

bar-fetchers

Berkeley Architecture Research pre-Fetchers
Scala
2
star
87

lbnl-torch

LBNL TORCH Reference Kernels
C
2
star
88

chisel-library-template

Use for developing Chisel+Firrtl libraries
2
star
89

Baremetal-IDE

A submodule of Chipyard https://github.com/ucb-bar/chipyard
HTML
2
star
90

fpga-images-zc706

2
star
91

caliptra-aes-acc

SystemVerilog
2
star
92

testers-regression

Uses gcd to do some really basic speed comparisons
Scala
1
star
93

esp-test-env

Custom extensions to the RISC-V test environments for the UCB-BAR ESP project
C
1
star
94

chisel-release

Chisel release tooling
1
star
95

sha3-workload

FireMarshal workload for the sha3 example rocc accelerator
C
1
star
96

esp-tools-feedstock

Shell
1
star
97

stac-bringup

Bringup infrastructure for the SRAM Timing Analysis Chip
C
1
star
98

esp-opcodes

Custom extensions to the RISC-V opcodes for the UCB-BAR ESP project
TeX
1
star
99

esp-gnu-toolchain

Custom extensions to the RISC-V toolchain for the UCB-BAR ESP project
C
1
star
100

Baremetal-llama

C
1
star