Skip to content

Commit

Permalink
Merge branch 'master' into autotuner_ci_level_1
Browse files Browse the repository at this point in the history
Signed-off-by: Song Luar <espsluar@gmail.com>
  • Loading branch information
luarss authored Aug 6, 2024
2 parents a689096 + d617deb commit 21fa678
Show file tree
Hide file tree
Showing 172 changed files with 174,846 additions and 5,294 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Python

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
description: Use GitHub --force push.
default:

repository_dispatch:


jobs:
Sync-Branch-From-Upstream:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/github-actions-manual-update-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Manually Trigger Update Rules
on:
workflow_dispatch:
inputs:
type:
description: 'Type of update (overwrite or normal)'
required: true
default: 'normal'

jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out repository code recursively
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python Packages
run: |
pip install firebase-admin
- name: Execute Python Script Update
env:
CREDS_FILE: ${{ secrets.CREDS_FILE }}
API_BASE_URL: ${{ secrets.API_BASE_URL }}
run: |
if [[ "${{ github.event.inputs.type }}" == "overwrite" ]]; then
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --commitSHA $(git rev-parse HEAD) --overwrite
else
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --commitSHA $(git rev-parse HEAD)
fi
- name: Push updated rules
id: remote-update
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [ -n "$(git status --porcelain)" ]; then
echo "has_update=true" >> "$GITHUB_OUTPUT"
else
echo "has_update=false" >> "$GITHUB_OUTPUT"
fi
git add .
git commit --signoff -m "flow: update rules based on new golden reference"
- if: "steps.remote-update.outputs.has_update == 'true'"
name: update rules pr
id: remote-update-pr
run: |
git push
19 changes: 14 additions & 5 deletions .github/workflows/github-actions-update-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ jobs:
- name: Check out repository code recursively
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Git prep
run: |
git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
git fetch
git checkout "origin/pr/${{ github.event.client_payload.branch }}"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -29,9 +33,9 @@ jobs:
echo ${{ github.event_name }}
echo ${{ github.event.client_payload.type }}
if [[ "${{ github.event_name }}" == "repository_dispatch" && "${{ github.event.client_payload.type }}" == "overwrite" ]]; then
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --overwrite
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --commitSHA ${{ github.event.client_payload.commitsha }} --overwrite
else
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL}
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --commitSHA ${{ github.event.client_payload.commitsha }}
fi
- name: Push updated rules
id: remote-update
Expand All @@ -44,8 +48,13 @@ jobs:
echo "has_update=false" >> "$GITHUB_OUTPUT"
fi
git add .
git commit -m "flow: update rules based on new golden reference"
- if: "steps.remote-update.outputs.has_update == 'true'"
git commit --signoff -m "flow: update rules based on new golden reference"
- if: "github.event.client_payload.branch != 'master'"
name: update rules pr
id: remote-update-pr
run: |
git push origin "HEAD:refs/pull/${{ github.event.client_payload.branch }}/head"
- if: "steps.remote-update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'"
name: Create Draft PR
uses: peter-evans/create-pull-request@v5
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
[submodule "tools/OpenROAD"]
path = tools/OpenROAD
url = ../OpenROAD.git
[submodule "tools/LSOracle"]
path = tools/LSOracle
url = ../../The-OpenROAD-Project/LSOracle.git
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ WORKDIR /OpenROAD-flow-scripts

# synthesis tools binaries and plugins
COPY --from=openroad/yosys /install ./tools/install/yosys
COPY --from=openroad/lsoracle /LSOracle/build/core/lsoracle ./tools/build/LSOracle/bin/lsoracle
COPY --from=openroad/lsoracle /LSOracle/core/test.ini ./tools/build/LSOracle/share/lsoracle/test.ini
COPY --from=openroad/lsoracle /LSOracle/build/yosys-plugin/oracle.so /OpenROAD-flow/tools/build/yosys/share/yosys/plugins/

# openroad binary
COPY --from=openroad/ubuntu22.04-builder-gcc /OpenROAD/build/src/openroad ./tools/install/OpenROAD/bin/openroad
Expand Down
45 changes: 0 additions & 45 deletions build_openroad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ YOSYS_ARGS="CONFIG=clang"
OPENROAD_APP_USER_ARGS=""
OPENROAD_APP_ARGS=""

LSORACLE_USER_ARGS=""
LSORACLE_ARGS="\
-D CMAKE_BUILD_TYPE=RELEASE \
-D YOSYS_INCLUDE_DIR=$(pwd)/tools/yosys \
-D YOSYS_PLUGIN=ON \
"

DOCKER_OS_NAME="ubuntu22.04"
PROC=-1

Expand All @@ -43,7 +36,6 @@ Usage: $0 [-h|--help] [-o|--local] [-l|--latest]
[-n|--nice] [-t|--threads N]
[--yosys-args-overwrite] [--yosys-args STRING]
[--openroad-args-overwrite] [--openroad-args STRING]
[--lsoracle-args-overwrite] [--lsoracle-args STRING]
[--install-path PATH] [--clean] [--clean-force]
[-c|--copy-platforms]
Expand Down Expand Up @@ -79,16 +71,6 @@ Options:
--openroad-args STRING Aditional compilation flags for OpenROAD app
compilation.
--lsoracle-enable Compile LSOracle. Disable by default as it is not
currently used on the flow.
--lsoracle-args-overwrite
Do not use default flags set by this script during
LSOracle compilation.
--lsoracle-args STRING Aditional compilation flags for LSOracle
compilation.
--install-path PATH Path to install tools. Default is ${INSTALL_PATH}.
--clean Call git clean interactively before compile.
Expand Down Expand Up @@ -159,16 +141,6 @@ while (( "$#" )); do
OPENROAD_APP_USER_ARGS="$2"
shift
;;
--lsoracle-enable)
LSORACLE_ENABLE=1
;;
--lsoracle-args-overwrite)
LSORACLE_OVERWIRTE_ARGS=1
;;
--lsoracle-args)
LSORACLE_USER_ARGS="$2"
shift
;;
--install-path)
INSTALL_PATH="$2"
shift
Expand Down Expand Up @@ -215,10 +187,6 @@ if [ -n "$CMAKE_INSTALL_RPATH" ]; then
OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}"
OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
fi
LSORACLE_ARGS+=" \
-D YOSYS_SHARE_DIR=${INSTALL_PATH}/yosys/share/yosys \
-D CMAKE_INSTALL_PREFIX=${INSTALL_PATH}/LSOracle \
"

__args_setup() {
if [ ! -z "${YOSYS_OVERWIRTE_ARGS+x}" ]; then
Expand All @@ -234,13 +202,6 @@ __args_setup() {
else
OPENROAD_APP_ARGS+=" ${OPENROAD_APP_USER_ARGS}"
fi

if [ ! -z "${LSORACLE_OVERWIRTE_ARGS+x}" ]; then
echo "[INFO FLW-0016] Overwriting LSOracle compilation flags."
LSORACLE_ARGS="${LSORACLE_USER_ARGS}"
else
LSORACLE_ARGS+=" ${LSORACLE_USER_ARGS}"
fi
}

__docker_build()
Expand Down Expand Up @@ -287,12 +248,6 @@ __local_build()
echo "[INFO FLW-0018] Compiling OpenROAD."
eval ${NICE} cmake tools/OpenROAD -B tools/OpenROAD/build ${OPENROAD_APP_ARGS}
${NICE} cmake --build tools/OpenROAD/build --target install -j "${PROC}"

if [ ! -z "${LSORACLE_ENABLE+x}" ]; then
echo "[INFO FLW-0019] Compiling LSOracle."
${NICE} cmake tools/LSOracle -B tools/LSOracle/build ${LSORACLE_ARGS}
${NICE} cmake --build tools/LSOracle/build --target install -j "${PROC}"
fi
}

__update_openroad_app_remote()
Expand Down
Loading

0 comments on commit 21fa678

Please sign in to comment.