Coder Social home page Coder Social logo

cithubs / rocket-rocc-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seldridge/rocket-rocc-examples

0.0 1.0 0.0 31 KB

Tests for example Rocket Custom Coprocessors

License: Other

Makefile 26.59% C 42.20% Assembly 20.76% M4 10.45%

rocket-rocc-examples's Introduction

Collection of example libraries and test programs for the existing Rocket Custom Coprocessor (RoCC) accelerators for Rocket Chip.

Usage

Install the RISC-V toolchain and make sure that it's on your path. You need to pass the path to riscv-tools in as an argument to configure --with-riscvtools=$PATH_TO_RISCV_TOOLS.

autoconf
mkdir build && cd build
../configure --with-riscvtools=$PATH_TO_RISCV_TOOLS
make

This creates two classes of tests:

Bare Metal tests can be run directly on the emulator (for instructions on how to build this see the following section), e.g.:

emulator-freechips.rocketchip.system-RoccExampleConfig bareMetal/examples-bareMetal-p-accumulator

Proxy Kernel tests are ELFs and need the Proxy Kernel (or Linux). You must first patch the Proxy Kernel so that the XS bits allow access to the "extension" (the RoCC). You can change this manually or use the provided patch (patches/riscv-pk.patch):

cd $RISCV_PK_DIR
git apply $THIS_REPO_DIR/patches/riscv-pk.patch

mkdir build
cd build
../configure --prefix=$RISCV/riscv64-unknown-elf --host=riscv64-unknown-elf
make
make install

Following that, you can run Proxy Kernel tests, e.g., :

emulator-freechips.rocketchip.system-RoccExampleConfig pk pk/examples-pk-accumulator

Building a Rocket Chip Emulator

Build a rocket-chip emulator with the RoCC examples baked in and run the provided test program:

cd $ROCKETCHIP_DIR/emulator
make CONFIG=RoccExampleConfig

Expected Run Time

The included test should run for ~5 million cycles over a wall clock time of ~5 minutes.

> time $ROCKETCHIP_DIR/emulator-freechips.rocketchip.system-RoccExampleConfig -c pk pk/examples-pk-accumulator
[INFO] Write R[1] = 0xdead
[INFO] Read R[1]
[INFO]   Received 0xdead (expected 0xdead)
[INFO] Accum R[1] with 0xffffffffffffe042
[INFO] Read R[1]
[INFO]   Received 0xbeef (expected 0xbeef)
[INFO] Load 0xbad (virt: 0x0xfee9ac0, phys: 0x0x8ffffac0) via L1 virtual address
[INFO] Read R[1]
[INFO]   Received 0xbad (expected 0xbad)
Completed after 3278954 cycles

real	5m2.738s
user	5m0.262s
sys	0m1.179s

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.