Skip to content

Commit

Permalink
Initial attempt to restore fault
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Jul 26, 2024
1 parent 5936eb8 commit 9fd2449
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
* [gdsfactory](https://github.com/gdsfactory/gdsfactory) Python library for GDS generation
Expand Down
14 changes: 14 additions & 0 deletions _build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
#######################################################################
Expand Down Expand Up @@ -384,6 +397,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}/
Expand Down
53 changes: 53 additions & 0 deletions _build/images/fault/scripts/dependencies.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions _build/images/fault/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9fd2449

Please sign in to comment.