Git Product home page Git Product logo

cva6-sdk's Introduction

CVA6 SDK

This repository houses a set of RISCV tools for the CVA6 core. Most importantly it does not contain openOCD.

Included tools:

  • Spike, the ISA simulator
  • riscv-tests, a battery of ISA-level tests
  • riscv-fesvr, the host side of a simulation tether that services system calls on behalf of a target machine
  • u-boot
  • opensbi, the open-source reference implementation of the RISC-V Supervisor Binary Interface (SBI)

As of now, the SDK has been designed and tested for the Digilent Genesys 2 FPGA board. To implement and test SDK for other boards in this repository, you can volunteer to create and drive a new project at the OpenHW Group.

Quickstart

Requirements Ubuntu:

$ sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev

Requirements Fedora:

$ sudo dnf install autoconf automake @development-tools curl dtc libmpc-devel mpfr-devel gmp-devel libusb-devel gawk gcc-c++ bison flex texinfo gperf libtool patchutils bc zlib-devel expat-devel

You can select the XLEN by setting it in the Makefile. Then compile the Linux images with

$ git submodule update --init --recursive
$ make images

Environment Variables

If you want to cross compile other projects for this target you can add buildroot/output/host/bin/ to your path in order to later make use of the installed tools after compiling them with :

$ make all

Linux

You can also build a compatible Linux image that boots Linux on the CVA6 fpga mapping:

$ make vmlinux # make only the elf Linux image
$ make uImage.bin # generate the Linux image with the u-boot wrapper
$ make fw_payload.bin # generate the OpenSBI + U-Boot payload

Or you can build everything directly with:

$ make images # generates all images and save them in install$(XLEN)

Spike

You can test your image on spike First, build spike with:

$ make isa-sim

Build the OpenSBI firmware with the Linux payload for the Spike platform:

$ make spike_payload

You can now launch Spike with OpenSBI + Linux

$ install$(XLEN)/bin/spike install$(XLEN)/spike_fw_payload.elf

Spike allows trace logging

$ install$(XLEN)/bin/spike --log-commits install$(XLEN)/spike_fw_payload.elf 2> trace.log.commits

Booting from an SD card

First compile the SBI firmware and the Linux image:

$ make images

The flash-sdcard Makefile recipe handle the creation of the GPT partition table and the flashing of fw_payload.bin and uImage at there correct offset. Be careful to set the correct SDDEVICE.

$ sudo -E make flash-sdcard SDDEVICE=/dev/sdb

OS X

Similar steps as above but flashing is sligthly different. Get sgdisk using homebrew.

$ brew install gptfdisk
$ sudo -E make flash-sdcard SDDEVICE=/dev/sdb

OpenOCD - Optional

If you really need and want to debug on an FPGA/ASIC target the installation instructions are here.

Ethernet SSH

This patch incorporates an overlay to overcome the painful delay in generating public/private key pairs on the target (which happens every time because the root filing system is volatile). Do not use these keys on more than one device. Likewise it also incorporates a script (rootfs/etc/init.d/S40fixup) which replaces the MAC address with a valid Digilent value. This should be replaced by the unique value on the back of the Genesys2 board if more than one device is used on the same VLAN. Needless to say both of these values would need regenerating for anything other than development use.

Docker Container

There is a pretty basic Docker container you can use to get a stable build environment to build the image.

$ cd container
$ sudo docker build -t ghcr.io/pulp-platform/ariane-sdk -f Dockerfile .

And build the image:

$ cd ..
$ sudo docker run -it -v `pwd`:/repo -w /repo -u $(id -u ${USER}):$(id -g ${USER}) ghcr.io/pulp-platform/ariane-sdk

cva6-sdk's People

Contributors

moschn avatar zarubaf avatar msfschaffner avatar dbees avatar eyssartk avatar jquevremont avatar zhangy-thu avatar kyaso 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.