diff --git a/.gitignore b/.gitignore index af6c64087..f73da82c2 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,8 @@ pdks/ /install # Venv -/venv \ No newline at end of file +/venv + +# Pyverilog +parser.out +parsetab.py \ No newline at end of file diff --git a/dependencies/python/run_time.txt b/dependencies/python/run_time.txt index 4abf5139c..fdfef7b76 100644 --- a/dependencies/python/run_time.txt +++ b/dependencies/python/run_time.txt @@ -1,4 +1,5 @@ click>=8.0.0,<9 pyyaml~=5.4.0 install~=1.3.5 -XlsxWriter~=3.0.2 \ No newline at end of file +XlsxWriter~=3.0.2 +pyverilog~=1.3.0 \ No newline at end of file diff --git a/dependencies/tool_metadata.yml b/dependencies/tool_metadata.yml index f59743351..375b995ed 100644 --- a/dependencies/tool_metadata.yml +++ b/dependencies/tool_metadata.yml @@ -72,16 +72,8 @@ build: '' in_install: false pdk: true -- name: iverilog - repo: https://github.com/steveicarus/iverilog - commit: af2b952769b7358a094a336fe2d7c7104b871d9f - build: | - make clean - sh autoconf.sh - ./configure --prefix=$PREFIX - make -j$(proc) - make install -- name: Fault +- name: fault repo: https://github.com/AUCOHL/Fault - commit: 080f4be01d236af438566ce0b28089531f21a997 - build: "" + commit: 296687f96be139daca9bfca4b1043f85aae12829 + build: '' + in_install: false diff --git a/docker/Fault/Dockerfile b/docker/Fault/Dockerfile deleted file mode 100644 index d9748d0b7..000000000 --- a/docker/Fault/Dockerfile +++ /dev/null @@ -1,100 +0,0 @@ -ARG RUN_BASE_IMAGE= -ARG BUILD_BASE_IMAGE= -FROM swift:5.6-centos7 AS swift - -FROM ${BUILD_BASE_IMAGE} AS builder - -ARG FAULT_REPO -ARG FAULT_COMMIT - -# Setup Build Environment -RUN yum install -y --setopt=skip_missing_names_on_install=False https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm centos-release-scl -RUN yum install -y --setopt=skip_missing_names_on_install=False git gettext curl devtoolset-8 devtoolset-8-libatomic-devel - -ENV CC=/opt/rh/devtoolset-8/root/usr/bin/gcc \ - CPP=/opt/rh/devtoolset-8/root/usr/bin/cpp \ - CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ \ - PATH=/opt/rh/devtoolset-8/root/usr/bin:$PATH \ - LD_LIBRARY_PATH=/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/dyninst:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8:$LD_LIBRARY_PATH - -# Install Other Dependencies -RUN yum install -y flex bison autoconf libtool gperf tcl-devel libcurl-devel openssl-devel zlib-devel - -WORKDIR / - -COPY --from=swift /usr /build - -# Install Git (Build-only dependency) -WORKDIR /git -RUN curl -L https://github.com/git/git/tarball/e9d7761bb94f20acc98824275e317fa82436c25d/ |\ - tar -xzC . --strip-components=1 &&\ - make configure &&\ - ./configure --prefix=/usr &&\ - make -j$(nproc) &&\ - make install &&\ - rm -rf * - -# Install IcarusVerilog 11 -# WORKDIR /iverilog -# RUN curl -L https://github.com/steveicarus/iverilog/archive/refs/tags/v11_0.tar.gz |\ -# tar --strip-components=1 -xzC . &&\ -# aclocal &&\ -# autoconf &&\ -# ./configure --prefix=/build &&\ -# make -j$(nproc) &&\ -# make install &&\ -# rm -rf * - -# RUN mkdir -p /usr/local/lib/ivl/ - -# RUN ln -s /build/lib/ivl/ivlpp /usr/local/lib/ivl/ivlpp -# RUN ln -s /build/lib/ivl/ivl /usr/local/lib/ivl/ivl - -WORKDIR /Fault -RUN curl -L ${FAULT_REPO}/tarball/${FAULT_COMMIT} | tar -xzC . --strip-components=1 - -RUN python3 -m pip install --target /build/lib/pythonpath --upgrade -r ./requirements.txt - -WORKDIR / - -# Copy Libraries for AppImage -RUN cp /lib64/libtinfo.so.5 /build/lib -RUN cp /lib64/libffi.so.6 /build/lib -RUN cp /lib64/libz.so.1 /build/lib -RUN cp /lib64/libreadline.so.6 /build/lib -RUN cp /lib64/libtcl8.5.so /build/lib -# RUN cp /lib64/libstdc++.so.6 /build/lib -# RUN cp /lib64/libm.so /build/lib - -# ENV PATH /build/bin:$PATH -# ENV PATH /usr/bin:$PATH - -WORKDIR /Fault -COPY . . -# RUN /build/bin/swift ./atalanta_podem_build.swift -# RUN INSTALL_DIR=/build/bin /build/bin/swift ./install.swift -RUN /build/bin/swift build --static-swift-stdlib -c release -RUN cp /Fault/.build/x86_64-unknown-linux-gnu/release/Fault /build/bin/fault - -RUN ln -s /build/lib64/libpython3.6m.so.1.0 /build/lib/libpython3.6m.so - -RUN echo "/build/lib/pythonpath/" > /build/lib64/python3.6/site-packages/usrlocal.pth - -RUN mkdir -p /build/version/ -RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/Fault.version -RUN echo ${FAULT_COMMIT} >> /build/version/Fault.version -RUN tar -czf /build.tar.gz /build - -# --- -FROM ${RUN_BASE_IMAGE} AS runnable -ENV PATH /build/bin:$PATH - -ENV PYTHON_LIBRARY=/build/lib/libpython3.6m.so\ - PYTHONPATH=/build/lib/pythonpath\ - LD_LIBRARY_PATH=/build/lib\ - FAULT_IVL_BASE=/build/lib/ivl\ - FAULT_IVERILOG=/build/bin/iverilog\ - FAULT_VVP=/build/bin/v - -COPY --from=builder /build /build -COPY --from=builder /build.tar.gz /build.tar.gz \ No newline at end of file diff --git a/docker/fault/Dockerfile b/docker/fault/Dockerfile new file mode 100644 index 000000000..fb0ef696e --- /dev/null +++ b/docker/fault/Dockerfile @@ -0,0 +1,37 @@ +# Copyright 2020-2022 Efabless Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# 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. +ARG RUN_BASE_IMAGE= +ARG BUILD_BASE_IMAGE= +ARG FAULT_REPO= +ARG FAULT_COMMIT= + +FROM ghcr.io/aucohl/fault:${FAULT_COMMIT} AS build + +# --- +FROM ${RUN_BASE_IMAGE} AS runnable +ENV PATH /build/bin:$PATH + +ENV LD_LIBRARY_PATH=/build/lib\ + FAULT_IVL_BASE=/build/lib/ivl\ + FAULT_IVERILOG=/build/bin/iverilog\ + FAULT_VVP=/build/bin/vvp + +RUN mkdir -p /build/version/ +COPY --from=build /build /build +## Collisions with OpenLane Utilities +RUN rm -rf $(find /build/lib | grep python); rm -f /build/bin/python3 +RUN rm -rf $(find /build/bin | grep yosys); rm -rf /build/share/yosys +RUN tar -czf /build.tar.gz /build +RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/fault.version +RUN echo ${FAULT_COMMIT} >> /build/version/fault.version \ No newline at end of file diff --git a/docker/iverilog/Dockerfile b/docker/iverilog/Dockerfile deleted file mode 100644 index 1b0934c4c..000000000 --- a/docker/iverilog/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -ARG RUN_BASE_IMAGE= -ARG BUILD_BASE_IMAGE= -FROM ${BUILD_BASE_IMAGE} AS builder - -ARG IVERILOG_REPO -ARG IVERILOG_COMMIT - -RUN yum install -y flex bison autoconf libtool gperf tcl-devel libcurl-devel openssl-devel zlib-devel - -WORKDIR /iverilog -RUN curl -L ${IVERILOG_REPO}/tarball/${IVERILOG_COMMIT} | tar -xzC . --strip-components=1 && \ - sh autoconf.sh && \ - ./configure --prefix=/build && \ - make -j$(nproc) && \ - make install - -RUN mkdir -p /build/version/ -RUN date +"Build Timestamp: %Y-%m-%d_%H-%M-%S" > /build/version/iverilog.version -RUN echo ${IVERILOG_COMMIT} >> /build/version/iverilog.version -RUN tar -czf /build.tar.gz /build - -# --- -FROM ${RUN_BASE_IMAGE} AS runnable -ENV PATH /build/bin:$PATH - -COPY --from=builder /build /build -COPY --from=builder /build.tar.gz /build.tar.gz \ No newline at end of file diff --git a/docker/openlane/Dockerfile.tpl b/docker/openlane/Dockerfile.tpl index 2d26efc80..1690647f3 100644 --- a/docker/openlane/Dockerfile.tpl +++ b/docker/openlane/Dockerfile.tpl @@ -25,7 +25,11 @@ ENV OPENROAD=/build/ ENV PATH=$OPENLANE_ROOT:$OPENLANE_ROOT/scripts:$OPENROAD/bin:$OPENROAD/bin/Linux-x86_64:$OPENROAD/pdn/scripts:$PATH ENV LD_LIBRARY_PATH=$OPENROAD/lib:$OPENROAD/lib/Linux-x86_64:$LD_LIBRARY_PATH ENV MANPATH=$OPENROAD/share/man:$MANPATH -ENV PDK_ROOT /build/pdk + +ENV PYTHON_LIBRARY=/lib64/libpython3.6m.so.1.0 +ENV FAULT_IVL_BASE=/build/lib/ivl +ENV FAULT_IVERILOG=/build/bin/iverilog +ENV FAULT_VVP=/build/bin/vvp # Locale RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8 diff --git a/scripts/tcl_commands/dft.tcl b/scripts/tcl_commands/dft.tcl index 3ccef9c95..21e09fe03 100644 --- a/scripts/tcl_commands/dft.tcl +++ b/scripts/tcl_commands/dft.tcl @@ -1,3 +1,16 @@ +# Copyright 2022 Rameen Anwar +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# 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. proc run_dft {args} { if { $::env(DFT_ENABLE) } { increment_index @@ -19,7 +32,7 @@ proc run_dft {args} { -clock $::env(CLOCK_PORT) \ -reset $::env(RESET_PORT) \ -output $::env(synthesis_results)/$::env(DESIGN_NAME).v - + increment_index fault_tap \ @@ -29,7 +42,7 @@ proc run_dft {args} { -reset $::env(RESET_PORT) \ -output $::env(synthesis_results)/$::env(DESIGN_NAME).v } - + } @@ -45,7 +58,7 @@ proc fault_chain {args} { parse_key_args "fault_chain" args values $options set tmp $::env(synthesis_tmpfiles)/$::env(DESIGN_NAME).v file copy -force $values(-verilog) $tmp - + try_catch $::env(DFT_BIN) chain \ --liberty $values(-liberty) \ --clock $values(-clock) \ @@ -67,7 +80,7 @@ proc fault_tap {args} { parse_key_args "fault_tap" args values $options set tmp $::env(synthesis_tmpfiles)/$::env(DESIGN_NAME).v.chained.v file copy -force $values(-verilog) $tmp - + try_catch $::env(DFT_BIN) tap \ --liberty $values(-liberty) \ --clock $values(-clock) \ diff --git a/scripts/tcl_commands/pkgIndex.tcl b/scripts/tcl_commands/pkgIndex.tcl index 1e8bc48aa..4d9d4cf71 100755 --- a/scripts/tcl_commands/pkgIndex.tcl +++ b/scripts/tcl_commands/pkgIndex.tcl @@ -22,4 +22,4 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -package ifneeded openlane 0.9 [list source [file join $dir all.tcl]]\n[list source [file join $dir checkers.tcl]]\n[list source [file join $dir cts.tcl]]\n[list source [file join $dir floorplan.tcl]]\n[list source [file join $dir init_design.tcl]]\n[list source [file join $dir lvs.tcl]]\n[list source [file join $dir magic.tcl]]\n[list source [file join $dir placement.tcl]]\n[list source [file join $dir routing.tcl]]\n[list source [file join $dir synthesis.tcl]]\n[list source [file join $dir dft.tcl]]\b[list source [file join $dir klayout.tcl]]\n[list source [file join $dir cvc_rv.tcl]]\n[list source [file join $dir eco.tcl]]\n[list source [file join $dir sta.tcl]] +package ifneeded openlane 0.9 [list source [file join $dir all.tcl]]\n[list source [file join $dir checkers.tcl]]\n[list source [file join $dir cts.tcl]]\n[list source [file join $dir floorplan.tcl]]\n[list source [file join $dir init_design.tcl]]\n[list source [file join $dir lvs.tcl]]\n[list source [file join $dir magic.tcl]]\n[list source [file join $dir placement.tcl]]\n[list source [file join $dir routing.tcl]]\n[list source [file join $dir synthesis.tcl]]\n[list source [file join $dir dft.tcl]]\n[list source [file join $dir klayout.tcl]]\n[list source [file join $dir cvc_rv.tcl]]\n[list source [file join $dir eco.tcl]]\n[list source [file join $dir sta.tcl]]