pyedb 0.50.0__py3-none-any.whl → 0.50.1__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/dotnet/database/cell/hierarchy/component.py +3 -3
- pyedb/dotnet/database/edb_data/padstacks_data.py +13 -0
- pyedb/grpc/database/components.py +494 -652
- pyedb/grpc/database/control_file.py +458 -149
- 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/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 +397 -395
- pyedb/grpc/database/hierarchy/component.py +58 -57
- 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/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 +139 -122
- pyedb/grpc/database/padstacks.py +174 -190
- 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 +166 -214
- pyedb/grpc/database/stackup.py +365 -292
- 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 +422 -672
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/METADATA +1 -1
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/RECORD +61 -62
- pyedb/grpc/database/utility/simulation_configuration.py +0 -3305
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/LICENSE +0 -0
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/WHEEL +0 -0
|
@@ -61,18 +61,17 @@ from pyedb.modeler.geometry_operators import GeometryOperators
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
def resistor_value_parser(r_value) -> float:
|
|
64
|
-
"""Convert a resistor value.
|
|
64
|
+
"""Convert a resistor value to float.
|
|
65
65
|
|
|
66
66
|
Parameters
|
|
67
67
|
----------
|
|
68
|
-
r_value : float
|
|
69
|
-
Resistor value.
|
|
68
|
+
r_value : float or str
|
|
69
|
+
Resistor value to convert.
|
|
70
70
|
|
|
71
71
|
Returns
|
|
72
72
|
-------
|
|
73
73
|
float
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
Converted resistor value.
|
|
76
75
|
"""
|
|
77
76
|
if isinstance(r_value, str):
|
|
78
77
|
r_value = r_value.replace(" ", "")
|
|
@@ -87,11 +86,12 @@ def resistor_value_parser(r_value) -> float:
|
|
|
87
86
|
|
|
88
87
|
|
|
89
88
|
class Components(object):
|
|
90
|
-
"""Manages EDB components and related
|
|
89
|
+
"""Manages EDB components and related methods accessible from `Edb.components`.
|
|
91
90
|
|
|
92
91
|
Parameters
|
|
93
92
|
----------
|
|
94
|
-
|
|
93
|
+
p_edb : :class:`pyedb.grpc.edb.Edb`
|
|
94
|
+
EDB object.
|
|
95
95
|
|
|
96
96
|
Examples
|
|
97
97
|
--------
|
|
@@ -101,16 +101,22 @@ class Components(object):
|
|
|
101
101
|
"""
|
|
102
102
|
|
|
103
103
|
def __getitem__(self, name):
|
|
104
|
-
"""Get
|
|
104
|
+
"""Get a component or component definition by name.
|
|
105
105
|
|
|
106
106
|
Parameters
|
|
107
107
|
----------
|
|
108
108
|
name : str
|
|
109
|
+
Name of the component or definition.
|
|
109
110
|
|
|
110
111
|
Returns
|
|
111
112
|
-------
|
|
112
|
-
:class:`pyedb.
|
|
113
|
+
:class:`pyedb.grpc.database.hierarchy.component.Component` or
|
|
114
|
+
:class:`pyedb.grpc.database.definition.component_def.ComponentDef` or None
|
|
115
|
+
Component instance if found, component definition if found by name, otherwise None.
|
|
113
116
|
|
|
117
|
+
Examples
|
|
118
|
+
--------
|
|
119
|
+
>>> component = edbapp.components["R1"]
|
|
114
120
|
"""
|
|
115
121
|
if name in self.instances:
|
|
116
122
|
return self.instances[name]
|
|
@@ -125,69 +131,119 @@ class Components(object):
|
|
|
125
131
|
self._pins = {}
|
|
126
132
|
self._comps_by_part = {}
|
|
127
133
|
self._padstack = Padstacks(self._pedb)
|
|
128
|
-
# self._excitations = self._pedb.excitations
|
|
129
134
|
|
|
130
135
|
@property
|
|
131
136
|
def _logger(self):
|
|
132
|
-
"""Logger.
|
|
137
|
+
"""Logger instance for the component manager.
|
|
138
|
+
|
|
139
|
+
Returns
|
|
140
|
+
-------
|
|
141
|
+
:class:`logging.Logger`
|
|
142
|
+
Logger instance.
|
|
143
|
+
"""
|
|
133
144
|
return self._pedb.logger
|
|
134
145
|
|
|
135
146
|
@property
|
|
136
147
|
def _active_layout(self):
|
|
148
|
+
"""Active layout of the EDB database.
|
|
149
|
+
|
|
150
|
+
Returns
|
|
151
|
+
-------
|
|
152
|
+
:class:`ansys.edb.core.layout.Layout`
|
|
153
|
+
Active layout object.
|
|
154
|
+
"""
|
|
137
155
|
return self._pedb.active_layout
|
|
138
156
|
|
|
139
157
|
@property
|
|
140
158
|
def _layout(self):
|
|
159
|
+
"""Layout of the EDB database.
|
|
160
|
+
|
|
161
|
+
Returns
|
|
162
|
+
-------
|
|
163
|
+
:class:`ansys.edb.core.layout.Layout`
|
|
164
|
+
Layout object.
|
|
165
|
+
"""
|
|
141
166
|
return self._pedb.layout
|
|
142
167
|
|
|
143
168
|
@property
|
|
144
169
|
def _cell(self):
|
|
170
|
+
"""Cell of the EDB database.
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
:class:`ansys.edb.core.layout.Cell`
|
|
175
|
+
Cell object.
|
|
176
|
+
"""
|
|
145
177
|
return self._pedb.cell
|
|
146
178
|
|
|
147
179
|
@property
|
|
148
180
|
def _db(self):
|
|
181
|
+
"""Active database.
|
|
182
|
+
|
|
183
|
+
Returns
|
|
184
|
+
-------
|
|
185
|
+
:class:`ansys.edb.core.database.Database`
|
|
186
|
+
Active database object.
|
|
187
|
+
"""
|
|
149
188
|
return self._pedb.active_db
|
|
150
189
|
|
|
151
190
|
@property
|
|
152
191
|
def instances(self) -> dict[str, Component]:
|
|
153
|
-
"""
|
|
192
|
+
"""Dictionary of all component instances in the layout.
|
|
154
193
|
|
|
155
194
|
Returns
|
|
156
195
|
-------
|
|
157
|
-
|
|
158
|
-
|
|
196
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
197
|
+
Dictionary of component instances keyed by name.
|
|
159
198
|
|
|
160
199
|
Examples
|
|
161
200
|
--------
|
|
162
|
-
|
|
163
|
-
>>> from pyedb import Edb
|
|
164
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
165
201
|
>>> edbapp.components.instances
|
|
166
|
-
|
|
167
202
|
"""
|
|
168
203
|
return self._cmp
|
|
169
204
|
|
|
170
205
|
@property
|
|
171
206
|
def definitions(self) -> dict[str, ComponentDef]:
|
|
172
|
-
"""
|
|
207
|
+
"""Dictionary of all component definitions.
|
|
173
208
|
|
|
174
209
|
Returns
|
|
175
210
|
-------
|
|
176
|
-
dict
|
|
211
|
+
dict[str, :class:`pyedb.grpc.database.definition.component_def.ComponentDef`]
|
|
212
|
+
Dictionary of component definitions keyed by name.
|
|
213
|
+
|
|
214
|
+
Examples
|
|
215
|
+
--------
|
|
216
|
+
>>> edbapp.components.definitions
|
|
217
|
+
"""
|
|
177
218
|
return {l.name: ComponentDef(self._pedb, l) for l in self._pedb.component_defs}
|
|
178
219
|
|
|
179
220
|
@property
|
|
180
221
|
def nport_comp_definition(self) -> dict[str, Component]:
|
|
181
|
-
"""
|
|
222
|
+
"""Dictionary of N-port component definitions.
|
|
223
|
+
|
|
224
|
+
Returns
|
|
225
|
+
-------
|
|
226
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
227
|
+
Dictionary of N-port component definitions keyed by name.
|
|
228
|
+
"""
|
|
182
229
|
return {name: l for name, l in self.definitions.items() if l.reference_file}
|
|
183
230
|
|
|
184
231
|
def import_definition(self, file_path) -> bool:
|
|
185
|
-
"""Import component
|
|
232
|
+
"""Import component definitions from a JSON file.
|
|
186
233
|
|
|
187
234
|
Parameters
|
|
188
235
|
----------
|
|
189
236
|
file_path : str
|
|
190
|
-
|
|
237
|
+
Path to the JSON file.
|
|
238
|
+
|
|
239
|
+
Returns
|
|
240
|
+
-------
|
|
241
|
+
bool
|
|
242
|
+
True if successful, False otherwise.
|
|
243
|
+
|
|
244
|
+
Examples
|
|
245
|
+
--------
|
|
246
|
+
>>> edbapp.components.import_definition("definitions.json")
|
|
191
247
|
"""
|
|
192
248
|
with codecs.open(file_path, "r", encoding="utf-8") as f:
|
|
193
249
|
data = json.load(f)
|
|
@@ -216,17 +272,21 @@ class Components(object):
|
|
|
216
272
|
return True
|
|
217
273
|
|
|
218
274
|
def export_definition(self, file_path) -> bool:
|
|
219
|
-
"""Export component definitions to
|
|
275
|
+
"""Export component definitions to a JSON file.
|
|
220
276
|
|
|
221
277
|
Parameters
|
|
222
278
|
----------
|
|
223
279
|
file_path : str
|
|
224
|
-
|
|
280
|
+
Path to the output JSON file.
|
|
225
281
|
|
|
226
282
|
Returns
|
|
227
283
|
-------
|
|
228
284
|
bool
|
|
285
|
+
True if successful, False otherwise.
|
|
229
286
|
|
|
287
|
+
Examples
|
|
288
|
+
--------
|
|
289
|
+
>>> edbapp.components.export_definition("exported_definitions.json")
|
|
230
290
|
"""
|
|
231
291
|
data = {
|
|
232
292
|
"SParameterModel": {},
|
|
@@ -267,7 +327,17 @@ class Components(object):
|
|
|
267
327
|
return True
|
|
268
328
|
|
|
269
329
|
def refresh_components(self) -> bool:
|
|
270
|
-
"""Refresh the component dictionary.
|
|
330
|
+
"""Refresh the component dictionary.
|
|
331
|
+
|
|
332
|
+
Returns
|
|
333
|
+
-------
|
|
334
|
+
bool
|
|
335
|
+
True if successful, False otherwise.
|
|
336
|
+
|
|
337
|
+
Examples
|
|
338
|
+
--------
|
|
339
|
+
>>> edbapp.components.refresh_components()
|
|
340
|
+
"""
|
|
271
341
|
self._logger.info("Refreshing the Components dictionary.")
|
|
272
342
|
self._cmp = {}
|
|
273
343
|
self._res = {}
|
|
@@ -302,132 +372,106 @@ class Components(object):
|
|
|
302
372
|
|
|
303
373
|
@property
|
|
304
374
|
def resistors(self) -> dict[str, Component]:
|
|
305
|
-
"""
|
|
375
|
+
"""Dictionary of resistor components.
|
|
306
376
|
|
|
307
377
|
Returns
|
|
308
378
|
-------
|
|
309
|
-
dict[str,
|
|
310
|
-
Dictionary of
|
|
379
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
380
|
+
Dictionary of resistor components keyed by name.
|
|
311
381
|
|
|
312
382
|
Examples
|
|
313
383
|
--------
|
|
314
|
-
|
|
315
|
-
>>> from pyedb import Edb
|
|
316
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
317
384
|
>>> edbapp.components.resistors
|
|
318
385
|
"""
|
|
319
386
|
return self._res
|
|
320
387
|
|
|
321
388
|
@property
|
|
322
389
|
def capacitors(self) -> dict[str, Component]:
|
|
323
|
-
"""
|
|
390
|
+
"""Dictionary of capacitor components.
|
|
324
391
|
|
|
325
392
|
Returns
|
|
326
393
|
-------
|
|
327
|
-
dict[str,
|
|
328
|
-
Dictionary of
|
|
394
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
395
|
+
Dictionary of capacitor components keyed by name.
|
|
329
396
|
|
|
330
397
|
Examples
|
|
331
398
|
--------
|
|
332
|
-
|
|
333
|
-
>>> from pyedb import Edb
|
|
334
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
335
399
|
>>> edbapp.components.capacitors
|
|
336
400
|
"""
|
|
337
401
|
return self._cap
|
|
338
402
|
|
|
339
403
|
@property
|
|
340
404
|
def inductors(self) -> dict[str, Component]:
|
|
341
|
-
"""
|
|
405
|
+
"""Dictionary of inductor components.
|
|
342
406
|
|
|
343
407
|
Returns
|
|
344
408
|
-------
|
|
345
|
-
dict[str,
|
|
346
|
-
Dictionary of
|
|
409
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
410
|
+
Dictionary of inductor components keyed by name.
|
|
347
411
|
|
|
348
412
|
Examples
|
|
349
413
|
--------
|
|
350
|
-
|
|
351
|
-
>>> from pyedb import Edb
|
|
352
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
353
414
|
>>> edbapp.components.inductors
|
|
354
|
-
|
|
355
415
|
"""
|
|
356
416
|
return self._ind
|
|
357
417
|
|
|
358
418
|
@property
|
|
359
419
|
def ICs(self) -> dict[str, Component]:
|
|
360
|
-
"""
|
|
420
|
+
"""Dictionary of integrated circuit components.
|
|
361
421
|
|
|
362
422
|
Returns
|
|
363
423
|
-------
|
|
364
|
-
dict[str,
|
|
365
|
-
Dictionary of
|
|
424
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
425
|
+
Dictionary of IC components keyed by name.
|
|
366
426
|
|
|
367
427
|
Examples
|
|
368
428
|
--------
|
|
369
|
-
|
|
370
|
-
>>> from pyedb import Edb
|
|
371
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
372
429
|
>>> edbapp.components.ICs
|
|
373
|
-
|
|
374
430
|
"""
|
|
375
431
|
return self._ics
|
|
376
432
|
|
|
377
433
|
@property
|
|
378
434
|
def IOs(self) -> dict[str, Component]:
|
|
379
|
-
"""
|
|
435
|
+
"""Dictionary of I/O components.
|
|
380
436
|
|
|
381
437
|
Returns
|
|
382
438
|
-------
|
|
383
|
-
dict[str,
|
|
384
|
-
Dictionary of
|
|
439
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
440
|
+
Dictionary of I/O components keyed by name.
|
|
385
441
|
|
|
386
442
|
Examples
|
|
387
443
|
--------
|
|
388
|
-
|
|
389
|
-
>>> from pyedb import Edb
|
|
390
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
391
444
|
>>> edbapp.components.IOs
|
|
392
|
-
|
|
393
445
|
"""
|
|
394
446
|
return self._ios
|
|
395
447
|
|
|
396
448
|
@property
|
|
397
449
|
def Others(self) -> dict[str, Component]:
|
|
398
|
-
"""
|
|
450
|
+
"""Dictionary of other components.
|
|
399
451
|
|
|
400
452
|
Returns
|
|
401
453
|
-------
|
|
402
|
-
dict[str,
|
|
403
|
-
Dictionary of other
|
|
454
|
+
dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
|
|
455
|
+
Dictionary of other components keyed by name.
|
|
404
456
|
|
|
405
457
|
Examples
|
|
406
458
|
--------
|
|
407
|
-
|
|
408
|
-
>>> from pyedb import Edb
|
|
409
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
410
|
-
>>> edbapp.components.others
|
|
411
|
-
|
|
459
|
+
>>> edbapp.components.Others
|
|
412
460
|
"""
|
|
413
461
|
return self._others
|
|
414
462
|
|
|
415
463
|
@property
|
|
416
|
-
def components_by_partname(self) -> dict[str, Component]:
|
|
417
|
-
"""
|
|
464
|
+
def components_by_partname(self) -> dict[str, list[Component]]:
|
|
465
|
+
"""Dictionary of components grouped by part name.
|
|
418
466
|
|
|
419
467
|
Returns
|
|
420
468
|
-------
|
|
421
|
-
dict
|
|
422
|
-
Dictionary of components by part name.
|
|
469
|
+
dict[str, list[:class:`pyedb.grpc.database.hierarchy.component.Component`]]
|
|
470
|
+
Dictionary of components lists keyed by part name.
|
|
423
471
|
|
|
424
472
|
Examples
|
|
425
473
|
--------
|
|
426
|
-
|
|
427
|
-
>>> from pyedb import Edb
|
|
428
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
429
474
|
>>> edbapp.components.components_by_partname
|
|
430
|
-
|
|
431
475
|
"""
|
|
432
476
|
self._comps_by_part = {}
|
|
433
477
|
for el, val in self.instances.items():
|
|
@@ -447,28 +491,35 @@ class Components(object):
|
|
|
447
491
|
|
|
448
492
|
Returns
|
|
449
493
|
-------
|
|
450
|
-
|
|
451
|
-
Component
|
|
494
|
+
:class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
495
|
+
Component instance.
|
|
452
496
|
|
|
497
|
+
Examples
|
|
498
|
+
--------
|
|
499
|
+
>>> comp = edbapp.components.get_component_by_name("R1")
|
|
453
500
|
"""
|
|
454
501
|
return self.instances[name]
|
|
455
502
|
|
|
456
503
|
def get_pin_from_component(self, component, net_name=None, pin_name=None) -> list:
|
|
457
|
-
"""
|
|
504
|
+
"""Get pins from a component with optional filtering.
|
|
505
|
+
|
|
458
506
|
Parameters
|
|
459
507
|
----------
|
|
460
|
-
component
|
|
461
|
-
Component
|
|
462
|
-
net_name : str
|
|
463
|
-
|
|
508
|
+
component : str or :class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
509
|
+
Component name or instance.
|
|
510
|
+
net_name : str or list[str], optional
|
|
511
|
+
Net name(s) to filter by.
|
|
464
512
|
pin_name : str, optional
|
|
465
|
-
|
|
466
|
-
Return
|
|
467
|
-
------
|
|
468
|
-
List[:clas: `PadstackInstance`]
|
|
469
|
-
|
|
513
|
+
Pin name to filter by.
|
|
470
514
|
|
|
515
|
+
Returns
|
|
516
|
+
-------
|
|
517
|
+
list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
|
|
518
|
+
List of pin instances.
|
|
471
519
|
|
|
520
|
+
Examples
|
|
521
|
+
--------
|
|
522
|
+
>>> pins = edbapp.components.get_pin_from_component("R1", net_name="GND")
|
|
472
523
|
"""
|
|
473
524
|
if isinstance(component, Component):
|
|
474
525
|
component = component.name
|
|
@@ -481,19 +532,22 @@ class Components(object):
|
|
|
481
532
|
pins = [pin for pin in pins if pin.name == pin_name]
|
|
482
533
|
return pins
|
|
483
534
|
|
|
484
|
-
def get_components_from_nets(self, netlist=None) -> list[
|
|
485
|
-
"""
|
|
535
|
+
def get_components_from_nets(self, netlist=None) -> list[str]:
|
|
536
|
+
"""Get components connected to specified nets.
|
|
486
537
|
|
|
487
538
|
Parameters
|
|
488
539
|
----------
|
|
489
|
-
netlist : str, optional
|
|
490
|
-
|
|
540
|
+
netlist : str or list[str], optional
|
|
541
|
+
Net name(s) to filter by.
|
|
491
542
|
|
|
492
543
|
Returns
|
|
493
544
|
-------
|
|
494
|
-
list
|
|
495
|
-
List of
|
|
545
|
+
list[str]
|
|
546
|
+
List of component names.
|
|
496
547
|
|
|
548
|
+
Examples
|
|
549
|
+
--------
|
|
550
|
+
>>> comps = edbapp.components.get_components_from_nets(["GND", "VCC"])
|
|
497
551
|
"""
|
|
498
552
|
cmp_list = []
|
|
499
553
|
if isinstance(netlist, str):
|
|
@@ -505,7 +559,21 @@ class Components(object):
|
|
|
505
559
|
cmp_list.append(refdes)
|
|
506
560
|
return cmp_list
|
|
507
561
|
|
|
508
|
-
def _get_edb_pin_from_pin_name(self, cmp, pin):
|
|
562
|
+
def _get_edb_pin_from_pin_name(self, cmp, pin) -> Union[ComponentPin, bool]:
|
|
563
|
+
"""Get EDB pin from pin name.
|
|
564
|
+
|
|
565
|
+
Parameters
|
|
566
|
+
----------
|
|
567
|
+
cmp : :class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
568
|
+
Component instance.
|
|
569
|
+
pin : str
|
|
570
|
+
Pin name.
|
|
571
|
+
|
|
572
|
+
Returns
|
|
573
|
+
-------
|
|
574
|
+
:class:`pyedb.grpc.database.definition.component_pin.ComponentPin` or bool
|
|
575
|
+
Pin instance if found, False otherwise.
|
|
576
|
+
"""
|
|
509
577
|
if not isinstance(cmp, Component):
|
|
510
578
|
return False
|
|
511
579
|
if not isinstance(pin, str):
|
|
@@ -523,53 +591,44 @@ class Components(object):
|
|
|
523
591
|
hosting_component_pin1,
|
|
524
592
|
hosting_component_pin2,
|
|
525
593
|
flipped=False,
|
|
526
|
-
):
|
|
527
|
-
"""Get
|
|
594
|
+
) -> tuple:
|
|
595
|
+
"""Get placement vector between two components.
|
|
528
596
|
|
|
529
597
|
Parameters
|
|
530
598
|
----------
|
|
531
|
-
mounted_component :
|
|
532
|
-
Mounted component
|
|
533
|
-
hosting_component :
|
|
534
|
-
Hosting component
|
|
599
|
+
mounted_component : :class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
600
|
+
Mounted component.
|
|
601
|
+
hosting_component : :class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
602
|
+
Hosting component.
|
|
535
603
|
mounted_component_pin1 : str
|
|
536
|
-
|
|
604
|
+
Pin name on mounted component.
|
|
537
605
|
mounted_component_pin2 : str
|
|
538
|
-
|
|
606
|
+
Pin name on mounted component.
|
|
539
607
|
hosting_component_pin1 : str
|
|
540
|
-
|
|
608
|
+
Pin name on hosting component.
|
|
541
609
|
hosting_component_pin2 : str
|
|
542
|
-
|
|
610
|
+
Pin name on hosting component.
|
|
543
611
|
flipped : bool, optional
|
|
544
|
-
|
|
612
|
+
Whether the component is flipped.
|
|
545
613
|
|
|
546
614
|
Returns
|
|
547
615
|
-------
|
|
548
616
|
tuple
|
|
549
|
-
|
|
617
|
+
(success, vector, rotation, solder_ball_height)
|
|
550
618
|
|
|
551
619
|
Examples
|
|
552
620
|
--------
|
|
553
|
-
>>>
|
|
554
|
-
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
|
|
555
|
-
>>> mounted_cmp = edb2.components.get_component_by_name("BGA")
|
|
556
|
-
>>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector(
|
|
557
|
-
... mounted_component=mounted_cmp,
|
|
558
|
-
... hosting_component=hosting_cmp,
|
|
559
|
-
... mounted_component_pin1="A12",
|
|
560
|
-
... mounted_component_pin2="A14",
|
|
561
|
-
... hosting_component_pin1="A12",
|
|
562
|
-
... hosting_component_pin2="A14")
|
|
621
|
+
>>> vec, rot, height = edbapp.components.get_component_placement_vector(...)
|
|
563
622
|
"""
|
|
564
|
-
m_pin1_pos = [0.0, 0.0]
|
|
565
|
-
m_pin2_pos = [0.0, 0.0]
|
|
566
|
-
h_pin1_pos = [0.0, 0.0]
|
|
567
|
-
h_pin2_pos = [0.0, 0.0]
|
|
568
623
|
if not isinstance(mounted_component, Component):
|
|
569
624
|
return False
|
|
570
625
|
if not isinstance(hosting_component, Component):
|
|
571
626
|
return False
|
|
572
627
|
|
|
628
|
+
m_pin1_pos = [0.0, 0.0]
|
|
629
|
+
m_pin2_pos = [0.0, 0.0]
|
|
630
|
+
h_pin1_pos = [0.0, 0.0]
|
|
631
|
+
h_pin2_pos = [0.0, 0.0]
|
|
573
632
|
if mounted_component_pin1:
|
|
574
633
|
m_pin1 = self._get_edb_pin_from_pin_name(mounted_component, mounted_component_pin1)
|
|
575
634
|
m_pin1_pos = self.get_pin_position(m_pin1)
|
|
@@ -612,38 +671,37 @@ class Components(object):
|
|
|
612
671
|
return False, [0, 0], 0, 0
|
|
613
672
|
|
|
614
673
|
def get_solder_ball_height(self, cmp) -> float:
|
|
615
|
-
"""Get
|
|
674
|
+
"""Get solder ball height of a component.
|
|
616
675
|
|
|
617
676
|
Parameters
|
|
618
677
|
----------
|
|
619
|
-
cmp : str or
|
|
620
|
-
|
|
678
|
+
cmp : str or :class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
679
|
+
Component name or instance.
|
|
621
680
|
|
|
622
681
|
Returns
|
|
623
682
|
-------
|
|
624
|
-
|
|
625
|
-
|
|
683
|
+
float
|
|
684
|
+
Solder ball height in meters.
|
|
626
685
|
|
|
686
|
+
Examples
|
|
687
|
+
--------
|
|
688
|
+
>>> height = edbapp.components.get_solder_ball_height("U1")
|
|
627
689
|
"""
|
|
628
690
|
if isinstance(cmp, str):
|
|
629
691
|
cmp = self.get_component_by_name(cmp)
|
|
630
692
|
return cmp.solder_ball_height
|
|
631
693
|
|
|
632
694
|
def get_vendor_libraries(self) -> ComponentLib:
|
|
633
|
-
"""
|
|
695
|
+
"""Get vendor component libraries.
|
|
634
696
|
|
|
635
697
|
Returns
|
|
636
698
|
-------
|
|
637
|
-
ComponentLib
|
|
638
|
-
|
|
699
|
+
:class:`pyedb.component_libraries.ansys_components.ComponentLib`
|
|
700
|
+
Component library object.
|
|
639
701
|
|
|
640
702
|
Examples
|
|
641
703
|
--------
|
|
642
|
-
>>>
|
|
643
|
-
>>> comp_lib = edbapp.components.get_vendor_libraries()
|
|
644
|
-
>>> network = comp_lib.capacitors["AVX"]["AccuP01005"]["C005YJ0R1ABSTR"].s_parameters
|
|
645
|
-
>>> network.write_touchstone(os.path.join(edbapp.directory, "test_export.s2p"))
|
|
646
|
-
|
|
704
|
+
>>> lib = edbapp.components.get_vendor_libraries()
|
|
647
705
|
"""
|
|
648
706
|
comp_lib_path = os.path.join(self._pedb.base_path, "complib", "Locked")
|
|
649
707
|
comp_types = ["Capacitors", "Inductors"]
|
|
@@ -673,22 +731,21 @@ class Components(object):
|
|
|
673
731
|
comp_lib.inductors = vendors
|
|
674
732
|
return comp_lib
|
|
675
733
|
|
|
676
|
-
def create_source_on_component(self, sources=None):
|
|
677
|
-
"""Create
|
|
734
|
+
def create_source_on_component(self, sources=None): # pragma: no cover
|
|
735
|
+
"""Create sources on components.
|
|
678
736
|
|
|
679
|
-
|
|
680
|
-
|
|
737
|
+
.. deprecated:: 0.28.0
|
|
738
|
+
Use :func:`pyedb.grpc.core.excitations.create_source_on_component` instead.
|
|
681
739
|
|
|
682
740
|
Parameters
|
|
683
741
|
----------
|
|
684
|
-
sources : list
|
|
685
|
-
List of
|
|
742
|
+
sources : list, optional
|
|
743
|
+
List of sources.
|
|
686
744
|
|
|
687
745
|
Returns
|
|
688
746
|
-------
|
|
689
747
|
bool
|
|
690
|
-
|
|
691
|
-
|
|
748
|
+
True if successful, False otherwise.
|
|
692
749
|
"""
|
|
693
750
|
warnings.warn(
|
|
694
751
|
"`create_source_on_component` is deprecated and is now located here "
|
|
@@ -706,42 +763,33 @@ class Components(object):
|
|
|
706
763
|
port_name=None,
|
|
707
764
|
pec_boundary=False,
|
|
708
765
|
pingroup_on_single_pin=False,
|
|
709
|
-
):
|
|
710
|
-
"""Create
|
|
766
|
+
): # pragma: no cover
|
|
767
|
+
"""Create port on pins.
|
|
711
768
|
|
|
712
|
-
|
|
713
|
-
|
|
769
|
+
.. deprecated:: 0.28.0
|
|
770
|
+
Use :func:`pyedb.grpc.core.excitations.create_port_on_pins` instead.
|
|
714
771
|
|
|
715
772
|
Parameters
|
|
716
773
|
----------
|
|
717
|
-
refdes :
|
|
718
|
-
|
|
719
|
-
pins :
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
If several pins are provided a pin group will is created. Pin names can be the EDB name or the
|
|
726
|
-
EDBPadstackInstance one. For instance the pin called ``Pin1`` located on component ``U1``, ``U1-Pin1``
|
|
727
|
-
or ``Pin1`` can be provided and will be handled.
|
|
728
|
-
str, [str], EDBPadstackInstance, [EDBPadstackInstance]
|
|
729
|
-
impedance : Port impedance
|
|
730
|
-
str, float
|
|
774
|
+
refdes : str
|
|
775
|
+
Reference designator.
|
|
776
|
+
pins : list
|
|
777
|
+
List of pins.
|
|
778
|
+
reference_pins : list
|
|
779
|
+
List of reference pins.
|
|
780
|
+
impedance : float, optional
|
|
781
|
+
Port impedance.
|
|
731
782
|
port_name : str, optional
|
|
732
|
-
Port name.
|
|
783
|
+
Port name.
|
|
733
784
|
pec_boundary : bool, optional
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
when there is no pin group.
|
|
738
|
-
pingroup_on_single_pin : bool
|
|
739
|
-
If ``True`` force using pingroup definition on single pin to have the port created at the pad center. If
|
|
740
|
-
``False`` the port is created at the pad edge. Default value is ``False``.
|
|
785
|
+
Use PEC boundary.
|
|
786
|
+
pingroup_on_single_pin : bool, optional
|
|
787
|
+
Use pin group on single pin.
|
|
741
788
|
|
|
742
789
|
Returns
|
|
743
790
|
-------
|
|
744
|
-
|
|
791
|
+
bool
|
|
792
|
+
True if successful, False otherwise.
|
|
745
793
|
"""
|
|
746
794
|
warnings.warn(
|
|
747
795
|
"`create_port_on_pins` is deprecated and is now located here "
|
|
@@ -770,50 +818,39 @@ class Components(object):
|
|
|
770
818
|
solder_balls_size=None,
|
|
771
819
|
solder_balls_mid_size=None,
|
|
772
820
|
extend_reference_pins_outside_component=False,
|
|
773
|
-
):
|
|
821
|
+
): # pragma: no cover
|
|
774
822
|
"""Create ports on a component.
|
|
775
823
|
|
|
776
|
-
|
|
777
|
-
|
|
824
|
+
.. deprecated:: 0.28.0
|
|
825
|
+
Use :func:`pyedb.grpc.core.excitations.create_port_on_component` instead.
|
|
778
826
|
|
|
779
827
|
Parameters
|
|
780
828
|
----------
|
|
781
|
-
component : str
|
|
782
|
-
|
|
783
|
-
net_list :
|
|
784
|
-
List of nets
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
list of the reference net.
|
|
794
|
-
port_name : str
|
|
795
|
-
Port name for overwriting the default port-naming convention,
|
|
796
|
-
which is ``[component][net][pin]``. The port name must be unique.
|
|
797
|
-
If a port with the specified name already exists, the
|
|
798
|
-
default naming convention is used so that port creation does
|
|
799
|
-
not fail.
|
|
829
|
+
component : str
|
|
830
|
+
Component name.
|
|
831
|
+
net_list : list
|
|
832
|
+
List of nets.
|
|
833
|
+
port_type : SourceType, optional
|
|
834
|
+
Port type.
|
|
835
|
+
do_pingroup : bool, optional
|
|
836
|
+
Use pin groups.
|
|
837
|
+
reference_net : str, optional
|
|
838
|
+
Reference net.
|
|
839
|
+
port_name : str, optional
|
|
840
|
+
Port name.
|
|
800
841
|
solder_balls_height : float, optional
|
|
801
|
-
Solder
|
|
802
|
-
provided in meter.
|
|
842
|
+
Solder ball height.
|
|
803
843
|
solder_balls_size : float, optional
|
|
804
|
-
Solder
|
|
844
|
+
Solder ball size.
|
|
805
845
|
solder_balls_mid_size : float, optional
|
|
806
|
-
Solder
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
When no reference pins are found on the component extend the pins search with taking the closest one. If
|
|
810
|
-
`do_pingroup` is `True` will be set to `False`. Default value is `False`.
|
|
846
|
+
Solder ball mid size.
|
|
847
|
+
extend_reference_pins_outside_component : bool, optional
|
|
848
|
+
Extend reference pins outside component.
|
|
811
849
|
|
|
812
850
|
Returns
|
|
813
851
|
-------
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
852
|
+
bool
|
|
853
|
+
True if successful, False otherwise.
|
|
817
854
|
"""
|
|
818
855
|
warnings.warn(
|
|
819
856
|
"`create_port_on_component` is deprecated and is now located here "
|
|
@@ -833,22 +870,23 @@ class Components(object):
|
|
|
833
870
|
extend_reference_pins_outside_component=extend_reference_pins_outside_component,
|
|
834
871
|
)
|
|
835
872
|
|
|
836
|
-
def _create_terminal(self, pin, term_name=None):
|
|
837
|
-
"""Create terminal on
|
|
873
|
+
def _create_terminal(self, pin, term_name=None): # pragma: no cover
|
|
874
|
+
"""Create terminal on pin.
|
|
838
875
|
|
|
839
|
-
|
|
840
|
-
|
|
876
|
+
.. deprecated:: 0.28.0
|
|
877
|
+
Use :func:`pyedb.grpc.core.excitations._create_terminal` instead.
|
|
841
878
|
|
|
842
879
|
Parameters
|
|
843
880
|
----------
|
|
844
|
-
pin :
|
|
845
|
-
|
|
846
|
-
term_name :
|
|
847
|
-
|
|
881
|
+
pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
|
|
882
|
+
Pin instance.
|
|
883
|
+
term_name : str, optional
|
|
884
|
+
Terminal name.
|
|
848
885
|
|
|
849
886
|
Returns
|
|
850
887
|
-------
|
|
851
|
-
|
|
888
|
+
bool
|
|
889
|
+
True if successful, False otherwise.
|
|
852
890
|
"""
|
|
853
891
|
warnings.warn(
|
|
854
892
|
"`_create_terminal` is deprecated and is now located here "
|
|
@@ -858,18 +896,19 @@ class Components(object):
|
|
|
858
896
|
self._pedb.excitations._create_terminal(pin, term_name=term_name)
|
|
859
897
|
|
|
860
898
|
def _get_closest_pin_from(self, pin, ref_pinlist):
|
|
861
|
-
"""
|
|
899
|
+
"""Get closest pin from a list of pins.
|
|
862
900
|
|
|
863
901
|
Parameters
|
|
864
902
|
----------
|
|
865
|
-
pin :
|
|
866
|
-
|
|
867
|
-
ref_pinlist : list
|
|
903
|
+
pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
|
|
904
|
+
Source pin.
|
|
905
|
+
ref_pinlist : list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
|
|
906
|
+
List of reference pins.
|
|
868
907
|
|
|
869
908
|
Returns
|
|
870
909
|
-------
|
|
871
|
-
|
|
872
|
-
|
|
910
|
+
:class:`pyedb.grpc.database.padstacks.PadstackInstance`
|
|
911
|
+
Closest pin.
|
|
873
912
|
"""
|
|
874
913
|
distance = 1e3
|
|
875
914
|
pin_position = pin.position
|
|
@@ -881,173 +920,29 @@ class Components(object):
|
|
|
881
920
|
closest_pin = ref_pin
|
|
882
921
|
return closest_pin
|
|
883
922
|
|
|
884
|
-
def
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
Parameters
|
|
889
|
-
----------
|
|
890
|
-
component : str
|
|
891
|
-
Reference designator of the RLC component.
|
|
892
|
-
|
|
893
|
-
Returns
|
|
894
|
-
-------
|
|
895
|
-
bool
|
|
896
|
-
``True`` when succeed, ``False`` if it failed.
|
|
897
|
-
|
|
898
|
-
Examples
|
|
899
|
-
--------
|
|
900
|
-
>>> from pyedb import Edb
|
|
901
|
-
>>> edb = Edb(edb_file)
|
|
902
|
-
>>> for refdes, cmp in edb.components.capacitors.items():
|
|
903
|
-
>>> edb.components.replace_rlc_by_gap_boundaries(refdes)
|
|
904
|
-
>>> edb.save_edb()
|
|
905
|
-
>>> edb.close_edb()
|
|
906
|
-
"""
|
|
907
|
-
if not component:
|
|
908
|
-
return False
|
|
909
|
-
if isinstance(component, str):
|
|
910
|
-
component = self.instances[component]
|
|
911
|
-
if not component:
|
|
912
|
-
self._logger.error("component %s not found.", component)
|
|
913
|
-
return False
|
|
914
|
-
if component.type in ["other", "ic", "io"]:
|
|
915
|
-
self._logger.info(f"Component {component.refdes} skipped to deactivate is not an RLC.")
|
|
916
|
-
return False
|
|
917
|
-
component.enabled = False
|
|
918
|
-
return self._pedb.source_excitation.add_rlc_boundary(component.refdes, False)
|
|
919
|
-
|
|
920
|
-
def deactivate_rlc_component(self, component=None, create_circuit_port=False, pec_boundary=False) -> bool:
|
|
921
|
-
"""Deactivate RLC component with a possibility to convert it to a circuit port.
|
|
922
|
-
|
|
923
|
-
Parameters
|
|
924
|
-
----------
|
|
925
|
-
component : str
|
|
926
|
-
Reference designator of the RLC component.
|
|
927
|
-
|
|
928
|
-
create_circuit_port : bool, optional
|
|
929
|
-
Whether to replace the deactivated RLC component with a circuit port. The default
|
|
930
|
-
is ``False``.
|
|
931
|
-
pec_boundary : bool, optional
|
|
932
|
-
Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
|
|
933
|
-
a perfect short is created between the pin and impedance is ignored. This
|
|
934
|
-
parameter is only supported on a port created between two pins, such as
|
|
935
|
-
when there is no pin group.
|
|
936
|
-
|
|
937
|
-
Returns
|
|
938
|
-
-------
|
|
939
|
-
bool
|
|
940
|
-
``True`` when successful, ``False`` when failed.
|
|
941
|
-
|
|
942
|
-
Examples
|
|
943
|
-
--------
|
|
944
|
-
>>> from pyedb import Edb
|
|
945
|
-
>>> edb_file = r'C:\my_edb_file.aedb'
|
|
946
|
-
>>> edb = Edb(edb_file)
|
|
947
|
-
>>> for cmp in list(edb.components.instances.keys()):
|
|
948
|
-
>>> edb.components.deactivate_rlc_component(component=cmp, create_circuit_port=False)
|
|
949
|
-
>>> edb.save_edb()
|
|
950
|
-
>>> edb.close_edb()
|
|
951
|
-
"""
|
|
952
|
-
if not component:
|
|
953
|
-
return False
|
|
954
|
-
if isinstance(component, str):
|
|
955
|
-
component = self.instances[component]
|
|
956
|
-
if not component:
|
|
957
|
-
self._logger.error("component %s not found.", component)
|
|
958
|
-
return False
|
|
959
|
-
if component.type in ["other", "ic", "io"]:
|
|
960
|
-
self._logger.info(f"Component {component.refdes} passed to deactivate is not an RLC.")
|
|
961
|
-
return False
|
|
962
|
-
component.is_enabled = False
|
|
963
|
-
return self._pedb.source_excitation.add_port_on_rlc_component(
|
|
964
|
-
component=component.refdes, circuit_ports=create_circuit_port, pec_boundary=pec_boundary
|
|
965
|
-
)
|
|
966
|
-
|
|
967
|
-
def add_port_on_rlc_component(self, component=None, circuit_ports=True, pec_boundary=False):
|
|
968
|
-
"""Deactivate RLC component and replace it with a circuit port.
|
|
969
|
-
The circuit port supports only two-pin components.
|
|
970
|
-
|
|
971
|
-
. deprecated:: pyedb 0.28.0
|
|
972
|
-
Use :func:`pyedb.grpc.core.excitations.add_port_on_rlc_component` instead.
|
|
973
|
-
|
|
974
|
-
Parameters
|
|
975
|
-
----------
|
|
976
|
-
component : str
|
|
977
|
-
Reference designator of the RLC component.
|
|
978
|
-
|
|
979
|
-
circuit_ports : bool
|
|
980
|
-
``True`` will replace RLC component by circuit ports, ``False`` gap ports compatible with HFSS 3D modeler
|
|
981
|
-
export.
|
|
982
|
-
|
|
983
|
-
pec_boundary : bool, optional
|
|
984
|
-
Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
|
|
985
|
-
a perfect short is created between the pin and impedance is ignored. This
|
|
986
|
-
parameter is only supported on a port created between two pins, such as
|
|
987
|
-
when there is no pin group.
|
|
923
|
+
def _create_pin_group_terminal(
|
|
924
|
+
self, pingroup, isref=False, term_name=None, term_type="circuit"
|
|
925
|
+
): # pragma: no cover
|
|
926
|
+
"""Create pin group terminal.
|
|
988
927
|
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
bool
|
|
992
|
-
``True`` when successful, ``False`` when failed.
|
|
993
|
-
"""
|
|
994
|
-
warnings.warn(
|
|
995
|
-
"`add_port_on_rlc_component` is deprecated and is now located here "
|
|
996
|
-
"`pyedb.grpc.core.excitations.add_port_on_rlc_component` instead.",
|
|
997
|
-
DeprecationWarning,
|
|
998
|
-
)
|
|
999
|
-
return self._pedb.source_excitation.add_port_on_rlc_component(
|
|
1000
|
-
component=component, circuit_ports=circuit_ports, pec_boundary=pec_boundary
|
|
1001
|
-
)
|
|
1002
|
-
|
|
1003
|
-
def add_rlc_boundary(self, component=None, circuit_type=True):
|
|
1004
|
-
"""Add RLC gap boundary on component and replace it with a circuit port.
|
|
1005
|
-
The circuit port supports only 2-pin components.
|
|
1006
|
-
|
|
1007
|
-
. deprecated:: pyedb 0.28.0
|
|
1008
|
-
Use :func:`pyedb.grpc.core.excitations.add_rlc_boundary` instead.
|
|
928
|
+
.. deprecated:: 0.28.0
|
|
929
|
+
Use :func:`pyedb.grpc.core.excitations._create_pin_group_terminal` instead.
|
|
1009
930
|
|
|
1010
931
|
Parameters
|
|
1011
932
|
----------
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
933
|
+
pingroup : :class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup`
|
|
934
|
+
Pin group.
|
|
935
|
+
isref : bool, optional
|
|
936
|
+
Is reference terminal.
|
|
937
|
+
term_name : str, optional
|
|
938
|
+
Terminal name.
|
|
939
|
+
term_type : str, optional
|
|
940
|
+
Terminal type.
|
|
1017
941
|
|
|
1018
942
|
Returns
|
|
1019
943
|
-------
|
|
1020
944
|
bool
|
|
1021
|
-
|
|
1022
|
-
"""
|
|
1023
|
-
warnings.warn(
|
|
1024
|
-
"`add_rlc_boundary` is deprecated and is now located here "
|
|
1025
|
-
"`pyedb.grpc.core.excitations.add_rlc_boundary` instead.",
|
|
1026
|
-
DeprecationWarning,
|
|
1027
|
-
)
|
|
1028
|
-
return self._pedb.source_excitation.add_rlc_boundary(self, component=component, circuit_type=circuit_type)
|
|
1029
|
-
|
|
1030
|
-
def _create_pin_group_terminal(self, pingroup, isref=False, term_name=None, term_type="circuit"):
|
|
1031
|
-
"""Creates an EDB pin group terminal from a given EDB pin group.
|
|
1032
|
-
|
|
1033
|
-
. deprecated:: pyedb 0.28.0
|
|
1034
|
-
Use :func:`pyedb.grpc.core.excitations._create_pin_group_terminal` instead.
|
|
1035
|
-
|
|
1036
|
-
Parameters
|
|
1037
|
-
----------
|
|
1038
|
-
pingroup : Edb pin group.
|
|
1039
|
-
|
|
1040
|
-
isref : bool
|
|
1041
|
-
Specify if this terminal a reference terminal.
|
|
1042
|
-
|
|
1043
|
-
term_name : Terminal name (Optional). If not provided default name is Component name, Pin name, Net name.
|
|
1044
|
-
str.
|
|
1045
|
-
|
|
1046
|
-
term_type: Type of terminal, gap, circuit or auto.
|
|
1047
|
-
str.
|
|
1048
|
-
Returns
|
|
1049
|
-
-------
|
|
1050
|
-
Edb pin group terminal.
|
|
945
|
+
True if successful, False otherwise.
|
|
1051
946
|
"""
|
|
1052
947
|
warnings.warn(
|
|
1053
948
|
"`_create_pin_group_terminal` is deprecated and is now located here "
|
|
@@ -1059,19 +954,17 @@ class Components(object):
|
|
|
1059
954
|
)
|
|
1060
955
|
|
|
1061
956
|
def _is_top_component(self, cmp) -> bool:
|
|
1062
|
-
"""
|
|
957
|
+
"""Check if component is on top layer.
|
|
1063
958
|
|
|
1064
959
|
Parameters
|
|
1065
960
|
----------
|
|
1066
|
-
cmp :
|
|
1067
|
-
|
|
961
|
+
cmp : :class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
962
|
+
Component instance.
|
|
1068
963
|
|
|
1069
964
|
Returns
|
|
1070
965
|
-------
|
|
1071
966
|
bool
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
967
|
+
True if on top layer, False otherwise.
|
|
1075
968
|
"""
|
|
1076
969
|
top_layer = self._pedb.stackup.signal[0].name
|
|
1077
970
|
if cmp.placement_layer == top_layer:
|
|
@@ -1079,7 +972,21 @@ class Components(object):
|
|
|
1079
972
|
else:
|
|
1080
973
|
return False
|
|
1081
974
|
|
|
1082
|
-
def _get_component_definition(self, name, pins):
|
|
975
|
+
def _get_component_definition(self, name, pins) -> Union[ComponentDef, None]:
|
|
976
|
+
"""Get or create component definition.
|
|
977
|
+
|
|
978
|
+
Parameters
|
|
979
|
+
----------
|
|
980
|
+
name : str
|
|
981
|
+
Definition name.
|
|
982
|
+
pins : list
|
|
983
|
+
List of pins.
|
|
984
|
+
|
|
985
|
+
Returns
|
|
986
|
+
-------
|
|
987
|
+
:class:`pyedb.grpc.database.definition.component_def.ComponentDef` or None
|
|
988
|
+
Component definition if successful, None otherwise.
|
|
989
|
+
"""
|
|
1083
990
|
component_definition = ComponentDef.find(self._db, name)
|
|
1084
991
|
if component_definition.is_null:
|
|
1085
992
|
from ansys.edb.core.layout.cell import Cell as GrpcCell
|
|
@@ -1089,7 +996,7 @@ class Components(object):
|
|
|
1089
996
|
component_definition = ComponentDef.create(self._db, name, fp=foot_print_cell)
|
|
1090
997
|
if component_definition.is_null:
|
|
1091
998
|
self._logger.error(f"Failed to create component definition {name}")
|
|
1092
|
-
return
|
|
999
|
+
return None
|
|
1093
1000
|
ind = 1
|
|
1094
1001
|
for pin in pins:
|
|
1095
1002
|
if not pin.name:
|
|
@@ -1114,43 +1021,38 @@ class Components(object):
|
|
|
1114
1021
|
c_value=None,
|
|
1115
1022
|
l_value=None,
|
|
1116
1023
|
is_parallel=False,
|
|
1117
|
-
) -> bool:
|
|
1118
|
-
"""Create a component
|
|
1024
|
+
) -> Union[Component, bool]:
|
|
1025
|
+
"""Create a new component.
|
|
1119
1026
|
|
|
1120
1027
|
Parameters
|
|
1121
1028
|
----------
|
|
1122
|
-
pins : list
|
|
1123
|
-
List of
|
|
1124
|
-
component_name : str
|
|
1125
|
-
|
|
1029
|
+
pins : list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
|
|
1030
|
+
List of pins.
|
|
1031
|
+
component_name : str, optional
|
|
1032
|
+
Component name.
|
|
1126
1033
|
placement_layer : str, optional
|
|
1127
|
-
|
|
1034
|
+
Placement layer name.
|
|
1128
1035
|
component_part_name : str, optional
|
|
1129
|
-
Part name
|
|
1036
|
+
Part name.
|
|
1130
1037
|
is_rlc : bool, optional
|
|
1131
|
-
Whether
|
|
1132
|
-
r_value : float
|
|
1133
|
-
|
|
1134
|
-
c_value : float
|
|
1038
|
+
Whether the component is RLC.
|
|
1039
|
+
r_value : float, optional
|
|
1040
|
+
Resistance value.
|
|
1041
|
+
c_value : float, optional
|
|
1135
1042
|
Capacitance value.
|
|
1136
|
-
l_value : float
|
|
1137
|
-
|
|
1138
|
-
is_parallel : bool
|
|
1139
|
-
|
|
1043
|
+
l_value : float, optional
|
|
1044
|
+
Inductance value.
|
|
1045
|
+
is_parallel : bool, optional
|
|
1046
|
+
Whether RLC is parallel.
|
|
1140
1047
|
|
|
1141
1048
|
Returns
|
|
1142
1049
|
-------
|
|
1143
|
-
bool
|
|
1144
|
-
|
|
1050
|
+
:class:`pyedb.grpc.database.hierarchy.component.Component` or bool
|
|
1051
|
+
New component instance if successful, False otherwise.
|
|
1145
1052
|
|
|
1146
1053
|
Examples
|
|
1147
1054
|
--------
|
|
1148
|
-
|
|
1149
|
-
>>> from pyedb import Edb
|
|
1150
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1151
|
-
>>> pins = edbapp.components.get_pin_from_component("A1")
|
|
1152
|
-
>>> edbapp.components.create(pins, "A1New")
|
|
1153
|
-
|
|
1055
|
+
>>> new_comp = edbapp.components.create(pins, "R1")
|
|
1154
1056
|
"""
|
|
1155
1057
|
from ansys.edb.core.hierarchy.component_group import (
|
|
1156
1058
|
ComponentGroup as GrpcComponentGroup,
|
|
@@ -1223,36 +1125,27 @@ class Components(object):
|
|
|
1223
1125
|
|
|
1224
1126
|
def create_component_from_pins(
|
|
1225
1127
|
self, pins, component_name, placement_layer=None, component_part_name=None
|
|
1226
|
-
) -> bool: # pragma: no cover
|
|
1227
|
-
"""Create
|
|
1128
|
+
) -> Union[Component, bool]: # pragma: no cover
|
|
1129
|
+
"""Create component from pins.
|
|
1228
1130
|
|
|
1229
1131
|
.. deprecated:: 0.6.62
|
|
1230
|
-
|
|
1132
|
+
Use :func:`create` instead.
|
|
1231
1133
|
|
|
1232
1134
|
Parameters
|
|
1233
1135
|
----------
|
|
1234
1136
|
pins : list
|
|
1235
|
-
List of
|
|
1137
|
+
List of pins.
|
|
1236
1138
|
component_name : str
|
|
1237
|
-
|
|
1139
|
+
Component name.
|
|
1238
1140
|
placement_layer : str, optional
|
|
1239
|
-
|
|
1141
|
+
Placement layer.
|
|
1240
1142
|
component_part_name : str, optional
|
|
1241
|
-
Part name
|
|
1143
|
+
Part name.
|
|
1242
1144
|
|
|
1243
1145
|
Returns
|
|
1244
1146
|
-------
|
|
1245
|
-
bool
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
Examples
|
|
1249
|
-
--------
|
|
1250
|
-
|
|
1251
|
-
>>> from pyedb import Edb
|
|
1252
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1253
|
-
>>> pins = edbapp.components.get_pin_from_component("A1")
|
|
1254
|
-
>>> edbapp.components.create(pins, "A1New")
|
|
1255
|
-
|
|
1147
|
+
:class:`pyedb.grpc.database.hierarchy.component.Component` or bool
|
|
1148
|
+
Component instance if successful, False otherwise.
|
|
1256
1149
|
"""
|
|
1257
1150
|
warnings.warn("`create_component_from_pins` is deprecated use `create` instead..", DeprecationWarning)
|
|
1258
1151
|
return self.create(
|
|
@@ -1264,34 +1157,27 @@ class Components(object):
|
|
|
1264
1157
|
)
|
|
1265
1158
|
|
|
1266
1159
|
def set_component_model(self, componentname, model_type="Spice", modelpath=None, modelname=None) -> bool:
|
|
1267
|
-
"""
|
|
1160
|
+
"""Set component model.
|
|
1268
1161
|
|
|
1269
1162
|
Parameters
|
|
1270
1163
|
----------
|
|
1271
1164
|
componentname : str
|
|
1272
|
-
|
|
1165
|
+
Component name.
|
|
1273
1166
|
model_type : str, optional
|
|
1274
|
-
|
|
1275
|
-
``"Touchstone"``. The default is ``"Spice"``.
|
|
1167
|
+
Model type ("Spice" or "Touchstone").
|
|
1276
1168
|
modelpath : str, optional
|
|
1277
|
-
|
|
1169
|
+
Model file path.
|
|
1278
1170
|
modelname : str, optional
|
|
1279
|
-
|
|
1171
|
+
Model name.
|
|
1280
1172
|
|
|
1281
1173
|
Returns
|
|
1282
1174
|
-------
|
|
1283
1175
|
bool
|
|
1284
|
-
|
|
1176
|
+
True if successful, False otherwise.
|
|
1285
1177
|
|
|
1286
1178
|
Examples
|
|
1287
1179
|
--------
|
|
1288
|
-
|
|
1289
|
-
>>> from pyedb import Edb
|
|
1290
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1291
|
-
>>> edbapp.components.set_component_model("A1", model_type="Spice",
|
|
1292
|
-
... modelpath="pathtospfile",
|
|
1293
|
-
... modelname="spicemodelname")
|
|
1294
|
-
|
|
1180
|
+
>>> edbapp.components.set_component_model("U1", "Spice", "path/to/model.sp")
|
|
1295
1181
|
"""
|
|
1296
1182
|
if not modelname:
|
|
1297
1183
|
modelname = get_filename_without_extension(modelpath)
|
|
@@ -1343,30 +1229,27 @@ class Components(object):
|
|
|
1343
1229
|
return True
|
|
1344
1230
|
|
|
1345
1231
|
def create_pingroup_from_pins(self, pins, group_name=None) -> Union[PinGroup, bool]:
|
|
1346
|
-
"""Create
|
|
1232
|
+
"""Create pin group from pins.
|
|
1347
1233
|
|
|
1348
1234
|
Parameters
|
|
1349
1235
|
----------
|
|
1350
|
-
pins : list
|
|
1351
|
-
List of
|
|
1236
|
+
pins : list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
|
|
1237
|
+
List of pins.
|
|
1352
1238
|
group_name : str, optional
|
|
1353
|
-
|
|
1354
|
-
a default name is assigned as follows: ``[component Name] [NetName]``.
|
|
1239
|
+
Group name.
|
|
1355
1240
|
|
|
1356
1241
|
Returns
|
|
1357
1242
|
-------
|
|
1358
|
-
pingroup
|
|
1243
|
+
:class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup` or bool
|
|
1244
|
+
Pin group instance if successful, False otherwise.
|
|
1359
1245
|
|
|
1360
1246
|
Examples
|
|
1361
1247
|
--------
|
|
1362
|
-
>>>
|
|
1363
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1364
|
-
>>> edbapp.components.create_pingroup_from_pins(gndpinlist, "MyGNDPingroup")
|
|
1365
|
-
|
|
1248
|
+
>>> pingroup = edbapp.components.create_pingroup_from_pins(pins, "GND_pins")
|
|
1366
1249
|
"""
|
|
1367
1250
|
if len(pins) < 1:
|
|
1368
1251
|
self._logger.error("No pins specified for pin group %s", group_name)
|
|
1369
|
-
return
|
|
1252
|
+
return False
|
|
1370
1253
|
if group_name is None:
|
|
1371
1254
|
group_name = PinGroup.unique_name(self._active_layout, "pin_group")
|
|
1372
1255
|
for pin in pins:
|
|
@@ -1396,31 +1279,22 @@ class Components(object):
|
|
|
1396
1279
|
pin_group.net = pins[0].net
|
|
1397
1280
|
return pin_group
|
|
1398
1281
|
|
|
1399
|
-
def delete_single_pin_rlc(self, deactivate_only=False) -> list[
|
|
1400
|
-
|
|
1401
|
-
"""Delete all RLC components with a single pin.
|
|
1402
|
-
Single pin component model type will be reverted to ``"RLC"``.
|
|
1282
|
+
def delete_single_pin_rlc(self, deactivate_only=False) -> list[str]:
|
|
1283
|
+
"""Delete or deactivate single-pin RLC components.
|
|
1403
1284
|
|
|
1404
1285
|
Parameters
|
|
1405
1286
|
----------
|
|
1406
1287
|
deactivate_only : bool, optional
|
|
1407
|
-
Whether to only deactivate
|
|
1408
|
-
delete them. The default is ``False``, in which case they are deleted.
|
|
1288
|
+
Whether to only deactivate instead of deleting.
|
|
1409
1289
|
|
|
1410
1290
|
Returns
|
|
1411
1291
|
-------
|
|
1412
|
-
list
|
|
1413
|
-
List of
|
|
1414
|
-
|
|
1292
|
+
list[str]
|
|
1293
|
+
List of affected components.
|
|
1415
1294
|
|
|
1416
1295
|
Examples
|
|
1417
1296
|
--------
|
|
1418
|
-
|
|
1419
|
-
>>> from pyedb import Edb
|
|
1420
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1421
|
-
>>> list_of_deleted_rlcs = edbapp.components.delete_single_pin_rlc()
|
|
1422
|
-
>>> print(list_of_deleted_rlcs)
|
|
1423
|
-
|
|
1297
|
+
>>> deleted = edbapp.components.delete_single_pin_rlc()
|
|
1424
1298
|
"""
|
|
1425
1299
|
deleted_comps = []
|
|
1426
1300
|
for comp, val in self.instances.items():
|
|
@@ -1442,20 +1316,16 @@ class Components(object):
|
|
|
1442
1316
|
Parameters
|
|
1443
1317
|
----------
|
|
1444
1318
|
component_name : str
|
|
1445
|
-
|
|
1319
|
+
Component name.
|
|
1446
1320
|
|
|
1447
1321
|
Returns
|
|
1448
1322
|
-------
|
|
1449
1323
|
bool
|
|
1450
|
-
|
|
1324
|
+
True if successful, False otherwise.
|
|
1451
1325
|
|
|
1452
1326
|
Examples
|
|
1453
1327
|
--------
|
|
1454
|
-
|
|
1455
|
-
>>> from pyedb import Edb
|
|
1456
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1457
|
-
>>> edbapp.components.delete("A1")
|
|
1458
|
-
|
|
1328
|
+
>>> edbapp.components.delete("R1")
|
|
1459
1329
|
"""
|
|
1460
1330
|
edb_cmp = self.get_component_by_name(component_name)
|
|
1461
1331
|
if edb_cmp is not None:
|
|
@@ -1466,25 +1336,21 @@ class Components(object):
|
|
|
1466
1336
|
return False
|
|
1467
1337
|
|
|
1468
1338
|
def disable_rlc_component(self, component_name) -> bool:
|
|
1469
|
-
"""Disable
|
|
1339
|
+
"""Disable RLC component.
|
|
1470
1340
|
|
|
1471
1341
|
Parameters
|
|
1472
1342
|
----------
|
|
1473
1343
|
component_name : str
|
|
1474
|
-
|
|
1344
|
+
Component name.
|
|
1475
1345
|
|
|
1476
1346
|
Returns
|
|
1477
1347
|
-------
|
|
1478
1348
|
bool
|
|
1479
|
-
|
|
1349
|
+
True if successful, False otherwise.
|
|
1480
1350
|
|
|
1481
1351
|
Examples
|
|
1482
1352
|
--------
|
|
1483
|
-
|
|
1484
|
-
>>> from pyedb import Edb
|
|
1485
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1486
|
-
>>> edbapp.components.disable_rlc_component("A1")
|
|
1487
|
-
|
|
1353
|
+
>>> edbapp.components.disable_rlc_component("R1")
|
|
1488
1354
|
"""
|
|
1489
1355
|
cmp = self.get_component_by_name(component_name)
|
|
1490
1356
|
if cmp is not None:
|
|
@@ -1514,45 +1380,39 @@ class Components(object):
|
|
|
1514
1380
|
reference_size_y=0,
|
|
1515
1381
|
reference_height=0,
|
|
1516
1382
|
) -> bool:
|
|
1517
|
-
"""Set
|
|
1383
|
+
"""Set solder ball properties for a component.
|
|
1518
1384
|
|
|
1519
1385
|
Parameters
|
|
1520
1386
|
----------
|
|
1521
|
-
component : str or
|
|
1522
|
-
|
|
1523
|
-
sball_diam
|
|
1524
|
-
|
|
1525
|
-
sball_height :
|
|
1526
|
-
|
|
1387
|
+
component : str or :class:`pyedb.grpc.database.hierarchy.component.Component`, optional
|
|
1388
|
+
Component name or instance.
|
|
1389
|
+
sball_diam : float, optional
|
|
1390
|
+
Solder ball diameter.
|
|
1391
|
+
sball_height : float, optional
|
|
1392
|
+
Solder ball height.
|
|
1527
1393
|
shape : str, optional
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
Mid diameter of the solder ball.
|
|
1394
|
+
Solder ball shape ("Cylinder" or "Spheroid").
|
|
1395
|
+
sball_mid_diam : float, optional
|
|
1396
|
+
Solder ball mid diameter.
|
|
1532
1397
|
chip_orientation : str, optional
|
|
1533
|
-
|
|
1534
|
-
IC model.
|
|
1398
|
+
Chip orientation ("chip_down" or "chip_up").
|
|
1535
1399
|
auto_reference_size : bool, optional
|
|
1536
|
-
|
|
1537
|
-
reference_size_x :
|
|
1538
|
-
|
|
1539
|
-
reference_size_y :
|
|
1540
|
-
|
|
1541
|
-
reference_height :
|
|
1542
|
-
|
|
1400
|
+
Use auto reference size.
|
|
1401
|
+
reference_size_x : float, optional
|
|
1402
|
+
Reference size X.
|
|
1403
|
+
reference_size_y : float, optional
|
|
1404
|
+
Reference size Y.
|
|
1405
|
+
reference_height : float, optional
|
|
1406
|
+
Reference height.
|
|
1543
1407
|
|
|
1544
1408
|
Returns
|
|
1545
1409
|
-------
|
|
1546
1410
|
bool
|
|
1547
|
-
|
|
1411
|
+
True if successful, False otherwise.
|
|
1548
1412
|
|
|
1549
1413
|
Examples
|
|
1550
1414
|
--------
|
|
1551
|
-
|
|
1552
|
-
>>> from pyedb import Edb
|
|
1553
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1554
|
-
>>> edbapp.components.set_solder_ball("A1")
|
|
1555
|
-
|
|
1415
|
+
>>> edbapp.components.set_solder_ball("U1", sball_diam=0.5e-3)
|
|
1556
1416
|
"""
|
|
1557
1417
|
if isinstance(component, str):
|
|
1558
1418
|
if component in self.instances:
|
|
@@ -1612,35 +1472,29 @@ class Components(object):
|
|
|
1612
1472
|
cap_value=None,
|
|
1613
1473
|
isparallel=False,
|
|
1614
1474
|
) -> bool:
|
|
1615
|
-
"""
|
|
1475
|
+
"""Set RLC values for a component.
|
|
1616
1476
|
|
|
1617
1477
|
Parameters
|
|
1618
1478
|
----------
|
|
1619
|
-
componentname :
|
|
1620
|
-
|
|
1479
|
+
componentname : str
|
|
1480
|
+
Component name.
|
|
1621
1481
|
res_value : float, optional
|
|
1622
|
-
Resistance value.
|
|
1482
|
+
Resistance value.
|
|
1623
1483
|
ind_value : float, optional
|
|
1624
|
-
|
|
1625
|
-
cap_value : float optional
|
|
1626
|
-
|
|
1484
|
+
Inductance value.
|
|
1485
|
+
cap_value : float, optional
|
|
1486
|
+
Capacitance value.
|
|
1627
1487
|
isparallel : bool, optional
|
|
1628
|
-
Whether
|
|
1488
|
+
Whether RLC is parallel.
|
|
1629
1489
|
|
|
1630
1490
|
Returns
|
|
1631
1491
|
-------
|
|
1632
1492
|
bool
|
|
1633
|
-
|
|
1493
|
+
True if successful, False otherwise.
|
|
1634
1494
|
|
|
1635
1495
|
Examples
|
|
1636
1496
|
--------
|
|
1637
|
-
|
|
1638
|
-
>>> from pyedb import Edb
|
|
1639
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
1640
|
-
>>> edbapp.components.set_component_rlc(
|
|
1641
|
-
... "R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False
|
|
1642
|
-
... )
|
|
1643
|
-
|
|
1497
|
+
>>> edbapp.components.set_component_rlc("R1", res_value=50)
|
|
1644
1498
|
"""
|
|
1645
1499
|
if res_value is None and ind_value is None and cap_value is None:
|
|
1646
1500
|
self.instances[componentname].enabled = False
|
|
@@ -1691,33 +1545,29 @@ class Components(object):
|
|
|
1691
1545
|
comptype="Prod name",
|
|
1692
1546
|
refdes="Pos / Place",
|
|
1693
1547
|
) -> bool:
|
|
1694
|
-
"""Update
|
|
1548
|
+
"""Update RLC values from BOM file.
|
|
1695
1549
|
|
|
1696
1550
|
Parameters
|
|
1697
1551
|
----------
|
|
1698
1552
|
bom_file : str
|
|
1699
|
-
|
|
1700
|
-
Header values needed inside the BOM reader must
|
|
1701
|
-
be explicitly set if different from the defaults.
|
|
1553
|
+
BOM file path.
|
|
1702
1554
|
delimiter : str, optional
|
|
1703
|
-
|
|
1555
|
+
Delimiter character.
|
|
1704
1556
|
valuefield : str, optional
|
|
1705
|
-
|
|
1706
|
-
The value for this parameter must being with the value of the component
|
|
1707
|
-
followed by a space and then the rest of the value. For example, ``"22pF"``.
|
|
1557
|
+
Value field name.
|
|
1708
1558
|
comptype : str, optional
|
|
1709
|
-
|
|
1710
|
-
example, you might enter ``"Inductor"``.
|
|
1559
|
+
Component type field name.
|
|
1711
1560
|
refdes : str, optional
|
|
1712
|
-
|
|
1713
|
-
``"Pos / Place"``. For example, you might enter ``"C100"``.
|
|
1561
|
+
Reference designator field name.
|
|
1714
1562
|
|
|
1715
1563
|
Returns
|
|
1716
1564
|
-------
|
|
1717
1565
|
bool
|
|
1718
|
-
|
|
1719
|
-
returned even if no values are assigned.
|
|
1566
|
+
True if successful, False otherwise.
|
|
1720
1567
|
|
|
1568
|
+
Examples
|
|
1569
|
+
--------
|
|
1570
|
+
>>> edbapp.components.update_rlc_from_bom("bom.csv")
|
|
1721
1571
|
"""
|
|
1722
1572
|
with open(bom_file, "r") as f:
|
|
1723
1573
|
Lines = f.readlines()
|
|
@@ -1761,28 +1611,31 @@ class Components(object):
|
|
|
1761
1611
|
comp_type_col=2,
|
|
1762
1612
|
value_col=3,
|
|
1763
1613
|
) -> bool:
|
|
1764
|
-
"""
|
|
1614
|
+
"""Import BOM file.
|
|
1765
1615
|
|
|
1766
1616
|
Parameters
|
|
1767
1617
|
----------
|
|
1768
1618
|
bom_file : str
|
|
1769
|
-
|
|
1619
|
+
BOM file path.
|
|
1770
1620
|
delimiter : str, optional
|
|
1771
|
-
|
|
1621
|
+
Delimiter character.
|
|
1772
1622
|
refdes_col : int, optional
|
|
1773
|
-
|
|
1623
|
+
Reference designator column index.
|
|
1774
1624
|
part_name_col : int, optional
|
|
1775
|
-
|
|
1776
|
-
the column does not exist.
|
|
1625
|
+
Part name column index.
|
|
1777
1626
|
comp_type_col : int, optional
|
|
1778
|
-
|
|
1627
|
+
Component type column index.
|
|
1779
1628
|
value_col : int, optional
|
|
1780
|
-
|
|
1781
|
-
if the column does not exist.
|
|
1629
|
+
Value column index.
|
|
1782
1630
|
|
|
1783
1631
|
Returns
|
|
1784
1632
|
-------
|
|
1785
1633
|
bool
|
|
1634
|
+
True if successful, False otherwise.
|
|
1635
|
+
|
|
1636
|
+
Examples
|
|
1637
|
+
--------
|
|
1638
|
+
>>> edbapp.components.import_bom("bom.csv")
|
|
1786
1639
|
"""
|
|
1787
1640
|
with open(bom_file, "r") as f:
|
|
1788
1641
|
lines = f.readlines()
|
|
@@ -1841,18 +1694,23 @@ class Components(object):
|
|
|
1841
1694
|
return True
|
|
1842
1695
|
|
|
1843
1696
|
def export_bom(self, bom_file, delimiter=",") -> bool:
|
|
1844
|
-
"""Export
|
|
1697
|
+
"""Export BOM file.
|
|
1845
1698
|
|
|
1846
1699
|
Parameters
|
|
1847
1700
|
----------
|
|
1848
1701
|
bom_file : str
|
|
1849
|
-
|
|
1702
|
+
Output file path.
|
|
1850
1703
|
delimiter : str, optional
|
|
1851
|
-
|
|
1704
|
+
Delimiter character.
|
|
1852
1705
|
|
|
1853
1706
|
Returns
|
|
1854
1707
|
-------
|
|
1855
1708
|
bool
|
|
1709
|
+
True if successful, False otherwise.
|
|
1710
|
+
|
|
1711
|
+
Examples
|
|
1712
|
+
--------
|
|
1713
|
+
>>> edbapp.components.export_bom("exported_bom.csv")
|
|
1856
1714
|
"""
|
|
1857
1715
|
with open(bom_file, "w") as f:
|
|
1858
1716
|
f.writelines([delimiter.join(["RefDes", "Part name", "Type", "Value\n"])])
|
|
@@ -1875,60 +1733,63 @@ class Components(object):
|
|
|
1875
1733
|
return True
|
|
1876
1734
|
|
|
1877
1735
|
def find_by_reference_designator(self, reference_designator) -> Component:
|
|
1878
|
-
"""Find
|
|
1736
|
+
"""Find component by reference designator.
|
|
1879
1737
|
|
|
1880
1738
|
Parameters
|
|
1881
1739
|
----------
|
|
1882
1740
|
reference_designator : str
|
|
1883
|
-
Reference designator
|
|
1741
|
+
Reference designator.
|
|
1884
1742
|
|
|
1885
1743
|
Returns
|
|
1886
1744
|
-------
|
|
1887
|
-
Component
|
|
1745
|
+
:class:`pyedb.grpc.database.hierarchy.component.Component`
|
|
1746
|
+
Component instance.
|
|
1747
|
+
|
|
1748
|
+
Examples
|
|
1749
|
+
--------
|
|
1750
|
+
>>> comp = edbapp.components.find_by_reference_designator("R1")
|
|
1888
1751
|
"""
|
|
1889
1752
|
return self.instances[reference_designator]
|
|
1890
1753
|
|
|
1891
1754
|
def get_aedt_pin_name(self, pin) -> str:
|
|
1892
|
-
"""
|
|
1893
|
-
|
|
1894
|
-
.. note::
|
|
1895
|
-
To obtain the EDB core pin name, use `pin.GetName()`.
|
|
1755
|
+
"""Get AEDT pin name.
|
|
1896
1756
|
|
|
1897
1757
|
Parameters
|
|
1898
1758
|
----------
|
|
1899
|
-
pin :
|
|
1900
|
-
|
|
1759
|
+
pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
|
|
1760
|
+
Pin instance.
|
|
1901
1761
|
|
|
1902
1762
|
Returns
|
|
1903
1763
|
-------
|
|
1904
1764
|
str
|
|
1905
|
-
|
|
1765
|
+
AEDT pin name.
|
|
1906
1766
|
|
|
1907
1767
|
Examples
|
|
1908
1768
|
--------
|
|
1909
|
-
|
|
1910
|
-
>>> from pyedb import Edb
|
|
1911
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
1912
|
-
>>> edbapp.components.get_aedt_pin_name(pin)
|
|
1913
|
-
|
|
1769
|
+
>>> name = edbapp.components.get_aedt_pin_name(pin)
|
|
1914
1770
|
"""
|
|
1915
1771
|
return pin.aedt_name
|
|
1916
1772
|
|
|
1917
|
-
def get_pins(self, reference_designator, net_name=None, pin_name=None):
|
|
1918
|
-
"""Get component
|
|
1773
|
+
def get_pins(self, reference_designator, net_name=None, pin_name=None) -> dict:
|
|
1774
|
+
"""Get pins of a component.
|
|
1919
1775
|
|
|
1920
1776
|
Parameters
|
|
1921
1777
|
----------
|
|
1922
1778
|
reference_designator : str
|
|
1923
|
-
Reference designator
|
|
1779
|
+
Reference designator.
|
|
1924
1780
|
net_name : str, optional
|
|
1925
|
-
|
|
1781
|
+
Net name filter.
|
|
1926
1782
|
pin_name : str, optional
|
|
1927
|
-
|
|
1783
|
+
Pin name filter.
|
|
1928
1784
|
|
|
1929
1785
|
Returns
|
|
1930
1786
|
-------
|
|
1931
|
-
|
|
1787
|
+
dict
|
|
1788
|
+
Dictionary of pins.
|
|
1789
|
+
|
|
1790
|
+
Examples
|
|
1791
|
+
--------
|
|
1792
|
+
>>> pins = edbapp.components.get_pins("U1", net_name="GND")
|
|
1932
1793
|
"""
|
|
1933
1794
|
comp = self.find_by_reference_designator(reference_designator)
|
|
1934
1795
|
|
|
@@ -1941,26 +1802,22 @@ class Components(object):
|
|
|
1941
1802
|
|
|
1942
1803
|
return pins
|
|
1943
1804
|
|
|
1944
|
-
def get_pin_position(self, pin) -> list[float
|
|
1945
|
-
"""
|
|
1805
|
+
def get_pin_position(self, pin) -> list[float]:
|
|
1806
|
+
"""Get pin position.
|
|
1946
1807
|
|
|
1947
1808
|
Parameters
|
|
1948
1809
|
----------
|
|
1949
|
-
pin :
|
|
1950
|
-
|
|
1810
|
+
pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
|
|
1811
|
+
Pin instance.
|
|
1951
1812
|
|
|
1952
1813
|
Returns
|
|
1953
1814
|
-------
|
|
1954
|
-
list
|
|
1955
|
-
|
|
1815
|
+
list[float]
|
|
1816
|
+
[x, y] position in meters.
|
|
1956
1817
|
|
|
1957
1818
|
Examples
|
|
1958
1819
|
--------
|
|
1959
|
-
|
|
1960
|
-
>>> from pyedb import Edb
|
|
1961
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
1962
|
-
>>> edbapp.components.get_pin_position(pin)
|
|
1963
|
-
|
|
1820
|
+
>>> pos = edbapp.components.get_pin_position(pin)
|
|
1964
1821
|
"""
|
|
1965
1822
|
|
|
1966
1823
|
pt_pos = pin.position
|
|
@@ -1971,27 +1828,23 @@ class Components(object):
|
|
|
1971
1828
|
return [transformed_pt_pos[0].value, transformed_pt_pos[1].value]
|
|
1972
1829
|
|
|
1973
1830
|
def get_pins_name_from_net(self, net_name, pin_list=None) -> list[str]:
|
|
1974
|
-
"""
|
|
1831
|
+
"""Get pin names from net.
|
|
1975
1832
|
|
|
1976
1833
|
Parameters
|
|
1977
1834
|
----------
|
|
1978
|
-
pin_list : list of EDBPadstackInstance, optional
|
|
1979
|
-
List of pins to check. The default is ``None``, in which case all pins are checked
|
|
1980
1835
|
net_name : str
|
|
1981
|
-
|
|
1836
|
+
Net name.
|
|
1837
|
+
pin_list : list, optional
|
|
1838
|
+
List of pins to search.
|
|
1982
1839
|
|
|
1983
1840
|
Returns
|
|
1984
1841
|
-------
|
|
1985
|
-
list
|
|
1986
|
-
|
|
1842
|
+
list[str]
|
|
1843
|
+
List of pin names.
|
|
1987
1844
|
|
|
1988
1845
|
Examples
|
|
1989
1846
|
--------
|
|
1990
|
-
|
|
1991
|
-
>>> from pyedb import Edb
|
|
1992
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
1993
|
-
>>> edbapp.components.get_pins_name_from_net(pin_list, net_name)
|
|
1994
|
-
|
|
1847
|
+
>>> pins = edbapp.components.get_pins_name_from_net("GND")
|
|
1995
1848
|
"""
|
|
1996
1849
|
pin_names = []
|
|
1997
1850
|
if not pin_list:
|
|
@@ -2006,48 +1859,40 @@ class Components(object):
|
|
|
2006
1859
|
return pin_names
|
|
2007
1860
|
|
|
2008
1861
|
def get_nets_from_pin_list(self, pins) -> list[str]:
|
|
2009
|
-
"""
|
|
1862
|
+
"""Get nets from pin list.
|
|
2010
1863
|
|
|
2011
1864
|
Parameters
|
|
2012
1865
|
----------
|
|
2013
|
-
|
|
1866
|
+
pins : list
|
|
2014
1867
|
List of pins.
|
|
2015
1868
|
|
|
2016
1869
|
Returns
|
|
2017
1870
|
-------
|
|
2018
|
-
list
|
|
2019
|
-
List of
|
|
1871
|
+
list[str]
|
|
1872
|
+
List of net names.
|
|
2020
1873
|
|
|
2021
1874
|
Examples
|
|
2022
1875
|
--------
|
|
2023
|
-
|
|
2024
|
-
>>> from pyedb import Edb
|
|
2025
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
2026
|
-
>>> edbapp.components.get_nets_from_pin_list(pins)
|
|
2027
|
-
|
|
1876
|
+
>>> nets = edbapp.components.get_nets_from_pin_list(pins)
|
|
2028
1877
|
"""
|
|
2029
1878
|
return list(set([pin.net.name for pin in pins]))
|
|
2030
1879
|
|
|
2031
|
-
def get_component_net_connection_info(self, refdes) ->
|
|
2032
|
-
"""
|
|
1880
|
+
def get_component_net_connection_info(self, refdes) -> dict:
|
|
1881
|
+
"""Get net connection info for a component.
|
|
2033
1882
|
|
|
2034
1883
|
Parameters
|
|
2035
1884
|
----------
|
|
2036
|
-
refdes :
|
|
2037
|
-
Reference designator
|
|
1885
|
+
refdes : str
|
|
1886
|
+
Reference designator.
|
|
2038
1887
|
|
|
2039
1888
|
Returns
|
|
2040
1889
|
-------
|
|
2041
1890
|
dict
|
|
2042
|
-
Dictionary
|
|
1891
|
+
Dictionary with refdes, pin_name, and net_name.
|
|
2043
1892
|
|
|
2044
1893
|
Examples
|
|
2045
1894
|
--------
|
|
2046
|
-
|
|
2047
|
-
>>> from pyedb import Edb
|
|
2048
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
2049
|
-
>>> edbapp.components.get_component_net_connection_info(refdes)
|
|
2050
|
-
|
|
1895
|
+
>>> info = edbapp.components.get_component_net_connection_info("U1")
|
|
2051
1896
|
"""
|
|
2052
1897
|
data = {"refdes": [], "pin_name": [], "net_name": []}
|
|
2053
1898
|
for _, pin_obj in self.instances[refdes].pins.items():
|
|
@@ -2060,22 +1905,17 @@ class Components(object):
|
|
|
2060
1905
|
data["net_name"].append(net_name)
|
|
2061
1906
|
return data
|
|
2062
1907
|
|
|
2063
|
-
def get_rats(self) -> list[dict
|
|
2064
|
-
"""
|
|
1908
|
+
def get_rats(self) -> list[dict]:
|
|
1909
|
+
"""Get RATS (Reference Designator, Pin, Net) information.
|
|
2065
1910
|
|
|
2066
1911
|
Returns
|
|
2067
1912
|
-------
|
|
2068
|
-
list
|
|
2069
|
-
List of dictionaries
|
|
2070
|
-
and net names.
|
|
1913
|
+
list[dict]
|
|
1914
|
+
List of dictionaries with refdes, pin_name, and net_name.
|
|
2071
1915
|
|
|
2072
1916
|
Examples
|
|
2073
1917
|
--------
|
|
2074
|
-
|
|
2075
|
-
>>> from pyedb import Edb
|
|
2076
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
2077
|
-
>>> edbapp.components.get_rats()
|
|
2078
|
-
|
|
1918
|
+
>>> rats = edbapp.components.get_rats()
|
|
2079
1919
|
"""
|
|
2080
1920
|
df_list = []
|
|
2081
1921
|
for refdes in self.instances.keys():
|
|
@@ -2083,26 +1923,22 @@ class Components(object):
|
|
|
2083
1923
|
df_list.append(df)
|
|
2084
1924
|
return df_list
|
|
2085
1925
|
|
|
2086
|
-
def get_through_resistor_list(self, threshold=1) -> list[
|
|
2087
|
-
"""
|
|
1926
|
+
def get_through_resistor_list(self, threshold=1) -> list[str]:
|
|
1927
|
+
"""Get through resistors below threshold.
|
|
2088
1928
|
|
|
2089
1929
|
Parameters
|
|
2090
1930
|
----------
|
|
2091
|
-
threshold :
|
|
2092
|
-
|
|
1931
|
+
threshold : float, optional
|
|
1932
|
+
Resistance threshold.
|
|
2093
1933
|
|
|
2094
1934
|
Returns
|
|
2095
1935
|
-------
|
|
2096
|
-
list
|
|
2097
|
-
List of
|
|
1936
|
+
list[str]
|
|
1937
|
+
List of component names.
|
|
2098
1938
|
|
|
2099
1939
|
Examples
|
|
2100
1940
|
--------
|
|
2101
|
-
|
|
2102
|
-
>>> from pyedb import Edb
|
|
2103
|
-
>>> edbapp = Edb("myaedbfolder", "project name", "release version")
|
|
2104
|
-
>>> edbapp.components.get_through_resistor_list()
|
|
2105
|
-
|
|
1941
|
+
>>> resistors = edbapp.components.get_through_resistor_list(1)
|
|
2106
1942
|
"""
|
|
2107
1943
|
through_comp_list = []
|
|
2108
1944
|
for refdes, comp_obj in self.resistors.items():
|
|
@@ -2118,29 +1954,25 @@ class Components(object):
|
|
|
2118
1954
|
return through_comp_list
|
|
2119
1955
|
|
|
2120
1956
|
def short_component_pins(self, component_name, pins_to_short=None, width=1e-3) -> bool:
|
|
2121
|
-
"""Short pins
|
|
1957
|
+
"""Short component pins with traces.
|
|
2122
1958
|
|
|
2123
1959
|
Parameters
|
|
2124
1960
|
----------
|
|
2125
1961
|
component_name : str
|
|
2126
|
-
|
|
2127
|
-
pins_to_short : list, optional
|
|
2128
|
-
List of
|
|
1962
|
+
Component name.
|
|
1963
|
+
pins_to_short : list[str], optional
|
|
1964
|
+
List of pin names to short.
|
|
2129
1965
|
width : float, optional
|
|
2130
|
-
|
|
1966
|
+
Trace width.
|
|
2131
1967
|
|
|
2132
1968
|
Returns
|
|
2133
1969
|
-------
|
|
2134
1970
|
bool
|
|
2135
|
-
|
|
1971
|
+
True if successful, False otherwise.
|
|
2136
1972
|
|
|
2137
1973
|
Examples
|
|
2138
1974
|
--------
|
|
2139
|
-
|
|
2140
|
-
>>> from pyedb import Edb
|
|
2141
|
-
>>> edbapp = Edb("myaedbfolder")
|
|
2142
1975
|
>>> edbapp.components.short_component_pins("J4A2", ["G4", "9", "3"])
|
|
2143
|
-
|
|
2144
1976
|
"""
|
|
2145
1977
|
component = self.instances[component_name]
|
|
2146
1978
|
pins = component.pins
|
|
@@ -2258,20 +2090,25 @@ class Components(object):
|
|
|
2258
2090
|
return True
|
|
2259
2091
|
|
|
2260
2092
|
def create_pin_group(self, reference_designator, pin_numbers, group_name=None) -> Union[tuple[str, PinGroup], bool]:
|
|
2261
|
-
"""Create pin group on
|
|
2093
|
+
"""Create pin group on a component.
|
|
2262
2094
|
|
|
2263
2095
|
Parameters
|
|
2264
2096
|
----------
|
|
2265
2097
|
reference_designator : str
|
|
2266
|
-
|
|
2267
|
-
pin_numbers :
|
|
2268
|
-
List of
|
|
2098
|
+
Reference designator.
|
|
2099
|
+
pin_numbers : list[str]
|
|
2100
|
+
List of pin names.
|
|
2269
2101
|
group_name : str, optional
|
|
2270
|
-
|
|
2102
|
+
Group name.
|
|
2271
2103
|
|
|
2272
2104
|
Returns
|
|
2273
2105
|
-------
|
|
2274
|
-
PinGroup
|
|
2106
|
+
tuple[str, :class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup`] or bool
|
|
2107
|
+
(group_name, PinGroup) if successful, False otherwise.
|
|
2108
|
+
|
|
2109
|
+
Examples
|
|
2110
|
+
--------
|
|
2111
|
+
>>> name, group = edbapp.components.create_pin_group("U1", ["1", "2"])
|
|
2275
2112
|
"""
|
|
2276
2113
|
if not isinstance(pin_numbers, list):
|
|
2277
2114
|
pin_numbers = [pin_numbers]
|
|
@@ -2298,20 +2135,25 @@ class Components(object):
|
|
|
2298
2135
|
return False
|
|
2299
2136
|
|
|
2300
2137
|
def create_pin_group_on_net(self, reference_designator, net_name, group_name=None) -> PinGroup:
|
|
2301
|
-
"""Create pin group
|
|
2138
|
+
"""Create pin group by net name.
|
|
2302
2139
|
|
|
2303
2140
|
Parameters
|
|
2304
2141
|
----------
|
|
2305
2142
|
reference_designator : str
|
|
2306
|
-
|
|
2143
|
+
Reference designator.
|
|
2307
2144
|
net_name : str
|
|
2308
|
-
|
|
2145
|
+
Net name.
|
|
2309
2146
|
group_name : str, optional
|
|
2310
|
-
|
|
2147
|
+
Group name.
|
|
2311
2148
|
|
|
2312
2149
|
Returns
|
|
2313
2150
|
-------
|
|
2314
|
-
PinGroup
|
|
2151
|
+
:class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup`
|
|
2152
|
+
Pin group instance.
|
|
2153
|
+
|
|
2154
|
+
Examples
|
|
2155
|
+
--------
|
|
2156
|
+
>>> group = edbapp.components.create_pin_group_on_net("U1", "GND")
|
|
2315
2157
|
"""
|
|
2316
2158
|
pins = [
|
|
2317
2159
|
pin.name for pin in list(self.instances[reference_designator].pins.values()) if pin.net_name == net_name
|