Skip to content

Commit a5bd30c

Browse files
committed
Merge branch 'master' of github.com:The-OpenROAD-Project-private/OpenROAD into rsz-repair-design-reroute
2 parents 7d7bbf3 + ec10d06 commit a5bd30c

439 files changed

Lines changed: 1298574 additions & 1260112 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ build:asan --copt=-O1
108108
build:asan --copt=-g
109109
build:asan --copt=-fno-omit-frame-pointer
110110
build:asan --linkopt=-fsanitize=address
111+
# TCMalloc is incompatible with ASan: __asan_init's interceptor setup calls
112+
# dlsym -> malloc before TCMalloc is initialized, segfaulting at startup.
113+
# Override the per-target malloc attribute to use the system allocator, which
114+
# ASan intercepts cleanly.
115+
build:asan --custom_malloc=@bazel_tools//tools/cpp:malloc
111116

112117
# Flags with enough debug symbols to get useful outputs with Linux `perf`
113118
build:profile --strip=never

.github/workflows/github-actions-check-bazel-lock.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,16 @@ jobs:
1212
- name: Check out repository code
1313
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

15-
- name: Verify lock file is up to date
16-
run: bazelisk mod deps --lockfile_mode=error
15+
- name: Update lock file to check for differences
16+
run: |
17+
cp MODULE.bazel MODULE.bazel.before
18+
bazelisk mod deps --lockfile_mode=update
19+
20+
- name: Differences to be adressed
21+
run: |
22+
if ! diff MODULE.bazel.before MODULE.bazel ; then
23+
echo "Run"
24+
echo "bazelisk mod deps --lockfile_mode=update"
25+
echo "and update pull request"
26+
exit 1
27+
fi

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
url = ../../The-OpenROAD-Project/abc.git
77
[submodule "third-party/slang-elab"]
88
path = third-party/slang-elab
9-
url = https://github.com/povik/yosys-slang
9+
url = ../../povik/yosys-slang.git

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# source control.
77

88
Andrew Kennings
9+
Antmicro
910
Federal University of Rio Grande do Sul (UFRGS)
1011
Google LLC
1112
Iowa State University

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ sh_binary(
666666
"$(rootpath @buildifier_prebuilt//:buildifier)",
667667
"$(rootpath //bazel:bzl_lint_test.sh)",
668668
"$(rootpath @buildifier_prebuilt//:buildifier)",
669+
"$(rootpath @git)",
669670
],
670671
data = [
671672
"MODULE.bazel",
@@ -677,5 +678,6 @@ sh_binary(
677678
"//bazel:tclfmt",
678679
"//bazel:tclint",
679680
"@buildifier_prebuilt//:buildifier",
681+
"@git",
680682
],
681683
)

CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ cmake_policy(SET CMP0074 NEW)
2121
# critical for builds in non-standard environments.
2222
cmake_policy(SET CMP0144 NEW)
2323

24-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
25-
# Disallows <PACKAGENAME>_ROOT in find_package.
26-
# TODO: resolve absl/or-tools issue and switch to NEW
27-
cmake_policy(SET CMP0144 OLD)
28-
endif()
29-
3024
# Allow AUTOUIC on generated source
3125
cmake_policy(SET CMP0071 NEW)
3226

@@ -48,6 +42,13 @@ option(USE_SYSTEM_ABC "Use system shared ABC library" OFF)
4842
# Allow disabling tests
4943
option(ENABLE_TESTS "Enable OpenROAD tests" ON)
5044

45+
# Opt-in GPU acceleration via Kokkos. The actual compute backend (CUDA, HIP,
46+
# SYCL, or host-only OpenMP/Threads) is determined by the installed Kokkos
47+
# package; OpenROAD inspects Kokkos_ENABLE_* and turns on the matching CMake
48+
# language and dependencies automatically. See the per-module CMakeLists for
49+
# how individual subsystems wire their GPU sources.
50+
option(ENABLE_GPU "Enable GPU acceleration via Kokkos" OFF)
51+
5152
# Allow enabling address sanitizer
5253
option(ASAN "Enable Address Sanitizer" OFF)
5354

@@ -94,6 +95,13 @@ if(NOT CMAKE_BUILD_TYPE)
9495
set(CMAKE_BUILD_TYPE RELEASE)
9596
endif()
9697

98+
# GPU backend wiring (opt-in). All Kokkos / CUDA / HIP / SYCL detection,
99+
# compiler probing, and language enablement live in cmake/KokkosBackend.cmake
100+
# and are loaded only when the user opts in via ENABLE_GPU=ON.
101+
if(ENABLE_GPU)
102+
include(KokkosBackend)
103+
endif()
104+
97105
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
98106
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.3.0")
99107
message(FATAL_ERROR "Insufficient gcc version. Found ${CMAKE_CXX_COMPILER_VERSION}, but require >= 8.3.0.")

MODULE.bazel

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ single_version_override(
2323

2424
bazel_dep(name = "abseil-cpp", version = "20260107.1")
2525
bazel_dep(name = "bazel_skylib", version = "1.7.1")
26-
bazel_dep(name = "coin-or-lemon", version = "1.3.1")
26+
bazel_dep(name = "coin-or-lemon", version = "1.3.1.bcr.1")
2727
bazel_dep(name = "platforms", version = "1.0.0")
2828
bazel_dep(name = "rules_bison", version = "0.3.1")
2929
bazel_dep(name = "rules_cc", version = "0.2.18")
@@ -78,7 +78,7 @@ bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
7878
bazel_dep(name = "fmt", version = "11.2.0.bcr.1")
7979
bazel_dep(name = "git", version = "2.54.0")
8080
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
81-
bazel_dep(name = "openmp", version = "21.1.5.bcr.1")
81+
bazel_dep(name = "openmp", version = "21.1.5.bcr.2")
8282
bazel_dep(name = "or-tools", version = "9.15")
8383
bazel_dep(name = "spdlog", version = "1.15.1")
8484
bazel_dep(name = "sv-lang", version = "10.0.1-20260316-f04e8156")
@@ -158,17 +158,12 @@ archive_override(
158158
)
159159

160160
bazel_dep(name = "yosys", version = "0.62.bcr.2", dev_dependency = True)
161-
162-
# yosys-slang is not on BCR. Pin to a commit on povik/yosys-slang master
163-
# that has the upstream Bazel build (povik/yosys-slang#310) and the
164-
# slang.so visibility fix (povik/yosys-slang#311). Submodules pull in
165-
# vendored slang and fmt sources.
166-
bazel_dep(name = "yosys-slang", dev_dependency = True)
167-
git_override(
161+
bazel_dep(name = "yosys-slang", version = "0.0.0", dev_dependency = True)
162+
archive_override(
168163
module_name = "yosys-slang",
169-
commit = "7753ea70431d85929292b90c33b32f6dbdb3b048",
170-
init_submodules = True,
171-
remote = "https://github.com/povik/yosys-slang.git",
164+
sha256 = "34198f2ed7b2d3175c3ce3c9fb1c6c91f28dbcfe531d97b91d6b12c48431bdef",
165+
strip_prefix = "sv-elab-6760afa2c9b9ba231a9c6a9e94f0939dd39f0a20",
166+
urls = ["https://github.com/povik/yosys-slang/archive/6760afa2c9b9ba231a9c6a9e94f0939dd39f0a20.tar.gz"],
172167
)
173168

174169
# --- Extensions ---

MODULE.bazel.lock

Lines changed: 35 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/fix_lint.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@
66
# that file-discovery logic is not duplicated (DRY).
77
set -euo pipefail
88

9+
TCL_TIDY_SH="$1"
10+
TCLFMT="$2"
11+
TCL_LINT_SH="$3"
12+
TCLINT="$4"
13+
BZL_TIDY_SH="$5"
14+
BZL_FMT_BUILDIFIER="$6"
15+
BZL_LINT_SH="$7"
16+
BZL_LINT_BUILDIFIER="$8"
17+
GIT="$9"
18+
919
export BUILD_WORKSPACE_DIRECTORY="${BUILD_WORKSPACE_DIRECTORY:-$PWD}"
1020

1121
# TCL: auto-format then lint
12-
"$1" "$2"
13-
"$3" "$4" || rc=$?
22+
"${TCL_TIDY_SH}" "${TCLFMT}"
23+
"${TCL_LINT_SH}" "${TCLINT}" "${GIT}" || rc=$?
1424

1525
# Bazel: auto-format then lint
16-
"$5" "$6"
17-
"$7" "$8" || rc=$?
26+
"${BZL_TIDY_SH}" "${BZL_FMT_BUILDIFIER}"
27+
"${BZL_LINT_SH}" "${BZL_LINT_BUILDIFIER}" "${GIT}" || rc=$?
1828

19-
git -C "$BUILD_WORKSPACE_DIRECTORY" status
29+
"${GIT}" -C "$BUILD_WORKSPACE_DIRECTORY" status
2030

2131
if [ "${rc:-0}" -ne 0 ]; then
2232
echo "Error: lint violations remain that require manual fixes." >&2

bazel/man_pages.bzl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ the real work is delegated to the `bazel-manpages` Makefile target.
1010
Host requirements: pandoc, nroff (groff), col (bsdextrautils), python3>=3.10.
1111
"""
1212

13+
def _man_pages_resource_set(_os, _num_inputs):
14+
# The 'cat web' make below fans out with -j$(nproc), so this action uses
15+
# the whole host. Reserve all local CPUs to keep Bazel from co-scheduling
16+
# other heavy actions alongside it and oversubscribing the machine. Bazel
17+
# clamps the request to the cores actually available, so this is safe on
18+
# small CI hosts too.
19+
return {"cpu": 512.0}
20+
1321
def _man_pages_impl(ctx):
1422
cat_dir = ctx.actions.declare_directory("cat")
1523
html_dir = ctx.actions.declare_directory("html")
@@ -18,14 +26,25 @@ def _man_pages_impl(ctx):
1826
set -euo pipefail
1927
CAT_OUT="$PWD/{cat_out}"
2028
HTML_OUT="$PWD/{html_out}"
21-
make --no-print-directory -C docs -f Makefile bazel-manpages \\
29+
# Two phases: 'preprocess' (serial) generates the md/man*/*.md sources, then
30+
# 'cat web' fan out pandoc/nroff in parallel. They cannot share one -j make
31+
# invocation: cat/web read the md files preprocess produces, and a parallel
32+
# build has no dependency edge forcing preprocess to finish first. Running
33+
# 'cat web' as a second invocation also re-parses the Makefile so its
34+
# $(wildcard md/man*/*.md) picks up the freshly generated sources.
35+
# nproc is GNU coreutils (absent on stock macOS); fall back to sysctl, then 4.
36+
JOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)"
37+
make --no-print-directory -C docs -f Makefile preprocess \\
38+
CAT_ROOT_DIR="$CAT_OUT" HTML_ROOT_DIR="$HTML_OUT"
39+
make --no-print-directory -j"$JOBS" -C docs -f Makefile cat web \\
2240
CAT_ROOT_DIR="$CAT_OUT" HTML_ROOT_DIR="$HTML_OUT"
2341
""".format(
2442
cat_out = cat_dir.path,
2543
html_out = html_dir.path,
2644
)
2745

2846
ctx.actions.run_shell(
47+
resource_set = _man_pages_resource_set,
2948
outputs = [cat_dir, html_dir],
3049
inputs = ctx.files.docs_srcs + ctx.files.scripts + ctx.files.readmes + ctx.files.messages,
3150
command = command,

0 commit comments

Comments
 (0)