Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Eryk Szpotanski <[email protected]>
  • Loading branch information
eszpotanski committed Apr 29, 2024
1 parent 8b2ad94 commit f2438dd
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 236 deletions.
9 changes: 5 additions & 4 deletions .github/scripts/build_local_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

target_name=${TARGET:-"tag_array_64x184"}
flow=${FLOW:-"local"}
if [[ -z "$STAGES" ]]; then
if [[ "$target_name" == L1MetadataArray_* ]]; then
STAGES=("synth_sdc" "synth" "floorplan" "place" "cts" "grt" "generate_abstract")
Expand All @@ -18,13 +19,13 @@ 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
bazel query ${target_name}_${stage}_scripts
bazel query ${target_name}_${stage}_scripts --output=build
echo "build make script"
bazel build --subcommands --verbose_failures --sandbox_debug ${target_name}_${stage}_make
bazel build --subcommands --verbose_failures --sandbox_debug ${target_name}_${stage}_scripts
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}_${flow}_script $(if [[ "$stage" != "memory" ]] ; then echo "bazel-" ; fi)${stage}
fi
done
271 changes: 153 additions & 118 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,111 +9,144 @@ env:
DOCKER_IMAGE: openroad/flow-ubuntu22.04-builder:latest

jobs:
lint:
name: Lint Bazel files
runs-on: ubuntu-22.04
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Download buildifier
run: |
wget https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64 -O /usr/local/bin/buildifier
chmod +x /usr/local/bin/buildifier
buildifier -version
- name: Checkout bazel-orfs
uses: actions/checkout@v4
- name: Check Bazel files
run: |
buildifier -lint warn -r .
# lint:
# name: Lint Bazel files
# runs-on: ubuntu-22.04
# env:
# DEBIAN_FRONTEND: "noninteractive"
# steps:
# - name: Download buildifier
# run: |
# wget https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64 -O /usr/local/bin/buildifier
# chmod +x /usr/local/bin/buildifier
# buildifier -version
# - name: Checkout bazel-orfs
# uses: actions/checkout@v4
# - name: Check Bazel files
# run: |
# buildifier -lint warn -r .

build-stage-target:
name: Build sample stage targets
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
STAGE_TARGET:
- "tag_array_64x184_generate_abstract"
- "L1MetadataArray_test_generate_abstract"
- "L1MetadataArray_full_generate_abstract"
- "L1MetadataArray_test_gds_final"
- "tag_array_64x184_memory"
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
swap-storage: false
- name: Print info
run: |
echo "USER: "$(whoami)
echo "PWD: "$(pwd)
ls -la
echo "HOME: "$HOME
docker --version
- name: Checkout bazel-orfs
uses: actions/checkout@v4
- name: load docker image
run: |
bazel run --subcommands --verbose_failures --sandbox_debug orfs_env
- name: query target
run: |
bazel query ${{ matrix.STAGE_TARGET }}
bazel query ${{ matrix.STAGE_TARGET }} --output=build
- name: build target
run: |
bazel build --subcommands --verbose_failures --sandbox_debug ${{ matrix.STAGE_TARGET }}
# build-make-target:
# name: Build sample make targets
# runs-on: ubuntu-22.04
# defaults:
# run:
# shell: bash
# strategy:
# fail-fast: false
# matrix:
# STAGE_TARGET:
# - "tag_array_64x184_generate_abstract_make"
# - "L1MetadataArray_test_generate_abstract_make"
# - "L1MetadataArray_full_generate_abstract_make"
# - "L1MetadataArray_test_gds_final_make"
# - "tag_array_64x184_memory_make"
# env:
# DEBIAN_FRONTEND: "noninteractive"
# steps:
# - name: Free Disk Space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# swap-storage: false
# - name: Print info
# run: |
# echo "USER: "$(whoami)
# echo "PWD: "$(pwd)
# ls -la
# echo "HOME: "$HOME
# docker --version
# - name: Checkout bazel-orfs
# uses: actions/checkout@v4
# - name: load docker image
# run: |
# bazel run --subcommands --verbose_failures --sandbox_debug orfs_env
# - name: query target
# run: |
# bazel query ${{ matrix.STAGE_TARGET }}
# bazel query ${{ matrix.STAGE_TARGET }} --output=build
# - 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/openroad-flow-scripts/ubuntu22.04@sha256:b13b35193bec45cb708bd9a5ee3546a7f20378e3c977a4c49f00e9c1c8a71181
defaults:
run:
shell: bash
strategy:
fail-fast: false
env:
DEBIAN_FRONTEND: "noninteractive"
FLOW_HOME: /OpenROAD-flow-scripts/flow
steps:
- 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: Install bazelisk as bazel
run: |
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
- name: Checkout bazel-orfs
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
# test-scripts-target-docker:
# name: Execute sample _scripts targets with docker flow
# runs-on: ubuntu-22.04
# defaults:
# run:
# shell: bash
# strategy:
# fail-fast: false
# env:
# DEBIAN_FRONTEND: "noninteractive"
# FLOW: docker
# steps:
# - name: Print info
# run: |
# echo "USER: "$(whoami)
# echo "PWD: "$(pwd)
# ls -la
# echo "HOME: "$HOME
# docker --version
# - name: Checkout bazel-orfs
# uses: actions/checkout@v4
# - name: load docker image
# run: |
# bazel run --subcommands --verbose_failures --sandbox_debug orfs_env
# - name: build docker stage targets - tag_array_64x184
# env:
# TARGET: tag_array_64x184
# run: .github/scripts/build_local_target.sh
# - name: build docker stage targets - L1MetadataArray_test
# env:
# TARGET: L1MetadataArray_test
# run: .github/scripts/build_local_target.sh

test-stage-make-targets:
name: Run ORFS using stage targets and _make scrips
# test-scripts-target-local:
# name: Execute sample _scripts targets with local flow
# runs-on: ubuntu-22.04
# container:
# image: ghcr.io/antmicro/openroad-flow-scripts/ubuntu22.04@sha256:b13b35193bec45cb708bd9a5ee3546a7f20378e3c977a4c49f00e9c1c8a71181
# defaults:
# run:
# shell: bash
# strategy:
# fail-fast: false
# env:
# DEBIAN_FRONTEND: "noninteractive"
# FLOW_HOME: /OpenROAD-flow-scripts/flow
# steps:
# - 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: Install bazelisk as bazel
# run: |
# wget https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel
# chmod +x /usr/local/bin/bazel
# - name: Checkout bazel-orfs
# 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

test-docker-local-targets:
name: Run ORFS using docker and local flow
runs-on: ubuntu-22.04
defaults:
run:
Expand All @@ -132,22 +165,24 @@ jobs:
- name: load docker image
run: |
bazel run --subcommands --verbose_failures --sandbox_debug orfs_env
- name: build synth stage targets
run: |
bazel build --subcommands --verbose_failures --sandbox_debug tag_array_64x184_synth_sdc tag_array_64x184_synth
- name: build make target
- name: build docker flow targets
env:
FLOW: docker
STAGES: synth_sdc synth
run: .github/scripts/build_local_target.sh
- name: prepare scripts with local flow
env:
SKIP_RUN: 1
run: .github/scripts/build_local_target.sh
- name: set env
run: |
echo "DOCKER_ARGS=-v $(realpath ~/.cache):$(realpath ~/.cache)" >> $GITHUB_ENV
echo "OR_IMAGE=$DOCKER_IMAGE" >> $GITHUB_ENV
- name: run make target
run: |
./docker_shell.sh "export SKIP_BUILD=1
export TARGET=$TARGET
export STAGES=\"$STAGES\"
export FLOW_HOME=/OpenROAD-flow-scripts/flow
cd "'$WORK_HOME
$WORK_HOME/.github/scripts/build_local_target.sh'
- name: run local flow target
run: >
docker run --rm
-v $(realpath ~/.cache):$(realpath ~/.cache)
-v $(pwd):$(pwd)
-e SKIP_BUILD=1
-e TARGET
-e STAGES
-e FLOW_HOME
-w $(pwd)
$DOCKER_IMAGE
.github/scripts/build_local_target.sh
Loading

0 comments on commit f2438dd

Please sign in to comment.