Skip to content

Commit a2e6a7f

Browse files
authored
Merge pull request #12031 from The-OpenROAD-Project-staging/pex-patterns
pex: patterns, model tables, builder and the modeling experiments
2 parents ba3e120 + 13a63cd commit a2e6a7f

24 files changed

Lines changed: 6173 additions & 0 deletions

‎src/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ add_subdirectory(dpl)
266266
add_subdirectory(exa)
267267
add_subdirectory(fin)
268268
add_subdirectory(fsv)
269+
add_subdirectory(pex)
269270
add_subdirectory(ram)
270271
add_subdirectory(ppl)
271272
add_subdirectory(rmp)

‎src/fsv/test/BUILD‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ filegroup(
228228
],
229229
)
230230

231+
exports_files([
232+
"GT2.itf",
233+
"field_solver_gcd.def",
234+
"sky130.itf",
235+
])
236+
231237
[regression_test(
232238
name = test_name,
233239
data = [":test_resources"],

‎src/fsv/test/GT2.itf‎

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
$ BSD 3-Clause License
2+
$
3+
$ Copyright 2025 Da Eun Shim, Piyush Kumar, Dongwon Jang, Azad Naeemi, or Georgia Institute of Technology
4+
$
5+
$ Redistribution and use in source and binary forms, with or without
6+
$ modification, are permitted provided that the following conditions are met:
7+
$
8+
$ 1. Redistributions of source code must retain the above copyright notice,
9+
$ this list of conditions and the following disclaimer.
10+
$
11+
$ 2. Redistributions in binary form must reproduce the above copyright notice,
12+
$ this list of conditions and the following disclaimer in the documentation
13+
$ and/or other materials provided with the distribution.
14+
$
15+
$ 3. Neither the name of the copyright holder nor the names of its contributors
16+
$ may be used to endorse or promote products derived from this software without
17+
$ specific prior written permission.
18+
$
19+
$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
20+
$ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21+
$ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22+
$ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
$ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24+
$ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25+
$ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26+
$ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
$ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28+
$ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
31+
$ GT2 ITF File
32+
33+
34+
TECHNOLOGY = GT2
35+
36+
DIELECTRIC RDL_diel { THICKNESS=0.5 ER=2.5}
37+
CONDUCTOR RDL { THICKNESS=0.5 WMIN=1.600 SMIN=1.600 RPSQ=0.01 }
38+
39+
DIELECTRIC M13_diel { THICKNESS=0.224 ER=2.5}
40+
CONDUCTOR M13 { THICKNESS=0.112 WMIN=0.360 SMIN=0.360 RPSQ=0.23 }
41+
42+
DIELECTRIC M12_diel { THICKNESS=0.224 ER=2.5}
43+
CONDUCTOR M12 { THICKNESS=0.112 WMIN=0.360 SMIN=0.360 RPSQ=0.23 }
44+
45+
DIELECTRIC M11_diel { THICKNESS=0.224 ER=2.5}
46+
CONDUCTOR M11 { THICKNESS=0.112 WMIN=0.056 SMIN=0.056 RPSQ=0.419 }
47+
48+
DIELECTRIC M10_diel { THICKNESS=0.224 ER=2.5}
49+
CONDUCTOR M10 { THICKNESS=0.112 WMIN=0.056 SMIN=0.056 RPSQ=0.419 }
50+
51+
DIELECTRIC M9_diel { THICKNESS=0.152 ER=2.5}
52+
CONDUCTOR M9 { THICKNESS=0.076 WMIN=0.038 SMIN=0.038 RPSQ=1.009 }
53+
54+
DIELECTRIC M8_diel { THICKNESS=0.152 ER=2.5}
55+
CONDUCTOR M8 { THICKNESS=0.076 WMIN=0.038 SMIN=0.038 RPSQ=1.009 }
56+
57+
DIELECTRIC M7_diel { THICKNESS=0.152 ER=2.5}
58+
CONDUCTOR M7 { THICKNESS=0.076 WMIN=0.038 SMIN=0.038 RPSQ=1.009 }
59+
60+
DIELECTRIC M6_diel { THICKNESS=0.152 ER=2.5}
61+
CONDUCTOR M6 { THICKNESS=0.076 WMIN=0.038 SMIN=0.038 RPSQ=1.009 }
62+
63+
DIELECTRIC M5_diel { THICKNESS=0.084 ER=2.5}
64+
CONDUCTOR M5 { THICKNESS=0.042 WMIN=0.021 SMIN=0.021 RPSQ=3.506 }
65+
66+
DIELECTRIC M4_diel { THICKNESS=0.084 ER=2.5}
67+
CONDUCTOR M4 { THICKNESS=0.042 WMIN=0.021 SMIN=0.021 RPSQ=3.506 }
68+
69+
DIELECTRIC M3_diel { THICKNESS=0.056 ER=2.4}
70+
CONDUCTOR M3 { THICKNESS=0.028 WMIN=0.014 SMIN=0.014 RPSQ=6.125 }
71+
72+
DIELECTRIC M2_diel { THICKNESS=0.048 ER=2.4 }
73+
CONDUCTOR M2 { THICKNESS=0.024 WMIN=0.012 SMIN=0.012 RPSQ=7.461 }
74+
75+
DIELECTRIC M1_diel { THICKNESS=0.056 ER=2.4}
76+
CONDUCTOR M1 { THICKNESS=0.028 WMIN=0.014 SMIN=0.014 RPSQ=6.125 }
77+
78+
DIELECTRIC M0_diel { THICKNESS=0.048 ER=2.4 }
79+
CONDUCTOR M0 { THICKNESS=0.024 WMIN=0.012 SMIN=0.012 RPSQ=7.461 }
80+
81+
DIELECTRIC VSD_diel { THICKNESS=0.023 ER=3.9 }
82+
$CONDUCTOR VSD { LAYER_TYPE=TRENCH_CONTACT THICKNESS=0.023 WMIN=0.012 SMIN=0.024 RPSQ=9.0081}
83+
$CONDUCTOR VG { LAYER_TYPE=TRENCH_CONTACT THICKNESS=0.023 WMIN=0.012 SMIN=0.024 RPSQ=9.0081}
84+
$ trench contact type conductor for VG/VSD
85+
86+
DIELECTRIC SDCON_diel { THICKNESS=0.053 ER=7.0 }
87+
CONDUCTOR SDCON { THICKNESS=0.053 WMIN=0.015 SMIN=0.027 RPSQ=12.5 }
88+
89+
DIELECTRIC GATE_diel2 { THICKNESS=0.002 ER=7.0 }
90+
CONDUCTOR ACT { THICKNESS=0.035 WMIN=0.021 SMIN=0.03 RPSQ=10.0 }
91+
$CONDUCTOR ACT { LAYER_TYPE=DIFFUSION THICKNESS=0.035 WMIN=0.021 SMIN=0.03 RPSQ=10.0 RAISED_DIFFUSION_THICKNESS=0.035 RAISED_DIFFUSION_TO_GATE_SMIN=0.006 }
92+
$ all three nanosheets combined in one active diffusion layer
93+
DIELECTRIC GATE_diel1 { THICKNESS=0.010 ER=7.0 }
94+
CONDUCTOR GATE { THICKNESS=0.065 WMIN=0.015 SMIN=0.027 RPSQ=6.9565 }
95+
$ SMIN is the spacing for same layer type
96+
97+
DIELECTRIC BOX_diel { THICKNESS=0.023 ER=3.9 }
98+
DIELECTRIC BPR_diel { THICKNESS=0.090 ER=3.9 }
99+
CONDUCTOR BPR { THICKNESS=0.090 WMIN=0.032 SMIN=0.112 RPSQ=0.7778 }
100+
101+
DIELECTRIC BM1_diel { THICKNESS=0.412 ER=3.9 }
102+
CONDUCTOR BM1 { THICKNESS=0.112 WMIN=0.056 SMIN=0.056 RPSQ=0.419 }
103+
104+
DIELECTRIC BM2_diel { THICKNESS=0.224 ER=2.5}
105+
CONDUCTOR BM2 { THICKNESS=0.112 WMIN=0.056 SMIN=0.056 RPSQ=0.419 }
106+
107+
DIELECTRIC BM3_diel { THICKNESS=0.224 ER=2.5}
108+
CONDUCTOR BM3 { THICKNESS=0.112 WMIN=0.360 SMIN=0.360 RPSQ=0.23 }
109+
110+
DIELECTRIC BM4_diel { THICKNESS=0.224 ER=2.5}
111+
CONDUCTOR BM4 { THICKNESS=0.112 WMIN=0.360 SMIN=0.360 RPSQ=0.23 }
112+
113+
DIELECTRIC BRDL_diel { THICKNESS=0.612 ER=2.5}
114+
CONDUCTOR BRDL { THICKNESS=0.5 WMIN=1.600 SMIN=1.600 RPSQ=0.01 }
115+
116+
DIELECTRIC dummy_diel { THICKNESS=0.0001 ER=2.5}
117+
118+
VIA BV4 { FROM=BRDL TO=BM4 AREA=0.1296 RPV=0.15 }
119+
VIA BV3 { FROM=BM4 TO=BM3 AREA=0.02016 RPV=0.95 }
120+
VIA BV2 { FROM=BM3 TO=BM2 AREA=0.003136 RPV=6.08 }
121+
VIA BV1 { FROM=BM2 TO=BM1 AREA=0.003136 RPV=6.08 }
122+
VIA BV0 { FROM=BM1 TO=BPR AREA=0.001792 RPV=25.1 }
123+
VIA VBPR { FROM=BPR TO=SDCON AREA=0.000165 RPV=32.0 }
124+
VIA VG { FROM=GATE TO=M0 AREA=0.000180 RPV=31.94 }
125+
VIA VSD { FROM=SDCON TO=M0 AREA=0.000156 RPV=36.86 }
126+
VIA V0 { FROM=M0 TO=M1 AREA=0.000168 RPV=54.99 }
127+
VIA V1 { FROM=M1 TO=M2 AREA=0.000168 RPV=54.99 }
128+
VIA V2 { FROM=M2 TO=M3 AREA=0.000168 RPV=54.99 }
129+
VIA V3 { FROM=M3 TO=M4 AREA=0.000294 RPV=45.78 }
130+
VIA V4 { FROM=M4 TO=M5 AREA=0.000441 RPV=27.8 }
131+
VIA V5 { FROM=M5 TO=M6 AREA=0.000798 RPV=14.89 }
132+
VIA V6 { FROM=M6 TO=M7 AREA=0.001444 RPV=13.26 }
133+
VIA V7 { FROM=M7 TO=M8 AREA=0.001444 RPV=13.26 }
134+
VIA V8 { FROM=M8 TO=M9 AREA=0.001444 RPV=13.26 }
135+
VIA V9 { FROM=M9 TO=M10 AREA=0.002128 RPV=7.65 }
136+
VIA V10 { FROM=M10 TO=M11 AREA=0.003136 RPV=6.08 }
137+
VIA V11 { FROM=M11 TO=M12 AREA=0.003136 RPV=6.08 }
138+
VIA V12 { FROM=M12 TO=M13 AREA=0.02016 RPV=0.95 }
139+
VIA V13 { FROM=M13 TO=RDL AREA=0.1296 RPV=0.15 }

‎src/pex/BUILD‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2026, The OpenROAD Authors
3+
4+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
5+
6+
package(
7+
default_visibility = ["//:__subpackages__"],
8+
features = ["layering_check"],
9+
)
10+
11+
# Patterns built from a process stack by layer name.
12+
cc_library(
13+
name = "patterns",
14+
srcs = ["src/Patterns.cpp"],
15+
hdrs = ["include/pex/Patterns.h"],
16+
includes = ["include"],
17+
deps = [
18+
"//src/fsv:geometry",
19+
"//src/fsv:stack",
20+
],
21+
)
22+
23+
# The capacitance tables and their lookup.
24+
cc_library(
25+
name = "model",
26+
srcs = ["src/Model.cpp"],
27+
hdrs = ["include/pex/Model.h"],
28+
includes = ["include"],
29+
)
30+
31+
# Builds the tables by solving patterns with fsv.
32+
cc_library(
33+
name = "model_builder",
34+
srcs = ["src/ModelBuilder.cpp"],
35+
hdrs = ["include/pex/ModelBuilder.h"],
36+
includes = ["include"],
37+
deps = [
38+
":model",
39+
":patterns",
40+
"//src/fsv",
41+
"//src/fsv:geometry",
42+
"//src/fsv:stack",
43+
"//src/utl",
44+
],
45+
)
46+
47+
# The model file.
48+
cc_library(
49+
name = "model_json",
50+
srcs = ["src/ModelJson.cpp"],
51+
hdrs = ["include/pex/ModelJson.h"],
52+
copts = ["-DBOOST_JSON_HEADER_ONLY"],
53+
includes = ["include"],
54+
deps = [
55+
":model",
56+
"@boost.json",
57+
],
58+
)
59+
60+
exports_files(["README.md"])

‎src/pex/CMakeLists.txt‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2026, The OpenROAD Authors
3+
4+
include("openroad")
5+
6+
add_library(pex
7+
src/Model.cpp
8+
src/ModelBuilder.cpp
9+
src/ModelJson.cpp
10+
src/Patterns.cpp
11+
)
12+
13+
target_include_directories(pex
14+
PUBLIC
15+
include
16+
)
17+
18+
target_compile_definitions(pex
19+
PRIVATE
20+
BOOST_JSON_HEADER_ONLY
21+
)
22+
23+
target_link_libraries(pex
24+
PUBLIC
25+
fsv
26+
PRIVATE
27+
utl_lib
28+
Boost::boost
29+
)

‎src/pex/README.md‎

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Parasitic Extraction (pex)
2+
3+
pex is a 2.5D RC extractor under development. Its capacitance model is a
4+
set of tables that the module builds itself by solving small wire patterns
5+
with the field solver (`src/fsv`) on an ITF process stack, so no external
6+
reference extractor is needed. The same solver checks the model on routed
7+
nets.
8+
9+
## Status
10+
11+
The first step is in: the patterns built from a stack by layer name
12+
(`pex/Patterns.h`), the model tables with their lookups (`pex/Model.h`),
13+
the table builder (`pex/ModelBuilder.h`), the model file
14+
(`pex/ModelJson.h`), a reference evaluator that applies the model to a
15+
field-solver geometry by brute force (`test/cpp/Reference.h`), and the
16+
modeling experiments below. There are no commands yet.
17+
18+
## Model
19+
20+
A wire is cut into pieces wherever its surroundings change. A piece's
21+
context is its layer and width, the spacing to the nearest same-layer
22+
neighbor on each side (or none past the table's last spacing), and the
23+
nearest covering layer below (the substrate when none) and above (none when
24+
open). Four kinds of table describe a layer:
25+
26+
- **Lateral.** One table per `(layer, below, above)` context holds, per
27+
unit length, the capacitance to the ground plane, to each neighbor and
28+
to each covering plane, over a grid of widths and of the spacing on each
29+
side; a spacing index past the grid means no neighbor. Lookups are
30+
linear in the width and in the logarithms of the spacings, a coupling
31+
interpolating geometrically along its own side. Each point is one cross
32+
section solved in 2D: the wire between its neighbors, with a plane on
33+
each covering layer.
34+
- **Crossing.** A covering layer is rarely a plane: it is wires crossing
35+
the piece. One table per `(layer, cover)` pair holds the share of the
36+
plane's effect that the crossings keep over the uncovered gap between two
37+
of them, for the total and for the coupling to the crossings, against
38+
the gap. It comes from periodic arrays of crossing wires at several
39+
widths and coverages, solved in 3D at two lengths so the ends cancel. A
40+
piece under crossings blends the open and the covered lateral values by
41+
that share. The amount kept, gap × share, is linear between the
42+
tabulated gaps, and its slope is the one-sided share a piece beside a
43+
single crossing takes; it is held within [0, 1], so a noisy table never
44+
takes capacitance away.
45+
- **Diagonal.** A parallel wire on a nearby layer that lies beside the
46+
piece rather than over it (a power rail one layer down, say) couples
47+
strongly and neither table above sees it. One table per `(layer, other)`
48+
pair holds the coupling to such a wire per unit length, what it adds to
49+
the total and what it takes from the coupling to the piece's own
50+
neighbor on that side, over the parallel wire's width, its edge-to-edge
51+
gap and the spacings to the piece's neighbors on that side and on the
52+
far side, from cross sections solved in 2D.
53+
- **End.** One table per context holds what a line end adds to the wire's
54+
capacitance, over the widths, from a short wire solved in 3D less its
55+
per-unit-length value times its length.
56+
57+
A point and its mirror share one solve, and each solve is seeded by its
58+
position, so a table does not depend on the thread count. The model file
59+
is JSON with a format version.
60+
61+
## Experiments
62+
63+
The experiments measure, against the field solver, what each
64+
simplification of the model costs. Every row gives a quantity's true value,
65+
its standard error, the value the simplification gives, and the relative
66+
error. They run on one conductor layer of a stack:
67+
68+
```
69+
bazelisk build //src/pex/test:Experiments
70+
bazel-bin/src/pex/test/Experiments --threads 64 --tol 0.003 \
71+
--itf src/fsv/test/sky130.itf --layer met2 --csv met2.csv
72+
```
73+
74+
| Group | Measures | Simplification tested | Decides |
75+
| --- | --- | --- | --- |
76+
| e1 additivity | a wire whose neighbor and cover change along it | the pieces' per-unit-length values plus the end terms | whether transitions need a correction |
77+
| e2 crossing | a wire under or over an array of crossing wires at a coverage fraction, alone, with neighbors, and with a plane on the other side | plane × coverage, and the blend by the crossing table's share | the crossing model |
78+
| e3 ends | short wires of several lengths; two line ends facing across a gap | per-unit-length × length | the end term and its dimensions |
79+
| e4 lateral | one to three neighbors per side; the nearest neighbor's width | only the nearest neighbor, at minimum width | the lateral cutoff and the table's neighbor width |
80+
| e5 vertical | planes on the three nearest layers each way, present or absent in every combination | only the nearest present plane on each side | the context depth of the tables |
81+
| e6 asymmetric | different spacings on the two sides | the ground averaged over the two symmetric cases, each coupling from its own | whether the table keeps both spacings |
82+
| e7 interpolation | off-grid widths and spacings, spacings past the grid, a width past the grid | the interpolated table | the table grid and the interpolation |
83+
| e8 vias | a via at a wire's end and in its middle, with and without the cut | the wires without the via | the via term |
84+
| e9 nets | nets of a routed design, each solved within a halo | the model applied to the same boxes by the reference evaluator | the attainable accuracy |
85+
| e11 diagonal | a parallel wire on a nearby layer beside the wire, alone and with neighbors | the wire without it | the diagonal table |
86+
87+
e9 reads LEF and DEF (by default the gcd window of the fsv tests) or an
88+
ODB file, builds the model for every routing layer of the design the stack
89+
has, saves it to `--model`, and reads it back on later runs:
90+
91+
```
92+
bazel-bin/src/pex/test/Experiments --groups e9 --threads 64 --tol 0.003 \
93+
--odb 6_final.odb --model sky130.json --sample 50 --halo 10
94+
```
95+
96+
`--smoke` runs a short version of every group, which `Experiments_smoke`
97+
does as a test. The lateral tables for e6, e7 and e9 take most of the
98+
time; e2 and e3 solve in 3D and take minutes at 0.3%.
99+
100+
## Regression tests
101+
102+
```
103+
bazelisk test //src/pex/test/...
104+
```

0 commit comments

Comments
 (0)