Skip to content

Latest commit

 

History

History
319 lines (245 loc) · 8.73 KB

README.org

File metadata and controls

319 lines (245 loc) · 8.73 KB

pulpissimo installation guide

Note: the following instructions are adapted from this blog and my experience with the installation

table of contents

system status

os: Ubuntu 20.04.6 LTS

gcc: 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

questa sim: Questa Intel starter FPGA Edition-64 2021.2

pulp-riscv-toolchain

git clone --recursive https://github.com/pulp-platform/pulp-riscv-gnu-toolchain

or, download latest releases from: https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/

requirements

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

# change owner of /opt/riscv to from root to user to avoid further complications
sudo mkdir /opt/riscv
sudo chown -R $USER:$USER /opt/riscv

install newlib cross-compiler for all pulp variants

cd pulp-riscv-gnu-toolchain
# config
./configure --prefix=/opt/riscv --with-arch=rv32imc --with-cmodel=medlow --enable-multilib
# make
make

# add path
export RISCV=/opt/riscv
export PULP_RISCV_GCC_TOOLCHAIN=$RISCV
export PATH=$PATH:$RISCV/bin

pulpissimo

git clone https://github.com/pulp-platform/pulpissimo.git

or download from latest release: https://github.com/pulp-platform/pulpissimo/releases

I have used the released version: v7.0.0

wget https://github.com/pulp-platform/pulpissimo/archive/refs/tags/v7.0.0.tar.gz
mkdir pulpissimo
tar -xvzf v7.0.0.tar.gz -C pulpissimo --strip-components 1
# export VSIM_PATH=<pulpissimo root folder>/sim
export VSIM_PATH=$HOME/pulpissimo/sim

requirements

pip3 install --user artifactory twisted prettytable sqlalchemy pyelftools 'openpyxl==2.6.4' xlsxwriter pyyaml numpy configparser pyvcd sphinx

pulp-runtime

requirements

sudo apt install python3-pip gawk texinfo libgmp-dev libmpfr-dev libmpc-dev
sudo pip3 install pyelftools

following not recommended, build from pulpissimo makefile: pulp-runtime from pulpissimo

git clone https://github.com/pulp-platform/pulp-runtime.git

or download from latest release: https://github.com/pulp-platform/pulp-runtime/releases

build

Choose the configuration for which you want to compile the runtime, for example:

source configs/pulp.sh

pulp-runtime from pulpissimo

from pulpissimo root directory

cd $HOME/pulpissimo
make pulp-runtime

cd ./pulp-runtime
source configs/pulpissimo.sh

pulp-sdk

new pulp-sdk do not support pulpissimo, better to clone/build from pulpissimo repository commands, jump to pulp-sdk from pulpissimo

requirements

sudo apt-get install -y build-essential git libftdi-dev libftdi1 doxygen python3-pip libsdl2-dev curl cmake libusb-1.0-0-dev scons gtkwave libsndfile1-dev rsync autoconf automake texinfo libtool pkg-config libsdl2-ttf-dev

pip install --user argcomplete pyelftools

download

git clone https://github.com/pulp-platform/pulp-sdk.git

or, download latest releases from: https://github.com/pulp-platform/pulp-sdk/releases

build gvsoc

cd pulp-sdk
# Source the file corresponding to the desired configuration:
source configs/pulp-open.sh

make build

pulp-sdk from pulpissimo

build pulp-sdk
cd $HOME/pulpissimo
make build-pulp-sdk

source ./env/pulpissimo.sh

rebuild sdk

only when required, not required for the installation
cd $HOME/pulpissimo/pulp-sdk
make all

build RTL platform

cd $HOME/pulpissimo
# build rtl simulation
make checkout

# questasim/modelsim should be installed with 'vlib' command available
source setup/vsim.sh
make build

run example

clone outside of ‘pulpissimo’ directory

for the sdk:

git clone https://github.com/pulp-platform/pulp-rt-examples.git

prepare the enviroment in the pulpissimo root directory: do not why load both ~pulp-runtime~ and ~pulp-sdk~

# at the root directory of Pulpissimo
cd $HOME/pulpissimo

source ./pulp-runtime/configs/pulpissimo.sh
source ./env/pulpissimo.sh
source ./pulp-sdk/configs/pulpissimo.sh

if you get the following line then rebuild sdk

bash: /pulpissimo/pulp-sdk/sourceme.sh: No such file or directory
cd pulp-rt-examples/hello

# terminal output
make clean all run

# following commands not tested yet
# see waveform
make clean all
make run vsim/script=export_run.tcl

# for gui
make run gui=1
# save vcd file
make run vsim/script=export_run.tcl

for the simple runtime:

git clone https://github.com/pulp-platform/pulp-runtime-examples.git

cd pulp-runtime-examples/hello
make clean all run

WAITING rtl development

if rtl changed, rebuild again, after that execute the example to test

cd pulpissimo
./generate-scripts
make clean build

WAITING virtual platform

not yet tested

source sourceme.sh
source configs/platform-gvsoc.sh

errors during installation

error 1: issue 275

* Error (suppressible): (vopt-14401) Option specified: +acc=mnpr. Following acc options are now deprecated 'f' 'm' 'q' 't' 'x' 'y'.

solution:

edit file: pulpissimo/sim/tcl_files/rtl_vopt.tcl

replace: vopt +acc=mnpr to vopt +acc in line 28 and 30

error 2: issue 340

the floatparams flag is set on line: 28 of pulpissimo/sim/tcl_files/rtl_vopt.tcl

the answer mentions that removing the option may cause crushing the simulators and also break some testbench stuff, so be aware of that.

after fixing error 1 and 2, line: 28 will be:

eval exec >@stdout vopt +acc -o vopt_tb tb_pulp  $VSIM_IP_LIBS $VSIM_RTL_LIBS -work work

error 3: issue 385

GLIBCXX 3.4.XX not found in conda environment

the error report may not match, I do not have the screenshot at the moment

solution:followed from the link

  • check if the required version is already in your system, (in my case it was)
  • after that execute in the terminal: ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/<usrname>/anaconda3/lib/libstdc++.so.6

settings to use after installation

export the following paths or put it in .bashrc file

export RISCV=/opt/riscv
export PULP_RISCV_GCC_TOOLCHAIN=$RISCV
export PATH=$PATH:$RISCV/bin
export VSIM_PATH=$HOME/pulpissimo/sim

source the target for simulation

cd $HOME/pulpissimo/pulp-sdk
# Target select
source configs/pulpissimo.sh

# Platform select: env/pulpissimo loads it
# source configs/platform-rtl.sh

# SDK setup
source pkg/sdk/dev/sourceme.sh

# RTL setup
cd $HOME/pulpissimo
# source setup/vsim.sh
# better load more things
source env/pulpissimo.sh

# in case required
source ./pulp-runtime/configs/pulpissimo.sh