The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
Find a file
2018-04-18 15:11:14 +02:00
ci Update riscv-gcc 2018-03-14 10:01:12 +01:00
docs Remove old and merged documentation 2018-01-25 10:58:04 +01:00
failedtests Update riscv-torture test framework 2018-01-23 17:12:27 +01:00
include Add placeholders for PMP CSRs for memory protection. 2018-04-18 15:11:14 +02:00
riscv-torture@4e1c13adc5 Clean-up add github remotes to submodules 2018-01-26 10:15:53 +01:00
src Add placeholders for PMP CSRs for memory protection. 2018-04-18 15:11:14 +02:00
tb@346ab824aa Implement RVC without RVI perf impact 2018-02-15 18:23:00 +01:00
.editorconfig 📝 Update doc add .travis.yml 2018-02-05 13:22:52 +01:00
.gitignore Add correct dependencies 2018-03-06 17:20:47 +01:00
.gitlab-ci.yml 📝 Update doc add .travis.yml 2018-02-05 13:22:52 +01:00
.gitmodules 🚧 Working on FPU integration to Ariane 2018-04-18 15:10:55 +02:00
.travis.yml Merge branch 'new-frontend' into ariane_next 2018-03-14 14:35:49 +01:00
ariane-run-torture 🐛 Resolve bug emerging from merge 2017-12-17 16:57:37 +01:00
ariane.core Add FuseSoC support for building verilator model 2018-02-27 22:34:35 +01:00
Bender.yml Remove regfile_ff from bender file 2018-03-16 16:37:17 +01:00
CHANGELOG.md Merge branch 'new-frontend' into ariane_next 2018-03-14 14:35:49 +01:00
CONTRIBUTING.md Update headers and style guide 2018-01-18 17:45:00 +01:00
LICENSE Add SolderPad Hardware License 2018-01-16 10:07:39 +01:00
Makefile Add placeholders for PMP CSRs for memory protection. 2018-04-18 15:11:14 +02:00
README.md README update for #21 2018-03-14 11:57:13 +05:30
src_files.yml Adapt src_files.yml to reflect src file changes 2018-03-21 09:45:41 +01:00

Build Status

Ariane RISC-V CPU

Ariane is a 6-stage, single issue, in-order CPU which implements the 64-bit RISC-V instruction set. It fully implements I, M and C extensions as specified in Volume I: User-Level ISA V 2.1 as well as the draft privilege extension 1.10. It implements three privilege levels M, S, U to fully support a Unix-like operating system.

It has configurable size, separate TLBs, a hardware PTW and branch-prediction (branch target buffer and branch history table). The primary design goal was on reducing critical path length.

Getting Started

Go and get the RISC-V tools.

Checkout the repository and initialize all submodules

git clone https://github.com/pulp-platform/ariane.git
git submodule update --init --recursive

The Verilator testbench relies on our forked version of riscv-fesvr which can be found here. Follow the README there and make sure that your compiler and linker is aware of the library (e.g.: add it to your path if it is in a non-default directory).

Build the Verilator model of Ariane by using the Makefile:

make verilate

This will create a C++ model of the core including a SystemVerilog wrapper and link it against a C++ testbench (in the tb subfolder). The binary can be found in the obj_dir and accepts a RISC-V ELF binary as an argument, e.g.:

obj_dir/Variane_wrapped -p rv64um-v-divuw

The Verilator testbench makes use of the riscv-fesvr. That means that bare riscv-tests can be run on the simulator.

Due to the way the C++ testbench is constructed we need a slightly altered version of the riscv-fesvr which can be found here.

Running custom C-code

It is possible to cross compile and run your own C-code or benchmarks on Ariane. The following steps need to be followed to compile and run:

Compile the file using the following command (you need to have the riscv-tests repo checked-out):

riscv64-unknown-elf-gcc -I./riscv-tests/benchmarks/../env -I./riscv-tests/benchmarks/common \
-DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common \
-fno-builtin-printf ./riscv-tests/benchmarks/common/syscalls.c -static -nostdlib \
./riscv-tests/benchmarks/common/crt.S  -nostartfiles -lm -lgcc \
-T ./riscv-tests/benchmarks/common/test.ld -o hello.riscv hello.c

Use the generated ELF file as an input to the Verilator model:

obj_dir/Variane_wrapped -p hello.riscv

Planned Improvements

While developing Ariane it has become evident that, in order to support Linux, the atomic extension is going to be mandatory. While the core is currently booting Linux by emulating Atomics in BBL (in a single core environment this is trivially met by disabling interrupts) this is not the behavior which is intended. For that reason we are going to fully support all atomic extensions in the very near future.

Furthermore, we have major IPC improvements planned. Specifically this will resolve about the way branches and jumps are currently handled in the core.

Going Beyond

The core has been developed with a full licensed version of QuestaSim. If you happen to have this simulator available yourself here is how you could run the core with it. You need to generate both an elf file and a hex file, most easily this can be done by calling:

elf2hex 8 2097152 elf_file.riscv 2147483648  > elf_file.riscv.hex

Start the simulation using Modelsim:

make build
make sim

To specify the test to run use (e.g.: you want to run rv64ui-p-sraw inside the tmp/risc-tests/build/isa folder:

make sim riscv-test=rv64ui-p-sraw

If you need to specify a different directory you can pass the optional riscv-test-dir flag:

make sim riscv-test=elf_name riscv-test-dir=/path/to/elf/and/hex/file

If you call simc instead of sim it will run without the GUI.

Unit Tests

Or start any of the unit tests by:

make alu

Randomized Constrained Testing with Torture

Ariane's core testbench is fully compatible with the randomized constrained testing framework called Torture. To start testing Ariane all you need is to step into the riscv-torture/ folder and issue:

make rgentest

Which will produce a single randomized program, runs it on Spike (see Getting Started) and on the RTL simulator (QuestaSim) by calling ariane-run-torture.

Torture's overnight tests work the same way, just call

make rnight

C (a.k.a. Verilator) tests are currently not supported.

Contributing

Check out the contribution guide