Skip to content

Commit 3a52e8b

Browse files
committed
Merge branch 'master' of https://github.com/The-OpenROAD-Project-private/OpenROAD-flow-scripts into secure-grt_runtime
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
2 parents e78cdcd + 5c5d440 commit 3a52e8b

22 files changed

Lines changed: 318 additions & 55 deletions

‎.github/workflows/github-actions-cron-update-OR.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
git pull
2525
- if: "steps.remote-update.outputs.has_update != ''"
2626
name: Create Draft PR
27-
uses: peter-evans/create-pull-request@v7
27+
uses: peter-evans/create-pull-request@v8
2828
with:
2929
token: ${{ github.token }}
3030
signoff: true

‎.github/workflows/github-actions-cron-update-yosys.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
git checkout ${latesttag}
2929
- if: "steps.remote-update.outputs.has_update != ''"
3030
name: Create Draft PR
31-
uses: peter-evans/create-pull-request@v7
31+
uses: peter-evans/create-pull-request@v8
3232
with:
3333
token: ${{ github.token }}
3434
signoff: true

‎.github/workflows/github-actions-publish-docker-images.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ jobs:
3636
run: echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
3737

3838
- name: Set up Docker Buildx
39-
uses: docker/setup-buildx-action@v3
39+
uses: docker/setup-buildx-action@v4
4040

4141
- name: Login to GitHub Container Registry (GHCR)
4242
if: github.event_name != 'pull_request'
43-
uses: docker/login-action@v3
43+
uses: docker/login-action@v4
4444
with:
4545
registry: ghcr.io
4646
username: gha
4747
password: ${{ github.token }}
4848

4949
- name: Build and export codespaces image
50-
uses: docker/build-push-action@v6
50+
uses: docker/build-push-action@v7
5151
with:
5252
context: .
5353
push: true
@@ -74,11 +74,11 @@ jobs:
7474
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os[0] }}" >> $GITHUB_ENV
7575
7676
- name: Set up Docker Buildx
77-
uses: docker/setup-buildx-action@v3
77+
uses: docker/setup-buildx-action@v4
7878

7979
- name: Login to GitHub Container Registry (GHCR)
8080
if: github.event_name != 'pull_request'
81-
uses: docker/login-action@v3
81+
uses: docker/login-action@v4
8282
with:
8383
registry: ghcr.io
8484
username: gha
@@ -88,7 +88,7 @@ jobs:
8888
run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh
8989

9090
- name: Build and export dependencies image
91-
uses: docker/build-push-action@v6
91+
uses: docker/build-push-action@v7
9292
with:
9393
context: etc
9494
push: true
@@ -125,18 +125,18 @@ jobs:
125125
echo "NUM_THREADS=$(nproc)" >> $GITHUB_ENV
126126
127127
- name: Set up Docker Buildx
128-
uses: docker/setup-buildx-action@v3
128+
uses: docker/setup-buildx-action@v4
129129

130130
- name: Login to GitHub Container Registry (GHCR)
131131
if: github.event_name != 'pull_request'
132-
uses: docker/login-action@v3
132+
uses: docker/login-action@v4
133133
with:
134134
registry: ghcr.io
135135
username: gha
136136
password: ${{ github.token }}
137137

138138
- name: Build and export ORFS image
139-
uses: docker/build-push-action@v6
139+
uses: docker/build-push-action@v7
140140
with:
141141
context: .
142142
push: true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
Stale:
10+
runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }}
11+
12+
permissions:
13+
# Required to label and close stale issues.
14+
issues: write
15+
# Required to label and close stale pull requests.
16+
pull-requests: write
17+
# Required to save state between runs
18+
actions: write
19+
20+
steps:
21+
- uses: actions/stale@v10
22+
with:
23+
days-before-stale: 60
24+
days-before-close: 21
25+
stale-issue-label: Stale
26+
stale-pr-label: Stale
27+
stale-issue-message: >
28+
This issue has been automatically marked as stale because it has not
29+
had recent activity. It will be closed in 21 days if no further
30+
activity occurs. Remove the `Stale` label or comment to keep it open.
31+
stale-pr-message: >
32+
This pull request has been automatically marked as stale because it
33+
has not had recent activity. It will be closed in 21 days if no
34+
further activity occurs. Remove the `Stale` label or comment to keep
35+
it open.
36+
close-issue-reason: not_planned
37+
exempt-issue-labels: pinned,security
38+
exempt-pr-labels: pinned,security
39+
operations-per-run: 100

‎.github/workflows/github-actions-update-rules.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
git push origin "HEAD:refs/pull/${{ github.event.client_payload.branch }}/head"
5959
- if: "steps.remote-update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'"
6060
name: Create Draft PR
61-
uses: peter-evans/create-pull-request@v7
61+
uses: peter-evans/create-pull-request@v8
6262
with:
6363
token: ${{ github.token }}
6464
signoff: true

‎BUILD.bazel‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
2+
3+
sh_binary(
4+
name = "install_for_bazel",
5+
srcs = ["bazel/install.sh"],
6+
)

‎MODULE.bazel‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ git_override(
1616
)
1717

1818
bazel_dep(name = "rules_python", version = "1.2.0")
19+
bazel_dep(name = "rules_shell", version = "0.6.1")
1920

2021
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
2122
python.toolchain(

‎MODULE.bazel.lock‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bazel/install.sh‎

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# ORFS developer install script
5+
# Builds and installs OpenROAD, Yosys, and yosys-slang to tools/install/
6+
# where flow/Makefile expects them.
7+
#
8+
# Uses stamp files for fast no-op re-runs (seconds when nothing changed).
9+
10+
WORKSPACE="${BUILD_WORKSPACE_DIRECTORY:-.}"
11+
INSTALL_DIR="${WORKSPACE}/tools/install"
12+
NUM_THREADS=$(nproc)
13+
14+
# --- Check system dependencies for yosys/slang builds ---
15+
check_deps() {
16+
local missing_cmds=()
17+
18+
for cmd in bison flex gawk g++ pkg-config tclsh git cmake; do
19+
if ! command -v "$cmd" &>/dev/null; then
20+
missing_cmds+=("$cmd")
21+
fi
22+
done
23+
24+
if [[ ${#missing_cmds[@]} -eq 0 ]]; then
25+
return
26+
fi
27+
28+
echo "ERROR: Missing commands: ${missing_cmds[*]}"
29+
echo ""
30+
31+
# Platform-specific install hint
32+
if [[ "$(uname -s)" == "Darwin" ]]; then
33+
echo " brew install bison flex gawk cmake pkg-config tcl-tk"
34+
elif command -v apt-get &>/dev/null; then
35+
echo " sudo apt-get install bison flex gawk g++ pkg-config tcl cmake git"
36+
elif command -v dnf &>/dev/null; then
37+
echo " sudo dnf install bison flex gawk gcc-c++ pkgconf tcl cmake git"
38+
elif command -v yum &>/dev/null; then
39+
echo " sudo yum install bison flex gawk gcc-c++ pkgconf tcl cmake git"
40+
elif command -v zypper &>/dev/null; then
41+
echo " sudo zypper install bison flex gawk gcc-c++ pkg-config tcl cmake git"
42+
fi
43+
exit 1
44+
}
45+
46+
check_deps
47+
48+
BUILD_OPENROAD=1
49+
50+
usage() {
51+
cat <<'EOF'
52+
Usage: bazelisk run //:install_for_bazel [-- OPTIONS]
53+
54+
Options:
55+
--help, -h Show this help
56+
--skip-openroad Skip OpenROAD build
57+
--threads N Compilation threads (default: nproc)
58+
EOF
59+
exit 0
60+
}
61+
62+
while [[ $# -gt 0 ]]; do
63+
case "$1" in
64+
--help|-h)
65+
usage
66+
;;
67+
--skip-openroad)
68+
BUILD_OPENROAD=0
69+
;;
70+
--threads)
71+
NUM_THREADS="$2"
72+
shift
73+
;;
74+
*)
75+
echo "Unknown option: $1"
76+
usage
77+
;;
78+
esac
79+
shift
80+
done
81+
82+
# --- Check submodules are initialized ---
83+
for sub in tools/OpenROAD tools/yosys tools/yosys-slang; do
84+
if [[ ! -d "${WORKSPACE}/${sub}" ]] || [[ -z "$(ls -A "${WORKSPACE}/${sub}" 2>/dev/null)" ]]; then
85+
echo "ERROR: ${sub} not initialized."
86+
echo "Run: git submodule update --init --recursive"
87+
exit 1
88+
fi
89+
done
90+
91+
# --- OpenROAD (delegates to its own //:install) ---
92+
if [[ $BUILD_OPENROAD -eq 1 ]]; then
93+
echo "=== Building OpenROAD with GUI support ==="
94+
(cd "${WORKSPACE}/tools/OpenROAD" && bazelisk run --//:platform=gui //:install)
95+
fi
96+
97+
# --- Yosys ---
98+
# Uses stamp file for fast no-op: if the yosys submodule commit hasn't
99+
# changed, skip the build entirely.
100+
YOSYS_INSTALL="${INSTALL_DIR}/yosys"
101+
YOSYS_STAMP="${YOSYS_INSTALL}/.yosys_commit"
102+
YOSYS_COMMIT="$(git -C "${WORKSPACE}/tools/yosys" rev-parse HEAD)"
103+
104+
if [[ -f "${YOSYS_STAMP}" ]] && [[ "$(cat "${YOSYS_STAMP}")" == "${YOSYS_COMMIT}" ]]; then
105+
echo "=== Yosys already up to date (${YOSYS_COMMIT:0:12}) ==="
106+
else
107+
echo "=== Building Yosys ==="
108+
(
109+
cd "${WORKSPACE}/tools/yosys"
110+
make -j "${NUM_THREADS}" PREFIX="${YOSYS_INSTALL}" ABC_ARCHFLAGS=-Wno-register
111+
make install PREFIX="${YOSYS_INSTALL}"
112+
)
113+
echo "${YOSYS_COMMIT}" > "${YOSYS_STAMP}"
114+
echo "Yosys installed to ${YOSYS_INSTALL}/bin/yosys"
115+
fi
116+
117+
# --- yosys-slang ---
118+
SLANG_STAMP="${YOSYS_INSTALL}/.slang_commit"
119+
SLANG_COMMIT="$(git -C "${WORKSPACE}/tools/yosys-slang" rev-parse HEAD)"
120+
121+
if [[ -f "${SLANG_STAMP}" ]] && [[ "$(cat "${SLANG_STAMP}")" == "${SLANG_COMMIT}" ]]; then
122+
echo "=== yosys-slang already up to date (${SLANG_COMMIT:0:12}) ==="
123+
else
124+
echo "=== Building yosys-slang ==="
125+
(
126+
cd "${WORKSPACE}/tools/yosys-slang"
127+
cmake -S . -B build \
128+
-DYOSYS_CONFIG="${YOSYS_INSTALL}/bin/yosys-config" \
129+
-DCMAKE_BUILD_TYPE=Release \
130+
-DYOSYS_SLANG_REVISION=unknown \
131+
-DSLANG_REVISION=unknown
132+
cmake --build build -j "${NUM_THREADS}"
133+
cmake --install build --prefix "${YOSYS_INSTALL}"
134+
)
135+
echo "${SLANG_COMMIT}" > "${SLANG_STAMP}"
136+
echo "yosys-slang installed to ${YOSYS_INSTALL}/share/yosys/plugins/"
137+
fi
138+
139+
echo ""
140+
echo "=== Done ==="
141+
echo "cd flow && make"

‎docs/user/BuildLocally.md‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@ cd OpenROAD-flow-scripts
1212
sudo ./setup.sh
1313
```
1414

15-
## Using Bazel to build OpenROAD and run the ORFS flow
15+
## Using Bazel to build OpenROAD and run the ORFS flow (unsupported)
1616

17-
Long story short: OpenROAD will eventually switch to using Bazel for downloading dependencies and building OpenROAD for all the reasons that the DependencyInstaller.sh and cmake are hard to support and brittle across platforms.
18-
19-
Currently the simplest way to build OpenROAD and run ORFS is to run one test, which will download all OpenROAD dependencies and build OpenROAD in the exec configuration:
17+
For ORFS/OpenROAD developers. Most of `./setup.sh` isn't needed when
18+
building OpenROAD with Bazel — this provides the bare minimum to build
19+
OpenROAD and test ORFS flows. No sudo required.
20+
Install [Bazelisk](https://bazel.build/install/bazelisk) first.
2021

2122
``` shell
22-
cd tools/OpenROAD
23-
bazelisk test src/drt/...
24-
cd ../../flow
25-
make OPENROAD_EXE=$(pwd)/../tools/OpenROAD/bazel-out/k8-opt-exec-ST-*/bin/openroad
23+
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts
24+
cd OpenROAD-flow-scripts
25+
bazelisk run //:install_for_bazel
26+
cd flow && make
2627
```
2728

28-
Bazel could similarly be used to download and make available pre-built binaries for tools such as Yosys, eqy and KLayout.
29-
30-
Running some quick tests will cause the desired exec config of OpenROAD to be built. There's no explicit Bazel way to build an exec config of an executable and we want to to use an exec config that is the same binary as is used for a local OpenROAD modify + test Bazel cycle.
31-
3229
## Build
3330

3431
``` shell

0 commit comments

Comments
 (0)