Skip to content

Commit 89a3837

Browse files
committed
Merge remote-tracking branch 'origin/master' into lef_parsing_jetski
2 parents 46235e7 + 51daec4 commit 89a3837

143 files changed

Lines changed: 5577 additions & 4031 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.

.claude/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.agents/skills

.gemini/commands/triage-issue.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description = "Triage an OpenROAD GitHub issue by reproducing the bug and minimizing the test case with whittle.py. Use when an issue has an attached tarball artifact (.tar.gz) from `make *_issue`."
2+
prompt = "Activate the triage-issue skill and triage the following issue: {{args}}"

.gemini/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"context": {
3+
"fileName": "AGENTS.md"
4+
}
5+
}

AGENTS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# OpenROAD - AI agent context
2+
3+
This file provides project-specific guidance for AI agent sessions working on the OpenROAD codebase.
4+
5+
## Quick Reference
6+
7+
Detailed guides are in `docs/agents/` subdirectory:
8+
9+
- **Build Pitfalls**: See `docs/agents/build.md`
10+
- **Testing Guide**: See `docs/agents/testing.md`
11+
- **Git & CI**: See `docs/agents/ci.md`
12+
- **Coding Patterns**: See `docs/agents/coding.md`
13+
14+
## Critical Rules
15+
16+
1. **Never modify `src/sta/` files** -- OpenSTA is managed upstream (`Sdc.cc`, `Power.cc`, `Sdc.tcl`, etc.). **Only test files may be modified.** All fixes must be in OpenROAD code (e.g., `src/dbSta/`, `src/rsz/`). If OpenSTA code change is inevitable, notify user. Exception: you *may* modify `src/sta/` files temporarily for **debugging purposes** only.
17+
2. Run `clang-format -i <files>` for C++ files before commit. **NEVER** for `src/sta/*` and `*.i` files.
18+
3. **Always use `git commit -s`** for DCO compliance.
19+
4. When amending submodule commits, parent repo submodule reference must also be updated via `git submodule update --init --recursive`. It is needed after any merge/pull.
20+
5. **Trace bugs upstream** -- when a bug appears in output (e.g., Verilog), find the data creation point (e.g., `buffer_ports`, `remove_buffers`), not the serialization point (e.g., `VerilogWriter`).

BUILD.bazel

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ cc_binary(
166166
"src/Main.cc",
167167
],
168168
copts = OPENROAD_COPTS,
169-
data = [
170-
"@tclreadline//:tclreadline_scripts",
171-
],
172169
features = ["-use_header_modules"],
173170
malloc = select({
174171
"@platforms//os:linux": "@tcmalloc//tcmalloc",
@@ -180,13 +177,13 @@ cc_binary(
180177
":openroad_version",
181178
":opt_notification",
182179
":ord",
183-
"//bazel:runfiles",
180+
"//bazel:tcl_library_init",
181+
"@rules_cc//cc/runfiles", # sets BAZEL_CURRENT_REPOSITORY
184182
"//src/cut",
185183
"//src/gui",
186184
"//src/sta:opensta_lib",
187185
"//src/utl",
188186
"@boost.stacktrace",
189-
"@rules_cc//cc/runfiles",
190187
"@tcl_lang//:tcl",
191188
# tclreadline: provides ENABLE_READLINE define + links libtclreadline.
192189
# On systems without tclreadline these are empty stub targets (no-op).

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

MODULE.bazel

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ bazel_dep(name = "platforms", version = "0.0.11")
1515
bazel_dep(name = "rules_bison", version = "0.3.1")
1616
bazel_dep(name = "rules_cc", version = "0.2.17")
1717
bazel_dep(name = "rules_flex", version = "0.3.1")
18+
bazel_dep(name = "rules_pkg", version = "1.2.0")
1819
bazel_dep(name = "rules_python", version = "1.8.5")
1920
bazel_dep(name = "rules_shell", version = "0.6.1")
2021
bazel_dep(name = "swig", version = "4.3.0.bcr.2")
@@ -65,6 +66,7 @@ bazel_dep(name = "or-tools", version = "9.15")
6566
bazel_dep(name = "readline", version = "8.2.bcr.3")
6667
bazel_dep(name = "spdlog", version = "1.15.1")
6768
bazel_dep(name = "tcl_lang", version = "8.6.16.bcr.1")
69+
bazel_dep(name = "tclreadline", version = "2.4.1")
6870
bazel_dep(name = "tcmalloc", version = "0.0.0-20250927-12f2552")
6971
bazel_dep(name = "yaml-cpp", version = "0.9.0")
7072
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
@@ -97,7 +99,6 @@ bazel_dep(name = "toolchains_llvm", version = "1.5.0")
9799

98100
bazel_dep(name = "bant", version = "0.2.4", dev_dependency = True)
99101
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True)
100-
bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True)
101102
bazel_dep(name = "rules_verilator", version = "0.1.0", dev_dependency = True)
102103
bazel_dep(name = "verilator", version = "5.036.bcr.3", dev_dependency = True)
103104

@@ -249,16 +250,6 @@ use_repo(maven, "maven")
249250

250251
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
251252

252-
http_archive(
253-
name = "tclreadline",
254-
build_file = "//bazel:tclreadline.BUILD",
255-
sha256 = "a64e0faed5957b8e1ac16f179948e21cdd6d3b8313590b7ab049a3192ab864fb",
256-
strip_prefix = "tclreadline-2.3.8",
257-
urls = [
258-
"https://github.com/flightaware/tclreadline/archive/refs/tags/v2.3.8.tar.gz",
259-
],
260-
)
261-
262253
http_archive(
263254
name = "circt",
264255
build_file_content = """

MODULE.bazel.lock

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

bazel/BUILD

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
load("@bazel_skylib//rules:build_test.bzl", "build_test")
2+
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
3+
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
24
load("@rules_cc//cc:cc_library.bzl", "cc_library")
5+
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
6+
load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
37
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
48
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
9+
load("//bazel:extract_zip.bzl", "extract_zip")
510

611
package(features = ["layering_check"])
712

@@ -36,17 +41,99 @@ compile_pip_requirements(
3641
requirements_txt = "requirements_lock_3_13.txt",
3742
)
3843

39-
cc_library(
40-
name = "runfiles",
44+
# Various tcl libraries that we want to embed into the binary.
45+
pkg_files(
46+
name = "tcl_core_files",
47+
srcs = ["@tcl_lang//:tcl_core"],
48+
strip_prefix = strip_prefix.from_root(),
49+
)
50+
51+
pkg_files(
52+
name = "tclreadline_files",
53+
srcs = ["@tclreadline//:tclreadline_scripts"],
54+
prefix = "tclreadline",
55+
strip_prefix = strip_prefix.from_root(),
56+
)
57+
58+
# Packaging up all tcl resources to one complete zip file. It can be
59+
# directly embedded in Tcl9 in a //zipfs:/ vfs.
60+
pkg_zip(
61+
name = "tcl_resources_zip",
4162
srcs = [
42-
"InitRunFiles.cpp",
43-
],
44-
data = [
45-
"@tcl_lang//:tcl_core",
63+
":tcl_core_files",
64+
":tclreadline_files",
4665
],
66+
)
67+
68+
# ... however, Tcl8 still needs access to a directory, so unpack in that case.
69+
extract_zip(
70+
name = "tcl_resources_dir",
71+
src = ":tcl_resources_zip",
72+
)
73+
74+
genrule(
75+
name = "tcl_resources_zip_data_h",
76+
srcs = [":tcl_resources_zip"],
77+
outs = ["tcl_resources_zip_data.h"],
78+
cmd = "$(location :embed) kTclResourceZip $< $@",
79+
tools = [":embed"],
80+
)
81+
82+
cc_binary(
83+
name = "embed",
84+
srcs = ["embed.cc"],
85+
)
86+
87+
# As long as we support tcl8 (using runfiles) we need this flag.
88+
bool_flag(
89+
name = "use_zipfs",
90+
build_setting_default = False, # False until we can use tcl9
91+
)
92+
93+
config_setting(
94+
name = "zipfs_config",
95+
flag_values = {":use_zipfs": "true"},
96+
)
97+
98+
# Library initialization is a bit different for tcl8 and tcl9.
99+
# In tcl9, we can use a zipped version of the needed include files, but
100+
# for tcl8, we have to use the unpacked zip file and point our runfiles
101+
# to it.
102+
cc_library(
103+
name = "tcl_library_init",
104+
srcs = ["tcl_library_init.cc"] +
105+
select({
106+
":zipfs_config": ["tcl_resources_zip_data.h"],
107+
"//conditions:default": [],
108+
}),
109+
hdrs = ["tcl_library_init.h"],
110+
copts = select({
111+
":zipfs_config": [],
112+
"//conditions:default": ["-DUSE_TCL_RUNFILE_INIT"],
113+
}),
114+
data = select({
115+
":zipfs_config": [],
116+
"//conditions:default": [":tcl_resources_dir"],
117+
}),
118+
visibility = ["//visibility:public"],
119+
deps = [
120+
"@tcl_lang//:tcl",
121+
] + select({
122+
":zipfs_config": [],
123+
"//conditions:default": ["@rules_cc//cc/runfiles"],
124+
}),
125+
)
126+
127+
# shim old library as it is still referenced in src/sta, implementing the
128+
# old behavior.
129+
cc_library(
130+
name = "runfiles",
131+
srcs = ["InitRunFiles.cpp"],
132+
data = [":tcl_resources_dir"],
47133
visibility = ["//visibility:public"],
48134
deps = [
49135
"@rules_cc//cc/runfiles",
136+
"@tcl_lang//:tcl",
50137
],
51138
alwayslink = True,
52139
)

0 commit comments

Comments
 (0)