Skip to content

Commit 0d65c03

Browse files
committed
Merge branch 'master' into cts_improve_level_creating_threshold
2 parents cc44545 + 7ffbedf commit 0d65c03

104 files changed

Lines changed: 18767 additions & 12554 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.

MODULE.bazel

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True)
192192
bazel_dep(name = "bazel-orfs", dev_dependency = True)
193193
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)
194194

195-
BAZEL_ORFS_COMMIT = "78f19f25cec73bdec3517a76465dec7ce17ce227"
195+
BAZEL_ORFS_COMMIT = "60d62021c779e64ef7360a1b08a8faee00183c8d"
196196

197197
BAZEL_ORFS_REMOTE = "https://github.com/The-OpenROAD-Project/bazel-orfs.git"
198198

@@ -210,27 +210,30 @@ git_override(
210210
strip_prefix = "verilog",
211211
)
212212

213-
# bazel-orfs pulls in orfs without a version and patches yosys, relying on
214-
# overrides that only apply when bazel-orfs is the root module. Mirror them
215-
# here so OpenROAD-as-root can resolve the module graph.
213+
# @orfs marks most non-root-only directives (qt-bazel/yosys-slang git_overrides,
214+
# orfs.default(), toolchain registration) as dev_dependency, so they are no-ops
215+
# here. But @orfs//flow loads @bazel-orfs//:openroad.bzl, and @orfs marks its
216+
# bazel-orfs bazel_dep dev_dependency too, which drops @bazel-orfs from @orfs's
217+
# repo mapping when consumed non-root — so loading @orfs//flow fails. The patch
218+
# makes that one bazel_dep non-dev.
216219
#
217220
# Use archive_override (HTTPS tarball) rather than git_override so the
218221
# build resolves on networks that block direct git access to github.com.
219-
ORFS_COMMIT = "10a2baea2171059ec14cda9a5855aa26dd7572c6"
222+
ORFS_COMMIT = "4b3f2663609fd3f6fd8d862729de1ec5967eb4e6"
220223

221224
bazel_dep(name = "orfs", dev_dependency = True)
222225
archive_override(
223226
module_name = "orfs",
224227
patch_strip = 1,
225228
patches = [
226-
"//bazel/bazel-orfs-patches:0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch",
229+
"//bazel/bazel-orfs-patches:0035-orfs-bazel-orfs-visible-non-root.patch",
227230
],
228-
sha256 = "8325c6755215857a87a84db078d47dfbb2dfcbef70eaf0dd376fe5a7a363cd58",
231+
sha256 = "b6e496221b5be5a5ecd54e978a7a8157a212b67374e2ecd6c27f90d35e02b473",
229232
strip_prefix = "OpenROAD-flow-scripts-" + ORFS_COMMIT,
230233
urls = ["https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/archive/" + ORFS_COMMIT + ".tar.gz"],
231234
)
232235

233-
bazel_dep(name = "yosys", version = "0.62.bcr.2", dev_dependency = True)
236+
bazel_dep(name = "yosys", version = "0.64", dev_dependency = True)
234237
bazel_dep(name = "yosys-slang", version = "0.0.0", dev_dependency = True)
235238
archive_override(
236239
module_name = "yosys-slang",

MODULE.bazel.lock

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

bazel/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,37 @@ RUN apt-get -y update \
3333
python3-yaml \
3434
time
3535

36+
# Runtime X11/xcb libraries for the Qt GUI build (--//:platform=gui).
37+
# Qt itself is hermetic (qt-bazel prebuilts), but the linked openroad binary
38+
# still resolves libX11/libxcb/libxkbcommon from the system at load time, so
39+
# without these every test against the gui binary dies at ld.so with
40+
# "libX11-xcb.so.1: cannot open shared object file". This is the runtime
41+
# (non -dev) subset of etc/DependencyInstaller.sh's GUI xcb list.
42+
RUN apt-get -y update \
43+
&& apt-get -y install --no-install-recommends \
44+
libx11-6 \
45+
libx11-xcb1 \
46+
libsm6 \
47+
libice6 \
48+
libxcb1 \
49+
libxcb-cursor0 \
50+
libxcb-icccm4 \
51+
libxcb-image0 \
52+
libxcb-keysyms1 \
53+
libxcb-randr0 \
54+
libxcb-render0 \
55+
libxcb-render-util0 \
56+
libxcb-shape0 \
57+
libxcb-shm0 \
58+
libxcb-sync1 \
59+
libxcb-util1 \
60+
libxcb-xfixes0 \
61+
libxcb-xkb1 \
62+
libdbus-1-3 \
63+
libfontconfig1 \
64+
libxkbcommon0 \
65+
libxkbcommon-x11-0
66+
3667
RUN groupadd -g 9000 user \
3768
&& useradd -u 9000 -g 9000 -m -s /bin/bash user
3869
USER user

bazel/bazel-orfs-patches/0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Oyvind Harboe <oyvind.harboe@zylin.com>
3+
Date: Wed, 8 Jul 2026 00:00:00 +0000
4+
Subject: [PATCH] orfs: keep bazel-orfs visible when orfs is a non-root dep
5+
6+
@orfs//flow loads @bazel-orfs//:openroad.bzl, so @bazel-orfs must be in
7+
@orfs's repo mapping. Upstream marks the bazel-orfs bazel_dep as
8+
dev_dependency, which drops it from the mapping when @orfs is consumed
9+
as a non-root dependency, so loading @orfs//flow fails with "No
10+
repository visible as '@bazel-orfs' from repository '@@orfs+'". Make the
11+
bazel_dep non-dev; the bazel-orfs version is unified by the root
12+
module's pin either way.
13+
14+
Signed-off-by: Oyvind Harboe <oyvind.harboe@zylin.com>
15+
---
16+
--- a/MODULE.bazel
17+
+++ b/MODULE.bazel
18+
@@ -33,7 +33,7 @@
19+
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
20+
)
21+
22+
-bazel_dep(name = "bazel-orfs", dev_dependency = True)
23+
+bazel_dep(name = "bazel-orfs")
24+
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)
25+
26+
BAZEL_ORFS_COMMIT = "6ebadeb4be5c9ada103081c9a5e668c014126616"

src/cts/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ cc_library(
3939
name = "cts",
4040
srcs = [
4141
"src/Clock.cpp",
42-
"src/Clock.h",
4342
"src/Clustering.cpp",
4443
"src/CtsOptions.cpp",
4544
"src/HTreeBuilder.cpp",

src/drt/src/dr/FlexDR_init.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,13 +2722,25 @@ void FlexDRWorker::initMazeCost_fixedObj(const frDesign* design)
27222722
result.clear();
27232723
if (getTech()->getLayer(layerNum)->getType() == dbTechLayerType::ROUTING) {
27242724
isRoutingLayer = true;
2725+
// The grid graph need not span the full layer stack: TOP_ROUTING_LAYER
2726+
// can trim routing layers above it out of the grid. Skip fixed-shape
2727+
// costing on layers absent from the grid so getMazeZIdx / getLayerNum
2728+
// stay in range. No-op when the grid spans every routing layer.
2729+
if (layerNum < gridGraph_.getMinLayerNum()
2730+
|| layerNum > gridGraph_.getMaxLayerNum()) {
2731+
continue;
2732+
}
27252733
zIdx = gridGraph_.getMazeZIdx(layerNum);
27262734
} else if (getTech()->getLayer(layerNum)->getType()
27272735
== dbTechLayerType::CUT) {
27282736
isRoutingLayer = false;
27292737
if (getTech()->getBottomLayerNum() <= layerNum - 1
27302738
&& getTech()->getLayer(layerNum - 1)->getType()
27312739
== dbTechLayerType::ROUTING) {
2740+
if (layerNum - 1 < gridGraph_.getMinLayerNum()
2741+
|| layerNum - 1 > gridGraph_.getMaxLayerNum()) {
2742+
continue;
2743+
}
27322744
zIdx = gridGraph_.getMazeZIdx(layerNum - 1);
27332745
} else {
27342746
continue;
@@ -2894,13 +2906,23 @@ void FlexDRWorker::initMazeCost_terms(
28942906
if (getTech()->getLayer(layerNum)->getType()
28952907
== dbTechLayerType::ROUTING) {
28962908
isRoutingLayer = true;
2909+
// Grid may not span the full stack (TOP_ROUTING_LAYER trim);
2910+
// skip layers absent from the grid. No-op when fully spanned.
2911+
if (layerNum < gridGraph_.getMinLayerNum()
2912+
|| layerNum > gridGraph_.getMaxLayerNum()) {
2913+
continue;
2914+
}
28972915
zIdx = gridGraph_.getMazeZIdx(layerNum);
28982916
} else if (getTech()->getLayer(layerNum)->getType()
28992917
== dbTechLayerType::CUT) {
29002918
isRoutingLayer = false;
29012919
if (getTech()->getBottomLayerNum() <= layerNum - 1
29022920
&& getTech()->getLayer(layerNum - 1)->getType()
29032921
== dbTechLayerType::ROUTING) {
2922+
if (layerNum - 1 < gridGraph_.getMinLayerNum()
2923+
|| layerNum - 1 > gridGraph_.getMaxLayerNum()) {
2924+
continue;
2925+
}
29042926
zIdx = gridGraph_.getMazeZIdx(layerNum - 1);
29052927
} else {
29062928
continue;
@@ -2971,13 +2993,23 @@ void FlexDRWorker::initMazeCost_terms(
29712993
if (getTech()->getLayer(layerNum)->getType()
29722994
== dbTechLayerType::ROUTING) {
29732995
isRoutingLayer = true;
2996+
// Grid may not span the full stack (TOP_ROUTING_LAYER trim);
2997+
// skip layers absent from the grid. No-op when fully spanned.
2998+
if (layerNum < gridGraph_.getMinLayerNum()
2999+
|| layerNum > gridGraph_.getMaxLayerNum()) {
3000+
continue;
3001+
}
29743002
zIdx = gridGraph_.getMazeZIdx(layerNum);
29753003
} else if (getTech()->getLayer(layerNum)->getType()
29763004
== dbTechLayerType::CUT) {
29773005
isRoutingLayer = false;
29783006
if (getTech()->getBottomLayerNum() <= layerNum - 1
29793007
&& getTech()->getLayer(layerNum - 1)->getType()
29803008
== dbTechLayerType::ROUTING) {
3009+
if (layerNum - 1 < gridGraph_.getMinLayerNum()
3010+
|| layerNum - 1 > gridGraph_.getMaxLayerNum()) {
3011+
continue;
3012+
}
29813013
zIdx = gridGraph_.getMazeZIdx(layerNum - 1);
29823014
} else {
29833015
continue;

src/drt/src/dr/FlexGridGraph.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,17 @@ void FlexGridGraph::initTracks(
471471
continue;
472472
}
473473
frLayerNum currLayerNum = layer->getLayerNum();
474+
// Layers above TOP_ROUTING_LAYER carry no routing edges or access vias
475+
// (initEdges and the special-access via loop already cap work at
476+
// TOP_ROUTING_LAYER), yet they were still added to the grid here, sizing
477+
// nodes_, the per-node arrays, and the maze search bounds across the full
478+
// layer stack. Skip them so the grid graph spans only the routing range,
479+
// cutting detailed-route memory and runtime when the design's top routing
480+
// layer is below the technology top. Default TOP_ROUTING_LAYER is INT_MAX,
481+
// so this is a no-op unless the top routing layer is explicitly lowered.
482+
if (currLayerNum > router_cfg_->TOP_ROUTING_LAYER) {
483+
continue;
484+
}
474485
dbTechLayerDir currPrefRouteDir = layer->getDir();
475486
for (auto& tp : design->getTopBlock()->getTrackPatterns(currLayerNum)) {
476487
// allow wrongway if global variable and design rule allow

0 commit comments

Comments
 (0)