From 0312ecc6749a3981986698e35472aa57e10ad536 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Thu, 26 Oct 2023 13:00:32 +0300 Subject: [PATCH 1/7] testing CI --- .github/workflows/user_project_ci.yml | 251 +++++++++++++++++++------- 1 file changed, 181 insertions(+), 70 deletions(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index 01bb46a02..2d2dbebd1 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - pdk: + download_caravel: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -19,34 +19,115 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Export PDK ROOT - run: echo "PDK_ROOT=/home/runner/work/pdk" >> $GITHUB_ENV - - - name: Export OPENLANE ROOT - run: echo "OPENLANE_ROOT=/home/runner/work/caravel_user_project/openlane" >> $GITHUB_ENV + - name: Setup Environment Variables + run: | + echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV + echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV + echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV + echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV + echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV + echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV - name: Install dependencies run: | sudo mkdir -p ${{ env.PDK_ROOT }} sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} make install - make openlane - make pdk-with-volare + cd ${{ env.CARAVEL_ROOT }} + rm -rf gds mag maglef def lef openlane scripts signoff spi LICENSE manifest .git - - name: Tarball PDK + - name: Tarball Caravel run: | - tar -cf /tmp/pdk.tar -C $PDK_ROOT . + tar -cf /tmp/caravel.tar -C $CARAVEL_ROOT . - - name: Upload PDK Tarball + - name: Upload Caravel Tarball uses: actions/upload-artifact@v2 with: - name: pdk-tarball - path: /tmp/pdk.tar + name: caravel-tarball + path: /tmp/caravel.tar + + download_deps: + runs-on: ubuntu-latest + strategy: + matrix: + targets: ["pdk-with-volare", "install_mcw", "openlane", "setup-timing-scripts", "precheck"] + needs: [download_caravel] + steps: + - uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Setup Environment Variables + run: | + echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV + echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV + echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV + echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV + echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV + echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + + - name: Get dependencies name + run: | + if [[ "${{ matrix.targets }}" == "install_mcw" ]]; then + echo "dep_name=mgmt_core_wrapper" >> $GITHUB_ENV + echo "dep_root=${{ env.MCW_ROOT }}" >> $GITHUB_ENV + elif [[ "${{ matrix.targets }}" == "openlane" ]]; then + echo "dep_name=openlane" >> $GITHUB_ENV + echo "dep_root=${{ env.OPENLANE_ROOT }}" >> $GITHUB_ENV + elif [[ "${{ matrix.targets }}" == "pdk-with-volare" ]]; then + echo "dep_name=pdk" >> $GITHUB_ENV + echo "dep_root=${{ env.PDK_ROOT }}" >> $GITHUB_ENV + elif [[ "${{ matrix.targets }}" == "setup-timing-scripts" ]]; then + echo "dep_name=timing-scripts" >> $GITHUB_ENV + echo "dep_root=${{ env.TIMING_ROOT }}" >> $GITHUB_ENV + elif [[ "${{ matrix.targets }}" == "precheck" ]]; then + echo "dep_name=precheck" >> $GITHUB_ENV + echo "dep_root=${{ env.PRECHECK_ROOT }}" >> $GITHUB_ENV + fi + + - name: Download caravel Tarball + uses: actions/download-artifact@v2 + with: + name: caravel-tarball + path: /tmp - user_project_flow_gf180mcuC: + - name: Unpack caravel Tarball + run: | + sudo mkdir -p ${{ env.CARAVEL_ROOT }} + sudo chown -R $USER:$USER ${{ env.CARAVEL_ROOT }} + tar -xf /tmp/caravel.tar -C $CARAVEL_ROOT . + + - name: Install dependencies + run: | + sudo mkdir -p ${{ env.PDK_ROOT }} + sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} + make ${{ matrix.targets }} + if [[ "${{ env.dep_name }}" == "mgmt_core_wrapper" ]]; then + cd ${{ env.dep_root }} + rm -rf gds mag maglef def lef openlane scripts signoff spi LICENSE manifest docs lib litex lvs .git + fi + + - name: Tarball Dependencies + run: | + tar -cf /tmp/${{ env.dep_name }}.tar -C ${{ env.dep_root }} . + + - name: Upload Dependencies Tarball + uses: actions/upload-artifact@v2 + with: + name: ${{ env.dep_name }}-tarball + path: /tmp/${{ env.dep_name }}.tar + + hardening: timeout-minutes: 720 runs-on: ubuntu-latest - needs: [pdk] + strategy: + matrix: + pdk: ["gf180mcuD"] + needs: [download_deps] steps: - uses: actions/checkout@v2 @@ -56,11 +137,16 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Export PDK ROOT - run: echo "PDK_ROOT=/home/runner/work/pdk" >> $GITHUB_ENV - - - name: Export OPENLANE ROOT - run: echo "OPENLANE_ROOT=/home/runner/work/caravel_user_project/openlane" >> $GITHUB_ENV + - name: Export ENVIRONMENT VARIABLES + run: | + echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV + echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV + echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV + echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV + echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV + echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV + echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV + echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV - name: Download PDK Tarball uses: actions/download-artifact@v2 @@ -74,66 +160,91 @@ jobs: sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} tar -xf /tmp/pdk.tar -C $PDK_ROOT . - - name: Install dependencies + - name: Download openlane Tarball + uses: actions/download-artifact@v2 + with: + name: openlane-tarball + path: /tmp + + - name: Unpack openlane Tarball run: | - make install - make install_mcw - make openlane - make simenv - - - name: remove existing generated files - run: | - rm -rf /home/runner/work/caravel_user_project/gds - rm -rf /home/runner/work/caravel_user_project/verilog/gl - rm -rf /home/runner/work/caravel_user_project/mag - rm -rf /home/runner/work/caravel_user_project/maglef - rm -rf /home/runner/work/caravel_user_project/lef - rm -rf /home/runner/work/caravel_user_project/lib - rm -rf /home/runner/work/caravel_user_project/sdf - rm -rf /home/runner/work/caravel_user_project/sdc - rm -rf /home/runner/work/caravel_user_project/spef + sudo mkdir -p ${{ env.OPENLANE_ROOT }} + sudo chown -R $USER:$USER ${{ env.OPENLANE_ROOT }} + tar -xf /tmp/openlane.tar -C $OPENLANE_ROOT . - name: Harden using Openlane run: | make user_proj_example make user_project_wrapper + rm -rf openlane/user_proj_example/runs openlane/user_project_wrapper/runs pdk openlane_src caravel mgmt_core_wrapper timing-scripts mpw_precheck + + - name: Tarball Design + run: | + tar -cf /tmp/design.tar -C $GITHUB_WORKSPACE . - - name: run precheck + - name: Upload Design Tarball + uses: actions/upload-artifact@v2 + with: + name: design-tarball + path: /tmp/design.tar + + precheck: + timeout-minutes: 720 + runs-on: ubuntu-latest + strategy: + matrix: + pdk: ["gf180mcuD"] + needs: [download_deps, hardening] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Export ENVIRONMENT VARIABLES run: | - export INPUT_DIRECTORY=$(pwd) - export PRECHECK_ROOT=$INPUT_DIRECTORY/mpw_precheck - export OUTPUT_DIRECTORY=$INPUT_DIRECTORY/mpw_precheck_result - export OUTPUT=$OUTPUT_DIRECTORY/logs/precheck.log + echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV + echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV + echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV + echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV + echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV + echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV + echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV + echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV - git clone --depth=1 -b gfmpw-0d https://github.com/efabless/mpw_precheck.git + - name: Download PDK Tarball + uses: actions/download-artifact@v2 + with: + name: pdk-tarball + path: /tmp + + - name: Unpack PDK Tarball + run: | + sudo mkdir -p ${{ env.PDK_ROOT }} + sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} + tar -xf /tmp/pdk.tar -C $PDK_ROOT . - docker run -v "$PRECHECK_ROOT":"$PRECHECK_ROOT" -v "$INPUT_DIRECTORY":"$INPUT_DIRECTORY" -v "${{ env.PDK_ROOT }}":"${{ env.PDK_ROOT }}" -e INPUT_DIRECTORY="$INPUT_DIRECTORY" -e PDK_ROOT="${{ env.PDK_ROOT }}" -e PDKPATH="${{ env.PDKPATH }}" -u $(id -u "$USER"):$(id -g "$USER") efabless/mpw_precheck:latest bash -c "cd $PRECHECK_ROOT; python3 mpw_precheck.py --input_directory $INPUT_DIRECTORY --pdk_path ${{ env.PDKPATH }} --output_directory $OUTPUT_DIRECTORY license makefile consistency xor magic_drc klayout_beol klayout_feol klayout_met_min_ca_density klayout_offgrid klayout_pin_label_purposes_overlapping_drawing klayout_zeroarea" + - name: Download precheck Tarball + uses: actions/download-artifact@v2 + with: + name: precheck-tarball + path: /tmp - cnt=$(grep -c "All Checks Passed" "$OUTPUT") - if ! [[ $cnt ]]; then cnt=0; fi - if [[ $cnt -eq 1 ]]; then exit 0; fi - exit 2 + - name: Unpack precheck Tarball + run: | + sudo mkdir -p ${{ env.PRECHECK_ROOT }} + sudo chown -R $USER:$USER ${{ env.PRECHECK_ROOT }} + tar -xf /tmp/precheck.tar -C $PRECHECK_ROOT . - - name: upload failure logs - if: failure() - uses: actions/upload-artifact@v2 + - name: Download Design Tarball + uses: actions/download-artifact@v2 with: - name: error - path: | - /home/runner/work/caravel_user_project/caravel_user_project/mpw_precheck_result/logs/* - - # - name: Run DV RTL tests - # run: | - # make verify-io_ports-rtl - # make verify-la_test1-rtl - # make verify-la_test2-rtl - # make verify-mprj_stimulus-rtl - # make verify-wb_port-rtl - - # - name: Run DV GL tests - # run: | - # make verify-io_ports-gl - # make verify-la_test1-gl - # make verify-la_test2-gl - # make verify-mprj_stimulus-gl - # make verify-wb_port-gl + name: design-tarball + path: /tmp + + - name: Unpack Design Tarball + run: | + sudo mkdir -p $GITHUB_WORKSPACE + sudo chown -R $USER:$USER $GITHUB_WORKSPACE + tar -xf /tmp/design.tar -C $GITHUB_WORKSPACE . From 6bc119b63e4369bbca21a0389831f19cdff7f159 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Thu, 26 Oct 2023 13:06:57 +0300 Subject: [PATCH 2/7] testing CI --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1f6358e41..3e6d0314d 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ endif ifeq ($(PDK),gf180mcuD) - MPW_TAG ?= gfmpw-0f + MPW_TAG ?= testgf-1a CARAVEL_NAME := caravel CARAVEL_REPO := https://github.com/efabless/caravel-gf180mcu CARAVEL_TAG := $(MPW_TAG) From f99faa303ee794412810470df47e18e2fad85aba Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Thu, 26 Oct 2023 14:12:05 +0300 Subject: [PATCH 3/7] testing CI --- .github/workflows/user_project_ci.yml | 95 +++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index 2d2dbebd1..f0f429383 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -248,3 +248,98 @@ jobs: sudo mkdir -p $GITHUB_WORKSPACE sudo chown -R $USER:$USER $GITHUB_WORKSPACE tar -xf /tmp/design.tar -C $GITHUB_WORKSPACE . + + - name: Run Precheck + run: make run-precheck + +precheck: + timeout-minutes: 720 + runs-on: ubuntu-latest + strategy: + matrix: + pdk: ["gf180mcuD"] + needs: [download_deps, hardening] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Export ENVIRONMENT VARIABLES + run: | + echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV + echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV + echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV + echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV + echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV + echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV + echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV + echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + + - name: Download PDK Tarball + uses: actions/download-artifact@v2 + with: + name: pdk-tarball + path: /tmp + + - name: Unpack PDK Tarball + run: | + sudo mkdir -p ${{ env.PDK_ROOT }} + sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} + tar -xf /tmp/pdk.tar -C $PDK_ROOT . + + - name: Download timing-scripts Tarball + uses: actions/download-artifact@v2 + with: + name: timing-scripts-tarball + path: /tmp + + - name: Unpack timing-scripts Tarball + run: | + sudo mkdir -p ${{ env.TIMING_ROOT }} + sudo chown -R $USER:$USER ${{ env.TIMING_ROOT }} + tar -xf /tmp/timing-scripts.tar -C $TIMING_ROOT . + + - name: Download Design Tarball + uses: actions/download-artifact@v2 + with: + name: design-tarball + path: /tmp + + - name: Unpack Design Tarball + run: | + sudo mkdir -p $GITHUB_WORKSPACE + sudo chown -R $USER:$USER $GITHUB_WORKSPACE + tar -xf /tmp/design.tar -C $GITHUB_WORKSPACE . + + - name: Download Caravel Tarball + uses: actions/download-artifact@v2 + with: + name: caravel-tarball + path: /tmp + + - name: Unpack Caravel Tarball + run: | + sudo mkdir -p ${{ env.CARAVEL_ROOT }} + sudo chown -R $USER:$USER ${{ env.CARAVEL_ROOT }} + tar -xf /tmp/caravel.tar -C ${{ env.CARAVEL_ROOT }} . + + - name: Download mgmt_core_wrapper Tarball + uses: actions/download-artifact@v2 + with: + name: mgmt_core_wrapper-tarball + path: /tmp + + - name: Unpack mgmt_core_wrapper Tarball + run: | + sudo mkdir -p ${{ env.MCW_ROOT }} + sudo chown -R $USER:$USER ${{ env.MCW_ROOT }} + tar -xf /tmp/mgmt_core_wrapper.tar -C ${{ env.MCW_ROOT }} . + + - name: Run STA + run: | + make caravel-extract-parasitics + make extract-parasitics + make create-spef-mapping + make caravel-sta From 4489c853ca13f24fe8741e036002dc0e68704e72 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Thu, 26 Oct 2023 14:13:16 +0300 Subject: [PATCH 4/7] testing CI --- .github/workflows/user_project_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index f0f429383..2a16e7c26 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -252,7 +252,7 @@ jobs: - name: Run Precheck run: make run-precheck -precheck: + STA: timeout-minutes: 720 runs-on: ubuntu-latest strategy: From 03e1e5214aa125fab4a332a413163ede3f751e23 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 12 Nov 2023 11:38:06 +0200 Subject: [PATCH 5/7] testing CI --- .github/workflows/user_project_ci.yml | 94 ++++++++++++++++++++------- 1 file changed, 72 insertions(+), 22 deletions(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index 2a16e7c26..c2aa39489 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -27,6 +27,7 @@ jobs: echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + echo "MPW_TAG=main" >> $GITHUB_ENV - name: Install dependencies run: | @@ -34,7 +35,7 @@ jobs: sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} make install cd ${{ env.CARAVEL_ROOT }} - rm -rf gds mag maglef def lef openlane scripts signoff spi LICENSE manifest .git + rm -rf gds maglef openlane spi LICENSE manifest .git - name: Tarball Caravel run: | @@ -69,6 +70,7 @@ jobs: echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + echo "MPW_TAG=main" >> $GITHUB_ENV - name: Get dependencies name run: | @@ -108,7 +110,7 @@ jobs: make ${{ matrix.targets }} if [[ "${{ env.dep_name }}" == "mgmt_core_wrapper" ]]; then cd ${{ env.dep_root }} - rm -rf gds mag maglef def lef openlane scripts signoff spi LICENSE manifest docs lib litex lvs .git + rm -rf gds maglef openlane spi LICENSE manifest docs litex lvs .git fi - name: Tarball Dependencies @@ -147,6 +149,7 @@ jobs: echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + echo "MPW_TAG=main" >> $GITHUB_ENV - name: Download PDK Tarball uses: actions/download-artifact@v2 @@ -174,19 +177,34 @@ jobs: - name: Harden using Openlane run: | - make user_proj_example - make user_project_wrapper - rm -rf openlane/user_proj_example/runs openlane/user_project_wrapper/runs pdk openlane_src caravel mgmt_core_wrapper timing-scripts mpw_precheck + python3 $GITHUB_WORKSPACE/.github/scripts/get_designs.py --design $GITHUB_WORKSPACE + for word in $(cat harden_sequence.txt); do + echo "CURRENT_DESIGN=${word}" >> $GITHUB_ENV + make $word + done + rm -rf openlane/*/runs pdk openlane_src caravel mgmt_core_wrapper timing-scripts mpw_precheck + + - name: Create reproducible + if: failure() + run: tar -cf $GITHUB_WORKSPACE/issue_reproducible.tar -C $GITHUB_WORKSPACE/openlane/${{ env.CURRENT_DESIGN }}/runs/${{ env.CURRENT_DESIGN }}/issue_reproducible . - - name: Tarball Design + - name: upload failure logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: openlane-issue-reproducible + path: | + $GITHUB_WORKSPACE/issue_reproducible.tar + + - name: Tarball Design_${{ matrix.pdk }} run: | - tar -cf /tmp/design.tar -C $GITHUB_WORKSPACE . + tar -cf /tmp/design_${{ matrix.pdk }}.tar -C $GITHUB_WORKSPACE . - - name: Upload Design Tarball + - name: Upload Design_${{ matrix.pdk }} Tarball uses: actions/upload-artifact@v2 with: - name: design-tarball - path: /tmp/design.tar + name: design_${{ matrix.pdk }}-tarball + path: /tmp/design_${{ matrix.pdk }}.tar precheck: timeout-minutes: 720 @@ -194,8 +212,9 @@ jobs: strategy: matrix: pdk: ["gf180mcuD"] - needs: [download_deps, hardening] + needs: [hardening] steps: + - uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -212,6 +231,7 @@ jobs: echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + echo "MPW_TAG=main" >> $GITHUB_ENV - name: Download PDK Tarball uses: actions/download-artifact@v2 @@ -237,20 +257,32 @@ jobs: sudo chown -R $USER:$USER ${{ env.PRECHECK_ROOT }} tar -xf /tmp/precheck.tar -C $PRECHECK_ROOT . - - name: Download Design Tarball + - name: Download Design_${{ matrix.pdk }} Tarball uses: actions/download-artifact@v2 with: - name: design-tarball + name: design_${{ matrix.pdk }}-tarball path: /tmp - - name: Unpack Design Tarball + - name: Unpack Design_${{ matrix.pdk }} Tarball run: | sudo mkdir -p $GITHUB_WORKSPACE sudo chown -R $USER:$USER $GITHUB_WORKSPACE - tar -xf /tmp/design.tar -C $GITHUB_WORKSPACE . + tar -xf /tmp/design_${{ matrix.pdk }}.tar -C $GITHUB_WORKSPACE . - name: Run Precheck - run: make run-precheck + run: | + export INPUT_DIRECTORY=$GITHUB_WORKSPACE + export PRECHECK_ROOT=$INPUT_DIRECTORY/mpw_precheck + export OUTPUT_DIRECTORY=$INPUT_DIRECTORY/mpw_precheck_result + export OUTPUT=$OUTPUT_DIRECTORY/logs/precheck.log + export PDKPATH=$PDK_ROOT/sky130A + + docker run -v "$PRECHECK_ROOT":"$PRECHECK_ROOT" -v "$INPUT_DIRECTORY":"$INPUT_DIRECTORY" -v "${{ env.PDK_ROOT }}":"${{ env.PDK_ROOT }}" -e INPUT_DIRECTORY="$INPUT_DIRECTORY" -e PDK_ROOT="${{ env.PDK_ROOT }}" -e PDKPATH="${{ env.PDKPATH }}" -u $(id -u "$USER"):$(id -g "$USER") efabless/mpw_precheck:latest bash -c "cd $PRECHECK_ROOT; python3 mpw_precheck.py --input_directory $INPUT_DIRECTORY --pdk_path ${{ env.PDKPATH }} --output_directory $OUTPUT_DIRECTORY license makefile consistency xor magic_drc klayout_beol klayout_feol klayout_met_min_ca_density klayout_offgrid klayout_pin_label_purposes_overlapping_drawing klayout_zeroarea lvs" + + cnt=$(grep -c "All Checks Passed" "$OUTPUT") + if ! [[ $cnt ]]; then cnt=0; fi + if [[ $cnt -eq 1 ]]; then exit 0; fi + exit 2 STA: timeout-minutes: 720 @@ -258,8 +290,9 @@ jobs: strategy: matrix: pdk: ["gf180mcuD"] - needs: [download_deps, hardening] + needs: [hardening] steps: + - uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -276,6 +309,7 @@ jobs: echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV + echo "MPW_TAG=main" >> $GITHUB_ENV - name: Download PDK Tarball uses: actions/download-artifact@v2 @@ -301,17 +335,17 @@ jobs: sudo chown -R $USER:$USER ${{ env.TIMING_ROOT }} tar -xf /tmp/timing-scripts.tar -C $TIMING_ROOT . - - name: Download Design Tarball + - name: Download Design_${{ matrix.pdk }} Tarball uses: actions/download-artifact@v2 with: - name: design-tarball + name: design_${{ matrix.pdk }}-tarball path: /tmp - - name: Unpack Design Tarball + - name: Unpack Design_${{ matrix.pdk }} Tarball run: | sudo mkdir -p $GITHUB_WORKSPACE sudo chown -R $USER:$USER $GITHUB_WORKSPACE - tar -xf /tmp/design.tar -C $GITHUB_WORKSPACE . + tar -xf /tmp/design_${{ matrix.pdk }}.tar -C $GITHUB_WORKSPACE . - name: Download Caravel Tarball uses: actions/download-artifact@v2 @@ -339,7 +373,23 @@ jobs: - name: Run STA run: | - make caravel-extract-parasitics + export CUP_ROOT=$GITHUB_WORKSPACE + export PROJECT_ROOT=$GITHUB_WORKSPACE + cd $CUP_ROOT make extract-parasitics make create-spef-mapping make caravel-sta + tar -cf /tmp/timing.tar $CUP_ROOT/signoff/caravel/openlane-signoff/timing + find $CUP_ROOT/signoff/caravel/openlane-signoff/timing/*/ -name "summary.log" | head -n1 \ + | xargs head -n5 | tail -n1 > $CUP_ROOT/signoff/caravel/openlane-signoff/timing/all-summary.rpt + find $CUP_ROOT/signoff/caravel/openlane-signoff/timing/*/ -name "summary.log" \ + | xargs -I {} bash -c "head -n7 {} | tail -n1" >> $CUP_ROOT/signoff/caravel/openlane-signoff/timing/all-summary.rpt + vio=$(grep -c "vio(" $CUP_ROOT/signoff/caravel/openlane-signoff/timing/all-summary.rpt || true) + if [[ $vio -gt 0 ]]; + then + echo "STA violation count: $vio" + exit 2 + else + echo "STA run passed" + exit 0 + fi \ No newline at end of file From b0ce4f3036443a9257c58e4585cb9298beefe55a Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 12 Nov 2023 12:07:09 +0200 Subject: [PATCH 6/7] testing CI --- .github/scripts/get_designs.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/scripts/get_designs.py diff --git a/.github/scripts/get_designs.py b/.github/scripts/get_designs.py new file mode 100644 index 000000000..0bb803f59 --- /dev/null +++ b/.github/scripts/get_designs.py @@ -0,0 +1,29 @@ +import argparse +import json + + +def parse_lvs_config(file_path): + """Parses the LVS config file at the specified path.""" + with open(file_path) as f: + data = json.load(f) + return data['LVS_VERILOG_FILES'] + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--design", help="The path to the design.") + args = parser.parse_args() + + config_file = f"{args.design}/lvs/user_project_wrapper/lvs_config.json" + data = parse_lvs_config(config_file) + f = open("harden_sequence.txt", "w") + for d in data: + macro_name = d.split('/')[-1].split('.v')[0] + if macro_name.startswith('$'): + macro_name = 'user_project_wrapper' + f.write(f"{macro_name} ") + f.close() + + +if __name__ == "__main__": + main() \ No newline at end of file From 83e98a7875e52b0cc2c44c3c9b474489fdfebe07 Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:37:45 +0200 Subject: [PATCH 7/7] Update Makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index ceda7ba1e..ac8b66906 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,6 @@ endif ifeq ($(PDK),gf180mcuD) - MPW_TAG ?= gfmpw-1c CARAVEL_NAME := caravel CARAVEL_REPO := https://github.com/efabless/caravel-gf180mcu