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/padstacks.py
CHANGED
|
@@ -55,7 +55,7 @@ from pyedb.modeler.geometry_operators import GeometryOperators
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
class Padstacks(object):
|
|
58
|
-
"""Manages EDB methods for
|
|
58
|
+
"""Manages EDB methods for padstacks accessible from `Edb.padstacks` property.
|
|
59
59
|
|
|
60
60
|
Examples
|
|
61
61
|
--------
|
|
@@ -65,16 +65,18 @@ class Padstacks(object):
|
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
67
|
def __getitem__(self, name):
|
|
68
|
-
"""Get
|
|
68
|
+
"""Get a padstack definition or instance from the EDB project.
|
|
69
69
|
|
|
70
70
|
Parameters
|
|
71
71
|
----------
|
|
72
72
|
name : str, int
|
|
73
|
+
Name or ID of the padstack definition or instance.
|
|
73
74
|
|
|
74
75
|
Returns
|
|
75
76
|
-------
|
|
76
|
-
:class:`pyedb.dotnet.database.
|
|
77
|
-
|
|
77
|
+
:class:`pyedb.dotnet.database.definition.padstack_def.PadstackDef` or
|
|
78
|
+
:class:`pyedb.dotnet.database.primitive.padstack_instance.PadstackInstance`
|
|
79
|
+
Requested padstack definition or instance. Returns ``None`` if not found.
|
|
78
80
|
"""
|
|
79
81
|
if isinstance(name, int) and name in self.instances:
|
|
80
82
|
return self.instances(name)
|
|
@@ -128,6 +130,11 @@ class Padstacks(object):
|
|
|
128
130
|
-------
|
|
129
131
|
object
|
|
130
132
|
EDB.PadType enumerator value.
|
|
133
|
+
|
|
134
|
+
Examples
|
|
135
|
+
--------
|
|
136
|
+
>>> pad_type = edb_padstacks.int_to_pad_type(0) # Returns REGULAR_PAD
|
|
137
|
+
>>> pad_type = edb_padstacks.int_to_pad_type(1) # Returns ANTI_PAD
|
|
131
138
|
"""
|
|
132
139
|
|
|
133
140
|
if val == 0:
|
|
@@ -154,6 +161,11 @@ class Padstacks(object):
|
|
|
154
161
|
-------
|
|
155
162
|
object
|
|
156
163
|
EDB.PadGeometryType enumerator value.
|
|
164
|
+
|
|
165
|
+
Examples
|
|
166
|
+
--------
|
|
167
|
+
>>> geom_type = edb_padstacks.int_to_geometry_type(1) # Returns CIRCLE
|
|
168
|
+
>>> geom_type = edb_padstacks.int_to_geometry_type(2) # Returns SQUARE
|
|
157
169
|
"""
|
|
158
170
|
if val == 0:
|
|
159
171
|
return GrpcPadGeometryType.PADGEOMTYPE_NO_GEOMETRY
|
|
@@ -188,9 +200,14 @@ class Padstacks(object):
|
|
|
188
200
|
|
|
189
201
|
Returns
|
|
190
202
|
-------
|
|
191
|
-
dict[str, :class:`pyedb.
|
|
192
|
-
|
|
203
|
+
dict[str, :class:`pyedb.grpc.database.definition.padstack_def.PadstackDef`]
|
|
204
|
+
Dictionary of padstack definitions with definition names as keys.
|
|
193
205
|
|
|
206
|
+
Examples
|
|
207
|
+
--------
|
|
208
|
+
>>> all_definitions = edb_padstacks.definitions
|
|
209
|
+
>>> for name, definition in all_definitions.items():
|
|
210
|
+
... print(f"Padstack: {name}")
|
|
194
211
|
"""
|
|
195
212
|
if len(self._definitions) == len(self.db.padstack_defs):
|
|
196
213
|
return self._definitions
|
|
@@ -202,13 +219,18 @@ class Padstacks(object):
|
|
|
202
219
|
|
|
203
220
|
@property
|
|
204
221
|
def instances(self):
|
|
205
|
-
"""
|
|
222
|
+
"""All padstack instances (vias and pins) in the layout.
|
|
206
223
|
|
|
207
224
|
Returns
|
|
208
225
|
-------
|
|
209
|
-
dict[int, :class:`
|
|
210
|
-
|
|
226
|
+
dict[int, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
227
|
+
Dictionary of padstack instances with database IDs as keys.
|
|
211
228
|
|
|
229
|
+
Examples
|
|
230
|
+
--------
|
|
231
|
+
>>> all_instances = edb_padstacks.instances
|
|
232
|
+
>>> for id, instance in all_instances.items():
|
|
233
|
+
... print(f"Instance {id}: {instance.name}")
|
|
212
234
|
"""
|
|
213
235
|
pad_stack_inst = self._pedb.layout.padstack_instances
|
|
214
236
|
if len(self._instances) == len(pad_stack_inst):
|
|
@@ -218,13 +240,18 @@ class Padstacks(object):
|
|
|
218
240
|
|
|
219
241
|
@property
|
|
220
242
|
def instances_by_name(self):
|
|
221
|
-
"""
|
|
243
|
+
"""All padstack instances (vias and pins) indexed by name.
|
|
222
244
|
|
|
223
245
|
Returns
|
|
224
246
|
-------
|
|
225
|
-
dict[str, :class:`
|
|
226
|
-
|
|
247
|
+
dict[str, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
248
|
+
Dictionary of padstack instances with names as keys.
|
|
227
249
|
|
|
250
|
+
Examples
|
|
251
|
+
--------
|
|
252
|
+
>>> named_instances = edb_padstacks.instances_by_name
|
|
253
|
+
>>> for name, instance in named_instances.items():
|
|
254
|
+
... print(f"Instance named {name}")
|
|
228
255
|
"""
|
|
229
256
|
padstack_instances = {}
|
|
230
257
|
for _, edb_padstack_instance in self.instances.items():
|
|
@@ -233,28 +260,40 @@ class Padstacks(object):
|
|
|
233
260
|
return padstack_instances
|
|
234
261
|
|
|
235
262
|
def find_instance_by_id(self, value: int):
|
|
236
|
-
"""Find a padstack instance by database
|
|
263
|
+
"""Find a padstack instance by database ID.
|
|
237
264
|
|
|
238
265
|
Parameters
|
|
239
266
|
----------
|
|
240
267
|
value : int
|
|
268
|
+
Database ID of the padstack instance.
|
|
269
|
+
|
|
270
|
+
Returns
|
|
271
|
+
-------
|
|
272
|
+
:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance` or None
|
|
273
|
+
Padstack instance if found, otherwise ``None``.
|
|
274
|
+
|
|
275
|
+
Examples
|
|
276
|
+
--------
|
|
277
|
+
>>> via = edb_padstacks.find_instance_by_id(123)
|
|
278
|
+
>>> if via:
|
|
279
|
+
... print(f"Found via: {via.name}")
|
|
241
280
|
"""
|
|
242
281
|
return self._pedb.modeler.find_object_by_id(value)
|
|
243
282
|
|
|
244
283
|
@property
|
|
245
284
|
def pins(self):
|
|
246
|
-
"""
|
|
285
|
+
"""All pin instances belonging to components.
|
|
247
286
|
|
|
248
287
|
Returns
|
|
249
288
|
-------
|
|
250
|
-
|
|
251
|
-
Dictionary of
|
|
252
|
-
|
|
289
|
+
dict[int, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
290
|
+
Dictionary of pin instances with database IDs as keys.
|
|
253
291
|
|
|
254
292
|
Examples
|
|
255
293
|
--------
|
|
256
|
-
>>>
|
|
257
|
-
>>>
|
|
294
|
+
>>> all_pins = edb_padstacks.pins
|
|
295
|
+
>>> for pin_id, pin in all_pins.items():
|
|
296
|
+
... print(f"Pin {pin_id} belongs to {pin.component.refdes}")
|
|
258
297
|
"""
|
|
259
298
|
pins = {}
|
|
260
299
|
for instancename, instance in self.instances.items():
|
|
@@ -264,18 +303,18 @@ class Padstacks(object):
|
|
|
264
303
|
|
|
265
304
|
@property
|
|
266
305
|
def vias(self):
|
|
267
|
-
"""
|
|
306
|
+
"""All via instances not belonging to components.
|
|
268
307
|
|
|
269
308
|
Returns
|
|
270
309
|
-------
|
|
271
|
-
|
|
272
|
-
Dictionary of
|
|
273
|
-
|
|
310
|
+
dict[int, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
311
|
+
Dictionary of via instances with database IDs as keys.
|
|
274
312
|
|
|
275
313
|
Examples
|
|
276
314
|
--------
|
|
277
|
-
>>>
|
|
278
|
-
>>>
|
|
315
|
+
>>> all_vias = edb_padstacks.vias
|
|
316
|
+
>>> for via_id, via in all_vias.items():
|
|
317
|
+
... print(f"Via {via_id} on net {via.net_name}")
|
|
279
318
|
"""
|
|
280
319
|
pnames = list(self.pins.keys())
|
|
281
320
|
vias = {i: j for i, j in self.instances.items() if i not in pnames}
|
|
@@ -292,6 +331,11 @@ class Padstacks(object):
|
|
|
292
331
|
-------
|
|
293
332
|
list
|
|
294
333
|
List of all layout pin groups.
|
|
334
|
+
|
|
335
|
+
Examples
|
|
336
|
+
--------
|
|
337
|
+
>>> groups = edb_padstacks.pingroups # Deprecated
|
|
338
|
+
>>> groups = edb_padstacks._layout.pin_groups # New way
|
|
295
339
|
"""
|
|
296
340
|
warnings.warn(
|
|
297
341
|
"`pingroups` is deprecated and is now located here " "`pyedb.grpc.core.layout.pin_groups` instead.",
|
|
@@ -335,6 +379,15 @@ class Padstacks(object):
|
|
|
335
379
|
-------
|
|
336
380
|
str
|
|
337
381
|
Name of the padstack if the operation is successful.
|
|
382
|
+
|
|
383
|
+
Examples
|
|
384
|
+
--------
|
|
385
|
+
>>> via_name = edb_padstacks.create_circular_padstack(
|
|
386
|
+
... padstackname="VIA1",
|
|
387
|
+
... holediam="200um",
|
|
388
|
+
... paddiam="400um",
|
|
389
|
+
... antipaddiam="600um"
|
|
390
|
+
... )
|
|
338
391
|
"""
|
|
339
392
|
|
|
340
393
|
padstack_def = PadstackDef.create(self._pedb.db, padstackname)
|
|
@@ -412,17 +465,17 @@ class Padstacks(object):
|
|
|
412
465
|
Parameters
|
|
413
466
|
----------
|
|
414
467
|
net_names : str, list
|
|
415
|
-
Names of the nets
|
|
468
|
+
Names of the nets whose padstack instances should be deleted.
|
|
416
469
|
|
|
417
470
|
Returns
|
|
418
471
|
-------
|
|
419
472
|
bool
|
|
420
473
|
``True`` when successful, ``False`` when failed.
|
|
421
474
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
>>>
|
|
475
|
+
Examples
|
|
476
|
+
--------
|
|
477
|
+
>>> success = edb_padstacks.delete_padstack_instances("GND")
|
|
478
|
+
>>> success = edb_padstacks.delete_padstack_instances(["GND", "PWR"])
|
|
426
479
|
"""
|
|
427
480
|
if not isinstance(net_names, list): # pragma: no cover
|
|
428
481
|
net_names = [net_names]
|
|
@@ -434,23 +487,28 @@ class Padstacks(object):
|
|
|
434
487
|
return True
|
|
435
488
|
|
|
436
489
|
def set_solderball(self, padstackInst, sballLayer_name, isTopPlaced=True, ballDiam=100e-6):
|
|
437
|
-
"""Set solderball for
|
|
490
|
+
"""Set solderball for a padstack instance.
|
|
438
491
|
|
|
439
492
|
Parameters
|
|
440
493
|
----------
|
|
441
|
-
padstackInst :
|
|
442
|
-
Padstack instance
|
|
443
|
-
sballLayer_name : str
|
|
444
|
-
Name of the layer where the solder ball is placed.
|
|
445
|
-
isTopPlaced : bool, optional
|
|
446
|
-
|
|
447
|
-
ballDiam :
|
|
448
|
-
Solder ball diameter
|
|
494
|
+
padstackInst : int or :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`
|
|
495
|
+
Padstack instance ID or object.
|
|
496
|
+
sballLayer_name : str
|
|
497
|
+
Name of the layer where the solder ball is placed.
|
|
498
|
+
isTopPlaced : bool, optional
|
|
499
|
+
Whether the solder ball is placed on top of the layer stackup. Default is ``True``.
|
|
500
|
+
ballDiam : float, optional
|
|
501
|
+
Solder ball diameter in meters. Default is ``100e-6`` (100 um).
|
|
449
502
|
|
|
450
503
|
Returns
|
|
451
504
|
-------
|
|
452
505
|
bool
|
|
506
|
+
``True`` when successful, ``False`` when failed.
|
|
453
507
|
|
|
508
|
+
Examples
|
|
509
|
+
--------
|
|
510
|
+
>>> via_id = 123
|
|
511
|
+
>>> success = edb_padstacks.set_solderball(via_id, "SolderBall_Top", True, 150e-6)
|
|
454
512
|
"""
|
|
455
513
|
if isinstance(padstackInst, int):
|
|
456
514
|
psdef = self.definitions[self.instances[padstackInst].padstack_definition].edb_padstack
|
|
@@ -511,21 +569,24 @@ class Padstacks(object):
|
|
|
511
569
|
)
|
|
512
570
|
|
|
513
571
|
def get_pin_from_component_and_net(self, refdes=None, netname=None):
|
|
514
|
-
"""Retrieve pins
|
|
572
|
+
"""Retrieve pins by component reference designator and net name.
|
|
515
573
|
|
|
516
574
|
Parameters
|
|
517
575
|
----------
|
|
518
576
|
refdes : str, optional
|
|
519
|
-
|
|
520
|
-
netname : str optional
|
|
521
|
-
|
|
577
|
+
Component reference designator.
|
|
578
|
+
netname : str, optional
|
|
579
|
+
Net name.
|
|
522
580
|
|
|
523
581
|
Returns
|
|
524
582
|
-------
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
``False`` is returned if the net does not belong to the component.
|
|
583
|
+
list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
584
|
+
List of matching pin instances.
|
|
528
585
|
|
|
586
|
+
Examples
|
|
587
|
+
--------
|
|
588
|
+
>>> pins = edb_padstacks.get_pin_from_component_and_net(refdes="U1", netname="VCC")
|
|
589
|
+
>>> pins = edb_padstacks.get_pin_from_component_and_net(netname="GND") # All GND pins
|
|
529
590
|
"""
|
|
530
591
|
pinlist = []
|
|
531
592
|
if refdes:
|
|
@@ -565,6 +626,10 @@ class Padstacks(object):
|
|
|
565
626
|
Dictionary of pins if the operation is successful.
|
|
566
627
|
``False`` is returned if the net does not belong to the component.
|
|
567
628
|
|
|
629
|
+
Examples
|
|
630
|
+
--------
|
|
631
|
+
>>> pins = edb_padstacks.get_pinlist_from_component_and_net(refdes="U1", netname="CLK") # Deprecated
|
|
632
|
+
>>> pins = edb_padstacks.get_pin_from_component_and_net(refdes="U1", netname="CLK") # New way
|
|
568
633
|
"""
|
|
569
634
|
warnings.warn(
|
|
570
635
|
"`get_pinlist_from_component_and_net` is deprecated use `get_pin_from_component_and_net` instead.",
|
|
@@ -573,21 +638,31 @@ class Padstacks(object):
|
|
|
573
638
|
return self.get_pin_from_component_and_net(refdes=refdes, netname=netname)
|
|
574
639
|
|
|
575
640
|
def get_pad_parameters(self, pin, layername, pad_type="regular_pad"):
|
|
576
|
-
"""Get
|
|
641
|
+
"""Get pad parameters for a pin on a specific layer.
|
|
577
642
|
|
|
578
643
|
Parameters
|
|
579
644
|
----------
|
|
580
|
-
pin :
|
|
581
|
-
|
|
645
|
+
pin : :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`
|
|
646
|
+
Padstack instance.
|
|
582
647
|
layername : str
|
|
583
|
-
Layer
|
|
584
|
-
pad_type : str
|
|
585
|
-
Pad
|
|
648
|
+
Layer name.
|
|
649
|
+
pad_type : str, optional
|
|
650
|
+
Pad type ("regular_pad", "anti_pad", "thermal_pad"). Default is ``"regular_pad"``.
|
|
586
651
|
|
|
587
652
|
Returns
|
|
588
653
|
-------
|
|
589
654
|
tuple
|
|
590
|
-
|
|
655
|
+
(geometry_type, parameters, offset_x, offset_y, rotation) where:
|
|
656
|
+
- geometry_type : str
|
|
657
|
+
- parameters : list[float] or list[list[float]]
|
|
658
|
+
- offset_x : float
|
|
659
|
+
- offset_y : float
|
|
660
|
+
- rotation : float
|
|
661
|
+
|
|
662
|
+
Examples
|
|
663
|
+
--------
|
|
664
|
+
>>> via = edb_padstacks.instances[123]
|
|
665
|
+
>>> geom_type, params, x, y, rot = edb_padstacks.get_pad_parameters(via, "TOP", "regular_pad")
|
|
591
666
|
"""
|
|
592
667
|
if pad_type == "regular_pad":
|
|
593
668
|
pad_type = GrpcPadType.REGULAR_PAD
|
|
@@ -620,17 +695,21 @@ class Padstacks(object):
|
|
|
620
695
|
return 0, [0], 0, 0, 0
|
|
621
696
|
|
|
622
697
|
def set_all_antipad_value(self, value):
|
|
623
|
-
"""Set
|
|
698
|
+
"""Set anti-pad value for all padstack definitions.
|
|
624
699
|
|
|
625
700
|
Parameters
|
|
626
701
|
----------
|
|
627
|
-
value : float
|
|
628
|
-
Anti-pad value.
|
|
702
|
+
value : float or str
|
|
703
|
+
Anti-pad value with units (e.g., "0.2mm").
|
|
629
704
|
|
|
630
705
|
Returns
|
|
631
706
|
-------
|
|
632
707
|
bool
|
|
633
|
-
``True`` when successful, ``False``
|
|
708
|
+
``True`` when successful, ``False`` when failed.
|
|
709
|
+
|
|
710
|
+
Examples
|
|
711
|
+
--------
|
|
712
|
+
>>> success = edb_padstacks.set_all_antipad_value("0.3mm")
|
|
634
713
|
"""
|
|
635
714
|
if self.definitions:
|
|
636
715
|
all_succeed = True
|
|
@@ -671,21 +750,23 @@ class Padstacks(object):
|
|
|
671
750
|
return all_succeed
|
|
672
751
|
|
|
673
752
|
def check_and_fix_via_plating(self, minimum_value_to_replace=0.0, default_plating_ratio=0.2):
|
|
674
|
-
"""Check
|
|
675
|
-
plating ratio.
|
|
753
|
+
"""Check and fix via plating ratios below a minimum value.
|
|
676
754
|
|
|
677
755
|
Parameters
|
|
678
756
|
----------
|
|
679
|
-
minimum_value_to_replace : float
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
Default value to use for plating ratio. The default value is ``0.2``.
|
|
757
|
+
minimum_value_to_replace : float, optional
|
|
758
|
+
Minimum plating ratio threshold. Default is ``0.0``.
|
|
759
|
+
default_plating_ratio : float, optional
|
|
760
|
+
Default plating ratio to apply. Default is ``0.2``.
|
|
684
761
|
|
|
685
762
|
Returns
|
|
686
763
|
-------
|
|
687
764
|
bool
|
|
688
|
-
``True`` when successful, ``False``
|
|
765
|
+
``True`` when successful, ``False`` when failed.
|
|
766
|
+
|
|
767
|
+
Examples
|
|
768
|
+
--------
|
|
769
|
+
>>> success = edb_padstacks.check_and_fix_via_plating(minimum_value_to_replace=0.1)
|
|
689
770
|
"""
|
|
690
771
|
for padstack_def in list(self.definitions.values()):
|
|
691
772
|
if padstack_def.hole_plating_ratio <= minimum_value_to_replace:
|
|
@@ -696,18 +777,22 @@ class Padstacks(object):
|
|
|
696
777
|
return True
|
|
697
778
|
|
|
698
779
|
def get_via_instance_from_net(self, net_list=None):
|
|
699
|
-
"""Get
|
|
780
|
+
"""Get via instances by net names.
|
|
700
781
|
|
|
701
782
|
Parameters
|
|
702
783
|
----------
|
|
703
|
-
net_list : str or list
|
|
704
|
-
|
|
705
|
-
return an all vias list.
|
|
784
|
+
net_list : str or list, optional
|
|
785
|
+
Net name(s) for filtering. Returns all vias if ``None``.
|
|
706
786
|
|
|
707
787
|
Returns
|
|
708
788
|
-------
|
|
709
|
-
list
|
|
710
|
-
List of
|
|
789
|
+
list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
790
|
+
List of via instances.
|
|
791
|
+
|
|
792
|
+
Examples
|
|
793
|
+
--------
|
|
794
|
+
>>> vias = edb_padstacks.get_via_instance_from_net("GND")
|
|
795
|
+
>>> vias = edb_padstacks.get_via_instance_from_net(["GND", "PWR"])
|
|
711
796
|
"""
|
|
712
797
|
if net_list and not isinstance(net_list, list):
|
|
713
798
|
net_list = [net_list]
|
|
@@ -750,61 +835,66 @@ class Padstacks(object):
|
|
|
750
835
|
anti_pad_y_size="600um",
|
|
751
836
|
hole_range="upper_pad_to_lower_pad",
|
|
752
837
|
):
|
|
753
|
-
"""Create a padstack.
|
|
838
|
+
"""Create a padstack definition.
|
|
754
839
|
|
|
755
840
|
Parameters
|
|
756
841
|
----------
|
|
757
842
|
padstackname : str, optional
|
|
758
|
-
Name of the padstack.
|
|
843
|
+
Name of the padstack definition.
|
|
759
844
|
holediam : str, optional
|
|
760
|
-
|
|
845
|
+
Hole diameter with units. Default is ``"300um"``.
|
|
761
846
|
paddiam : str, optional
|
|
762
|
-
|
|
847
|
+
Pad diameter with units. Default is ``"400um"``.
|
|
763
848
|
antipaddiam : str, optional
|
|
764
|
-
|
|
849
|
+
Anti-pad diameter with units. Default is ``"600um"``.
|
|
765
850
|
pad_shape : str, optional
|
|
766
|
-
|
|
851
|
+
Pad geometry type ("Circle", "Rectangle", "Polygon"). Default is ``"Circle"``.
|
|
767
852
|
antipad_shape : str, optional
|
|
768
|
-
|
|
769
|
-
``"Bullet"``.
|
|
853
|
+
Anti-pad geometry type ("Circle", "Rectangle", "Bullet", "Polygon"). Default is ``"Circle"``.
|
|
770
854
|
x_size : str, optional
|
|
771
|
-
|
|
855
|
+
X-size for rectangular/bullet shapes. Default is ``"600um"``.
|
|
772
856
|
y_size : str, optional
|
|
773
|
-
|
|
774
|
-
corner_radius :
|
|
775
|
-
|
|
857
|
+
Y-size for rectangular/bullet shapes. Default is ``"600um"``.
|
|
858
|
+
corner_radius : str, optional
|
|
859
|
+
Corner radius for bullet shapes. Default is ``"300um"``.
|
|
776
860
|
offset_x : str, optional
|
|
777
|
-
X
|
|
861
|
+
X-offset for anti-pad. Default is ``"0.0"``.
|
|
778
862
|
offset_y : str, optional
|
|
779
|
-
Y
|
|
863
|
+
Y-offset for anti-pad. Default is ``"0.0"``.
|
|
780
864
|
rotation : str, optional
|
|
781
|
-
|
|
865
|
+
Rotation for anti-pad in degrees. Default is ``"0.0"``.
|
|
782
866
|
has_hole : bool, optional
|
|
783
|
-
Whether
|
|
867
|
+
Whether the padstack has a hole. Default is ``True``.
|
|
784
868
|
pad_offset_x : str, optional
|
|
785
|
-
|
|
869
|
+
X-offset for pad. Default is ``"0.0"``.
|
|
786
870
|
pad_offset_y : str, optional
|
|
787
|
-
|
|
871
|
+
Y-offset for pad. Default is ``"0.0"``.
|
|
788
872
|
pad_rotation : str, optional
|
|
789
|
-
|
|
873
|
+
Rotation for pad in degrees. Default is ``"0.0"``.
|
|
874
|
+
pad_polygon : list or :class:`ansys.edb.core.geometry.PolygonData`, optional
|
|
875
|
+
Polygon points for custom pad shape.
|
|
876
|
+
antipad_polygon : list or :class:`ansys.edb.core.geometry.PolygonData`, optional
|
|
877
|
+
Polygon points for custom anti-pad shape.
|
|
878
|
+
polygon_hole : list or :class:`ansys.edb.core.geometry.PolygonData`, optional
|
|
879
|
+
Polygon points for custom hole shape.
|
|
790
880
|
start_layer : str, optional
|
|
791
|
-
|
|
881
|
+
Starting layer name.
|
|
792
882
|
stop_layer : str, optional
|
|
793
|
-
|
|
883
|
+
Ending layer name.
|
|
794
884
|
add_default_layer : bool, optional
|
|
795
|
-
|
|
885
|
+
Whether to add "Default" layer. Default is ``False``.
|
|
796
886
|
anti_pad_x_size : str, optional
|
|
797
|
-
|
|
887
|
+
Anti-pad X-size. Default is ``"600um"``.
|
|
798
888
|
anti_pad_y_size : str, optional
|
|
799
|
-
|
|
889
|
+
Anti-pad Y-size. Default is ``"600um"``.
|
|
800
890
|
hole_range : str, optional
|
|
801
|
-
|
|
802
|
-
|
|
891
|
+
Hole range type ("through", "begin_on_upper_pad", "end_on_lower_pad", "upper_pad_to_lower_pad").
|
|
892
|
+
Default is ``"upper_pad_to_lower_pad"``.
|
|
803
893
|
|
|
804
894
|
Returns
|
|
805
895
|
-------
|
|
806
896
|
str
|
|
807
|
-
Name of the padstack
|
|
897
|
+
Name of the created padstack definition.
|
|
808
898
|
"""
|
|
809
899
|
holediam = GrpcValue(holediam)
|
|
810
900
|
paddiam = GrpcValue(paddiam)
|
|
@@ -949,19 +1039,19 @@ class Padstacks(object):
|
|
|
949
1039
|
return False
|
|
950
1040
|
|
|
951
1041
|
def duplicate(self, target_padstack_name, new_padstack_name=""):
|
|
952
|
-
"""Duplicate a padstack.
|
|
1042
|
+
"""Duplicate a padstack definition.
|
|
953
1043
|
|
|
954
1044
|
Parameters
|
|
955
1045
|
----------
|
|
956
1046
|
target_padstack_name : str
|
|
957
|
-
Name of the padstack to
|
|
1047
|
+
Name of the padstack definition to duplicate.
|
|
958
1048
|
new_padstack_name : str, optional
|
|
959
|
-
Name
|
|
1049
|
+
Name for the new padstack definition.
|
|
960
1050
|
|
|
961
1051
|
Returns
|
|
962
1052
|
-------
|
|
963
1053
|
str
|
|
964
|
-
Name of the new padstack.
|
|
1054
|
+
Name of the new padstack definition.
|
|
965
1055
|
"""
|
|
966
1056
|
new_padstack_definition_data = GrpcPadstackDefData(self.definitions[target_padstack_name].data.msg)
|
|
967
1057
|
if not new_padstack_name:
|
|
@@ -982,33 +1072,33 @@ class Padstacks(object):
|
|
|
982
1072
|
solderlayer=None,
|
|
983
1073
|
is_pin=False,
|
|
984
1074
|
):
|
|
985
|
-
"""Place a
|
|
1075
|
+
"""Place a padstack instance.
|
|
986
1076
|
|
|
987
1077
|
Parameters
|
|
988
1078
|
----------
|
|
989
|
-
position : list
|
|
990
|
-
|
|
1079
|
+
position : list[float, float]
|
|
1080
|
+
[x, y] position for placement.
|
|
991
1081
|
definition_name : str
|
|
992
|
-
|
|
1082
|
+
Padstack definition name.
|
|
993
1083
|
net_name : str, optional
|
|
994
|
-
|
|
1084
|
+
Net name. Default is ``""``.
|
|
995
1085
|
via_name : str, optional
|
|
996
|
-
|
|
1086
|
+
Instance name. Default is ``""``.
|
|
997
1087
|
rotation : float, optional
|
|
998
|
-
Rotation
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
The default is ``None``.
|
|
1088
|
+
Rotation in degrees. Default is ``0.0``.
|
|
1089
|
+
fromlayer : str, optional
|
|
1090
|
+
Starting layer name.
|
|
1091
|
+
tolayer : str, optional
|
|
1092
|
+
Ending layer name.
|
|
1093
|
+
solderlayer : str, optional
|
|
1094
|
+
Solder ball layer name.
|
|
1006
1095
|
is_pin : bool, optional
|
|
1007
|
-
Whether
|
|
1096
|
+
Whether the instance is a pin. Default is ``False``.
|
|
1008
1097
|
|
|
1009
1098
|
Returns
|
|
1010
1099
|
-------
|
|
1011
|
-
:class:`
|
|
1100
|
+
:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance` or bool
|
|
1101
|
+
Created padstack instance or ``False`` if failed.
|
|
1012
1102
|
"""
|
|
1013
1103
|
padstack_def = None
|
|
1014
1104
|
for pad in list(self.definitions.keys()):
|
|
@@ -1060,19 +1150,19 @@ class Padstacks(object):
|
|
|
1060
1150
|
return False
|
|
1061
1151
|
|
|
1062
1152
|
def remove_pads_from_padstack(self, padstack_name, layer_name=None):
|
|
1063
|
-
"""Remove
|
|
1153
|
+
"""Remove pads from a padstack definition on specified layers.
|
|
1064
1154
|
|
|
1065
1155
|
Parameters
|
|
1066
1156
|
----------
|
|
1067
1157
|
padstack_name : str
|
|
1068
|
-
|
|
1069
|
-
layer_name : str, optional
|
|
1070
|
-
Layer name
|
|
1158
|
+
Padstack definition name.
|
|
1159
|
+
layer_name : str or list, optional
|
|
1160
|
+
Layer name(s). Applies to all layers if ``None``.
|
|
1071
1161
|
|
|
1072
1162
|
Returns
|
|
1073
1163
|
-------
|
|
1074
1164
|
bool
|
|
1075
|
-
``True``
|
|
1165
|
+
``True`` when successful, ``False`` when failed.
|
|
1076
1166
|
"""
|
|
1077
1167
|
pad_type = GrpcPadType.REGULAR_PAD
|
|
1078
1168
|
pad_geo = GrpcPadGeometryType.PADGEOMTYPE_CIRCLE
|
|
@@ -1111,40 +1201,39 @@ class Padstacks(object):
|
|
|
1111
1201
|
antipad_y_offset=0,
|
|
1112
1202
|
antipad_rotation=0,
|
|
1113
1203
|
):
|
|
1114
|
-
"""Set pad and
|
|
1204
|
+
"""Set pad and anti-pad properties for a padstack definition.
|
|
1115
1205
|
|
|
1116
1206
|
Parameters
|
|
1117
1207
|
----------
|
|
1118
1208
|
padstack_name : str
|
|
1119
|
-
|
|
1120
|
-
layer_name : str, optional
|
|
1121
|
-
|
|
1209
|
+
Padstack definition name.
|
|
1210
|
+
layer_name : str or list, optional
|
|
1211
|
+
Layer name(s). Applies to all layers if ``None``.
|
|
1122
1212
|
pad_shape : str, optional
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
Rotation of the pad. The default is ``"0"``.
|
|
1213
|
+
Pad geometry type ("Circle", "Square", "Rectangle", "Oval", "Bullet"). Default is ``"Circle"``.
|
|
1214
|
+
pad_params : float or list, optional
|
|
1215
|
+
Pad dimension(s). Default is ``0``.
|
|
1216
|
+
pad_x_offset : float, optional
|
|
1217
|
+
Pad X-offset. Default is ``0``.
|
|
1218
|
+
pad_y_offset : float, optional
|
|
1219
|
+
Pad Y-offset. Default is ``0``.
|
|
1220
|
+
pad_rotation : float, optional
|
|
1221
|
+
Pad rotation in degrees. Default is ``0``.
|
|
1133
1222
|
antipad_shape : str, optional
|
|
1134
|
-
|
|
1135
|
-
antipad_params :
|
|
1136
|
-
|
|
1137
|
-
antipad_x_offset :
|
|
1138
|
-
X
|
|
1139
|
-
antipad_y_offset :
|
|
1140
|
-
Y
|
|
1141
|
-
antipad_rotation :
|
|
1142
|
-
|
|
1223
|
+
Anti-pad geometry type ("Circle", "Square", "Rectangle", "Oval", "Bullet"). Default is ``"Circle"``.
|
|
1224
|
+
antipad_params : float or list, optional
|
|
1225
|
+
Anti-pad dimension(s). Default is ``0``.
|
|
1226
|
+
antipad_x_offset : float, optional
|
|
1227
|
+
Anti-pad X-offset. Default is ``0``.
|
|
1228
|
+
antipad_y_offset : float, optional
|
|
1229
|
+
Anti-pad Y-offset. Default is ``0``.
|
|
1230
|
+
antipad_rotation : float, optional
|
|
1231
|
+
Anti-pad rotation in degrees. Default is ``0``.
|
|
1143
1232
|
|
|
1144
1233
|
Returns
|
|
1145
1234
|
-------
|
|
1146
1235
|
bool
|
|
1147
|
-
``True``
|
|
1236
|
+
``True`` when successful, ``False`` when failed.
|
|
1148
1237
|
"""
|
|
1149
1238
|
shape_dict = {
|
|
1150
1239
|
"Circle": GrpcPadGeometryType.PADGEOMTYPE_CIRCLE,
|
|
@@ -1204,26 +1293,28 @@ class Padstacks(object):
|
|
|
1204
1293
|
component_reference_designator=None,
|
|
1205
1294
|
component_pin=None,
|
|
1206
1295
|
):
|
|
1207
|
-
"""Get padstack instances by
|
|
1296
|
+
"""Get padstack instances by search criteria.
|
|
1208
1297
|
|
|
1209
1298
|
Parameters
|
|
1210
1299
|
----------
|
|
1211
1300
|
name : str, optional
|
|
1212
|
-
|
|
1301
|
+
Instance name.
|
|
1213
1302
|
pid : int, optional
|
|
1214
|
-
|
|
1215
|
-
definition_name : str
|
|
1216
|
-
|
|
1217
|
-
net_name : str, optional
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1303
|
+
Database ID.
|
|
1304
|
+
definition_name : str or list, optional
|
|
1305
|
+
Padstack definition name(s).
|
|
1306
|
+
net_name : str or list, optional
|
|
1307
|
+
Net name(s).
|
|
1308
|
+
component_reference_designator : str or list, optional
|
|
1309
|
+
Component reference designator(s).
|
|
1310
|
+
component_pin : str or list, optional
|
|
1311
|
+
Component pin number(s).
|
|
1312
|
+
|
|
1221
1313
|
Returns
|
|
1222
1314
|
-------
|
|
1223
|
-
list
|
|
1224
|
-
List of
|
|
1315
|
+
list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
1316
|
+
List of matching padstack instances.
|
|
1225
1317
|
"""
|
|
1226
|
-
|
|
1227
1318
|
instances_by_id = self.instances
|
|
1228
1319
|
if pid:
|
|
1229
1320
|
return instances_by_id[pid]
|
|
@@ -1255,35 +1346,25 @@ class Padstacks(object):
|
|
|
1255
1346
|
def get_reference_pins(
|
|
1256
1347
|
self, positive_pin, reference_net="gnd", search_radius=5e-3, max_limit=0, component_only=True
|
|
1257
1348
|
):
|
|
1258
|
-
"""
|
|
1349
|
+
"""Find reference pins near a specified pin.
|
|
1259
1350
|
|
|
1260
1351
|
Parameters
|
|
1261
1352
|
----------
|
|
1262
|
-
positive_pin :
|
|
1263
|
-
|
|
1353
|
+
positive_pin : :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`
|
|
1354
|
+
Target pin.
|
|
1264
1355
|
reference_net : str, optional
|
|
1265
|
-
Reference net.
|
|
1356
|
+
Reference net name. Default is ``"gnd"``.
|
|
1266
1357
|
search_radius : float, optional
|
|
1267
|
-
Search radius
|
|
1358
|
+
Search radius in meters. Default is ``5e-3`` (5 mm).
|
|
1268
1359
|
max_limit : int, optional
|
|
1269
|
-
Maximum
|
|
1270
|
-
case no limit is applied. The maximum limit value occurs on the nearest
|
|
1271
|
-
reference pins from the positive one that is found.
|
|
1360
|
+
Maximum number of pins to return. Default is ``0`` (no limit).
|
|
1272
1361
|
component_only : bool, optional
|
|
1273
|
-
Whether to
|
|
1274
|
-
default is ``True``. When ``False``, the search is extended to the entire layout.
|
|
1362
|
+
Whether to search only in component pins. Default is ``True``.
|
|
1275
1363
|
|
|
1276
1364
|
Returns
|
|
1277
1365
|
-------
|
|
1278
|
-
list
|
|
1279
|
-
List of
|
|
1280
|
-
|
|
1281
|
-
Examples
|
|
1282
|
-
--------
|
|
1283
|
-
>>> edbapp = Edb("target_path")
|
|
1284
|
-
>>> pin = edbapp.components.instances["J5"].pins["19"]
|
|
1285
|
-
>>> reference_pins = edbapp.padstacks.get_reference_pins(positive_pin=pin, reference_net="GND",
|
|
1286
|
-
>>> search_radius=5e-3, max_limit=0, component_only=True)
|
|
1366
|
+
list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
|
|
1367
|
+
List of reference pins.
|
|
1287
1368
|
"""
|
|
1288
1369
|
pinlist = []
|
|
1289
1370
|
if not positive_pin:
|