diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh index f6ab2328..816b1d7c 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,18 @@ 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 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..fb1b2fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,11 +95,30 @@ 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 '.*/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 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*\.lef' | wc -l) -eq 1 ] + fi + [ $(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 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*/1_.*\.log' | wc -l) -eq 0 ] + [ $(find build ! -regex '.*/\(objects\|external\|test\)/.*' -regex '.*/2_.*\.log' | wc -l) -gt 1 ] test-target-local-clean-setup: name: Local flow - clean setup