From 22a128418b6eebb6ea531f821004c8a4f43ee75a Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Fri, 12 Apr 2024 19:09:06 +0200 Subject: [PATCH 1/3] CI: test local flow Signed-off-by: Pawel Czarnecki --- .github/scripts/build_local_target.sh | 30 ++++++++++++++++++ .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 .github/scripts/build_local_target.sh diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh new file mode 100755 index 0000000..9fd6f3c --- /dev/null +++ b/.github/scripts/build_local_target.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +target_name=${TARGET:-"tag_array_64x184"} +if [[ -z "$STAGES" ]]; then + if [[ "$target_name" == L1MetadataArray_* ]]; then + STAGES=("synth_sdc" "synth" "floorplan" "place" "cts" "grt" "generate_abstract") + else + STAGES=("synth_sdc" "synth" "memory" "floorplan" "generate_abstract") + fi +else + eval "STAGES=($STAGES)" +fi + +echo "Build tag_array_64x184 macro" +for stage in ${STAGES[@]} +do + if [[ -z $SKIP_BUILD ]] ; then + echo "query make script target" + bazel query ${target_name}_${stage}_make + bazel query ${target_name}_${stage}_make --output=build + echo "build make script" + bazel build --subcommands --verbose_failures --sandbox_debug ${target_name}_${stage}_make + fi + if [[ -z $SKIP_RUN ]] ; then + echo "run make script" + ./bazel-bin/${target_name}_${stage}_make $(if [[ "$stage" != "memory" ]] ; then echo "bazel-" ; fi)${stage} + fi +done diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51bc92a..decf80e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,3 +45,47 @@ jobs: - name: build target run: | bazel build --subcommands --verbose_failures --sandbox_debug ${{ matrix.STAGE_TARGET }} + + test-make-script-target: + name: Execute sample _make scripts + runs-on: ubuntu-22.04 + container: + image: ghcr.io/antmicro/bazel-orfs@sha256:78b4c15830d75e026dc2294b280cb5ff1200f6ee7902a714dca71fd61b5b2e4e + defaults: + run: + shell: bash + strategy: + fail-fast: false + env: + DEBIAN_FRONTEND: "noninteractive" + steps: + # Workaround for https://github.com/actions/runner/issues/863 + - name: Override HOME env var + shell: bash + run: | + echo HOME=/root | sudo tee -a $GITHUB_ENV + - name: Print info + run: | + echo "USER: "$(whoami) + echo "PWD: "$(pwd) + ls -la + echo "HOME: "$HOME + cd ~/OpenROAD-flow-scripts + echo "OpenROAD-flow-scripts SHA: "$(git rev-parse HEAD) + source ./env.sh + yosys --version + openroad -version + - name: Checkout megaboom + uses: actions/checkout@v4 + - name: build local stage targets - tag_array_64x184 + env: + TARGET: tag_array_64x184 + run: .github/scripts/build_local_target.sh + - name: build local stage targets - lb_32x128 + env: + TARGET: lb_32x128 + run: .github/scripts/build_local_target.sh + - name: build local stage targets - L1MetadataArray_test + env: + TARGET: L1MetadataArray_test + run: .github/scripts/build_local_target.sh From 4d512a4c41e5cf2005c657ef456e5d4753d5ba9e Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Fri, 12 Apr 2024 19:25:26 +0200 Subject: [PATCH 2/3] CI: disable memory stage local tests Signed-off-by: Pawel Czarnecki --- .github/scripts/build_local_target.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build_local_target.sh b/.github/scripts/build_local_target.sh index 9fd6f3c..f3f73ee 100755 --- a/.github/scripts/build_local_target.sh +++ b/.github/scripts/build_local_target.sh @@ -7,7 +7,7 @@ if [[ -z "$STAGES" ]]; then if [[ "$target_name" == L1MetadataArray_* ]]; then STAGES=("synth_sdc" "synth" "floorplan" "place" "cts" "grt" "generate_abstract") else - STAGES=("synth_sdc" "synth" "memory" "floorplan" "generate_abstract") + STAGES=("synth_sdc" "synth" "floorplan" "generate_abstract") fi else eval "STAGES=($STAGES)" @@ -25,6 +25,6 @@ do fi if [[ -z $SKIP_RUN ]] ; then echo "run make script" - ./bazel-bin/${target_name}_${stage}_make $(if [[ "$stage" != "memory" ]] ; then echo "bazel-" ; fi)${stage} + ./bazel-bin/${target_name}_${stage}_make "bazel-"${stage} fi done From df50b0f8f25518343175edc7f4e503bfda570a1a Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Fri, 12 Apr 2024 18:17:50 +0200 Subject: [PATCH 3/3] test fixed local flow Signed-off-by: Pawel Czarnecki --- MODULE.bazel | 6 +++++- MODULE.bazel.lock | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 708f472..92f462d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,5 +8,9 @@ bazel_dep(name = "bazel-orfs") git_override( module_name = "bazel-orfs", remote = "https://github.com/antmicro/bazel-orfs.git", - commit = "9c6a77edd9c6e431f578f28e01fa631765061fd2" + commit = "08c9ec6508d42e48095af0195dee4349c79a99ce" ) + +#local_path_override( +# module_name = "bazel-orfs", path = "../bazel-orfs" +#) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index c5f331e..8181966 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 3, - "moduleFileHash": "162dacd209b29225f1ae0758bc8a140632e01b5a752c9f5c857e0627786eb24b", + "moduleFileHash": "c4c435484be59380bf1f498269b5e8a9c4d6f6c59c486a8fc0f6c94852eb955b", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/"