-
Clang 3.8.0 or newer
-
Verilator master branch (4.015 devel rev UNKNOWN_REV)
Note that the versions mentioned above are known to work. Try other versions at your own peril. In particular, GHC 8.2.2 or newer works; Clang 10.0.0 or newer works but Clang 8.0.0 does not work; Verilator 4.013 devel rev UNKNOWN_REV or newer works.
-
RiscvSpecFormal: The top level repository containing the actual model in sub repositories along with several scripts for building and running https://github.com/sifive/RiscvSpecFormal
-
FpuKami: The formal specification of IEEE floating point standard (IEEE 754) in Kami and an implementation in Kami https://github.com/sifive/FpuKami
-
Kami: The Coq-based DSL + tactics + theorems to write and prove hardware in Coq https://github.com/sifive/Kami
-
ProcKami: The formal specification of RISCV-ISA written in Kami https://github.com/sifive/ProcKami
-
StdLibKami: The standard library of useful Kami modules https://github.com/sifive/StdLibKami
-
bbv: The bitvector library from MIT (stands for Bedrock Bit Vectors) https://github.com/mit-plv/bbv
-
coq-record-updates: Utility library for in-place updates of Coq (Gallina) records https://github.com/tchajed/coq-record-update
-
-
riscv-tests: https://github.com/riscv/riscv-tests
Note that in the following set of instructions sudo
permission is needed to install the tools from Ubuntu’s official repositories and other PPAs. One can also install these packages directly from sources without sudo
permission. Please refer to the specific packages websites for instructions on how to do it. If the following instructions are followed one after the other, one should be able to build the model and run most of the tests in riscv-tests (the instructions for running the tests are also provided).
sudo add-apt-repository ppa:jgross-h/many-coq-versions --yes
sudo apt-get update
sudo apt-get install coq-8.10.0 --yes
coqc --version
Note that this PPA installs ghc
in a non-standard location ($HOME/.ghcup/bin
) so as to not clobber your existing ghc
installation.
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
curl https://get-ghcup.haskell.org -sSf | sh
source $HOME/.ghcup/env
ghc --version
cabal --version
These instructions install RISCV GCC on the current directory and adds that directory to the path for later commands to execute correctly.
wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-linux-ubuntu14.tar.gz
tar xzf riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-linux-ubuntu14.tar.gz
export PATH=`pwd`/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-linux-ubuntu14/bin:$PATH
riscv64-unknown-elf-gcc --version
Verilator will be install inside the directory verilator-binary
, which will be added to the path.
git clone http://git.veripool.org/git/verilator
cd verilator
autoconf
./configure --prefix=`pwd`/../verilator-binary
make -j 4 && make install
export PATH=`pwd`/../verilator-binary/bin:$PATH
verilator --version
cd ..
git clone https://github.com/sifive/RiscvSpecFormal.git cd RiscvSpecFormal git submodule update --init
The following command builds the model and runs the riscv-tests. runTests.sh
requires the path of the directory where riscv-tests
are installed.
./runTests.sh --path `pwd`/../riscv-tests/isa --xlen 32
./runTests.sh --path `pwd`/../riscv-tests/isa --xlen 64
./runTests.sh --path `pwd`/../riscv-tests/isa --haskell-sim --xlen 32