From 1ba9fe6aa3a37e71c04c17266cf82234ecf10d53 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Mon, 27 Jan 2025 08:49:04 -0800 Subject: [PATCH 1/9] Update sail model to build with cmake --- bin/wally-tool-chain-install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index dbe60a007..8fe98569d 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -428,13 +428,13 @@ fi # The RISC-V Sail Model is the golden reference model for RISC-V. It is written in Sail (described above) section_header "Installing/Updating RISC-V Sail Model" STATUS="riscv-sail-model" -if git_check "sail-riscv" "https://github.com/riscv/sail-riscv.git" "$RISCV/bin/riscv_sim_RV32"; then +if git_check "sail-riscv" "https://github.com/riscv/sail-riscv.git" "$RISCV/bin/riscv_sim_rv32d"; then cd "$RISCV"/sail-riscv - git reset --hard && git clean -f && git checkout master && git pull - ARCH=RV64 make -j "${NUM_THREADS}" c_emulator/riscv_sim_RV64 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - ARCH=RV32 make -j "${NUM_THREADS}" c_emulator/riscv_sim_RV32 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - cp -f c_emulator/riscv_sim_RV64 "$RISCV"/bin/riscv_sim_RV64 - cp -f c_emulator/riscv_sim_RV32 "$RISCV"/bin/riscv_sim_RV32 + git reset --hard && git clean -f && git checkout master && git pull && rm -rf build + cmake -S . -B build -DCMAKE_RELEASE_TYPE=RelWithDebInfo -GNinja 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + cmake --build build 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + cp -f build/c_emulator/riscv_sim_rv64d "$RISCV"/bin/riscv_sim_rv64d + cp -f build/c_emulator/riscv_sim_rv32d "$RISCV"/bin/riscv_sim_rv32d if [ "$clean" ]; then cd "$RISCV" rm -rf sail-riscv From 3c74f37e594a3e51f8d7956097a161cccd98a336 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Mon, 27 Jan 2025 08:49:20 -0800 Subject: [PATCH 2/9] Update name of sail executables --- tests/riscof/sail_cSim/riscof_sail_cSim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/riscof/sail_cSim/riscof_sail_cSim.py b/tests/riscof/sail_cSim/riscof_sail_cSim.py index e739af411..54e6b77d2 100644 --- a/tests/riscof/sail_cSim/riscof_sail_cSim.py +++ b/tests/riscof/sail_cSim/riscof_sail_cSim.py @@ -21,8 +21,8 @@ class sail_cSim(pluginTemplate): raise SystemExit(1) self.num_jobs = str(config['jobs'] if 'jobs' in config else 1) self.pluginpath = os.path.abspath(config['pluginpath']) - self.sail_exe = { '32' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV32"), - '64' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV64")} + self.sail_exe = { '32' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_rv32d"), + '64' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_rv64d")} self.isa_spec = os.path.abspath(config['ispec']) if 'ispec' in config else '' self.platform_spec = os.path.abspath(config['pspec']) if 'ispec' in config else '' self.make = config['make'] if 'make' in config else 'make' From 256fafc4fb8ea9f1f5531049a24c87885cc520fe Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Mon, 27 Jan 2025 21:34:07 -0800 Subject: [PATCH 3/9] Fix sail install --- bin/wally-tool-chain-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 8fe98569d..0018cafc4 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -430,7 +430,7 @@ section_header "Installing/Updating RISC-V Sail Model" STATUS="riscv-sail-model" if git_check "sail-riscv" "https://github.com/riscv/sail-riscv.git" "$RISCV/bin/riscv_sim_rv32d"; then cd "$RISCV"/sail-riscv - git reset --hard && git clean -f && git checkout master && git pull && rm -rf build + git reset --hard && git clean -f && git checkout master && git pull cmake -S . -B build -DCMAKE_RELEASE_TYPE=RelWithDebInfo -GNinja 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] cmake --build build 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] cp -f build/c_emulator/riscv_sim_rv64d "$RISCV"/bin/riscv_sim_rv64d From 8d01b46a05a6030e54843b50bb02d24e3297d138 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 30 Jan 2025 07:57:22 -0800 Subject: [PATCH 4/9] Fix typo --- bin/wally-tool-chain-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 0018cafc4..413a7953b 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -431,7 +431,7 @@ STATUS="riscv-sail-model" if git_check "sail-riscv" "https://github.com/riscv/sail-riscv.git" "$RISCV/bin/riscv_sim_rv32d"; then cd "$RISCV"/sail-riscv git reset --hard && git clean -f && git checkout master && git pull - cmake -S . -B build -DCMAKE_RELEASE_TYPE=RelWithDebInfo -GNinja 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] cmake --build build 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] cp -f build/c_emulator/riscv_sim_rv64d "$RISCV"/bin/riscv_sim_rv64d cp -f build/c_emulator/riscv_sim_rv32d "$RISCV"/bin/riscv_sim_rv32d From 31bfcdc660b2fb1a8c5c0206a68de91b60f7aa58 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 30 Jan 2025 13:29:32 -0800 Subject: [PATCH 5/9] Update CI to ensure sufficient space --- .github/scripts/cli-create-lvm.sh | 64 ++++++++++++++++++++++ .github/{ => scripts}/cli-space-cleanup.sh | 0 .github/workflows/install.yml | 16 +++--- 3 files changed, 73 insertions(+), 7 deletions(-) create mode 100755 .github/scripts/cli-create-lvm.sh rename .github/{ => scripts}/cli-space-cleanup.sh (100%) diff --git a/.github/scripts/cli-create-lvm.sh b/.github/scripts/cli-create-lvm.sh new file mode 100755 index 000000000..a28fbe27d --- /dev/null +++ b/.github/scripts/cli-create-lvm.sh @@ -0,0 +1,64 @@ +#!/bin/bash +########################################### +## GitHub runner create LVM volume merging /mnt with / for more space +## +## Written: Jordan Carlin, jcarlin@hmc.edu +## Created: 30 Jan 2025 +## Based on https://github.com/easimon/maximize-build-space/blob/master/action.yml +## +## Purpose: Combine free space from multiple disks into a single logical volume for GitHub Actions runner +## A component of the CORE-V-WALLY configurable RISC-V project. +## https://github.com/openhwgroup/cvw +## +## Copyright (C) 2021-25 Harvey Mudd College & Oklahoma State University +## +## SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 +## +## Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file +## except in compliance with the License, or, at your option, the Apache License version 2.0. You +## may obtain a copy of the License at +## +## https:##solderpad.org/licenses/SHL-2.1/ +## +## Unless required by applicable law or agreed to in writing, any work distributed under the +## License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +## either express or implied. See the License for the specific language governing permissions +## and limitations under the License. +################################################################################################ + +ROOT_SAVE_SPACE="${1:-20}" # in GB, needed for installing packages, etc. +MOUNT="${2:-$GITHUB_WORKSPACE}" + +# First disable and remove swap file on /mnt +sudo swapoff -a +sudo rm -f /mnt/swapfile + +# Create / LVM physical volume +ROOT_FREE_SPACE=$(df --block-size=1024 --output=avail / | tail -1) +ROOT_LVM_SIZE=$(((ROOT_FREE_SPACE - (ROOT_SAVE_SPACE * 1024 * 1024)) * 1024)) +sudo touch /pv.img && sudo fallocate -z -l $ROOT_LVM_SIZE /pv.img +ROOT_LOOP_DEV=$(sudo losetup --find --show /pv.img) +sudo pvcreate -f "$ROOT_LOOP_DEV" + +# Create /mnt LVM physical volume +MNT_FREE_SPACE=$(df --block-size=1024 --output=avail /mnt | tail -1) +MNT_LVM_SIZE=$(((MNT_FREE_SPACE - (1 * 1024)) * 1024)) # Leave 1MB free on /mnt +sudo touch /mnt/pv.img && sudo fallocate -z -l $MNT_LVM_SIZE /mnt/pv.img +MNT_LOOP_DEV=$(sudo losetup --find --show /mnt/pv.img) +sudo pvcreate -f "$MNT_LOOP_DEV" + +# Create LVM volume group +sudo vgcreate runnervg "$ROOT_LOOP_DEV" "$MNT_LOOP_DEV" + +# Recreate swap +sudo lvcreate -L 4G -n swap runnervg +sudo mkswap /dev/mapper/runnervg-swap +sudo swapon /dev/mapper/runnervg-swap + +# Create LVM logical volume +sudo lvcreate -l 100%FREE -n runnerlv runnervg +sudo mkfs.ext4 /dev/mapper/runnervg-runnerlv +sudo mkdir -p "$MOUNT" +sudo mount /dev/mapper/runnervg-runnerlv "$MOUNT" +sudo chown runner:runner "$MOUNT" +sudo rm -rf "$MOUNT/lost+found" diff --git a/.github/cli-space-cleanup.sh b/.github/scripts/cli-space-cleanup.sh similarity index 100% rename from .github/cli-space-cleanup.sh rename to .github/scripts/cli-space-cleanup.sh diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 10e36cbab..00d72ee50 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -127,9 +127,11 @@ jobs: run: | df -h if [ -z ${{ matrix.image }} ]; then - ./.github/cli-space-cleanup.sh + ./.github/scripts/cli-space-cleanup.sh + ./.github/scripts/cli-create-lvm.sh else - nsenter -t 1 -m -u -n -i bash -c "$(cat .github/cli-space-cleanup.sh)" + nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-space-cleanup.sh)" + nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-create-lvm.sh)" fi df -h # Run main tool chain installation script, either as a user or system wide @@ -159,16 +161,16 @@ jobs: with: name: installation-logs-${{ matrix.name }} path: ${{ env.RISCV }}/logs/ + # Only the linux-testvectors are needed, so remove the rest of the buildroot to save space + - name: Remove Buildroot to Save Space + run: | + rm -rf $RISCV/buildroot/ || sudo rm -rf $RISCV/ + df -h # Make riscof and zsbl only as that is the only testsuite used by standard regression - name: make tests run: | source setup.sh make riscof zsbl --jobs $(nproc --ignore 1) - # Only the linux-testvectors are needed, so remove the rest of the buildroot to save space - - name: Remove Buildroot to Save Space - run: | - rm -rf $RISCV/buildroot/output/build || sudo rm -rf $RISCV/buildroot/output/build - df -h # Run standard regression, skipping distros that are known to be broken with Verilator - name: Regression if: ${{ matrix.regressionFail != true }} From c99f11a5a220431802a96f44247c5cae2cced59f Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 30 Jan 2025 13:32:58 -0800 Subject: [PATCH 6/9] Reorder installation CI for better space usage --- .github/workflows/install.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 00d72ee50..fc6363a4d 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -128,10 +128,10 @@ jobs: df -h if [ -z ${{ matrix.image }} ]; then ./.github/scripts/cli-space-cleanup.sh - ./.github/scripts/cli-create-lvm.sh + #./.github/scripts/cli-create-lvm.sh else nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-space-cleanup.sh)" - nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-create-lvm.sh)" + #nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-create-lvm.sh)" fi df -h # Run main tool chain installation script, either as a user or system wide @@ -162,9 +162,11 @@ jobs: name: installation-logs-${{ matrix.name }} path: ${{ env.RISCV }}/logs/ # Only the linux-testvectors are needed, so remove the rest of the buildroot to save space - - name: Remove Buildroot to Save Space + # Logs have already been uploaded so they can be removed + - name: Clean up installation run: | - rm -rf $RISCV/buildroot/ || sudo rm -rf $RISCV/ + rm -rf $RISCV/buildroot/ || sudo rm -rf $RISCV/buildroot/ + rm -rf $RISCV/logs || sudo rm -rf $RISCV/logs df -h # Make riscof and zsbl only as that is the only testsuite used by standard regression - name: make tests From e5992ad4f7d98a4a4cf28c94bcbded03f184bc01 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 30 Jan 2025 19:17:04 -0800 Subject: [PATCH 7/9] Cleanup --- .github/scripts/cli-create-lvm.sh | 64 ------------------------------- .github/workflows/install.yml | 2 - 2 files changed, 66 deletions(-) delete mode 100755 .github/scripts/cli-create-lvm.sh diff --git a/.github/scripts/cli-create-lvm.sh b/.github/scripts/cli-create-lvm.sh deleted file mode 100755 index a28fbe27d..000000000 --- a/.github/scripts/cli-create-lvm.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -########################################### -## GitHub runner create LVM volume merging /mnt with / for more space -## -## Written: Jordan Carlin, jcarlin@hmc.edu -## Created: 30 Jan 2025 -## Based on https://github.com/easimon/maximize-build-space/blob/master/action.yml -## -## Purpose: Combine free space from multiple disks into a single logical volume for GitHub Actions runner -## A component of the CORE-V-WALLY configurable RISC-V project. -## https://github.com/openhwgroup/cvw -## -## Copyright (C) 2021-25 Harvey Mudd College & Oklahoma State University -## -## SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 -## -## Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file -## except in compliance with the License, or, at your option, the Apache License version 2.0. You -## may obtain a copy of the License at -## -## https:##solderpad.org/licenses/SHL-2.1/ -## -## Unless required by applicable law or agreed to in writing, any work distributed under the -## License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -## either express or implied. See the License for the specific language governing permissions -## and limitations under the License. -################################################################################################ - -ROOT_SAVE_SPACE="${1:-20}" # in GB, needed for installing packages, etc. -MOUNT="${2:-$GITHUB_WORKSPACE}" - -# First disable and remove swap file on /mnt -sudo swapoff -a -sudo rm -f /mnt/swapfile - -# Create / LVM physical volume -ROOT_FREE_SPACE=$(df --block-size=1024 --output=avail / | tail -1) -ROOT_LVM_SIZE=$(((ROOT_FREE_SPACE - (ROOT_SAVE_SPACE * 1024 * 1024)) * 1024)) -sudo touch /pv.img && sudo fallocate -z -l $ROOT_LVM_SIZE /pv.img -ROOT_LOOP_DEV=$(sudo losetup --find --show /pv.img) -sudo pvcreate -f "$ROOT_LOOP_DEV" - -# Create /mnt LVM physical volume -MNT_FREE_SPACE=$(df --block-size=1024 --output=avail /mnt | tail -1) -MNT_LVM_SIZE=$(((MNT_FREE_SPACE - (1 * 1024)) * 1024)) # Leave 1MB free on /mnt -sudo touch /mnt/pv.img && sudo fallocate -z -l $MNT_LVM_SIZE /mnt/pv.img -MNT_LOOP_DEV=$(sudo losetup --find --show /mnt/pv.img) -sudo pvcreate -f "$MNT_LOOP_DEV" - -# Create LVM volume group -sudo vgcreate runnervg "$ROOT_LOOP_DEV" "$MNT_LOOP_DEV" - -# Recreate swap -sudo lvcreate -L 4G -n swap runnervg -sudo mkswap /dev/mapper/runnervg-swap -sudo swapon /dev/mapper/runnervg-swap - -# Create LVM logical volume -sudo lvcreate -l 100%FREE -n runnerlv runnervg -sudo mkfs.ext4 /dev/mapper/runnervg-runnerlv -sudo mkdir -p "$MOUNT" -sudo mount /dev/mapper/runnervg-runnerlv "$MOUNT" -sudo chown runner:runner "$MOUNT" -sudo rm -rf "$MOUNT/lost+found" diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index fc6363a4d..3cf9fd041 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -128,10 +128,8 @@ jobs: df -h if [ -z ${{ matrix.image }} ]; then ./.github/scripts/cli-space-cleanup.sh - #./.github/scripts/cli-create-lvm.sh else nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-space-cleanup.sh)" - #nsenter -t 1 -m -u -n -i bash -c "$(cat .github/scripts/cli-create-lvm.sh)" fi df -h # Run main tool chain installation script, either as a user or system wide From 057823d61f747832cffb7b136ac074285e0ba69f Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 30 Jan 2025 19:40:16 -0800 Subject: [PATCH 8/9] Install newer cmake on old debian and ubuntu --- bin/wally-tool-chain-install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 413a7953b..2c6db771c 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -286,6 +286,21 @@ if (( UBUNTU_VERSION == 20 || DEBIAN_VERSION == 11 )) || [ "$FAMILY" == suse ]; fi fi +# Newer version of CMake needed to build sail-riscv model (at least 3.20) +if (( UBUNTU_VERSION == 20 || DEBIAN_VERSION == 11 )); then + STATUS="cmake" + if [ ! -e "$RISCV"/bin/cmake ]; then + section_header "Installing cmake" + cd "$RISCV" + wget -nv --retry-connrefused $retry_on_host_error --output-document=cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-linux-x86_64.tar.gz + tar xz --directory="$RISCV" --strip-components=1 -f cmake.tar.gz + rm -f cmake.tar.gz + echo -e "${SUCCESS_COLOR}CMake successfully installed/updated!${ENDC}" + else + echo -e "${SUCCESS_COLOR}CMake already installed.${ENDC}" + fi +fi + # RISC-V GNU Toolchain (https://github.com/riscv-collab/riscv-gnu-toolchain) # The RISC-V GNU Toolchain includes the GNU Compiler Collection (gcc), GNU Binutils, Newlib, # and the GNU Debugger Project (gdb). It is a collection of tools used to compile RISC-V programs. From d475f64f99d8b27212574e0c5a8241b377e09e4e Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 30 Jan 2025 19:40:40 -0800 Subject: [PATCH 9/9] Cleanup installation logging --- bin/wally-tool-chain-install.sh | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 2c6db771c..9ffddf8bc 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -99,7 +99,7 @@ git_check() { # Log output to a file and only print lines with keywords logger() { - local log_file="$RISCV/logs/$1.log" + local log_file="$RISCV/logs/$STATUS.log" local keyword_pattern="(\bwarning|\berror|\bfail|\bsuccess|\bstamp|\bdoesn't work)" local exclude_pattern="(_warning|warning_|_error|error_|-warning|warning-|-error|error-|Werror|error\.o|warning flags)" @@ -183,7 +183,7 @@ echo "Using $NUM_THREADS thread(s) for compilation" mkdir -p "$RISCV"/logs # Install/update system packages if root. Otherwise, check that packages are already installed. -STATUS="system packages" +STATUS="system_packages" if [ "$ROOT" == true ]; then source "${dir}"/wally-package-install.sh else @@ -211,7 +211,7 @@ fi # Create python virtual environment so the python command targets desired version of python # and installed packages are isolated from the rest of the system. section_header "Setting up Python Environment" -STATUS="python virtual environment" +STATUS="python_virtual_environment" cd "$RISCV" if [ ! -e "$RISCV"/riscv-python/bin/activate ]; then "$PYTHON_VERSION" -m venv riscv-python --prompt cvw @@ -244,8 +244,8 @@ if (( RHEL_VERSION == 8 )) || (( UBUNTU_VERSION == 20 )); then rm -f glib-2.70.5.tar.xz cd glib-2.70.5 meson setup _build --prefix="$RISCV" - meson compile -C _build -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - meson install -C _build 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + meson compile -C _build -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + meson install -C _build 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] cd "$RISCV" rm -rf glib-2.70.5 echo -e "${SUCCESS_COLOR}glib successfully installed!${ENDC}" @@ -263,8 +263,8 @@ if (( RHEL_VERSION == 8 )); then rm -f gmp-6.3.0.tar.xz cd gmp-6.3.0 ./configure --prefix="$RISCV" - make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - make install 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] cd "$RISCV" rm -rf gmp-6.3.0 echo -e "${SUCCESS_COLOR}gmp successfully installed!${ENDC}" @@ -314,7 +314,7 @@ if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain cd "$RISCV"/riscv-gnu-toolchain git reset --hard && git clean -f && git checkout master && git pull && git submodule update ./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;" - make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] if [ "$clean" ]; then cd "$RISCV" rm -rf riscv-gnu-toolchain @@ -341,8 +341,8 @@ if git_check "elf2hex" "https://github.com/sifive/elf2hex.git" "$RISCV/bin/riscv git reset --hard && git clean -f && git checkout master && git pull autoreconf -i ./configure --target=riscv64-unknown-elf --prefix="$RISCV" - make 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - make install 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] if [ "$clean" ]; then cd "$RISCV" rm -rf elf2hex @@ -362,8 +362,8 @@ if git_check "qemu" "https://github.com/qemu/qemu" "$RISCV/include/qemu-plugin.h cd "$RISCV"/qemu git reset --hard && git clean -f && git checkout master && git pull ./configure --target-list=riscv64-softmmu --prefix="$RISCV" - make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - make install 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] if [ "$clean" ]; then cd "$RISCV" rm -rf qemu @@ -385,8 +385,8 @@ if git_check "riscv-isa-sim" "https://github.com/riscv-software-src/riscv-isa-si mkdir -p build cd build ../configure --prefix="$RISCV" - make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - make install 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] if [ "$clean" ]; then cd "$RISCV" rm -rf riscv-isa-sim @@ -410,8 +410,8 @@ if git_check "verilator" "https://github.com/verilator/verilator" "$RISCV/share/ git reset --hard && git clean -f && git checkout master && git pull autoconf ./configure --prefix="$RISCV" - make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - make install 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] if [ "$clean" ]; then cd "$RISCV" rm -rf verilator @@ -428,7 +428,7 @@ fi # The Sail Compiler is written in OCaml, which is an object-oriented extension of ML, which in turn # is a functional programming language suited to formal verification. section_header "Installing/Updating Sail Compiler" -STATUS="Sail Compiler" +STATUS="sail_compiler" if [ ! -e "$RISCV"/bin/sail ]; then cd "$RISCV" wget -nv --retry-connrefused $retry_on_host_error --output-document=sail.tar.gz https://github.com/rems-project/sail/releases/latest/download/sail.tar.gz @@ -446,8 +446,8 @@ STATUS="riscv-sail-model" if git_check "sail-riscv" "https://github.com/riscv/sail-riscv.git" "$RISCV/bin/riscv_sim_rv32d"; then cd "$RISCV"/sail-riscv git reset --hard && git clean -f && git checkout master && git pull - cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] - cmake --build build 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] + cmake --build build 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] cp -f build/c_emulator/riscv_sim_rv64d "$RISCV"/bin/riscv_sim_rv64d cp -f build/c_emulator/riscv_sim_rv32d "$RISCV"/bin/riscv_sim_rv32d if [ "$clean" ]; then @@ -463,7 +463,7 @@ fi # OSU Skywater 130 cell library (https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12) # The OSU Skywater 130 cell library is a standard cell library that is used to synthesize Wally. section_header "Installing/Updating OSU Skywater 130 cell library" -STATUS="OSU Skywater 130 cell library" +STATUS="osu_skywater_130_cell_library" mkdir -p "$RISCV"/cad/lib cd "$RISCV"/cad/lib if git_check "sky130_osu_sc_t12" "https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12" "$RISCV/cad/lib/sky130_osu_sc_t12" "main"; then @@ -488,11 +488,11 @@ if [ ! "$no_buidroot" ]; then fi cd "$dir"/../linux if [ ! -e "$RISCV"/buildroot ]; then - FORCE_UNSAFE_CONFIGURE=1 make 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] # FORCE_UNSAFE_CONFIGURE is needed to allow buildroot to compile when run as root + FORCE_UNSAFE_CONFIGURE=1 make 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] # FORCE_UNSAFE_CONFIGURE is needed to allow buildroot to compile when run as root echo -e "${SUCCESS_COLOR}Buildroot successfully installed and Linux testvectors created!${ENDC}" elif [ ! -e "$RISCV"/linux-testvectors ]; then echo -e "${OK_COLOR}Buildroot already exists, but Linux testvectors are missing. Generating them now.${ENDC}" - make dumptvs 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] + make dumptvs 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] echo -e "${SUCCESS_COLOR}Linux testvectors successfully generated!${ENDC}" else echo -e "${OK_COLOR}Buildroot and Linux testvectors already exist.${ENDC}" @@ -506,7 +506,7 @@ fi # The site-setup script is used to set up the environment for the RISC-V tools and EDA tools by setting # the PATH and other environment variables. It also sources the Python virtual environment. section_header "Downloading Site Setup Script" -STATUS="site-setup scripts" +STATUS="site-setup_scripts" cd "$RISCV" if [ ! -e "${RISCV}"/site-setup.sh ]; then wget -nv --retry-connrefused $retry_on_host_error https://raw.githubusercontent.com/openhwgroup/cvw/main/site-setup.sh