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 d0cdc72 commit 2962001
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
15 changes: 13 additions & 2 deletions .github/scripts/build_local_target.sh
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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"
Expand Down
31 changes: 28 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2962001

Please sign in to comment.