the repository contains VPU source code writen in Chisel, corresponding to rocket-chip and patch for rocket-chip.
checkout tag v1.2.6 of rocket-chip
$ git clone https://github.com/chipsalliance/rocket-chip.git
$ cd rocket-chip
$ git checkout v1.2.6
$ git submodule update --init --recursive
checkout riscv-gnu-toolchain rvv-0.8.x branch
$ git clone https://github.com/riscv/riscv-gnu-toolchain.git
$ cd riscv-gnu-toolchain
$ git checkout rvv-0.8.x
$ git submodule update --init --recursive
install riscv-gnu-toolchain prerequisites describes:
$ sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
install riscv-gnu-toolchain
$ export RISCV=/path/to/install/riscv-gnu-toolchain
$ ./configure --prefix=$RISCV
$ make
$ sudo apt-get install default-jdk
$ echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/ apt/$ sources.list.d/sbt.list$
$ sudo apt-key adv --keys$ erve r hkp://keyserver.ubuntu.com:80 --rec v $ 642AC823$
$ sudo apt-get update
$ sudo apt-get install sbt
install verilator, optional, which will be auto installed when running simulation in rocket-chip/emulator
$ sudo apt-get install git make autoconf g++ flex bison
$ git clone http://git.veripool.org/git/verilator
$ git pull
$ git checkout v4.016
$ unset VERILATOR_ROOT
$ autoconf
$ ./configure
$ make
$ sudo make install
$ cd rocket_chip_vpu
$ cp 0001-feat-integrate-VPU-which-is-based-on-0.8-release-SPE.patch /path/to/clone/rocket-chip
$ cd /path/to/clone/rocket-chip
$ git am 0001-feat-integrate-VPU-which-is-based-on-0.8-release-SPE.patch
first copy vpu folder to rocket-chip
$ cp -R vpu /path/to/clone/rocket-chip
then make verilog
$ cd /patch/to/clone/rocket-chip/vsim
$ make verilog CONFIG=VPUConfig
VPU depends on hardfloat repo.
To compile VPU, there are three ways to supply source files.
- the first way is to copy all scala files to vpu/src/main/scala/hardfloat
$ cd vpu
$ mkdir -p src/scala/main/hardfloat
$ cp /path/to/clone/hardfloat/src/main/scala/* src/scala/main/hardfloat
$ make verilog
- the second way is to depend on remote repo, which is writen in build.sbt
$ cd vpu
$ make verilog
- the last way is to place hardfloat repo in rocket_chip_vpu/vpu
$ git clone https://github.com/ucb-bar/berkeley-hardfloat.git
$ sed -i '62,63s/^\/\///g' vpu/build.sbt
$ cd vpu
$ make verilog