• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language Verilog
  • License
    GNU General Publi...
  • Created almost 5 years ago
  • Updated over 3 years ago

Reviews

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

Repository Details

Fuxi (伏羲) is a 32-bit pipelined RISC-V processor written in Chisel3.

Fuxi

Test

Fuxi (伏羲) is a 32-bit pipelined RISC-V processor written in Chisel3.

datapath

Implemented ISAs

  • RV32I 2.1
  • Zifencei extension 2.0
  • Zicsr extension 2.0
  • M extension 2.0
  • A extension 2.0
  • Machine-level ISA 1.11
  • Supervisor-level ISA 1.11

Unimplemented Details

Fuxi processor is designed for running GeeOS, or other simple operating systems or bare-metal software. Considering the complexity, the following functions has not yet been implemented:

  • Memory privilege in mstatus register: MPRV bit and MXR bit are hardwired to 0.
  • Virtualization support in mstatus register: TVM bit, TW bit and TSR bit are hardwired to 0.
  • Physical Memory Protection: all PMP registers are hardwired to 0.

Performance

With default configuration:

  • Dhrystone 2.1: 0.60 DMIPS/MHz.
  • CoreMark: 2.15 CoreMark/MHz.

Getting Started

By issuing the following command lines, you can get generated verilog file in directory verilog/build:

$ git clone https://github.com/MaxXSoft/Fuxi
$ cd Fuxi
$ make

Running Tests

Running Unit Tests

All unit tests are available in directory src/test/scala. For example, unit test for decode stage is available in core/DecoderTest.scala, you can run this test by executing the following command lines:

$ sbt
> test:runMain core.DecoderTest

Running CoreTest

CoreTest is a special unit test provided in this repository, it can run simple RISC-V programs using the Fuxi core. We also provided some programs in directory src/test/resources. For example, you can run one of it:

$ sbt
> test:runMain core.CoreTest -if src/test/resources/fib.txt

Trace information during running program fib.txt will be printed to the console.

CoreTest supports the following command line arguments:

Option Abbreviation Argument Description
--init-file -if path to program file Specify the initialization file of ROM.
--trace-file -tf path to trace file Specify the trace file, default to empty.
--gen-trace -gt 0 or other values Set to 0 for trace comparison, otherwise use Fuxi core to generate trace file. Default to 0.

So you can test the core using a trace file generated by other processor or emulator:

> test:runMain core.CoreTest -if src/test/resources/fib.txt -tf src/test/resources/fib_trace.txt

For other details, please read the source file of CoreTest.scala.

All provided programs:

Name Description
fib.txt Generate the first 10 terms of the Fibonacci sequence.
mdu.txt Perform some multiplications and divisions.
mecall.txt Test machine mode environment call.
secall.txt Test supervisor mode environment call.

Running Other Test Benches

This part is under construction.

As we see in the top level module, the complete Fuxi processor consists of Core and CoreBus, the latter provides MMU, cache system and AXI4 interface for the Core part.

All of the unit test cases currently contained in this repository can only test modules in the Core part, we are still preparing the test bench the entire processor system. For now, you can build a tiny SoC by yourself based on some AXI4 IP cores to run other test benches you want.

Copyright and License

Copyright (C) 2010-2020 MaxXing. License GPLv3.

Special thanks to @Yukiteru Lee.

More Repositories

1

YuLang

The Yu (羽) programming language.
C++
74
star
2

GeeOS

The Gee (寂) Operating System, written in YuLang.
C++
34
star
3

laps

Build lexers and parsers by deriving traits.
Rust
21
star
4

sigma-vm

Sigma Virtual Machine.
Rust
20
star
5

fst-tools

Tools for manipulating Fast Signal Trace (FST) format waveforms.
C
12
star
6

Bossa

BOOM's Simulation Accelerator.
Scala
11
star
7

ZexVM

Zexium Virtual Machine (aka. ZexVM or ZVM)
C++
10
star
8

Frenda

Split large FIRRTL into separated modules for incremental compilation.
Scala
9
star
9

XSTL

write some gadgets to eXtend STL ...
C++
7
star
10

Ionia

Design and implementation of a functional scripting language.
C++
6
star
11

Risky32

Risky32 is a RISC-V emulator written in C++.
C++
5
star
12

Fuxi-Soft

Some bare-metal software that can run on Fuxi SoC.
C++
5
star
13

ImgEdit

ImgEdit is a simple tool for creating and editing FAT12 format floppy disk images.
C++
5
star
14

Chii

A QQ bot based on Mirai.
Kotlin
5
star
15

LuaPlate

Playing computer graphics with LuaPlate.
Lua
4
star
16

article-gen

An automatic article generator based on jieba and Hidden Markov Model (HMM)
Python
4
star
17

build_assert

Asserts const generic expressions at build-time.
Rust
4
star
18

key-node-list

Doubly-linked list that stores key-node pairs.
Rust
3
star
19

YuLang-doc

Documentation of YuLang.
HTML
3
star
20

Uranus-OOPA

Uranus OOPA (Out-of-Order Pepper Architecture)
Verilog
3
star
21

Deeplearning-Notes

Some notes about deeplearning (TVM).
Python
3
star
22

PL-0.1

Implement a PL/0 compiler and interpreter from scratch
C++
3
star
23

Saby

The Saby Programming Language
C++
3
star
24

vscode-yulang

Extension of YuLang for Visual Studio Code.
2
star
25

canvas-flat

write code to learn computer graphics
C++
2
star
26

MIPSim

A simple MIPS simulator, designed for Project Uranus
C++
2
star
27

300words

300words is an open source story solitaire website framework.
PHP
2
star
28

fir2smv

Convert FIRRTL to NuSMV/nuXmv input file (SMV file).
Scala
2
star
29

brainfuck

implements BrainFuck interpreter in a variety of ways
Assembly
1
star
30

simple-calc

A simple calculator based on a recursive descent parser.
C++
1
star
31

NeuralGen

A naive neural network generator, OpenCL supported.
C++
1
star
32

Zodia

A toy 2D game engine, based on SDL2 and Ionia.
C++
1
star
33

qpoints

QEMU plugin for generating BBV data.
C++
1
star
34

reX

a simple regular expression engine & lexer generator
C++
1
star
35

ZexGP

A toy framework written in Python for developing genetic programming applications.
Python
1
star