Skip to content

Commit d87cb90

Browse files
authored
Merge pull request #10298 from The-OpenROAD-Project-staging/resolve_spef_def
dbSta: SpefReader name-escape regression for DEF+SPEF flow + OpenSTA submodule bump
2 parents df15ee7 + ff0d6b1 commit d87cb90

7 files changed

Lines changed: 267 additions & 1 deletion

File tree

src/dbSta/test/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ ALL_TESTS = [
5858
"sdc_get1",
5959
"sdc_names1",
6060
"sdc_names2",
61+
"spef_def_names",
6162
"sta1",
6263
"sta2",
6364
"sta3",
@@ -200,6 +201,10 @@ filegroup(
200201
"sdc_names1": [
201202
"hier1.def",
202203
],
204+
"spef_def_names": [
205+
"example1_slow.lib",
206+
"example1.lef",
207+
],
203208
"sta1": [
204209
"example1_slow.lib",
205210
"example1.def",

src/dbSta/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ or_integration_tests(
4848
sdc_get1
4949
sdc_names1
5050
sdc_names2
51+
spef_def_names
5152
sta1
5253
sta2
5354
sta3

src/dbSta/test/spef_def_names.def

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
VERSION 5.5 ;
2+
NAMESCASESENSITIVE ON ;
3+
DIVIDERCHAR "/" ;
4+
BUSBITCHARS "[]" ;
5+
6+
DESIGN top ;
7+
8+
UNITS DISTANCE MICRONS 1000 ;
9+
10+
DIEAREA ( 0 0 ) ( 1000 1000 ) ;
11+
12+
# Names exercise three patterns:
13+
# - plain identifier (baseline) : b_plain, n_plain
14+
# - flat name with literal '/' (CTS-style) : cts/leaf_buf, cts/leaf_net
15+
# - flat name with literal '[]' (bus-bit) : bus[0], bus_n[0]
16+
COMPONENTS 6 ;
17+
- b_plain BUF_X1 ;
18+
- cts/leaf_buf BUF_X1 ;
19+
- bus[0] BUF_X1 ;
20+
- b_sink_a BUF_X1 ;
21+
- b_sink_b BUF_X1 ;
22+
- b_sink_c BUF_X1 ;
23+
END COMPONENTS
24+
25+
PINS 2 ;
26+
- in + NET in + DIRECTION INPUT ;
27+
- out + NET out + DIRECTION OUTPUT ;
28+
END PINS
29+
30+
NETS 7 ;
31+
- in ( PIN in ) ( b_plain A ) ( cts/leaf_buf A ) ( bus[0] A ) ;
32+
- n_plain ( b_plain Z ) ( b_sink_a A ) ;
33+
- cts/leaf_net ( cts/leaf_buf Z ) ( b_sink_b A ) ;
34+
- bus_n[0] ( bus[0] Z ) ( b_sink_c A ) ;
35+
- s_a ( b_sink_a Z ) ;
36+
- s_b ( b_sink_b Z ) ;
37+
- out ( b_sink_c Z ) ( PIN out ) ;
38+
END NETS
39+
40+
END DESIGN

src/dbSta/test/spef_def_names.ok

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
[INFO ODB-0227] LEF file: example1.lef, created 2 layers, 6 library cells
2+
[INFO ODB-0128] Design: top
3+
[INFO ODB-0130] Created 2 pins.
4+
[INFO ODB-0131] Created 6 components and 24 component-terminals.
5+
[INFO ODB-0133] Created 7 nets and 12 connections.
6+
[WARNING ORD-2056] The following 128 liberty cell(s) do not have LEF masters and will be marked as dont-use:
7+
AND2_X2
8+
AND2_X4
9+
AND3_X1
10+
AND3_X2
11+
AND3_X4
12+
AND4_X1
13+
AND4_X2
14+
AND4_X4
15+
ANTENNA_X1
16+
AOI211_X1
17+
AOI211_X2
18+
AOI211_X4
19+
AOI21_X1
20+
AOI21_X2
21+
AOI21_X4
22+
AOI221_X1
23+
AOI221_X2
24+
AOI221_X4
25+
AOI222_X1
26+
AOI222_X2
27+
AOI222_X4
28+
AOI22_X1
29+
AOI22_X2
30+
AOI22_X4
31+
BUF_X16
32+
BUF_X32
33+
BUF_X4
34+
BUF_X8
35+
CLKBUF_X1
36+
CLKBUF_X2
37+
CLKBUF_X3
38+
CLKGATETST_X1
39+
CLKGATETST_X2
40+
CLKGATETST_X4
41+
CLKGATETST_X8
42+
CLKGATE_X1
43+
CLKGATE_X2
44+
CLKGATE_X4
45+
CLKGATE_X8
46+
DFFRS_X1
47+
DFFRS_X2
48+
DFFR_X1
49+
DFFR_X2
50+
DFFS_X1
51+
DFFS_X2
52+
DFF_X2
53+
DLH_X1
54+
DLH_X2
55+
DLL_X1
56+
DLL_X2
57+
FA_X1
58+
FILLCELL_X1
59+
FILLCELL_X16
60+
FILLCELL_X2
61+
FILLCELL_X32
62+
FILLCELL_X4
63+
FILLCELL_X8
64+
HA_X1
65+
INV_X16
66+
INV_X2
67+
INV_X32
68+
INV_X4
69+
INV_X8
70+
LOGIC0_X1
71+
LOGIC1_X1
72+
MUX2_X1
73+
MUX2_X2
74+
NAND2_X1
75+
NAND2_X2
76+
NAND2_X4
77+
NAND3_X1
78+
NAND3_X2
79+
NAND3_X4
80+
NAND4_X1
81+
NAND4_X2
82+
NAND4_X4
83+
NOR2_X2
84+
NOR2_X4
85+
NOR3_X1
86+
NOR3_X2
87+
NOR3_X4
88+
NOR4_X1
89+
NOR4_X2
90+
NOR4_X4
91+
OAI211_X1
92+
OAI211_X2
93+
OAI211_X4
94+
OAI21_X1
95+
OAI21_X2
96+
OAI21_X4
97+
OAI221_X1
98+
OAI221_X2
99+
OAI221_X4
100+
OAI222_X1
101+
OAI222_X2
102+
OAI222_X4
103+
OAI22_X1
104+
OAI22_X2
105+
OAI22_X4
106+
OAI33_X1
107+
OR2_X1
108+
OR2_X2
109+
OR2_X4
110+
OR3_X1
111+
OR3_X2
112+
OR3_X4
113+
OR4_X1
114+
OR4_X2
115+
OR4_X4
116+
SDFFRS_X1
117+
SDFFRS_X2
118+
SDFFR_X1
119+
SDFFR_X2
120+
SDFFS_X1
121+
SDFFS_X2
122+
SDFF_X1
123+
SDFF_X2
124+
TBUF_X1
125+
TBUF_X16
126+
TBUF_X2
127+
TBUF_X4
128+
TBUF_X8
129+
TINV_X1
130+
TLAT_X1
131+
XNOR2_X1
132+
XNOR2_X2
133+
XOR2_X1
134+
XOR2_X2
135+
spef_def_names: read_spef done

src/dbSta/test/spef_def_names.spef

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
*SPEF "IEEE 1481-1998"
2+
*DESIGN "top"
3+
*DATE "Mon Jan 1 00:00:00 2026"
4+
*VENDOR "synthetic"
5+
*PROGRAM "spef_def_names"
6+
*VERSION "1.0"
7+
*DESIGN_FLOW "MISSING_NETS"
8+
*DIVIDER /
9+
*DELIMITER :
10+
*BUS_DELIMITER [ ]
11+
*T_UNIT 1.0 PS
12+
*C_UNIT 1.0 PF
13+
*R_UNIT 1.0 OHM
14+
*L_UNIT 1.0 HENRY
15+
16+
*PORTS
17+
in I
18+
out O
19+
20+
*D_NET in 0.300
21+
*CONN
22+
*P in I
23+
*I b_plain:A I *L .003
24+
*I cts\/leaf_buf:A I *L .003
25+
*I bus\[0\]:A I *L .003
26+
*CAP
27+
1 in 0.10
28+
2 b_plain:A 0.05
29+
3 cts\/leaf_buf:A 0.05
30+
4 bus\[0\]:A 0.05
31+
*RES
32+
5 in b_plain:A 50
33+
6 in cts\/leaf_buf:A 50
34+
7 in bus\[0\]:A 50
35+
*END
36+
37+
*D_NET n_plain 0.250
38+
*CONN
39+
*I b_plain:Z O
40+
*I b_sink_a:A I *L .003
41+
*CAP
42+
1 b_plain:Z 0.10
43+
2 b_sink_a:A 0.05
44+
*RES
45+
3 b_plain:Z b_sink_a:A 50
46+
*END
47+
48+
*D_NET cts\/leaf_net 0.250
49+
*CONN
50+
*I cts\/leaf_buf:Z O
51+
*I b_sink_b:A I *L .003
52+
*CAP
53+
1 cts\/leaf_buf:Z 0.10
54+
2 b_sink_b:A 0.05
55+
*RES
56+
3 cts\/leaf_buf:Z b_sink_b:A 50
57+
*END
58+
59+
*D_NET bus_n\[0\] 0.250
60+
*CONN
61+
*I bus\[0\]:Z O
62+
*I b_sink_c:A I *L .003
63+
*CAP
64+
1 bus\[0\]:Z 0.10
65+
2 b_sink_c:A 0.05
66+
*RES
67+
3 bus\[0\]:Z b_sink_c:A 50
68+
*END

src/dbSta/test/spef_def_names.tcl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Regression for SpefReader name-escape lookups when the netlist comes from
2+
# DEF rather than verilog. The DEF stores instance/net names verbatim with
3+
# literal '/' (post-CTS-style flat names) and '[]' (bus bits); the SPEF
4+
# follows the SPEF grammar and decorates those characters with backslash
5+
# escapes ('\/', '\[', '\]'). Without the SpefReader fallbacks, lookups for
6+
# the slash- and bracket-bearing names would all miss because:
7+
# * Network::findInstanceRelative splits at unescaped '/' -> hierarchy walk
8+
# finds no parent matching the pre-'/' segment, and
9+
# * dbNetwork's literal block_->find* expects the unescaped form actually
10+
# stored by the DEF reader.
11+
# Pass criterion: read_spef completes with no STA-1648/1650/1651 warnings.
12+
source "helpers.tcl"
13+
read_lef example1.lef
14+
read_liberty example1_slow.lib
15+
read_def spef_def_names.def
16+
read_spef spef_def_names.spef
17+
puts "spef_def_names: read_spef done"

0 commit comments

Comments
 (0)