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 <oystein@ascenium.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
  • Loading branch information
oharboe and hovind committed Oct 16, 2024
1 parent d0cdc72 commit 35b0b6e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
14 changes: 12 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 All @@ -28,14 +29,23 @@ do
stages+=("do-yosys-keep-hierarchy")
stages+=("do-yosys")
stages+=("do-synth")
[ $(find build/results -name '*.lef' | wc -l) -eq 1 ]
[ $(find build/results -name '*.lib' | wc -l) -eq 1 ]
elif [[ $stage == "grt" ]]; then
stages+=("do-5_1_grt")
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 '*.lef' | 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
[ $(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
30 changes: 27 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,35 @@ jobs:
uses: actions/checkout@v4
- name: Run target
run: |
rm -rf ./build
set -ex
if [[ "${{ matrix.STAGE_TARGET }}" == //sram:* ]]; then
BUILD="./sram/build"
else
BUILD="./build"
fi
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" ]]; 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 [[ "${{ matrix.STAGE_TARGET }}" == "L1MetadataArray" || "${{ matrix.STAGE_TARGET }}" == "subpackage:L1MetadataArray" ]]; 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 35b0b6e

Please sign in to comment.