pyedb 0.50.0__py3-none-any.whl → 0.51.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyedb might be problematic. Click here for more details.
- pyedb/__init__.py +1 -1
- pyedb/configuration/cfg_ports_sources.py +79 -239
- pyedb/configuration/configuration.py +27 -0
- pyedb/dotnet/clr_module.py +9 -3
- pyedb/dotnet/database/cell/hierarchy/component.py +3 -3
- pyedb/dotnet/database/cell/layout.py +10 -1
- pyedb/dotnet/database/dotnet/database.py +0 -2
- pyedb/dotnet/database/edb_data/padstacks_data.py +13 -0
- pyedb/dotnet/database/layout_validation.py +17 -13
- pyedb/dotnet/database/modeler.py +0 -1
- pyedb/dotnet/edb.py +7 -1
- pyedb/generic/design_types.py +183 -62
- pyedb/grpc/database/components.py +604 -652
- pyedb/grpc/database/control_file.py +597 -155
- pyedb/grpc/database/definition/component_def.py +17 -14
- pyedb/grpc/database/definition/materials.py +27 -27
- pyedb/grpc/database/definition/package_def.py +8 -8
- pyedb/grpc/database/definition/padstack_def.py +31 -33
- pyedb/grpc/database/definitions.py +36 -2
- pyedb/grpc/database/geometry/arc_data.py +5 -5
- pyedb/grpc/database/geometry/point_3d_data.py +3 -3
- pyedb/grpc/database/geometry/polygon_data.py +5 -5
- pyedb/grpc/database/hfss.py +412 -395
- pyedb/grpc/database/hierarchy/component.py +67 -58
- pyedb/grpc/database/hierarchy/pin_pair_model.py +6 -6
- pyedb/grpc/database/hierarchy/pingroup.py +13 -11
- pyedb/grpc/database/hierarchy/s_parameter_model.py +1 -1
- pyedb/grpc/database/hierarchy/spice_model.py +1 -1
- pyedb/grpc/database/layers/layer.py +2 -2
- pyedb/grpc/database/layers/stackup_layer.py +26 -23
- pyedb/grpc/database/layout/layout.py +12 -12
- pyedb/grpc/database/layout/voltage_regulator.py +8 -8
- pyedb/grpc/database/layout_validation.py +58 -7
- pyedb/grpc/database/modeler.py +248 -245
- pyedb/grpc/database/net/differential_pair.py +4 -4
- pyedb/grpc/database/net/extended_net.py +7 -8
- pyedb/grpc/database/net/net.py +57 -46
- pyedb/grpc/database/nets.py +362 -116
- pyedb/grpc/database/padstacks.py +259 -178
- pyedb/grpc/database/ports/ports.py +23 -17
- pyedb/grpc/database/primitive/padstack_instance.py +45 -30
- pyedb/grpc/database/primitive/path.py +6 -6
- pyedb/grpc/database/primitive/polygon.py +9 -9
- pyedb/grpc/database/primitive/primitive.py +21 -21
- pyedb/grpc/database/primitive/rectangle.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_settings_options.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +6 -6
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +2 -2
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +2 -2
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +1 -1
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +3 -3
- pyedb/grpc/database/siwave.py +226 -214
- pyedb/grpc/database/source_excitations.py +307 -40
- pyedb/grpc/database/stackup.py +461 -283
- pyedb/grpc/database/terminal/bundle_terminal.py +12 -12
- pyedb/grpc/database/terminal/edge_terminal.py +6 -5
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +13 -13
- pyedb/grpc/database/terminal/pingroup_terminal.py +12 -12
- pyedb/grpc/database/terminal/point_terminal.py +6 -6
- pyedb/grpc/database/terminal/terminal.py +26 -26
- pyedb/grpc/database/utility/heat_sink.py +5 -5
- pyedb/grpc/database/utility/hfss_extent_info.py +21 -21
- pyedb/grpc/database/utility/layout_statistics.py +13 -13
- pyedb/grpc/database/utility/rlc.py +3 -3
- pyedb/grpc/database/utility/sources.py +1 -1
- pyedb/grpc/database/utility/sweep_data_distribution.py +1 -1
- pyedb/grpc/edb.py +542 -739
- pyedb/grpc/edb_init.py +50 -3
- {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/METADATA +1 -1
- {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/RECORD +74 -75
- pyedb/grpc/database/utility/simulation_configuration.py +0 -3305
- {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/LICENSE +0 -0
- {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/WHEEL +0 -0
pyedb/grpc/database/nets.py
CHANGED
|
@@ -36,107 +36,244 @@ from pyedb.misc.utilities import compute_arc_points
|
|
|
36
36
|
class Nets(CommonNets):
|
|
37
37
|
"""Manages EDB methods for nets management accessible from `Edb.nets` property.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
Examples
|
|
40
|
+
--------
|
|
41
41
|
>>> from pyedb import Edb
|
|
42
|
-
|
|
43
|
-
>>>
|
|
42
|
+
|
|
43
|
+
>>> # Initialize EDB session
|
|
44
|
+
>>> edbapp = Edb(edbversion="2025.2")
|
|
45
|
+
|
|
46
|
+
>>> # Access Nets class
|
|
47
|
+
>>> nets = edbapp.nets
|
|
48
|
+
|
|
49
|
+
>>> # =================
|
|
50
|
+
>>> # Property examples
|
|
51
|
+
>>> # =================
|
|
52
|
+
|
|
53
|
+
>>> # Get all nets dictionary
|
|
54
|
+
>>> all_nets = nets.nets
|
|
55
|
+
>>> print("All nets:", list(all_nets.keys()))
|
|
56
|
+
|
|
57
|
+
>>> # Get net names list
|
|
58
|
+
>>> net_names = nets.netlist
|
|
59
|
+
>>> print("Net names:", net_names)
|
|
60
|
+
|
|
61
|
+
>>> # Get signal nets
|
|
62
|
+
>>> signal_nets = nets.signal
|
|
63
|
+
>>> print("Signal nets:", list(signal_nets.keys()))
|
|
64
|
+
|
|
65
|
+
>>> # Get power/ground nets
|
|
66
|
+
>>> power_nets = nets.power
|
|
67
|
+
>>> print("Power nets:", list(power_nets.keys()))
|
|
68
|
+
|
|
69
|
+
>>> # Get nets by components
|
|
70
|
+
>>> nets_by_comps = nets.nets_by_components
|
|
71
|
+
>>> print("Nets by components:", nets_by_comps)
|
|
72
|
+
|
|
73
|
+
>>> # Get components by nets
|
|
74
|
+
>>> comps_by_nets = nets.components_by_nets
|
|
75
|
+
>>> print("Components by nets:", comps_by_nets)
|
|
76
|
+
|
|
77
|
+
>>> # ===============
|
|
78
|
+
>>> # Method examples
|
|
79
|
+
>>> # ===============
|
|
80
|
+
|
|
81
|
+
>>> # Get net by name
|
|
82
|
+
>>> net_obj = nets["GND"]
|
|
83
|
+
>>> print(f"Net object: {net_obj.name}")
|
|
84
|
+
|
|
85
|
+
>>> # Check net existence
|
|
86
|
+
>>> if "PCIe_RX" in nets:
|
|
87
|
+
>>> print("PCIe_RX exists")
|
|
88
|
+
|
|
89
|
+
>>> # Identify eligible power nets
|
|
90
|
+
>>> eligible_pwr = nets.eligible_power_nets(threshold=0.25)
|
|
91
|
+
>>> print("Eligible power nets:", [net.name for net in eligible_pwr])
|
|
92
|
+
|
|
93
|
+
>>> # Generate extended nets (deprecated)
|
|
94
|
+
>>> nets.generate_extended_nets(
|
|
95
|
+
>>> resistor_below=5,
|
|
96
|
+
>>>inductor_below=0.5,
|
|
97
|
+
>>> capacitor_above=0.1
|
|
98
|
+
>>> )
|
|
99
|
+
|
|
100
|
+
>>> # Classify nets
|
|
101
|
+
>>> nets.classify_nets(
|
|
102
|
+
>>> power_nets=["VDD_CPU", "VDD_MEM"],
|
|
103
|
+
>>> signal_nets=["PCIe_TX", "ETH_RX"]
|
|
104
|
+
>>> )
|
|
105
|
+
|
|
106
|
+
>>> # Check power/ground status
|
|
107
|
+
>>> is_power = nets.is_power_gound_net(["VDD_CPU", "PCIe_TX"])
|
|
108
|
+
>>> print("Is power net:", is_power)
|
|
109
|
+
|
|
110
|
+
>>> # Get DC-connected nets
|
|
111
|
+
>>> dc_connected = nets.get_dcconnected_net_list(
|
|
112
|
+
>>> ground_nets=["GND"],
|
|
113
|
+
>>> res_value=0.002
|
|
114
|
+
>>> )
|
|
115
|
+
print("DC-connected nets:", dc_connected)
|
|
116
|
+
|
|
117
|
+
>>> # Get power tree
|
|
118
|
+
>>> comp_list, columns, net_group = nets.get_powertree(
|
|
119
|
+
>>> power_net_name="VDD_CPU",
|
|
120
|
+
>>> ground_nets=["GND"]
|
|
121
|
+
>>> )
|
|
122
|
+
>>> print("Power tree components:", comp_list)
|
|
123
|
+
|
|
124
|
+
>>> # Find net by name
|
|
125
|
+
>>> found_net = nets.get_net_by_name("PCIe_TX")
|
|
126
|
+
>>> print(f"Found net: {found_net.name}")
|
|
127
|
+
|
|
128
|
+
>>> # Delete nets
|
|
129
|
+
>>> deleted = nets.delete(["Unused_Net", "Test_Net"])
|
|
130
|
+
>>> print("Deleted nets:", deleted)
|
|
131
|
+
|
|
132
|
+
>>> # Find or create net
|
|
133
|
+
>>> new_net = nets.find_or_create_net(net_name="New_Net")
|
|
134
|
+
>>> print(f"Created net: {new_net.name}")
|
|
135
|
+
|
|
136
|
+
>>> # Check net-component association
|
|
137
|
+
>>> in_component = nets.is_net_in_component("U1", "VDD_CPU")
|
|
138
|
+
>>> print("Net in component:", in_component)
|
|
139
|
+
|
|
140
|
+
>>> # Find and fix disjoint nets (deprecated)
|
|
141
|
+
>>> fixed_nets = nets.find_and_fix_disjoint_nets(
|
|
142
|
+
>>> net_list=["PCIe_TX"],
|
|
143
|
+
>>> clean_disjoints_less_than=1e-6
|
|
144
|
+
>>> )
|
|
145
|
+
>>> print("Fixed nets:", fixed_nets)
|
|
146
|
+
|
|
147
|
+
>>> # Merge net polygons
|
|
148
|
+
>>> merged = nets.merge_nets_polygons(["VDD_CPU", "VDD_MEM"])
|
|
149
|
+
>>> print("Polygons merged:", merged)
|
|
150
|
+
|
|
151
|
+
# Close EDB session
|
|
152
|
+
>>> edbapp.close()
|
|
44
153
|
"""
|
|
45
154
|
|
|
46
155
|
def __getitem__(self, name):
|
|
47
|
-
"""Get
|
|
156
|
+
"""Get a net by name.
|
|
48
157
|
|
|
49
158
|
Parameters
|
|
50
159
|
----------
|
|
51
|
-
name : str
|
|
160
|
+
name : str
|
|
161
|
+
Name of the net to retrieve.
|
|
52
162
|
|
|
53
163
|
Returns
|
|
54
164
|
-------
|
|
55
|
-
|
|
165
|
+
pyedb.grpc.database.net.net.Net
|
|
166
|
+
Net object if found, otherwise None.
|
|
56
167
|
|
|
168
|
+
Examples
|
|
169
|
+
--------
|
|
170
|
+
>>> gnd_net = edb_nets["GND"]
|
|
171
|
+
>>> print(gnd_net.name)
|
|
57
172
|
"""
|
|
58
173
|
return Net(self._pedb, Net.find_by_name(self._active_layout, name))
|
|
59
174
|
|
|
60
175
|
def __contains__(self, name):
|
|
61
|
-
"""
|
|
176
|
+
"""Check if a net exists in the layout.
|
|
62
177
|
|
|
63
178
|
Parameters
|
|
64
179
|
----------
|
|
65
180
|
name : str
|
|
181
|
+
Name of the net to check.
|
|
66
182
|
|
|
67
183
|
Returns
|
|
68
184
|
-------
|
|
69
185
|
bool
|
|
70
|
-
|
|
186
|
+
True if the net exists, False otherwise.
|
|
71
187
|
|
|
188
|
+
Examples
|
|
189
|
+
--------
|
|
190
|
+
>>> if "PCIe_RX" in edb_nets:
|
|
191
|
+
>>> print("Net exists")
|
|
72
192
|
"""
|
|
73
193
|
return name in self.nets
|
|
74
194
|
|
|
75
195
|
def __init__(self, p_edb):
|
|
196
|
+
"""Initialize the Nets class."""
|
|
76
197
|
CommonNets.__init__(self, p_edb)
|
|
77
198
|
self._nets_by_comp_dict = {}
|
|
78
199
|
self._comps_by_nets_dict = {}
|
|
79
200
|
|
|
80
201
|
@property
|
|
81
202
|
def _edb(self):
|
|
82
|
-
""" """
|
|
203
|
+
"""EDB object."""
|
|
83
204
|
return self._pedb
|
|
84
205
|
|
|
85
206
|
@property
|
|
86
207
|
def _active_layout(self):
|
|
87
|
-
""" """
|
|
208
|
+
"""Active layout."""
|
|
88
209
|
return self._pedb.active_layout
|
|
89
210
|
|
|
90
211
|
@property
|
|
91
212
|
def _layout(self):
|
|
92
|
-
""" """
|
|
213
|
+
"""Current layout."""
|
|
93
214
|
return self._pedb.layout
|
|
94
215
|
|
|
95
216
|
@property
|
|
96
217
|
def _cell(self):
|
|
97
|
-
""" """
|
|
218
|
+
"""Current cell."""
|
|
98
219
|
return self._pedb.cell
|
|
99
220
|
|
|
100
221
|
@property
|
|
101
222
|
def db(self):
|
|
102
|
-
"""
|
|
223
|
+
"""Database object."""
|
|
103
224
|
return self._pedb.active_db
|
|
104
225
|
|
|
105
226
|
@property
|
|
106
227
|
def _logger(self):
|
|
107
|
-
"""
|
|
228
|
+
"""Logger instance."""
|
|
108
229
|
return self._pedb.logger
|
|
109
230
|
|
|
110
231
|
@property
|
|
111
232
|
def nets(self):
|
|
112
|
-
"""
|
|
233
|
+
"""All nets in the layout.
|
|
113
234
|
|
|
114
235
|
Returns
|
|
115
236
|
-------
|
|
116
|
-
dict[str,
|
|
117
|
-
Dictionary of
|
|
237
|
+
dict[str, pyedb.grpc.database.net.net.Net]
|
|
238
|
+
Dictionary of net names to Net objects.
|
|
239
|
+
|
|
240
|
+
Examples
|
|
241
|
+
--------
|
|
242
|
+
>>> all_nets = edb_nets.nets
|
|
243
|
+
>>> for net_name, net_obj in all_nets.items():
|
|
244
|
+
... print(net_name, net_obj.is_power_ground)
|
|
118
245
|
"""
|
|
119
246
|
return {i.name: i for i in self._pedb.layout.nets}
|
|
120
247
|
|
|
121
248
|
@property
|
|
122
249
|
def netlist(self):
|
|
123
|
-
"""
|
|
250
|
+
"""List of all net names.
|
|
124
251
|
|
|
125
252
|
Returns
|
|
126
253
|
-------
|
|
127
|
-
list
|
|
128
|
-
|
|
254
|
+
list[str]
|
|
255
|
+
Names of all nets in the layout.
|
|
256
|
+
|
|
257
|
+
Examples
|
|
258
|
+
--------
|
|
259
|
+
>>> net_names = edb_nets.netlist
|
|
260
|
+
>>> print("Total nets:", len(net_names))
|
|
129
261
|
"""
|
|
130
262
|
return list(self.nets.keys())
|
|
131
263
|
|
|
132
264
|
@property
|
|
133
265
|
def signal(self):
|
|
134
|
-
"""Signal nets.
|
|
266
|
+
"""Signal nets in the layout.
|
|
135
267
|
|
|
136
268
|
Returns
|
|
137
269
|
-------
|
|
138
|
-
dict[str,
|
|
139
|
-
Dictionary of signal
|
|
270
|
+
dict[str, pyedb.grpc.database.net.net.Net]
|
|
271
|
+
Dictionary of signal net names to Net objects.
|
|
272
|
+
|
|
273
|
+
Examples
|
|
274
|
+
--------
|
|
275
|
+
>>> signal_nets = edb_nets.signal
|
|
276
|
+
>>> print("Signal nets:", list(signal_nets.keys()))
|
|
140
277
|
"""
|
|
141
278
|
nets = {}
|
|
142
279
|
for net, value in self.nets.items():
|
|
@@ -146,12 +283,17 @@ class Nets(CommonNets):
|
|
|
146
283
|
|
|
147
284
|
@property
|
|
148
285
|
def power(self):
|
|
149
|
-
"""Power nets.
|
|
286
|
+
"""Power and ground nets in the layout.
|
|
150
287
|
|
|
151
288
|
Returns
|
|
152
289
|
-------
|
|
153
|
-
dict[str,
|
|
154
|
-
Dictionary of power
|
|
290
|
+
dict[str, pyedb.grpc.database.net.net.Net]
|
|
291
|
+
Dictionary of power/ground net names to Net objects.
|
|
292
|
+
|
|
293
|
+
Examples
|
|
294
|
+
--------
|
|
295
|
+
>>> power_nets = edb_nets.power
|
|
296
|
+
>>> print("Power nets:", list(power_nets.keys()))
|
|
155
297
|
"""
|
|
156
298
|
nets = {}
|
|
157
299
|
for net, value in self.nets.items():
|
|
@@ -160,17 +302,25 @@ class Nets(CommonNets):
|
|
|
160
302
|
return nets
|
|
161
303
|
|
|
162
304
|
def eligible_power_nets(self, threshold=0.3):
|
|
163
|
-
"""
|
|
164
|
-
|
|
305
|
+
"""Identify nets eligible for power/ground classification based on area ratio.
|
|
306
|
+
|
|
307
|
+
Uses the same algorithm implemented in SIwave.
|
|
165
308
|
|
|
166
309
|
Parameters
|
|
167
310
|
----------
|
|
168
311
|
threshold : float, optional
|
|
169
|
-
|
|
312
|
+
Area ratio threshold. Nets with plane area ratio above this value are
|
|
313
|
+
considered power/ground nets.
|
|
170
314
|
|
|
171
315
|
Returns
|
|
172
316
|
-------
|
|
173
|
-
list
|
|
317
|
+
list[pyedb.grpc.database.net.net.Net]
|
|
318
|
+
List of nets eligible as power/ground nets.
|
|
319
|
+
|
|
320
|
+
Examples
|
|
321
|
+
--------
|
|
322
|
+
>>> eligible_pwr = edb_nets.eligible_power_nets(threshold=0.25)
|
|
323
|
+
>>> print([net.name for net in eligible_pwr])
|
|
174
324
|
"""
|
|
175
325
|
pwr_gnd_nets = []
|
|
176
326
|
for net in self._layout.nets[:]:
|
|
@@ -194,16 +344,36 @@ class Nets(CommonNets):
|
|
|
194
344
|
|
|
195
345
|
@property
|
|
196
346
|
def nets_by_components(self):
|
|
197
|
-
|
|
198
|
-
|
|
347
|
+
"""Mapping of components to their associated nets.
|
|
348
|
+
|
|
349
|
+
Returns
|
|
350
|
+
-------
|
|
351
|
+
dict[str, list[str]]
|
|
352
|
+
Dictionary mapping component names to list of net names.
|
|
353
|
+
|
|
354
|
+
Examples
|
|
355
|
+
--------
|
|
356
|
+
>>> nets_by_comps = edb_nets.nets_by_components
|
|
357
|
+
>>> print("U1 nets:", nets_by_comps.get("U1", []))
|
|
358
|
+
"""
|
|
199
359
|
for comp, i in self._pedb.components.instances.items():
|
|
200
360
|
self._nets_by_comp_dict[comp] = i.nets
|
|
201
361
|
return self._nets_by_comp_dict
|
|
202
362
|
|
|
203
363
|
@property
|
|
204
364
|
def components_by_nets(self):
|
|
205
|
-
|
|
206
|
-
|
|
365
|
+
"""Mapping of nets to their associated components.
|
|
366
|
+
|
|
367
|
+
Returns
|
|
368
|
+
-------
|
|
369
|
+
dict[str, list[str]]
|
|
370
|
+
Dictionary mapping net names to list of component names.
|
|
371
|
+
|
|
372
|
+
Examples
|
|
373
|
+
--------
|
|
374
|
+
>>> comps_by_nets = edb_nets.components_by_nets
|
|
375
|
+
>>> print("Components on GND:", comps_by_nets.get("GND", []))
|
|
376
|
+
"""
|
|
207
377
|
for comp, i in self._pedb.components.instances.items():
|
|
208
378
|
for n in i.nets:
|
|
209
379
|
if n in self._comps_by_nets_dict:
|
|
@@ -221,40 +391,38 @@ class Nets(CommonNets):
|
|
|
221
391
|
include_signal=True,
|
|
222
392
|
include_power=True,
|
|
223
393
|
):
|
|
224
|
-
|
|
225
|
-
"""Get extended net and associated components.
|
|
394
|
+
"""Generate extended nets based on component thresholds.
|
|
226
395
|
|
|
227
|
-
|
|
228
|
-
|
|
396
|
+
.. deprecated:: pyedb 0.30.0
|
|
397
|
+
Use :func:`pyedb.grpc.extended_nets.generate_extended_nets` instead.
|
|
229
398
|
|
|
230
399
|
Parameters
|
|
231
400
|
----------
|
|
232
|
-
resistor_below : int
|
|
233
|
-
|
|
234
|
-
inductor_below : int
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
Threshold of capacitor value. Search extended net across capacitors which has value higher than the
|
|
239
|
-
threshold.
|
|
401
|
+
resistor_below : int | float, optional
|
|
402
|
+
Resistor threshold value. Components below this value are considered.
|
|
403
|
+
inductor_below : int | float, optional
|
|
404
|
+
Inductor threshold value. Components below this value are considered.
|
|
405
|
+
capacitor_above : int | float, optional
|
|
406
|
+
Capacitor threshold value. Components above this value are considered.
|
|
240
407
|
exception_list : list, optional
|
|
241
|
-
List of components to bypass
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
Whether to generate extended power nets. The default is ``True``.
|
|
408
|
+
List of components to bypass during threshold checks.
|
|
409
|
+
include_signal : bool, optional
|
|
410
|
+
Whether to include signal nets in extended net generation.
|
|
411
|
+
include_power : bool, optional
|
|
412
|
+
Whether to include power nets in extended net generation.
|
|
247
413
|
|
|
248
414
|
Returns
|
|
249
415
|
-------
|
|
250
416
|
list
|
|
251
|
-
List of
|
|
417
|
+
List of generated extended nets.
|
|
252
418
|
|
|
253
419
|
Examples
|
|
254
420
|
--------
|
|
255
|
-
>>>
|
|
256
|
-
|
|
257
|
-
|
|
421
|
+
>>> edb_nets.generate_extended_nets(
|
|
422
|
+
... resistor_below=5,
|
|
423
|
+
... inductor_below=0.5,
|
|
424
|
+
... capacitor_above=0.1
|
|
425
|
+
... )
|
|
258
426
|
"""
|
|
259
427
|
warnings.warn("Use new method :func:`edb.extended_nets.generate_extended_nets` instead.", DeprecationWarning)
|
|
260
428
|
self._pedb.extended_nets.generate_extended_nets(
|
|
@@ -262,9 +430,18 @@ class Nets(CommonNets):
|
|
|
262
430
|
)
|
|
263
431
|
|
|
264
432
|
@staticmethod
|
|
265
|
-
def _get_points_for_plot(
|
|
266
|
-
"""
|
|
267
|
-
|
|
433
|
+
def _get_points_for_plot(my_net_points):
|
|
434
|
+
"""Get points for plotting.
|
|
435
|
+
|
|
436
|
+
Parameters
|
|
437
|
+
----------
|
|
438
|
+
my_net_points : list
|
|
439
|
+
List of points defining the net.
|
|
440
|
+
|
|
441
|
+
Returns
|
|
442
|
+
-------
|
|
443
|
+
tuple
|
|
444
|
+
X and Y coordinates of the points.
|
|
268
445
|
"""
|
|
269
446
|
# fmt: off
|
|
270
447
|
x = []
|
|
@@ -288,19 +465,26 @@ class Nets(CommonNets):
|
|
|
288
465
|
return x, y
|
|
289
466
|
|
|
290
467
|
def classify_nets(self, power_nets=None, signal_nets=None):
|
|
291
|
-
"""Reassign power/ground or signal
|
|
468
|
+
"""Reassign net classifications as power/ground or signal.
|
|
292
469
|
|
|
293
470
|
Parameters
|
|
294
471
|
----------
|
|
295
|
-
power_nets : str
|
|
296
|
-
|
|
297
|
-
signal_nets : str
|
|
298
|
-
|
|
472
|
+
power_nets : str | list[str], optional
|
|
473
|
+
Nets to classify as power/ground.
|
|
474
|
+
signal_nets : str | list[str], optional
|
|
475
|
+
Nets to classify as signal.
|
|
299
476
|
|
|
300
477
|
Returns
|
|
301
478
|
-------
|
|
302
479
|
bool
|
|
303
|
-
|
|
480
|
+
True if successful, False otherwise.
|
|
481
|
+
|
|
482
|
+
Examples
|
|
483
|
+
--------
|
|
484
|
+
>>> edb_nets.classify_nets(
|
|
485
|
+
... power_nets=["VDD_CPU", "VDD_MEM"],
|
|
486
|
+
... signal_nets=["PCIe_TX", "ETH_RX"]
|
|
487
|
+
... )
|
|
304
488
|
"""
|
|
305
489
|
if isinstance(power_nets, str):
|
|
306
490
|
power_nets = []
|
|
@@ -319,17 +503,22 @@ class Nets(CommonNets):
|
|
|
319
503
|
return True
|
|
320
504
|
|
|
321
505
|
def is_power_gound_net(self, netname_list):
|
|
322
|
-
"""
|
|
506
|
+
"""Check if any net in a list is a power/ground net.
|
|
323
507
|
|
|
324
508
|
Parameters
|
|
325
509
|
----------
|
|
326
|
-
netname_list : list
|
|
327
|
-
|
|
510
|
+
netname_list : str | list[str]
|
|
511
|
+
Net name or list of net names to check.
|
|
328
512
|
|
|
329
513
|
Returns
|
|
330
514
|
-------
|
|
331
515
|
bool
|
|
332
|
-
|
|
516
|
+
True if any net is power/ground, False otherwise.
|
|
517
|
+
|
|
518
|
+
Examples
|
|
519
|
+
--------
|
|
520
|
+
>>> is_power = edb_nets.is_power_gound_net(["VDD_CPU", "PCIe_TX"])
|
|
521
|
+
>>> print("Contains power net:", is_power)
|
|
333
522
|
"""
|
|
334
523
|
if isinstance(netname_list, str):
|
|
335
524
|
netname_list = [netname_list]
|
|
@@ -340,20 +529,28 @@ class Nets(CommonNets):
|
|
|
340
529
|
return False
|
|
341
530
|
|
|
342
531
|
def get_dcconnected_net_list(self, ground_nets=["GND"], res_value=0.001):
|
|
343
|
-
"""Get
|
|
344
|
-
|
|
345
|
-
.. note::
|
|
346
|
-
Only inductors are considered.
|
|
532
|
+
"""Get nets connected to DC through inductors and low-value resistors.
|
|
347
533
|
|
|
348
534
|
Parameters
|
|
349
535
|
----------
|
|
350
|
-
ground_nets :
|
|
351
|
-
|
|
536
|
+
ground_nets : tuple, optional
|
|
537
|
+
Ground net names. Default is ("GND",).
|
|
538
|
+
res_value : float, optional
|
|
539
|
+
Resistance threshold value. Default is 0.001 ohms.
|
|
352
540
|
|
|
353
541
|
Returns
|
|
354
542
|
-------
|
|
355
|
-
list
|
|
356
|
-
List of
|
|
543
|
+
list[set]
|
|
544
|
+
List of sets of connected nets.
|
|
545
|
+
|
|
546
|
+
Examples
|
|
547
|
+
--------
|
|
548
|
+
>>> dc_connected = edb_nets.get_dcconnected_net_list(
|
|
549
|
+
... ground_nets=["GND"],
|
|
550
|
+
... res_value=0.002
|
|
551
|
+
... )
|
|
552
|
+
>>> for net_group in dc_connected:
|
|
553
|
+
... print("Connected nets:", net_group)
|
|
357
554
|
"""
|
|
358
555
|
temp_list = []
|
|
359
556
|
for _, comp_obj in self._pedb.components.inductors.items():
|
|
@@ -390,18 +587,27 @@ class Nets(CommonNets):
|
|
|
390
587
|
return dcconnected_net_list
|
|
391
588
|
|
|
392
589
|
def get_powertree(self, power_net_name, ground_nets):
|
|
393
|
-
"""Retrieve
|
|
590
|
+
"""Retrieve power tree for a given power net.
|
|
394
591
|
|
|
395
592
|
Parameters
|
|
396
593
|
----------
|
|
397
594
|
power_net_name : str
|
|
398
595
|
Name of the power net.
|
|
399
|
-
ground_nets :
|
|
400
|
-
|
|
596
|
+
ground_nets : list
|
|
597
|
+
List of ground net names.
|
|
401
598
|
|
|
402
599
|
Returns
|
|
403
600
|
-------
|
|
601
|
+
tuple
|
|
602
|
+
(component_list, component_list_columns, net_group)
|
|
404
603
|
|
|
604
|
+
Examples
|
|
605
|
+
--------
|
|
606
|
+
>>> comp_list, columns, net_group = edb_nets.get_powertree(
|
|
607
|
+
... power_net_name="VDD_CPU",
|
|
608
|
+
... ground_nets=["GND"]
|
|
609
|
+
... )
|
|
610
|
+
>>> print("Power tree components:", comp_list)
|
|
405
611
|
"""
|
|
406
612
|
flag_in_ng = False
|
|
407
613
|
net_group = []
|
|
@@ -449,27 +655,43 @@ class Nets(CommonNets):
|
|
|
449
655
|
return component_list, component_list_columns, net_group
|
|
450
656
|
|
|
451
657
|
def get_net_by_name(self, net_name):
|
|
452
|
-
"""Find a net by name.
|
|
658
|
+
"""Find a net by name.
|
|
659
|
+
|
|
660
|
+
Parameters
|
|
661
|
+
----------
|
|
662
|
+
net_name : str
|
|
663
|
+
Name of the net to find.
|
|
664
|
+
|
|
665
|
+
Returns
|
|
666
|
+
-------
|
|
667
|
+
pyedb.grpc.database.net.net.Net
|
|
668
|
+
Net object if found, otherwise None.
|
|
669
|
+
|
|
670
|
+
Examples
|
|
671
|
+
--------
|
|
672
|
+
>>> found_net = edb_nets.get_net_by_name("PCIe_TX")
|
|
673
|
+
>>> if found_net:
|
|
674
|
+
... print("Net found:", found_net.name)
|
|
675
|
+
"""
|
|
453
676
|
edb_net = Net.find_by_name(self._active_layout, net_name)
|
|
454
677
|
if edb_net is not None:
|
|
455
678
|
return edb_net
|
|
456
679
|
|
|
457
680
|
def delete(self, netlist):
|
|
458
|
-
"""Delete one or more nets from
|
|
681
|
+
"""Delete one or more nets from the layout.
|
|
459
682
|
|
|
460
683
|
Parameters
|
|
461
684
|
----------
|
|
462
|
-
netlist : str
|
|
463
|
-
|
|
685
|
+
netlist : str | list[str]
|
|
686
|
+
Net name or list of net names to delete.
|
|
464
687
|
|
|
465
688
|
Returns
|
|
466
689
|
-------
|
|
467
|
-
list
|
|
468
|
-
|
|
690
|
+
list[str]
|
|
691
|
+
Names of nets that were deleted.
|
|
469
692
|
|
|
470
693
|
Examples
|
|
471
694
|
--------
|
|
472
|
-
|
|
473
695
|
>>> deleted_nets = database.nets.delete(["Net1","Net2"])
|
|
474
696
|
"""
|
|
475
697
|
if isinstance(netlist, str):
|
|
@@ -487,26 +709,37 @@ class Nets(CommonNets):
|
|
|
487
709
|
return nets_deleted
|
|
488
710
|
|
|
489
711
|
def find_or_create_net(self, net_name="", start_with="", contain="", end_with=""):
|
|
490
|
-
"""Find or create
|
|
712
|
+
"""Find or create a net based on given criteria.
|
|
491
713
|
|
|
492
714
|
Parameters
|
|
493
715
|
----------
|
|
494
716
|
net_name : str, optional
|
|
495
|
-
|
|
496
|
-
|
|
717
|
+
Exact name of the net to find or create.
|
|
497
718
|
start_with : str, optional
|
|
498
|
-
|
|
499
|
-
|
|
719
|
+
Find nets starting with this string.
|
|
500
720
|
contain : str, optional
|
|
501
|
-
|
|
502
|
-
|
|
721
|
+
Find nets containing this string.
|
|
503
722
|
end_with : str, optional
|
|
504
|
-
|
|
723
|
+
Find nets ending with this string.
|
|
505
724
|
|
|
506
725
|
Returns
|
|
507
726
|
-------
|
|
508
|
-
|
|
509
|
-
Net
|
|
727
|
+
pyedb.grpc.database.net.net.Net | list[pyedb.grpc.database.net.net.Net]
|
|
728
|
+
Net object or list of matching net objects.
|
|
729
|
+
|
|
730
|
+
Examples
|
|
731
|
+
--------
|
|
732
|
+
>>> # Create new net
|
|
733
|
+
>>> new_net = edb_nets.find_or_create_net(net_name="New_Net")
|
|
734
|
+
>>>
|
|
735
|
+
>>> # Find existing net
|
|
736
|
+
>>> existing_net = edb_nets.find_or_create_net(net_name="GND")
|
|
737
|
+
>>>
|
|
738
|
+
>>> # Find nets starting with "VDD"
|
|
739
|
+
>>> vdd_nets = edb_nets.find_or_create_net(start_with="VDD")
|
|
740
|
+
>>>
|
|
741
|
+
>>> # Find nets ending with "_P"
|
|
742
|
+
>>> pos_nets = edb_nets.find_or_create_net(end_with="_P")
|
|
510
743
|
"""
|
|
511
744
|
if not net_name and not start_with and not contain and not end_with:
|
|
512
745
|
net_name = generate_unique_name("NET_")
|
|
@@ -569,8 +802,12 @@ class Nets(CommonNets):
|
|
|
569
802
|
Returns
|
|
570
803
|
-------
|
|
571
804
|
bool
|
|
572
|
-
|
|
805
|
+
True if the net is found in the component, False otherwise.
|
|
573
806
|
|
|
807
|
+
Examples
|
|
808
|
+
--------
|
|
809
|
+
>>> in_component = edb_nets.is_net_in_component("U1", "VDD_CPU")
|
|
810
|
+
>>> print("Net in component:", in_component)
|
|
574
811
|
"""
|
|
575
812
|
if component_name not in self._pedb.components.instances:
|
|
576
813
|
return False
|
|
@@ -582,51 +819,60 @@ class Nets(CommonNets):
|
|
|
582
819
|
def find_and_fix_disjoint_nets(
|
|
583
820
|
self, net_list=None, keep_only_main_net=False, clean_disjoints_less_than=0.0, order_by_area=False
|
|
584
821
|
):
|
|
585
|
-
"""Find and fix disjoint nets
|
|
822
|
+
"""Find and fix disjoint nets.
|
|
586
823
|
|
|
587
|
-
.. deprecated::
|
|
588
|
-
|
|
824
|
+
.. deprecated:: pyedb 0.30.0
|
|
825
|
+
Use :func:`edb.layout_validation.disjoint_nets` instead.
|
|
589
826
|
|
|
590
827
|
Parameters
|
|
591
828
|
----------
|
|
592
|
-
net_list : str,
|
|
593
|
-
List of nets
|
|
829
|
+
net_list : list[str], optional
|
|
830
|
+
List of nets to check. Checks all nets if None.
|
|
594
831
|
keep_only_main_net : bool, optional
|
|
595
|
-
|
|
596
|
-
clean_disjoints_less_than :
|
|
597
|
-
Clean
|
|
832
|
+
Keep only the main net segment if True.
|
|
833
|
+
clean_disjoints_less_than : float, optional
|
|
834
|
+
Clean disjoint nets smaller than this area (in m²).
|
|
598
835
|
order_by_area : bool, optional
|
|
599
|
-
|
|
600
|
-
Default is ``False``.
|
|
836
|
+
Order naming by area instead of object count.
|
|
601
837
|
|
|
602
838
|
Returns
|
|
603
839
|
-------
|
|
604
|
-
|
|
840
|
+
list
|
|
841
|
+
New ne
|
|
842
|
+
|
|
605
843
|
New nets created.
|
|
606
844
|
|
|
607
845
|
Examples
|
|
608
846
|
--------
|
|
609
|
-
|
|
610
|
-
|
|
847
|
+
>>> fixed_nets = edb_nets.find_and_fix_disjoint_nets(
|
|
848
|
+
... net_list=["PCIe_TX"],
|
|
849
|
+
... clean_disjoints_less_than=1e-6
|
|
850
|
+
... )
|
|
851
|
+
>>> print("Fixed nets:", fixed_nets)
|
|
611
852
|
"""
|
|
853
|
+
|
|
612
854
|
warnings.warn("Use new function :func:`edb.layout_validation.disjoint_nets` instead.", DeprecationWarning)
|
|
613
855
|
return self._pedb.layout_validation.disjoint_nets(
|
|
614
856
|
net_list, keep_only_main_net, clean_disjoints_less_than, order_by_area
|
|
615
857
|
)
|
|
616
858
|
|
|
617
859
|
def merge_nets_polygons(self, net_names_list):
|
|
618
|
-
"""
|
|
860
|
+
"""Merge polygons for specified nets on each layer.
|
|
619
861
|
|
|
620
862
|
Parameters
|
|
621
863
|
----------
|
|
622
|
-
net_names_list : str
|
|
623
|
-
Net name
|
|
864
|
+
net_names_list : str | list[str]
|
|
865
|
+
Net name or list of net names.
|
|
624
866
|
|
|
625
867
|
Returns
|
|
626
868
|
-------
|
|
627
869
|
bool
|
|
628
|
-
|
|
870
|
+
True if successful, False otherwise.
|
|
629
871
|
|
|
872
|
+
Examples
|
|
873
|
+
--------
|
|
874
|
+
>>> merged = edb_nets.merge_nets_polygons(["VDD_CPU", "VDD_MEM"])
|
|
875
|
+
>>> print("Merge successful:", merged)
|
|
630
876
|
"""
|
|
631
877
|
if isinstance(net_names_list, str):
|
|
632
878
|
net_names_list = [net_names_list]
|