diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh index f6ab2328..c963d64d 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") @@ -33,9 +34,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/results -name '*.odb' | wc -l) -eq 1 ] + [ $(find build/results -name '*.sdc' | wc -l) -eq 1 ] + [ $(find build/results -name '*.v' | wc -l) -eq 0 ] else stages+=("do-${stage}") fi + if [[ "$target_name" == "L1MetadataArray" || "$target_name" == "subpackage:L1MetadataArray" ]]; then + [ $(find build/results -name '*.lef' | wc -l) -eq 1 ] + [ $(find build/results -name '*.lib' | wc -l) -eq 1 ] + fi + [ $(find build/results -name '*.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..735560e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,11 +95,36 @@ jobs: uses: actions/checkout@v4 - name: Run target run: | - rm -rf ./build + set -ex + + if [[ "${{ matrix.STAGE_TARGET }}" == //sram:* ]]; then + BUILD="./build/sram" + else + BUILD="./build" + fi + + rm -rf $BUILD/ bazel run ${{ matrix.STAGE_TARGET }}_synth -- `pwd`/build OR_ARGS=-exit open_synth - rm -rf ./build + macro='[[ "${{ matrix.STAGE_TARGET }}" == "L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "subpackage:L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "//sram:top_mix" ]]' + if [[ eval $macro ]]; then + [ $(find $BUILD/results -name '*.lib' | wc -l) -eq 1 ] + [ $(find $BUILD/results -name '*.lef' | wc -l) -eq 1 ] + fi + [ $(find $BUILD/results -name '*.gds' | wc -l) -eq 0 ] + [ $(find $BUILD/logs -name '1_*.log' | wc -l) -gt 1 ] + [ $(find $BUILD/logs -name '2_*.log' | wc -l) -eq 0 ] + rm -rf $BUILD/ bazel run ${{ matrix.STAGE_TARGET }}_floorplan -- `pwd`/build OR_ARGS=-exit open_floorplan - + if [[ eval $macro ]]; then + [ $(find $BUILD/results -name '*.lib' | wc -l) -eq 1 ] + fi + [ $(find $BUILD/results -name '*.lef' | wc -l) -eq 0 ] + [ $(find $BUILD/results -name '*.odb' | wc -l) -eq 1 ] + [ $(find $BUILD/results -name '*.gds' | wc -l) -eq 0 ] + [ $(find $BUILD/results -name '*.sdc' | wc -l) -eq 1 ] + [ $(find $BUILD/results -name '*.v' | wc -l) -eq 0 ] + [ $(find $BUILD/logs -name '1_*.log' | wc -l) -gt 1 ] + [ $(find $BUILD/logs -name '2_*.log' | wc -l) -gt 1 ] test-target-local-clean-setup: name: Local flow - clean setup