diff --git a/.gitignore b/.gitignore index 05bab5ff20..09c20d9ab3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ Bender.lock .vscode/ __pycache__ -// Modelsim Fiels +# Modelsim Files *.wlf modelsim.ini *stacktrace* @@ -11,6 +11,10 @@ transcript gmon.out -// Docs +# Docs /site/ -/docs/generated/ \ No newline at end of file +/docs/generated/ + +# Installation directories +/.venv/ +/tools/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3334e6bde6..946426fd71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,33 +9,12 @@ variables: TERM: ansi FORCE_COLOR: 1 # Configure environment - PYTHON: /usr/local/anaconda3-2022.05/bin/python3 - BENDER: bender-0.27.1 - CC: gcc-9.2.0 - CXX: g++-9.2.0 - VCS_SEPP: vcs-2020.12 - VERILATOR_SEPP: verilator-4.110 - QUESTA_SEPP: questa-2022.3 - LLVM_BINROOT: /usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/pack/gcc-9.2.0-af/linux-x64/bin/gcc LLVM_SYS_120_PREFIX: /usr/pack/llvm-12.0.1-af CMAKE: cmake-3.18.1 before_script: - - $PYTHON -m venv .venv - - source .venv/bin/activate - # Unpack packages in a local temporary directory which can be safely cleaned - # after installation. Also protects against "No space left on device" errors - # occurring when the /tmp folder is filled by other processes. - - mkdir tmp - - TMPDIR=tmp pip install -r python-requirements.txt - - rm -rf tmp - - $BENDER vendor init - # Install spike-dasm - # yamllint disable rule:line-length - - wget https://github.com/pulp-platform/riscv-isa-sim/releases/download/snitch-v0.1.0/snitch-spike-dasm-0.1.0-x86_64-linux-gnu-almalinux8.7.tar.gz - # yamllint enable rule:line-length - - tar xzf snitch-spike-dasm-0.1.0-x86_64-linux-gnu-almalinux8.7.tar.gz + source iis-setup.sh ############## # Build docs # diff --git a/docs/ug/getting_started.md b/docs/ug/getting_started.md index c7f3a194e0..e847fec4e4 100644 --- a/docs/ug/getting_started.md +++ b/docs/ug/getting_started.md @@ -46,46 +46,12 @@ The following instructions are extracted from the Docker container [README.md](h ## IIS environment setup -To make sure the right versions of each tool are picked up, set the following environment variables, e.g. in a bash shell: +To make sure the right versions of each tool are picked up on your IIS machine and install additional tools, run: ```bash -export PYTHON="/usr/local/anaconda3-2022.05/bin/python3" -export BENDER="bender-0.27.1" -export CC="gcc-9.2.0" -export CXX="g++-9.2.0" -export LLVM_BINROOT="/usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin" -# As a temporary workaround (until correct tool versions are installed system-wide): -export PATH=/usr/scratch/dachstein/colluca/opt/verible/bin:$PATH - -# Install spike-dasm -cd sw/deps/riscv-isa-sim -autoconf -mkdir build -cd build -../configure -make -export PATH=$(pwd):$PATH +source iis-setup.sh ``` -Add these commands to your shell startup file (e.g. `~/.bashrc` if you use bash as the default shell) to ensure that the environment is set up correctly every time you open a new shell. +Have a look inside the script. You will want to add some of the steps contained therein to your shell startup file, e.g. exporting environment variables and activating the Python virtual environment. This way, every time you open a new shell, your environment will be ready for developing on Snitch, and you won't have to repeat the installation steps. -Create a Python virtual environment: - -```shell -$PYTHON -m venv ~/.venvs/snitch_cluster -``` - -Activate your environment, e.g. in a bash shell: - -```bash -source ~/.venvs/snitch_cluster/bin/activate -``` - -You may want to add the last command to your shell startup file to ensure that the virtual environment is activated on every new shell you open. - -Install the required packages in the currently active virtual environment: - -```shell -pip install -r python-requirements.txt -``` diff --git a/iis-setup.sh b/iis-setup.sh new file mode 100755 index 0000000000..6317e410d4 --- /dev/null +++ b/iis-setup.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# Define environment variables +export PYTHON=/usr/local/anaconda3-2022.05/bin/python3 +export BENDER=bender-0.27.1 +export CC=gcc-9.2.0 +export CXX=g++-9.2.0 +export VCS_SEPP=vcs-2020.12 +export VERILATOR_SEPP=verilator-4.110 +export QUESTA_SEPP=questa-2022.3 +export LLVM_BINROOT=/usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin + +# Create Python virtual environment with required packages +$PYTHON -m venv .venv +source .venv/bin/activate +# Unpack packages in a local temporary directory which can be safely cleaned +# after installation. Also protects against "No space left on device" errors +# occurring when the /tmp folder is filled by other processes. +mkdir tmp +TMPDIR=tmp pip install -r python-requirements.txt +rm -rf tmp + +# Bender initialization +$BENDER vendor init + +# Install spike-dasm +mkdir tools/ +cd tools/ +wget https://github.com/pulp-platform/riscv-isa-sim/releases/download/snitch-v0.1.0/snitch-spike-dasm-0.1.0-x86_64-linux-gnu-almalinux8.7.tar.gz +tar xzf snitch-spike-dasm-0.1.0-x86_64-linux-gnu-almalinux8.7.tar.gz +cd - +echo $PATH +export PATH=$(pwd)/tools:$PATH