Skip to content

Commit

Permalink
test: add test that build run downloads what it should
Browse files Browse the repository at this point in the history
Co-authored-by: Øystein Hovind <[email protected]>
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe and hovind committed Oct 16, 2024
1 parent 8269a48 commit 32dfc5a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
18 changes: 16 additions & 2 deletions .github/scripts/build_local_target.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/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")
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
Expand All @@ -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"
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,31 @@ 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
# FIXME reenable when logs are published for synthesis
# [ $(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
Expand Down

0 comments on commit 32dfc5a

Please sign in to comment.