Skip to content

Commit 2aae40a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into refactor-odb-ptr-sets-jetski
Signed-off-by: Drew Lewis <cannada@google.com>
2 parents 818c7c4 + 5f0ba34 commit 2aae40a

158 files changed

Lines changed: 12017 additions & 18001 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.

.github/CODEOWNERS

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# OpenROAD code owners
2+
#
3+
# Order matters: later rules override earlier ones for the same path.
4+
# The '*' fallback applies to anything not matched by a more specific rule.
5+
#
6+
# Fallback owner for everything (docs, CI, bazel, top-level files, src/ root files)
7+
# and a few misc modules commented below
8+
* @The-OpenROAD-Project/openroad-maintainers
9+
10+
# Per-module owners
11+
/src/ant/ @The-OpenROAD-Project/openroad-ant
12+
/src/cgt/ @The-OpenROAD-Project/openroad-cgt
13+
#/src/cmake/
14+
/src/cts/ @The-OpenROAD-Project/openroad-cts
15+
/src/cut/ @The-OpenROAD-Project/openroad-cut
16+
/src/dbSta/ @The-OpenROAD-Project/openroad-dbsta
17+
/src/dft/ @The-OpenROAD-Project/openroad-dft
18+
/src/dpl/ @The-OpenROAD-Project/openroad-dpl
19+
/src/drt/ @The-OpenROAD-Project/openroad-drt
20+
/src/dst/ @The-OpenROAD-Project/openroad-dst
21+
/src/est/ @The-OpenROAD-Project/openroad-est
22+
#/src/exa/
23+
#/src/fin/
24+
/src/gpl/ @The-OpenROAD-Project/openroad-gpl
25+
/src/grt/ @The-OpenROAD-Project/openroad-grt
26+
/src/gui/ @The-OpenROAD-Project/openroad-gui
27+
/src/ifp/ @The-OpenROAD-Project/openroad-ifp
28+
/src/mpl/ @The-OpenROAD-Project/openroad-mpl
29+
/src/odb/ @The-OpenROAD-Project/openroad-odb
30+
/src/pad/ @The-OpenROAD-Project/openroad-pad
31+
/src/par/ @The-OpenROAD-Project/openroad-par
32+
/src/pdn/ @The-OpenROAD-Project/openroad-pdn
33+
/src/ppl/ @The-OpenROAD-Project/openroad-ppl
34+
/src/psm/ @The-OpenROAD-Project/openroad-psm
35+
#/src/ram/
36+
/src/rcx/ @The-OpenROAD-Project/openroad-rcx
37+
/src/rmp/ @The-OpenROAD-Project/openroad-rmp
38+
/src/rsz/ @The-OpenROAD-Project/openroad-rsz
39+
/src/sta/ @The-OpenROAD-Project/openroad-sta
40+
/src/stt/ @The-OpenROAD-Project/openroad-stt
41+
/src/syn/ @The-OpenROAD-Project/openroad-syn
42+
/src/tap/ @The-OpenROAD-Project/openroad-tap
43+
/src/tst/ @The-OpenROAD-Project/openroad-tst
44+
/src/upf/ @The-OpenROAD-Project/openroad-upf
45+
/src/utl/ @The-OpenROAD-Project/openroad-utl
46+
/src/web/ @The-OpenROAD-Project/openroad-web

.github/workflows/github-actions-clang-tidy-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333
const fs = require('fs');
3434
fs.writeFileSync('${{github.workspace}}/clang-tidy-review.zip', Buffer.from(download.data));
3535
- name: 'Unzip artifact'
36-
run: unzip clang-tidy-review.zip
36+
run: unzip -o clang-tidy-review.zip
3737
- uses: The-OpenROAD-Project/clang-tidy-review/post@master

.github/workflows/github-actions-on-label-create.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,86 @@ jobs:
8888
env:
8989
GITHUB_TOKEN: ${{ github.token }}
9090
UPSTREAM_PR: ${{ steps.send_pr.outputs.pr }}
91+
92+
- name: Request CODEOWNERS reviewers on upstream PR
93+
if: steps.send_pr.outputs.pr != ''
94+
env:
95+
GH_TOKEN: ${{ steps.resolve_token.outputs.token }}
96+
PR: ${{ steps.send_pr.outputs.pr }}
97+
UPSTREAM: ${{ env.UPSTREAM_OWNER }}/${{ env.UPSTREAM_REPO }}
98+
run: |
99+
set -euo pipefail
100+
# System Python on the runner is PEP 668 externally-managed; use a venv.
101+
python3 -m venv /tmp/codeowners-venv
102+
/tmp/codeowners-venv/bin/pip install --quiet pathspec
103+
/tmp/codeowners-venv/bin/python <<'PY'
104+
import base64, json, os, subprocess, sys
105+
from pathspec import GitIgnoreSpec
106+
107+
pr = os.environ["PR"]
108+
upstream = os.environ["UPSTREAM"]
109+
110+
pr_json = subprocess.check_output(
111+
["gh", "api", f"repos/{upstream}/pulls/{pr}"], text=True)
112+
pr_data = json.loads(pr_json)
113+
author = pr_data["user"]["login"]
114+
base_ref = pr_data["base"]["ref"]
115+
116+
# Authoritative CODEOWNERS is the one on the PR base branch.
117+
raw = subprocess.check_output(
118+
["gh", "api", "--method", "GET",
119+
f"repos/{upstream}/contents/.github/CODEOWNERS",
120+
"-f", f"ref={base_ref}", "--jq", ".content"], text=True).strip()
121+
codeowners = base64.b64decode(raw).decode()
122+
123+
rules = []
124+
for line in codeowners.splitlines():
125+
line = line.split("#", 1)[0].strip()
126+
if not line:
127+
continue
128+
pattern, *rule_owners = line.split()
129+
rules.append((GitIgnoreSpec.from_lines([pattern]), rule_owners))
130+
131+
# GitHub caps /pulls/{n}/files at 3000 even with --paginate; truly
132+
# enormous PRs will under-request owners for the overflow.
133+
files = subprocess.check_output(
134+
["gh", "api", f"repos/{upstream}/pulls/{pr}/files", "--paginate",
135+
"--jq", ".[].filename"], text=True).splitlines()
136+
137+
owners = set()
138+
for path in files:
139+
matched = None
140+
for spec, rule_owners in rules:
141+
if spec.match_file(path):
142+
matched = rule_owners # last match wins
143+
if matched:
144+
owners.update(o.lstrip("@") for o in matched)
145+
146+
# CODEOWNERS lists teams as "org/slug"; the REST endpoint wants the
147+
# bare slug in team_reviewers.
148+
team_slugs = sorted(t.split("/", 1)[1] for t in owners if "/" in t)
149+
users = sorted(o for o in owners
150+
if "/" not in o and o.lower() != author.lower())
151+
152+
if not (team_slugs or users):
153+
print("No CODEOWNERS-matched reviewers.")
154+
sys.exit(0)
155+
156+
# Use the REST POST endpoint directly: `gh pr edit --add-reviewer`
157+
# runs a GraphQL query that needs read:org, which our tokens don't
158+
# have. POST /pulls/{n}/requested_reviewers only writes, so the
159+
# existing repo / pull-requests:write scope is enough. Each array
160+
# is capped at 15 per call.
161+
def request(body):
162+
print("Requesting:", body)
163+
subprocess.run(
164+
["gh", "api", "--method", "POST",
165+
f"repos/{upstream}/pulls/{pr}/requested_reviewers",
166+
"--input", "-"],
167+
input=json.dumps(body), text=True, check=True)
168+
169+
for i in range(0, len(team_slugs), 15):
170+
request({"team_reviewers": team_slugs[i:i + 15]})
171+
for i in range(0, len(users), 15):
172+
request({"reviewers": users[i:i + 15]})
173+
PY

BUILD.bazel

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,14 @@ OPENROAD_LIBRARY_DEPS = [
103103
"//src/ifp:ui",
104104
"//src/mpl",
105105
"//src/mpl:ui",
106-
"//src/odb",
106+
"//src/odb/src/3dblox",
107+
"//src/odb/src/cdl",
108+
"//src/odb/src/db",
109+
"//src/odb/src/defin",
110+
"//src/odb/src/defout",
111+
"//src/odb/src/lefin",
112+
"//src/odb/src/lefout",
113+
"//src/odb/src/swig:swig_common",
107114
"//src/odb:ui",
108115
"//src/pad",
109116
"//src/par",
@@ -330,7 +337,7 @@ cc_binary(
330337
"//src/grt",
331338
"//src/gui",
332339
"//src/ifp",
333-
"//src/odb",
340+
"//src/odb/src/db",
334341
"//src/par",
335342
"//src/pdn",
336343
"//src/ppl",

src/ant/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cc_library(
3333
"include",
3434
],
3535
deps = [
36-
"//src/odb",
36+
"//src/odb/src/db",
3737
"//src/utl",
3838
"@abseil-cpp//absl/synchronization",
3939
"@boost.container_hash",
@@ -57,7 +57,7 @@ cc_library(
5757
deps = [
5858
":ant",
5959
"//:ord",
60-
"//src/odb",
60+
"//src/odb/src/db",
6161
"//src/utl",
6262
"@boost.stacktrace",
6363
"@tcl_lang//:tcl",

src/cgt/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cc_library(
3939
"//:ord",
4040
"//src/cut",
4141
"//src/dbSta",
42-
"//src/odb",
42+
"//src/odb/src/db",
4343
"//src/sta:opensta_lib",
4444
"//src/utl",
4545
"@abc",

src/cts/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cc_library(
6363
"//src/dbSta",
6464
"//src/dbSta:dbNetwork",
6565
"//src/est",
66-
"//src/odb",
66+
"//src/odb/src/db",
6767
"//src/rsz",
6868
"//src/sta:opensta_lib",
6969
"//src/stt",
@@ -98,7 +98,7 @@ cc_library(
9898
"//src/dbSta",
9999
"//src/est",
100100
"//src/gui",
101-
"//src/odb",
101+
"//src/odb/src/db",
102102
"//src/rsz",
103103
"//src/utl",
104104
"@boost.stacktrace",

src/cut/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ cc_library(
3232
deps = [
3333
"//src/dbSta",
3434
"//src/dbSta:dbNetwork",
35-
"//src/odb",
35+
"//src/odb/src/db",
3636
"//src/rsz",
3737
"//src/sta:opensta_lib",
3838
"//src/utl",

src/cut/test/BUILD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ cc_test(
3636
"//src/cut",
3737
"//src/dbSta",
3838
"//src/dbSta:dbReadVerilog",
39-
"//src/odb",
39+
"//src/odb/src/db",
40+
"//src/odb/src/lefin",
4041
"//src/sta:opensta_lib",
4142
"//src/tst",
4243
"//src/utl",
@@ -74,7 +75,8 @@ cc_test(
7475
"//src/cut",
7576
"//src/dbSta",
7677
"//src/dbSta:dbReadVerilog",
77-
"//src/odb",
78+
"//src/odb/src/db",
79+
"//src/odb/src/lefin",
7880
"//src/sta:opensta_lib",
7981
"//src/tst",
8082
"//src/utl",

src/dbSta/BUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cc_library(
2525
deps = [
2626
":dbNetwork",
2727
":dbSdcNetwork",
28-
"//src/odb",
28+
"//src/odb/src/db",
2929
"//src/sta:opensta_lib",
3030
"//src/utl",
3131
"@boost.json",
@@ -48,7 +48,7 @@ cc_library(
4848
deps = [
4949
":dbNetwork",
5050
":dbSta",
51-
"//src/odb",
51+
"//src/odb/src/db",
5252
"//src/sta:opensta_lib",
5353
"//src/utl",
5454
],
@@ -68,7 +68,7 @@ cc_library(
6868
deps = [
6969
":dbNetwork",
7070
":dbSta",
71-
"//src/odb",
71+
"//src/odb/src/db",
7272
"//src/sta:opensta_lib",
7373
"//src/utl",
7474
],
@@ -105,7 +105,7 @@ cc_library(
105105
],
106106
deps = [
107107
":dbSta",
108-
"//src/odb",
108+
"//src/odb/src/db",
109109
"//src/utl",
110110
],
111111
)
@@ -124,7 +124,7 @@ cc_library(
124124
"include",
125125
],
126126
deps = [
127-
"//src/odb",
127+
"//src/odb/src/db",
128128
"//src/sta:opensta_lib",
129129
"//src/utl",
130130
],
@@ -154,7 +154,7 @@ cc_library(
154154
":dbNetwork",
155155
":dbSta",
156156
"//:ord",
157-
"//src/odb",
157+
"//src/odb/src/db",
158158
"//src/sta:opensta_lib",
159159
"//src/utl",
160160
"@boost.json",

0 commit comments

Comments
 (0)