Skip to content

Commit 65d9034

Browse files
committed
Merge remote-tracking branch 'private/master' into dpl-cell-height
2 parents 0a9a62d + 1ee4f87 commit 65d9034

200 files changed

Lines changed: 1293725 additions & 1253841 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.

.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

MODULE.bazel

Lines changed: 2 additions & 13 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")
@@ -158,18 +158,7 @@ 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(
168-
module_name = "yosys-slang",
169-
commit = "7753ea70431d85929292b90c33b32f6dbdb3b048",
170-
init_submodules = True,
171-
remote = "https://github.com/povik/yosys-slang.git",
172-
)
161+
bazel_dep(name = "yosys-slang", version = "0.0.0", dev_dependency = True)
173162

174163
# --- Extensions ---
175164

MODULE.bazel.lock

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

bazel/install.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ fi
6161
ABS_DEST="$(realpath "$DEST_DIR")"
6262
echo "OpenROAD binary installed to $ABS_DEST"
6363

64+
# Install man pages (cat/ and html/ generated by //docs:man_pages).
65+
MAN_CAT_SRC="$(rlocation openroad/docs/man_pages/cat 2>/dev/null || true)"
66+
if [ -n "$MAN_CAT_SRC" ] && [ -d "$MAN_CAT_SRC" ]; then
67+
MAN_DIR="$ABS_DEST/share/openroad/man"
68+
mkdir -p "$MAN_DIR"
69+
rm -rf "$MAN_DIR/cat"
70+
cp -rf "$MAN_CAT_SRC" "$MAN_DIR/"
71+
MAN_HTML_SRC="$(rlocation openroad/docs/man_pages/html 2>/dev/null || true)"
72+
if [ -n "$MAN_HTML_SRC" ] && [ -d "$MAN_HTML_SRC" ]; then
73+
rm -rf "$MAN_DIR/html"
74+
cp -rf "$MAN_HTML_SRC" "$MAN_DIR/"
75+
fi
76+
echo "OpenROAD man pages installed to $MAN_DIR"
77+
fi
78+
6479
# Remove any previously installed desktop entry and icon before (re)installing,
6580
# mirroring the binary artifact cleanup above. This runs unconditionally so a
6681
# prior GUI install is cleaned up even when the current install is not a GUI

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,

bazel/tcl_encode_or.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ tcl_encode = rule(
4848
doc = "Files to be wrapped.",
4949
),
5050
"_encode_script": attr.label(
51-
default = "//etc:file_to_string",
51+
default = "//etc:file_to_string.py",
5252
executable = True,
53-
allow_files = True,
53+
allow_single_file = [".py"],
5454
cfg = "exec",
5555
),
5656
},

etc/BUILD

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
1+
load("@rules_python//python:defs.bzl", "py_library", "py_test")
22

33
package(features = ["layering_check"])
44

@@ -7,16 +7,8 @@ exports_files(
77
"whittle.py",
88
"whittle_cleanup.tcl",
99
"whittle_cut.tcl",
10-
],
11-
visibility = ["//visibility:public"],
12-
)
13-
14-
py_binary(
15-
name = "file_to_string",
16-
srcs = [
1710
"file_to_string.py",
1811
],
19-
main = "file_to_string.py",
2012
visibility = ["//visibility:public"],
2113
)
2214

packaging/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
77
sh_binary(
88
name = "install",
99
srcs = ["//bazel:install.sh"],
10-
data = [":tarfile"] + select({
10+
data = [
11+
":tarfile",
12+
"//docs:man_pages",
13+
] + select({
1114
# Ship the desktop entry + icon only for GUI builds so install.sh
1215
# can register a menu launcher (mirrors the CMake GUI install).
1316
"//:platform_gui": ["//src/gui:desktop_files"],

src/OpenRoad.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,20 @@ std::string OpenRoad::getExePath() const
728728

729729
std::string OpenRoad::getDocsPath() const
730730
{
731+
#ifdef BAZEL_BUILD
732+
// When invoked via 'bazel run', BUILD_WORKSPACE_DIRECTORY is set to the
733+
// workspace root. Look for generated man pages in bazel-bin/docs/ so that
734+
// 'man' works without a full install step.
735+
const char* workspace_dir = std::getenv("BUILD_WORKSPACE_DIRECTORY");
736+
if (workspace_dir != nullptr) {
737+
auto docs_path
738+
= std::filesystem::path(workspace_dir) / "bazel-bin" / "docs";
739+
if (std::filesystem::is_directory(docs_path)) {
740+
return docs_path;
741+
}
742+
}
743+
#endif
744+
731745
const std::string exe = getExePath();
732746

733747
if (exe.empty()) {

src/dpl/src/Opendp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Opendp::Opendp(odb::dbDatabase* db, utl::Logger* logger)
6161
grid_ = std::make_unique<Grid>();
6262
grid_->init(logger);
6363
network_ = std::make_unique<Network>();
64+
network_->init(logger);
6465
arch_ = std::make_unique<Architecture>();
6566
}
6667

0 commit comments

Comments
 (0)