From f876a9ca5daa7f9aa344e67cf2193c07d076dbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 16 Oct 2024 10:22:52 +0200 Subject: [PATCH] test: add test that build run downloads what it should MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Øystein Hovind Signed-off-by: Øyvind Harboe --- .github/scripts/build_local_target.sh | 19 +++++++++++++++++-- .github/workflows/ci.yml | 27 ++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh index f6ab2328..40a18525 100755 --- a/.github/scripts/build_local_target.sh +++ b/.github/scripts/build_local_target.sh @@ -1,8 +1,9 @@ #!/bin/bash -set -e +set -ex -target_name=${TARGET:-"tag_array_64x184"} +# Test local build with submacros +target_name=${TARGET:-"L1MetadataArray"} if [[ -z "$STAGES" ]]; then # Skip "grt" "route", takes too long STAGES=("synth" "floorplan" "place" "cts") @@ -10,6 +11,10 @@ else eval "STAGES=($STAGES)" fi + +if [[ "$target_name" == "L1MetadataArray" || "$target_name" == "subpackage:L1MetadataArray" || "$target_name" == "//sram:top_mix" ]]; then + macro="true" +fi echo "Build ${target_name} macro" for stage in "${STAGES[@]}" do @@ -33,9 +38,19 @@ do elif [[ $stage == "route" ]]; then stages+=("do-5_2_route") stages+=("do-5_3_fillcell") + elif [[ $stage == "cts" ]]; then + stages+=("do-cts") + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.odb' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.sdc' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.v' | wc -l) -eq 0 ] else stages+=("do-${stage}") fi + if [[ "$macro" == "true" ]]; then + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lib' | wc -l) -eq 1 ] + fi + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.gds' | wc -l) -eq 0 ] for local_stage in "${stages[@]}" do echo "[${target_name}] ${local_stage}: Run make script" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8218caa1..1fad2dfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,11 +95,32 @@ jobs: uses: actions/checkout@v4 - name: Run target run: | - rm -rf ./build + set -ex + + rm -rf ./build/ bazel run ${{ matrix.STAGE_TARGET }}_synth -- `pwd`/build OR_ARGS=-exit open_synth - rm -rf ./build + if [[ "${{ matrix.STAGE_TARGET }}" == "L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "subpackage:L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "//sram:top_mix" ]]; then + macro="true" + fi + if [[ "$macro" == "true" ]]; then + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lib' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 1 ] + fi + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.gds' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\1_.*\.log' | wc -l) -gt 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\2_*\.log' | wc -l) -eq 0 ] + rm -rf ./build/ bazel run ${{ matrix.STAGE_TARGET }}_floorplan -- `pwd`/build OR_ARGS=-exit open_floorplan - + if [[ "$macro" == "true" ]]; then + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lib' | wc -l) -eq 1 ] + fi + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.odb' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.gds' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.sdc' | wc -l) -eq 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.v' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\1_.*\.log' | wc -l) -gt 1 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\2_.*\.log' | wc -l) -gt 1 ] test-target-local-clean-setup: name: Local flow - clean setup