2019-06-29 15:04:58 +02:00
# RISCV-VP
2019-06-29 15:47:45 +02:00
An instruction set simulator based on DBT-RISE implementing the RISC-V ISA. The project is hosted at https://git.minres.com/VP/RISCV-VP.
2017-08-27 12:10:38 +02:00
2019-06-29 15:04:58 +02:00
**RISCV-VP README**
2017-08-27 12:10:38 +02:00
2019-06-29 15:04:58 +02:00
This is work in progress, so use at your own risk. Goal is to implement an open-source ISS which can easily embedded e.g. into SystemC Virtual Prototypes. It uses code generation to allow easy extension and adaptation of the used instruction. Please see also [https://git.minres.com/DBT-RISE/DBT-RISE-RISCV ](https://git.minres.com/DBT-RISE/DBT-RISE-RISCV )
The RISC-V ISS reaches about 65MIPS running on a decent Intel Processor.
2017-08-27 12:10:38 +02:00
2019-06-29 15:04:58 +02:00
The implementation is based on LLVM > v4.0. Eclipse CDT 4.7 (Oxygen) is recommended as IDE.
2017-08-27 12:10:38 +02:00
2019-06-29 15:04:58 +02:00
RISCV-VP uses libGIS (https://github.com/vsergeev/libGIS) as well as ELFIO (http://elfio.sourceforge.net/), both under MIT license
2017-08-27 12:10:38 +02:00
**Quick start**
2019-06-29 15:04:58 +02:00
* you need to have a C++11 capable compiler (e.g. gcc >= 4.8), make, python, and cmake installed
2018-11-08 13:31:28 +01:00
* install LLVM >= 4.0 according to http://apt.llvm.org/ (if it is not already provided by your distribution e.g by Ubuntu 18.04)
2017-10-29 20:56:20 +01:00
* install conan.io (see also http://docs.conan.io/en/latest/installation.html):
2020-03-30 21:41:35 +02:00
2017-10-26 11:41:35 +02:00
```
pip install conan
```
2020-03-30 21:41:35 +02:00
2017-10-29 20:56:20 +01:00
* setup conan to use the minres repo:
2020-03-30 21:41:35 +02:00
2017-10-26 11:41:35 +02:00
```
2017-11-23 11:24:25 +01:00
conan remote add minres https://api.bintray.com/conan/minres/conan-repo
2018-03-27 19:49:11 +02:00
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
2017-10-26 11:41:35 +02:00
```
2020-03-30 21:41:35 +02:00
2017-08-27 12:10:38 +02:00
* checkout source from git
2017-10-29 20:56:20 +01:00
* start an out-of-source build:
2020-03-30 21:41:35 +02:00
2017-10-26 11:41:35 +02:00
```
2019-06-29 15:04:58 +02:00
cd RISCV-VP
2017-08-27 12:10:38 +02:00
mkdir build
cd build
2017-09-25 21:17:55 +02:00
cmake ..
2017-10-26 11:41:35 +02:00
cmake --build .
2017-08-27 12:10:38 +02:00
```
2020-03-30 21:41:35 +02:00
2017-10-26 11:41:35 +02:00
* if you encounter issues when linking wrt. c++11 symbols you might have run into GCC ABI incompatibility introduced from GCC 5.0 onwards. You can fix this by adding '-s compiler.libcxx=libstdc++11' to the conan call or changing compiler.libcxx to
2020-03-30 21:41:35 +02:00
2017-10-26 11:41:35 +02:00
```
compiler.libcxx=libstdc++11
```
2020-03-30 21:41:35 +02:00
2017-11-28 03:45:49 +01:00
in $HOME/.conan/profiles/default
2018-07-12 15:28:34 +02:00
2020-01-11 10:07:02 +01:00
**Detailed Setup steps**
2018-07-12 15:28:34 +02:00
2020-01-11 10:07:02 +01:00
***prepare Ubuntu 18.04***
2018-07-12 15:28:34 +02:00
```
sudo apt-get install -y git python-pip build-essential cmake libloki-dev zlib1g-dev libncurses5-dev \
libboost-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev llvm-dev llvm-doc
pip install --user conan
```
2020-01-11 10:07:02 +01:00
***prepare Fedora 28***
2018-07-12 15:28:34 +02:00
```
#prepare system
dnf install @development -tools gcc-c++ boost-devel zlib-devel loki-lib-devel cmake python2 python3 llvm-devel llvm-static
#install conan
pip3 install --user conan
export PATH=${PATH}:$HOME/.local/bin
```
2020-01-11 10:07:02 +01:00
***Build the ISS***
2018-07-12 15:28:34 +02:00
```
# configure conan
conan remote add minres https://api.bintray.com/conan/minres/conan-repo
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
conan profile new default --detect
# clone and build DBT-RISE-RISCV
2020-01-11 10:07:02 +01:00
git clone --recursive https://git.minres.com/VP/RISCV-VP.git
cd RISCV-VP/
2018-07-12 15:28:34 +02:00
git checkout develop
2020-01-11 10:07:02 +01:00
git submodule update --recursive
2018-07-12 15:28:34 +02:00
mkdir build;cd build
MAKE_FLAGS="-j4" cmake ..
make -j4
```