├── .gitignore ├── .gitmodules ├── README.md ├── configs ├── board.sh ├── common.sh ├── fpgas │ └── pulpissimo │ │ └── genesys2.sh ├── pulp.sh ├── pulpissimo.sh ├── pulpissimo_ibex.sh └── rtl.sh ├── install └── rules │ └── pulp.mk └── scripts ├── build-runtime ├── clean └── deprecated ├── build-gvsoc └── update-gvsoc /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | install/ 3 | all_state.txt 4 | core_state.txt 5 | efuse_preload.data 6 | plt_config.json 7 | rt_state.txt 8 | stimuli/ 9 | test.debugInfo 10 | tx_uart.log 11 | 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pulp-configs"] 2 | path = pulp-configs 3 | url = https://github.com/pulp-platform/pulp-configs.git 4 | [submodule "json-tools"] 5 | path = json-tools 6 | url = https://github.com/pulp-platform/json-tools.git 7 | [submodule "runner"] 8 | path = runner 9 | url = https://github.com/pulp-platform/runner.git 10 | [submodule "pulp-runtime"] 11 | path = pulp-runtime 12 | url = git@github.com:pulp-platform/pulp-runtime.git 13 | [submodule "plptest"] 14 | path = plptest 15 | url = https://github.com/pulp-platform/plptest.git 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PULP builder 2 | 3 | 4 | ## About 5 | 6 | This module is a build process for the PULP runtime. 7 | 8 | ### Runtime build 9 | 10 | You need to first install the Linux dependencies (see [below](#dependencies)). 11 | 12 | Get the submodules: 13 | 14 | $ git submodule update --init 15 | 16 | Choose the configuration for which you want to compile the runtime, for example: 17 | 18 | $ source configs/pulp.sh 19 | 20 | Then execute this script: 21 | 22 | $ ./scripts/build-runtime 23 | 24 | Then you can get one of the pulp example, compile and run it. 25 | 26 | 27 | ## Linux dependencies 28 | 29 | Here are the required system dependencies for building the SDK and its dependencies. 30 | 31 | ### Ubuntu 16.04 32 | 33 | Starting from a fresh Ubuntu 16.04 distribution, here are the commands to be executed to get all required dependencies: 34 | 35 | $ sudo apt install git python3-pip gawk texinfo libgmp-dev libmpfr-dev libmpc-dev swig3.0 libjpeg-dev lsb-core doxygen python-sphinx sox graphicsmagick-libmagick-dev-compat libsdl2-dev libswitch-perl libftdi1-dev cmake scons libsndfile1-dev 36 | $ sudo pip3 install twisted prettytable pyelftools openpyxl xlsxwriter pyyaml numpy configparser pyvcd 37 | $ sudo pip2 install configparser 38 | 39 | ### Scientific Linux 7.4 40 | 41 | Starting from a fresh Scientific Linux 7.4 distribution, here are the commands to be executed to get all required dependencies: 42 | 43 | $ sudo yum install git python34-pip python34-devel gawk texinfo gmp-devel mpfr-devel libmpc-devel swig libjpeg-turbo-devel redhat-lsb-core doxygen python-sphinx sox GraphicsMagick-devel ImageMagick-devel SDL2-devel perl-Switch libftdi-devel cmake scons 44 | $ sudo pip3 install twisted prettytable pyelftools openpyxl xlsxwriter pyyaml numpy configparser pyvcd 45 | $ sudo pip2 install configparser 46 | 47 | ## Dependencies 48 | 49 | ### Build 50 | 51 | Have a look at the dependencies documentation to see how to build them. 52 | 53 | You can have a look [here](https://github.com/pulp-platform/pulp-riscv-gnu-toolchain.git) for the toolchain. 54 | 55 | ### Setup 56 | 57 | The toolchain must be built separately and the following environment variable should set: 58 | 59 | $ export PATH=/bin:$PATH 60 | 61 | RTL platforms should also be built separately (see the platform documentation for that) and the following 62 | environment variable must point to the folder where the platform was installed (this example is for pulpissimo): 63 | 64 | $ export VSIM_PATH=/sim 65 | 66 | -------------------------------------------------------------------------------- /configs/board.sh: -------------------------------------------------------------------------------- 1 | export PULPRUN_PLATFORM=board 2 | -------------------------------------------------------------------------------- /configs/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | add_path() { 4 | export PATH=${PATH//":$1:"/:} 5 | export PATH=${PATH/%":$1"/} 6 | export PATH=${PATH/#"$1:"/} 7 | export PATH="$1${PATH:+":$PATH"}" 8 | } 9 | 10 | add_ld_path() { 11 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH//":$1:"/:} 12 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH/%":$1"/} 13 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH/#"$1:"/} 14 | export LD_LIBRARY_PATH="$1${LD_LIBRARY_PATH:+":$LD_LIBRARY_PATH"}" 15 | } 16 | 17 | add_PYTHONPATH() { 18 | export PYTHONPATH=${PYTHONPATH//":$1:"/:} 19 | export PYTHONPATH=${PYTHONPATH/%":$1"/} 20 | export PYTHONPATH=${PYTHONPATH/#"$1:"/} 21 | export PYTHONPATH="$1${PYTHONPATH:+":$PYTHONPATH"}" 22 | } 23 | 24 | scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" 25 | 26 | install_dir=$scriptDir/install/ws 27 | 28 | add_path $install_dir/bin 29 | add_ld_path $install_dir/lib 30 | add_PYTHONPATH $install_dir/python 31 | 32 | export PULP_CONFIGS_PATH=$install_dir/configs 33 | export INSTALL_DIR=$install_dir 34 | export PULP_SDK_INSTALL=$install_dir 35 | -------------------------------------------------------------------------------- /configs/fpgas/pulpissimo/genesys2.sh: -------------------------------------------------------------------------------- 1 | scriptDir="$(dirname "$(dirname "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")")")" 2 | 3 | export PULP_SDK_HOME=$scriptDir 4 | 5 | source $PULP_SDK_HOME/pulp-runtime/configs/pulpissimo.sh 6 | source $PULP_SDK_HOME/configs/common.sh 7 | 8 | export PULP_CURRENT_CONFIG=pulpissimo@config_file=fpgas/pulpissimo/genesys2.json 9 | 10 | export PULPRUN_PLATFORM=fpga 11 | 12 | export io=uart -------------------------------------------------------------------------------- /configs/pulp.sh: -------------------------------------------------------------------------------- 1 | scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" 2 | 3 | export PULP_SDK_HOME=$scriptDir 4 | 5 | source $PULP_SDK_HOME/pulp-runtime/configs/pulp.sh 6 | source $PULP_SDK_HOME/configs/common.sh 7 | 8 | export PULP_CURRENT_CONFIG=pulp@config_file=chips/pulp/pulp.json 9 | -------------------------------------------------------------------------------- /configs/pulpissimo.sh: -------------------------------------------------------------------------------- 1 | scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" 2 | 3 | export PULP_SDK_HOME=$scriptDir 4 | 5 | source $PULP_SDK_HOME/pulp-runtime/configs/pulpissimo.sh 6 | source $PULP_SDK_HOME/configs/common.sh 7 | 8 | export PULP_CURRENT_CONFIG=pulpissimo@config_file=chips/pulpissimo/pulpissimo.json 9 | -------------------------------------------------------------------------------- /configs/pulpissimo_ibex.sh: -------------------------------------------------------------------------------- 1 | scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" 2 | 3 | export PULP_SDK_HOME=$scriptDir 4 | 5 | source $PULP_SDK_HOME/pulp-runtime/configs/pulpissimo.sh 6 | source $PULP_SDK_HOME/configs/common.sh 7 | 8 | export PULP_CURRENT_CONFIG=pulpissimo_ibex@config_file=chips/pulpissimo/pulpissimo_ibex.json 9 | -------------------------------------------------------------------------------- /configs/rtl.sh: -------------------------------------------------------------------------------- 1 | export PULPRUN_PLATFORM=rtl 2 | -------------------------------------------------------------------------------- /install/rules/pulp.mk: -------------------------------------------------------------------------------- 1 | ../../pulp-runtime/rules/pulp.mk -------------------------------------------------------------------------------- /scripts/build-runtime: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | install_dir=$PWD/install 4 | ws_install_dir=$PWD/install/ws 5 | build_dir=$PWD/build 6 | 7 | export PATH=$ws_install_dir/bin:$PATH 8 | export PYTHONPATH=$ws_install_dir/python:$PYTHONPATH 9 | export PULP_CONFIGS_PATH=$ws_install_dir/configs 10 | 11 | 12 | make -C json-tools all install BUILD_DIR=$build_dir/json-tools INSTALL_DIR=$ws_install_dir 13 | 14 | make -C pulp-configs all_scons BUILD_DIR=$build_dir/pulp-configs INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 15 | 16 | make -C runner sdk.build BUILD_DIR=$build_dir/gvsoc INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 17 | 18 | make -C plptest build INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 19 | -------------------------------------------------------------------------------- /scripts/clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | install_dir=$TARGET_INSTALL_DIR 4 | ws_install_dir=$INSTALL_DIR 5 | build_dir=$BUILD_DIR 6 | 7 | if [ -z "$install_dir" ]; then 8 | install_dir=$PWD/install 9 | fi 10 | 11 | if [ -z "$ws_install_dir" ]; then 12 | ws_install_dir=$PWD/install/ws 13 | fi 14 | 15 | if [ -z "$build_dir" ]; then 16 | build_dir=$PWD/build 17 | fi 18 | 19 | rm -rf $install_dir $ws_install_dir $build_dir -------------------------------------------------------------------------------- /scripts/deprecated/build-gvsoc: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | install_dir=$PWD/install 4 | doc_install_dir=$PWD/install/doc 5 | ws_install_dir=$PWD/install/ws 6 | build_dir=$PWD/build 7 | 8 | export PATH=$ws_install_dir/bin:$PATH 9 | export PYTHONPATH=$ws_install_dir/python:$PYTHONPATH 10 | export PULP_CONFIGS_PATH=$ws_install_dir/configs 11 | 12 | #git submodule update --init json-tools pulp-configs archi pulp-debug-bridge dpi-models gvsoc runner doc 13 | 14 | make -C json-tools all install BUILD_DIR=$build_dir/json-tools INSTALL_DIR=$ws_install_dir 15 | 16 | make -C pulp-configs all_scons BUILD_DIR=$build_dir/pulp-configs INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 17 | 18 | make -C archi build BUILD_DIR=$build_dir/archi INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 19 | 20 | make -C pulp-debug-bridge all BUILD_DIR=$build_dir/pulp-debug-bridge INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 21 | 22 | make -C dpi-models build install BUILD_DIR=$build_dir/archi INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 23 | 24 | make -C gvsoc build BUILD_DIR=$build_dir/gvsoc INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 25 | 26 | make -C runner sdk.build BUILD_DIR=$build_dir/gvsoc INSTALL_DIR=$ws_install_dir TARGET_INSTALL_DIR=$install_dir 27 | -------------------------------------------------------------------------------- /scripts/deprecated/update-gvsoc: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | git checkout git@github.com:pulp-platform/gvsoc.git 4 | 5 | git checkout git@github.com:pulp-platform/dpi-models.git 6 | 7 | git checkout git@github.com:pulp-platform/archi.git 8 | 9 | git checkout git@github.com:pulp-platform/hal.git 10 | 11 | git checkout git@github.com:pulp-platform/pulp-debug-bridge.git --------------------------------------------------------------------------------