From 28164bcd2568af1aa0ffa764bdb6ff88be2e8612 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Fri, 26 Jul 2024 21:34:04 +0300 Subject: [PATCH] Initial attempt to restore fault --- README.md | 1 + _build/Dockerfile | 14 +++++ _build/images/fault/scripts/dependencies.sh | 53 +++++++++++++++++++ _build/images/fault/scripts/install.sh | 14 +++++ .../skel/dockerstartup/scripts/env.sh | 1 + 5 files changed, 83 insertions(+) create mode 100755 _build/images/fault/scripts/dependencies.sh create mode 100755 _build/images/fault/scripts/install.sh diff --git a/README.md b/README.md index 0cf60c61..881ac012 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Below is a list of the current tools already installed and ready to use (note th * [covered](https://github.com/hpretl/verilog-covered) Verilog code coverage * [cvc](https://github.com/d-m-bailey/cvc) circuit validity checker (ERC) * [edalize](https://github.com/olofk/edalize) Python abstraction library for EDA tools +* [fault](https://github.com/AUCOHL/Fault) design-for-test (DFT) solution * [fusesoc](https://github.com/olofk/fusesoc) package manager and build tools for SoC * [gaw3-xschem](https://github.com/StefanSchippers/xschem-gaw.git) waveform plot tool for `xschem` * [gaw3-xschem](https://github.com/StefanSchippers/xschem-gaw) waveform plot tool for `xschem` diff --git a/_build/Dockerfile b/_build/Dockerfile index 66b1d8d3..cd8dfcf6 100644 --- a/_build/Dockerfile +++ b/_build/Dockerfile @@ -92,6 +92,19 @@ ARG CVC_RV_NAME="cvc_rv" RUN --mount=type=bind,source=images/cvc_rv,target=/images/cvc_rv \ bash /images/cvc_rv/scripts/install.sh +####################################################################### +# Compile fault +####################################################################### +# FIXME build dependencies clean as stand-alone stages +FROM base as fault +ARG FAULT_REPO_URL="https://github.com/AUCOHL/Fault.git" +ARG FAULT_REPO_COMMIT="0d42398b287fa8ed755f8f5bb518c14b65be4d52" +ARG FAULT_NAME="fault" +RUN --mount=type=bind,source=images/fault,target=/images/fault \ + bash /images/fault/scripts/dependencies.sh +RUN --mount=type=bind,source=images/fault,target=/images/fault \ + bash /images/fault/scripts/install.sh + ####################################################################### # Compile gaw3-xschem ####################################################################### @@ -422,6 +435,7 @@ ENV OMPI_MCA_btl_vader_single_copy_mechanism=none COPY --from=open_pdks ${PDK_ROOT}/ ${PDK_ROOT}/ COPY --from=covered ${TOOLS}/ ${TOOLS}/ COPY --from=cvc_rv ${TOOLS}/ ${TOOLS}/ +COPY --from=fault ${TOOLS}/ ${TOOLS}/ COPY --from=gaw3-xschem ${TOOLS}/ ${TOOLS}/ COPY --from=gds3d ${TOOLS}/ ${TOOLS}/ COPY --from=gds3d ${PDK_ROOT}/ ${PDK_ROOT}/ diff --git a/_build/images/fault/scripts/dependencies.sh b/_build/images/fault/scripts/dependencies.sh new file mode 100755 index 00000000..82a1a295 --- /dev/null +++ b/_build/images/fault/scripts/dependencies.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +set -e + +UBUNTU_VERSION=$(lsb_release -r -s) + +# Install Quaigh +_install_quaigh () { + echo "[INFO] Installing Quaigh." + cd /tmp + git clone --filter=blob:none https://github.com/coloquinte/Quaigh.git quaigh + cd quaigh + git checkout 1b690ebece60a0181df7af22546f13427914cf82 + cargo build + make clear + cd .. + mv quaigh ${TOOLS}/${FAULT_NAME}/${REPO_COMMIT_SHORT}/quaigh +} +_install_quaigh + +# Install nl2bench +_install_nl2bench () { + echo "Installing nl2bench." + pip3 install --prefix ${TOOLS}/${FAULT_NAME}/${REPO_COMMIT_SHORT}/ nl2bench +} +_install_nl2bench + +# Install Swift +_install_swift () { + echo "[INFO] Installing Swift." + cd /tmp + SWIFT_VERSION=5.9.2 + if [[ $UBUNTU_VERSION == 22.04 ]]; then + if [ "$(arch)" == "x86_64" ]; then + echo "[INFO] Platform is x86_64, 22.04" + wget --no-verbose https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz + tar xzf swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz + mv swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04 /opt/swift + elif [ "$(arch)" == "aarch64" ]; then + echo "[INFO] Platform is aarch64, 22.04" + wget --no-verbose https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204-aarch64/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04-aarch64.tar.gz + tar xzf swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04-aarch64.tar.gz + mv swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04-aarch64 /opt/swift + else + echo "[ERROR] Unknown platform" + exit 1 + fi + else + echo "[ERROR] Unknown Ubuntu version" + exit 1 + fi +} +_install_swift diff --git a/_build/images/fault/scripts/install.sh b/_build/images/fault/scripts/install.sh new file mode 100755 index 00000000..b8e2a9e8 --- /dev/null +++ b/_build/images/fault/scripts/install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +REPO_COMMIT_SHORT=$(echo "$FAULT_REPO_COMMIT" | cut -c 1-7) + +mkdir -p "${TOOLS}/${FAULT_NAME}/${REPO_COMMIT_SHORT}" +git clone --filter=blob:none "${FAULT_REPO_URL}" "${FAULT_NAME}" +cd "${FAULT_NAME}" +git checkout "${FAULT_REPO_COMMIT}" +echo "[INFO] Compiling Fault using Swift." +export PATH=/opt/swift/usr/bin:$PATH +swift build -c release --static-stdlib +mv ./.build/release/fault ${TOOLS}/${FAULT_NAME}/${REPO_COMMIT_SHORT}/fault diff --git a/_build/images/iic-osic-tools/skel/dockerstartup/scripts/env.sh b/_build/images/iic-osic-tools/skel/dockerstartup/scripts/env.sh index 2d5f3fca..45dc8023 100644 --- a/_build/images/iic-osic-tools/skel/dockerstartup/scripts/env.sh +++ b/_build/images/iic-osic-tools/skel/dockerstartup/scripts/env.sh @@ -39,6 +39,7 @@ function _path_add_tool_python() { if [ -z ${FOSS_PATH_SET+x} ]; then _path_add_tool_bin "covered" _path_add_tool_bin "cvc_rv" + _path_add_tool "fault" _path_add_tool_bin "gaw3-xschem" _path_add_tool_bin "gds3d" _path_add_tool_bin "ghdl"