Coder Social home page Coder Social logo

riscv-chisel's Introduction

RISC-V Chisel Project

This is a simple RISC-V 5-stage pipeline written in Chisel. It now implements RV32I Base Integer Instruction Set, Version 2.1, and will implement the Machine-level ISA of the Privileged Architecture Version 1.11 in the future. Also, simple instruction and data caches planed to add.

How to get started

The first thing you want to do is clone this repo into a directory of your own. I'd recommend creating a chisel projects directory somewhere

mkdir ~/ChiselProjects
cd ~/ChiselProjects

git clone https://github.com/lxu28973/riscv-chisel.git ChiselProject
cd ChiselProject

Generate verilog

You should now have a project based on Chisel3 that can be run.
So go for it, at the command line in the project root.

sbt 'test:runMain riscv5stages.TopMain'

You should see a whole bunch of output that ends with something like the following lines

[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] running riscv5stages.TopMain 
[info] [0.003] Elaborating design...
[info] [1.276] Done elaborating.
Computed transform order in: 412.8 ms
Total FIRRTL Compile Time: 2243.0 ms
file loaded in 0.271195238 seconds, 840 symbols, 809 statements
[info] [0.002] SEED 1608361638323
test Top Success: 0 tests passed in 1015 cycles in 0.222829 seconds 4555.07 Hz
[info] [0.196] RAN 1010 CYCLES PASSED
[success] Total time: 6 s, completed Dec 19, 2020, 3:07:23 PM

If you see the above then...

It worked!

You are ready to go.

Some backends (verilator for example) produce VCD files by default, while other backends (firrtl and treadle) do not. You can control the generation of VCD files with the --generate-vcd-output flag.

To run the simulation and generate a VCD output file regardless of the backend:

sbt 'test:runMain riscv5stages.TopMain --generate-vcd-output on'

To run the simulation and suppress the generation of a VCD output file:

sbt 'test:runMain riscv5stages.TopMain --generate-vcd-output off'

Development/Bug Fixes

If you have bug fixes or changes you would like to see incorporated in this repo, please checkout the main branch and submit pull requests against it.

riscv-chisel's People

Contributors

lxu28973 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.