Skip to content

Commit 1a85b0f

Browse files
author
osamahammad21
committed
Merge remote-tracking branch 'origin/master' into odb-new-unfolded-structuree
2 parents b398dba + 065077a commit 1a85b0f

180 files changed

Lines changed: 13897 additions & 4894 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ common --enable_bzlmod
55
# Remove this registry line once the version lands on BCR.
66
common --registry=https://raw.githubusercontent.com/oharboe/bazel-central-registry/1beaf797951046d93a2f656d4238c954a21833e5/
77
common --registry=https://bcr.bazel.build/
8+
9+
# abc is driven programmatically by OpenROAD, so skip the interactive
10+
# readline dependency exposed by abc@0.64-yosyshq.bcr.2.
11+
common --@abc//:use_readline=false
812
build --workspace_status_command=tools/workspace_status.sh
913

1014
# Release builds embed real git version info; dev builds use cache-safe placeholders.

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ build:
1515
- libasound2
1616
- graphviz
1717
tools:
18-
python: "3.7"
18+
python: "3.10"
1919
nodejs: "16"
2020
jobs:
2121
post_install:

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ OPENROAD_MAIN_DEPS = [
187187
"//src/utl",
188188
"//src/web",
189189
"@abseil-cpp//absl/base:no_destructor",
190+
"@boost.dll",
190191
"@boost.stacktrace",
191192
"@rules_cc//cc/runfiles", # sets BAZEL_CURRENT_REPOSITORY
192193
"@tcl_lang//:tcl",

MODULE.bazel

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,20 @@ module(
77

88
# --- Regular dependencies (propagated to downstream consumers via MVS) ---
99

10-
bazel_dep(name = "abc", version = "0.64-yosyshq.bcr.1")
10+
bazel_dep(name = "abc", version = "0.64-yosyshq.bcr.2")
11+
12+
# Patch abc's non-readline prompt path to flush stdout and exit on EOF.
13+
# Without this, yosys's coprocess driver (which waits for the "abc NN> "
14+
# prompt over a pipe) deadlocks when abc is built with use_readline=false.
15+
# Drop this override once the fix is in a published BCR abc release.
16+
single_version_override(
17+
module_name = "abc",
18+
patch_strip = 1,
19+
patches = [
20+
"//bazel/abc-patches:0001-mainUtils-flush-prompt-and-handle-eof-without-readline.patch",
21+
],
22+
)
23+
1124
bazel_dep(name = "abseil-cpp", version = "20260107.1")
1225
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1326
bazel_dep(name = "coin-or-lemon", version = "1.3.1")
@@ -30,6 +43,7 @@ bazel_dep(name = "boost.bind", version = BOOST_VERSION)
3043
bazel_dep(name = "boost.config", version = BOOST_VERSION)
3144
bazel_dep(name = "boost.container", version = BOOST_VERSION)
3245
bazel_dep(name = "boost.container_hash", version = BOOST_VERSION)
46+
bazel_dep(name = "boost.dll", version = BOOST_VERSION)
3347
bazel_dep(name = "boost.format", version = BOOST_VERSION)
3448
bazel_dep(name = "boost.fusion", version = BOOST_VERSION)
3549
bazel_dep(name = "boost.geometry", version = BOOST_VERSION)

MODULE.bazel.lock

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Matt Liberty <mliberty@precisioninno.com>
3+
Date: Fri, 30 May 2026 00:00:00 +0000
4+
Subject: [PATCH] mainUtils: match readline behavior when ABC_USE_READLINE is
5+
undefined
6+
7+
The non-readline branch of Abc_UtilsGetUsersInput has three behavioral
8+
gaps versus the readline branch that break callers driving abc as a
9+
coprocess over a pipe (e.g. yosys's techmap/abc.cc, which waits for the
10+
"abc NN> " prompt with the source command echoed back via
11+
read_until_abc_done()):
12+
13+
1. The prompt is written with fprintf() but never flushed. With stdout
14+
fully buffered (pipe), the prompt never reaches the reader; the
15+
reader waits for the prompt, abc waits in fgets(), deadlock.
16+
17+
2. There is no echo of the line read from stdin. readline() displays
18+
each character as it is typed (and on a pipe, readline's stream
19+
handling still emits the line + newline to its output). Without
20+
that, yosys never sees the "abc NN> source ..." pattern it requires
21+
to advance state.
22+
23+
3. EOF on stdin is silently ignored: fgets() returns NULL, the
24+
function returns a stale Prompt buffer, and the caller loops. The
25+
readline branch exits(0) when readline() returns NULL.
26+
27+
Fix all three. Echo only when stdin is not a tty -- on a tty the kernel
28+
already echoes typed characters, and double-echo would be visible.
29+
30+
Upstreaming to YosysHQ/abc and berkeley-abc/abc.
31+
32+
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
33+
---
34+
src/base/main/mainUtils.c | 9 ++++++++-
35+
1 file changed, 8 insertions(+), 1 deletion(-)
36+
37+
diff --git a/src/base/main/mainUtils.c b/src/base/main/mainUtils.c
38+
--- a/src/base/main/mainUtils.c
39+
+++ b/src/base/main/mainUtils.c
40+
@@ -18,6 +18,8 @@
41+
42+
***********************************************************************/
43+
44+
+#include <unistd.h>
45+
+
46+
#include "base/abc/abc.h"
47+
#include "mainInt.h"
48+
49+
@@ -91,7 +93,13 @@
50+
{
51+
char * pRetValue;
52+
fprintf( pAbc->Out, "%s", Prompt );
53+
+ fflush( pAbc->Out );
54+
pRetValue = fgets( Prompt, 5000, stdin );
55+
+ if ( pRetValue == NULL ) { exit(0); }
56+
+ if ( !isatty( fileno(stdin) ) ) {
57+
+ fputs( Prompt, pAbc->Out );
58+
+ fflush( pAbc->Out );
59+
+ }
60+
return Prompt;
61+
}
62+
#endif

bazel/abc-patches/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exports_files(glob(["*.patch"]))

bazel/install.sh

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,65 @@ set -e
33

44
# Install binary and runfiles from bazel build
55

6-
TARFILE=$(cd $BUILD_WORKSPACE_DIRECTORY; bazelisk info bazel-bin)/packaging/openroad.tar
6+
BAZEL_BIN=$(cd "$BUILD_WORKSPACE_DIRECTORY"; bazel info bazel-bin)
7+
TARFILE="$BAZEL_BIN/packaging/openroad.tar"
78

8-
DEST_DIR=${1:-${BUILD_WORKSPACE_DIRECTORY}/../install/OpenROAD/bin}
9+
# The desktop entry is built into bazel-bin only for GUI builds
10+
# --//:platform=gui
11+
DESKTOP_SRC="$BAZEL_BIN/src/gui/openroad.desktop"
12+
ICON_SRC="$BUILD_WORKSPACE_DIRECTORY/src/gui/resources/icon.png"
913

10-
mkdir -p "$DEST_DIR"
11-
cp -f "$TARFILE" "$DEST_DIR"
12-
cd "$DEST_DIR"
13-
tar -xf openroad.tar
14-
rm -f openroad.tar
14+
INSTALL_DESKTOP=0
15+
if [ "${OPENROAD_INSTALL_GUI:-0}" = "1" ]; then
16+
INSTALL_DESKTOP=1
17+
fi
18+
19+
DEST_DIR=${1:-${BUILD_WORKSPACE_DIRECTORY}/../install/OpenROAD}
20+
21+
mkdir -p "$DEST_DIR/bin"
22+
23+
# Remove previous OpenROAD install artifacts.
24+
rm -f "$DEST_DIR/bin/openroad"
25+
rm -f "$DEST_DIR/bin/openroad.repo_mapping"
26+
rm -f "$DEST_DIR/bin/openroad.runfiles_manifest"
27+
rm -rf "$DEST_DIR/bin/openroad.runfiles"
28+
29+
tar -xf "$TARFILE" -C "$DEST_DIR/bin"
1530

1631
# Remove useless files from pkg_tar from bazel
17-
if [ -e openroad.repo_mapping ]; then
18-
chmod u+w openroad.repo_mapping
19-
rm -rf openroad.repo_mapping
32+
if [ -e "$DEST_DIR/bin/openroad.repo_mapping" ]; then
33+
chmod u+w "$DEST_DIR/bin/openroad.repo_mapping"
34+
rm -rf "$DEST_DIR/bin/openroad.repo_mapping"
2035
fi
2136

22-
echo "OpenROAD binary installed to $(realpath "$DEST_DIR")"
37+
ABS_DEST="$(realpath "$DEST_DIR")"
38+
echo "OpenROAD binary installed to $ABS_DEST"
39+
40+
# Remove any previously installed desktop entry and icon before (re)installing,
41+
# mirroring the binary artifact cleanup above. This runs unconditionally so a
42+
# prior GUI install is cleaned up even when the current install is not a GUI
43+
# build, avoiding a stale launcher/icon left pointing at an old prefix.
44+
APPS_DIR="${HOME}/.local/share/applications"
45+
rm -f "$ABS_DEST/share/openroad/gui/icon.png"
46+
rm -f "$APPS_DIR/openroad.desktop"
47+
48+
# Install the desktop entry (menu launcher + icon) if Bazel built it, i.e.
49+
# this is a GUI build.
50+
if [ "$INSTALL_DESKTOP" = "1" ] && [ -f "$DESKTOP_SRC" ]; then
51+
GUI_SHARE="$ABS_DEST/share/openroad/gui"
52+
mkdir -p "$GUI_SHARE"
53+
cp -f "$ICON_SRC" "$GUI_SHARE/icon.png"
54+
55+
mkdir -p "$APPS_DIR"
56+
cp -f "$DESKTOP_SRC" "$APPS_DIR/openroad.desktop"
57+
# Fill in the install prefix for the icon, and point Exec at the absolute
58+
# binary so the launcher works without openroad being on PATH.
59+
sed -i \
60+
-e "s|@OPENROAD_PREFIX@|$ABS_DEST|g" \
61+
-e "s|^Exec=openroad |Exec=$ABS_DEST/bin/openroad |" \
62+
"$APPS_DIR/openroad.desktop"
63+
if command -v update-desktop-database >/dev/null 2>&1; then
64+
update-desktop-database "$APPS_DIR" >/dev/null 2>&1 || true
65+
fi
66+
echo "OpenROAD desktop entry installed to $APPS_DIR/openroad.desktop"
67+
fi

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"myst_parser",
3636
"sphinxcontrib.mermaid",
3737
"sphinx_tabs.tabs",
38+
"sphinx_llm.txt",
3839
]
3940

4041
myst_enable_extensions = [

docs/requirements.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sphinx-external-toc==0.3.1
2+
sphinx
3+
sphinx-autobuild
4+
myst-parser
5+
sphinxcontrib-mermaid
6+
sphinx-book-theme
7+
sphinx-copybutton
8+
sphinx-tabs
9+
sphinx-llm

0 commit comments

Comments
 (0)