pyedb 0.52.0__py3-none-any.whl → 0.54.0__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_common.py +12 -15
- pyedb/configuration/cfg_data.py +2 -2
- pyedb/configuration/cfg_modeler.py +163 -234
- pyedb/configuration/cfg_ports_sources.py +6 -8
- pyedb/configuration/cfg_stackup.py +62 -249
- pyedb/configuration/configuration.py +272 -170
- pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/database/cell/layout.py +1 -1
- pyedb/dotnet/database/cell/layout_obj.py +3 -3
- pyedb/dotnet/database/cell/primitive/path.py +1 -1
- pyedb/dotnet/database/cell/primitive/primitive.py +8 -8
- pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/terminal.py +24 -26
- pyedb/dotnet/database/components.py +33 -27
- pyedb/dotnet/database/definition/component_def.py +3 -3
- pyedb/dotnet/database/definition/component_model.py +1 -1
- pyedb/dotnet/database/definition/package_def.py +1 -1
- pyedb/dotnet/database/dotnet/database.py +47 -38
- pyedb/dotnet/database/dotnet/primitive.py +16 -16
- pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
- pyedb/dotnet/database/edb_data/layer_data.py +17 -15
- pyedb/dotnet/database/edb_data/padstacks_data.py +12 -12
- pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
- pyedb/dotnet/database/edb_data/sources.py +6 -6
- pyedb/dotnet/database/edb_data/variables.py +7 -3
- pyedb/dotnet/database/geometry/point_data.py +1 -1
- pyedb/dotnet/database/geometry/polygon_data.py +2 -4
- pyedb/dotnet/database/hfss.py +7 -7
- pyedb/dotnet/database/materials.py +2 -2
- pyedb/dotnet/database/modeler.py +8 -11
- pyedb/dotnet/database/nets.py +1 -1
- pyedb/dotnet/database/padstack.py +72 -1
- pyedb/dotnet/database/sim_setup_data/data/settings.py +24 -0
- pyedb/dotnet/database/sim_setup_data/io/siwave.py +26 -1
- pyedb/dotnet/database/siwave.py +19 -5
- pyedb/dotnet/database/stackup.py +80 -137
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +1 -1
- pyedb/dotnet/database/utilities/simulation_setup.py +1 -1
- pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +894 -0
- pyedb/dotnet/database/utilities/siwave_simulation_setup.py +15 -0
- pyedb/dotnet/database/utilities/value.py +116 -0
- pyedb/dotnet/edb.py +58 -45
- pyedb/generic/design_types.py +39 -1
- pyedb/generic/grpc_warnings.py +5 -0
- pyedb/grpc/__init__.py +0 -0
- pyedb/grpc/database/components.py +155 -98
- pyedb/grpc/database/control_file.py +240 -193
- pyedb/grpc/database/definition/materials.py +23 -30
- pyedb/grpc/database/definition/package_def.py +15 -15
- pyedb/grpc/database/definition/padstack_def.py +51 -51
- pyedb/grpc/database/definitions.py +7 -5
- pyedb/grpc/database/geometry/arc_data.py +7 -5
- pyedb/grpc/database/geometry/point_3d_data.py +8 -7
- pyedb/grpc/database/geometry/polygon_data.py +3 -2
- pyedb/grpc/database/hierarchy/component.py +43 -38
- pyedb/grpc/database/hierarchy/pin_pair_model.py +15 -14
- pyedb/grpc/database/hierarchy/pingroup.py +9 -9
- pyedb/grpc/database/layers/stackup_layer.py +45 -44
- pyedb/grpc/database/layout/layout.py +9 -8
- pyedb/grpc/database/layout/voltage_regulator.py +7 -7
- pyedb/grpc/database/layout_validation.py +13 -12
- pyedb/grpc/database/modeler.py +156 -131
- pyedb/grpc/database/nets.py +42 -31
- pyedb/grpc/database/padstacks.py +270 -175
- pyedb/grpc/database/ports/ports.py +5 -6
- pyedb/grpc/database/primitive/bondwire.py +8 -7
- pyedb/grpc/database/primitive/circle.py +4 -4
- pyedb/grpc/database/primitive/padstack_instance.py +18 -18
- pyedb/grpc/database/primitive/path.py +7 -7
- pyedb/grpc/database/primitive/polygon.py +3 -3
- pyedb/grpc/database/primitive/primitive.py +13 -17
- pyedb/grpc/database/primitive/rectangle.py +13 -13
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +10 -0
- pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +961 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +17 -1
- pyedb/grpc/database/siwave.py +44 -24
- pyedb/grpc/database/source_excitations.py +333 -229
- pyedb/grpc/database/stackup.py +164 -147
- pyedb/grpc/database/terminal/bundle_terminal.py +17 -7
- pyedb/grpc/database/terminal/edge_terminal.py +10 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +15 -4
- pyedb/grpc/database/terminal/pingroup_terminal.py +11 -10
- pyedb/grpc/database/terminal/point_terminal.py +4 -3
- pyedb/grpc/database/terminal/terminal.py +9 -9
- pyedb/grpc/database/utility/value.py +109 -0
- pyedb/grpc/edb.py +129 -45
- pyedb/grpc/edb_init.py +0 -7
- pyedb/siwave_core/cpa/simulation_setup_data_model.py +132 -0
- pyedb/siwave_core/product_properties.py +198 -0
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info}/METADATA +15 -13
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info}/RECORD +97 -89
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info}/WHEEL +1 -1
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -28,7 +28,7 @@ import json
|
|
|
28
28
|
import math
|
|
29
29
|
import os
|
|
30
30
|
import re
|
|
31
|
-
from typing import Union
|
|
31
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
32
32
|
import warnings
|
|
33
33
|
|
|
34
34
|
from ansys.edb.core.definition.die_property import DieOrientation as GrpDieOrientation
|
|
@@ -39,7 +39,6 @@ from ansys.edb.core.definition.solder_ball_property import (
|
|
|
39
39
|
from ansys.edb.core.hierarchy.component_group import ComponentType as GrpcComponentType
|
|
40
40
|
from ansys.edb.core.hierarchy.spice_model import SPICEModel as GrpcSPICEModel
|
|
41
41
|
from ansys.edb.core.utility.rlc import Rlc as GrpcRlc
|
|
42
|
-
from ansys.edb.core.utility.value import Value as GrpcValue
|
|
43
42
|
|
|
44
43
|
from pyedb.component_libraries.ansys_components import (
|
|
45
44
|
ComponentLib,
|
|
@@ -57,6 +56,7 @@ from pyedb.grpc.database.hierarchy.pin_pair_model import PinPairModel
|
|
|
57
56
|
from pyedb.grpc.database.hierarchy.pingroup import PinGroup
|
|
58
57
|
from pyedb.grpc.database.padstacks import Padstacks
|
|
59
58
|
from pyedb.grpc.database.utility.sources import SourceType
|
|
59
|
+
from pyedb.grpc.database.utility.value import Value
|
|
60
60
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
61
61
|
|
|
62
62
|
|
|
@@ -100,7 +100,7 @@ class Components(object):
|
|
|
100
100
|
>>> edbapp.components
|
|
101
101
|
"""
|
|
102
102
|
|
|
103
|
-
def __getitem__(self, name):
|
|
103
|
+
def __getitem__(self, name: str) -> Optional[Union[Component, ComponentDef]]:
|
|
104
104
|
"""Get a component or component definition by name.
|
|
105
105
|
|
|
106
106
|
Parameters
|
|
@@ -125,7 +125,7 @@ class Components(object):
|
|
|
125
125
|
self._pedb.logger.error("Component or definition not found.")
|
|
126
126
|
return
|
|
127
127
|
|
|
128
|
-
def __init__(self, p_edb):
|
|
128
|
+
def __init__(self, p_edb: Any) -> None:
|
|
129
129
|
self._pedb = p_edb
|
|
130
130
|
self.refresh_components()
|
|
131
131
|
self._pins = {}
|
|
@@ -133,7 +133,7 @@ class Components(object):
|
|
|
133
133
|
self._padstack = Padstacks(self._pedb)
|
|
134
134
|
|
|
135
135
|
@property
|
|
136
|
-
def _logger(self):
|
|
136
|
+
def _logger(self) -> Any:
|
|
137
137
|
"""Logger instance for the component manager.
|
|
138
138
|
|
|
139
139
|
Returns
|
|
@@ -188,7 +188,7 @@ class Components(object):
|
|
|
188
188
|
return self._pedb.active_db
|
|
189
189
|
|
|
190
190
|
@property
|
|
191
|
-
def instances(self) ->
|
|
191
|
+
def instances(self) -> Dict[str, Component]:
|
|
192
192
|
"""Dictionary of all component instances in the layout.
|
|
193
193
|
|
|
194
194
|
Returns
|
|
@@ -203,7 +203,7 @@ class Components(object):
|
|
|
203
203
|
return self._cmp
|
|
204
204
|
|
|
205
205
|
@property
|
|
206
|
-
def definitions(self) ->
|
|
206
|
+
def definitions(self) -> Dict[str, ComponentDef]:
|
|
207
207
|
"""Dictionary of all component definitions.
|
|
208
208
|
|
|
209
209
|
Returns
|
|
@@ -218,7 +218,7 @@ class Components(object):
|
|
|
218
218
|
return {l.name: ComponentDef(self._pedb, l) for l in self._pedb.component_defs}
|
|
219
219
|
|
|
220
220
|
@property
|
|
221
|
-
def nport_comp_definition(self) ->
|
|
221
|
+
def nport_comp_definition(self) -> Dict[str, Component]:
|
|
222
222
|
"""Dictionary of N-port component definitions.
|
|
223
223
|
|
|
224
224
|
Returns
|
|
@@ -371,7 +371,7 @@ class Components(object):
|
|
|
371
371
|
return True
|
|
372
372
|
|
|
373
373
|
@property
|
|
374
|
-
def resistors(self) ->
|
|
374
|
+
def resistors(self) -> Dict[str, Component]:
|
|
375
375
|
"""Dictionary of resistor components.
|
|
376
376
|
|
|
377
377
|
Returns
|
|
@@ -386,7 +386,7 @@ class Components(object):
|
|
|
386
386
|
return self._res
|
|
387
387
|
|
|
388
388
|
@property
|
|
389
|
-
def capacitors(self) ->
|
|
389
|
+
def capacitors(self) -> Dict[str, Component]:
|
|
390
390
|
"""Dictionary of capacitor components.
|
|
391
391
|
|
|
392
392
|
Returns
|
|
@@ -401,7 +401,7 @@ class Components(object):
|
|
|
401
401
|
return self._cap
|
|
402
402
|
|
|
403
403
|
@property
|
|
404
|
-
def inductors(self) ->
|
|
404
|
+
def inductors(self) -> Dict[str, Component]:
|
|
405
405
|
"""Dictionary of inductor components.
|
|
406
406
|
|
|
407
407
|
Returns
|
|
@@ -416,7 +416,7 @@ class Components(object):
|
|
|
416
416
|
return self._ind
|
|
417
417
|
|
|
418
418
|
@property
|
|
419
|
-
def ICs(self) ->
|
|
419
|
+
def ICs(self) -> Dict[str, Component]:
|
|
420
420
|
"""Dictionary of integrated circuit components.
|
|
421
421
|
|
|
422
422
|
Returns
|
|
@@ -431,7 +431,7 @@ class Components(object):
|
|
|
431
431
|
return self._ics
|
|
432
432
|
|
|
433
433
|
@property
|
|
434
|
-
def IOs(self) ->
|
|
434
|
+
def IOs(self) -> Dict[str, Component]:
|
|
435
435
|
"""Dictionary of I/O components.
|
|
436
436
|
|
|
437
437
|
Returns
|
|
@@ -446,7 +446,7 @@ class Components(object):
|
|
|
446
446
|
return self._ios
|
|
447
447
|
|
|
448
448
|
@property
|
|
449
|
-
def Others(self) ->
|
|
449
|
+
def Others(self) -> Dict[str, Component]:
|
|
450
450
|
"""Dictionary of other components.
|
|
451
451
|
|
|
452
452
|
Returns
|
|
@@ -461,7 +461,7 @@ class Components(object):
|
|
|
461
461
|
return self._others
|
|
462
462
|
|
|
463
463
|
@property
|
|
464
|
-
def components_by_partname(self) ->
|
|
464
|
+
def components_by_partname(self) -> Dict[str, List[Component]]:
|
|
465
465
|
"""Dictionary of components grouped by part name.
|
|
466
466
|
|
|
467
467
|
Returns
|
|
@@ -500,7 +500,12 @@ class Components(object):
|
|
|
500
500
|
"""
|
|
501
501
|
return self.instances[name]
|
|
502
502
|
|
|
503
|
-
def get_pin_from_component(
|
|
503
|
+
def get_pin_from_component(
|
|
504
|
+
self,
|
|
505
|
+
component: Union[str, Component],
|
|
506
|
+
net_name: Optional[Union[str, List[str]]] = None,
|
|
507
|
+
pin_name: Optional[str] = None,
|
|
508
|
+
) -> List[Any]:
|
|
504
509
|
"""Get pins from a component with optional filtering.
|
|
505
510
|
|
|
506
511
|
Parameters
|
|
@@ -559,7 +564,7 @@ class Components(object):
|
|
|
559
564
|
cmp_list.append(refdes)
|
|
560
565
|
return cmp_list
|
|
561
566
|
|
|
562
|
-
def _get_edb_pin_from_pin_name(self, cmp, pin) -> Union[ComponentPin, bool]:
|
|
567
|
+
def _get_edb_pin_from_pin_name(self, cmp: Component, pin: str) -> Union[ComponentPin, bool]:
|
|
563
568
|
"""Get EDB pin from pin name.
|
|
564
569
|
|
|
565
570
|
Parameters
|
|
@@ -584,14 +589,14 @@ class Components(object):
|
|
|
584
589
|
|
|
585
590
|
def get_component_placement_vector(
|
|
586
591
|
self,
|
|
587
|
-
mounted_component,
|
|
588
|
-
hosting_component,
|
|
589
|
-
mounted_component_pin1,
|
|
590
|
-
mounted_component_pin2,
|
|
591
|
-
hosting_component_pin1,
|
|
592
|
-
hosting_component_pin2,
|
|
593
|
-
flipped=False,
|
|
594
|
-
) ->
|
|
592
|
+
mounted_component: Component,
|
|
593
|
+
hosting_component: Component,
|
|
594
|
+
mounted_component_pin1: str,
|
|
595
|
+
mounted_component_pin2: str,
|
|
596
|
+
hosting_component_pin1: str,
|
|
597
|
+
hosting_component_pin2: str,
|
|
598
|
+
flipped: bool = False,
|
|
599
|
+
) -> Tuple[bool, List[float], float, float]:
|
|
595
600
|
"""Get placement vector between two components.
|
|
596
601
|
|
|
597
602
|
Parameters
|
|
@@ -670,7 +675,7 @@ class Components(object):
|
|
|
670
675
|
self._logger.warning("Failed to compute vector.")
|
|
671
676
|
return False, [0, 0], 0, 0
|
|
672
677
|
|
|
673
|
-
def get_solder_ball_height(self, cmp) -> float:
|
|
678
|
+
def get_solder_ball_height(self, cmp: Union[str, Component]) -> float:
|
|
674
679
|
"""Get solder ball height of a component.
|
|
675
680
|
|
|
676
681
|
Parameters
|
|
@@ -1012,15 +1017,15 @@ class Components(object):
|
|
|
1012
1017
|
|
|
1013
1018
|
def create(
|
|
1014
1019
|
self,
|
|
1015
|
-
pins,
|
|
1016
|
-
component_name=None,
|
|
1017
|
-
placement_layer=None,
|
|
1018
|
-
component_part_name=None,
|
|
1019
|
-
is_rlc=False,
|
|
1020
|
-
r_value=None,
|
|
1021
|
-
c_value=None,
|
|
1022
|
-
l_value=None,
|
|
1023
|
-
is_parallel=False,
|
|
1020
|
+
pins: List[Any],
|
|
1021
|
+
component_name: Optional[str] = None,
|
|
1022
|
+
placement_layer: Optional[str] = None,
|
|
1023
|
+
component_part_name: Optional[str] = None,
|
|
1024
|
+
is_rlc: bool = False,
|
|
1025
|
+
r_value: Optional[float] = None,
|
|
1026
|
+
c_value: Optional[float] = None,
|
|
1027
|
+
l_value: Optional[float] = None,
|
|
1028
|
+
is_parallel: bool = False,
|
|
1024
1029
|
) -> Union[Component, bool]:
|
|
1025
1030
|
"""Create a new component.
|
|
1026
1031
|
|
|
@@ -1093,17 +1098,17 @@ class Components(object):
|
|
|
1093
1098
|
rlc.r_enabled = False
|
|
1094
1099
|
else:
|
|
1095
1100
|
rlc.r_enabled = True
|
|
1096
|
-
rlc.r =
|
|
1101
|
+
rlc.r = Value(r_value)
|
|
1097
1102
|
if l_value is None:
|
|
1098
1103
|
rlc.l_enabled = False
|
|
1099
1104
|
else:
|
|
1100
1105
|
rlc.l_enabled = True
|
|
1101
|
-
rlc.l =
|
|
1106
|
+
rlc.l = Value(l_value)
|
|
1102
1107
|
if c_value is None:
|
|
1103
1108
|
rlc.c_enabled = False
|
|
1104
1109
|
else:
|
|
1105
1110
|
rlc.c_enabled = True
|
|
1106
|
-
rlc.C =
|
|
1111
|
+
rlc.C = Value(c_value)
|
|
1107
1112
|
if rlc.r_enabled and not rlc.c_enabled and not rlc.l_enabled:
|
|
1108
1113
|
new_cmp.component_type = GrpcComponentType.RESISTOR
|
|
1109
1114
|
elif rlc.c_enabled and not rlc.r_enabled and not rlc.l_enabled:
|
|
@@ -1156,7 +1161,13 @@ class Components(object):
|
|
|
1156
1161
|
is_rlc=False,
|
|
1157
1162
|
)
|
|
1158
1163
|
|
|
1159
|
-
def set_component_model(
|
|
1164
|
+
def set_component_model(
|
|
1165
|
+
self,
|
|
1166
|
+
componentname: str,
|
|
1167
|
+
model_type: str = "Spice",
|
|
1168
|
+
modelpath: Optional[str] = None,
|
|
1169
|
+
modelname: Optional[str] = None,
|
|
1170
|
+
) -> bool:
|
|
1160
1171
|
"""Set component model.
|
|
1161
1172
|
|
|
1162
1173
|
Parameters
|
|
@@ -1228,7 +1239,7 @@ class Components(object):
|
|
|
1228
1239
|
component.component_property.model = s_parameter_mod
|
|
1229
1240
|
return True
|
|
1230
1241
|
|
|
1231
|
-
def create_pingroup_from_pins(self, pins, group_name=None) -> Union[PinGroup, bool]:
|
|
1242
|
+
def create_pingroup_from_pins(self, pins: List[Any], group_name: Optional[str] = None) -> Union[PinGroup, bool]:
|
|
1232
1243
|
"""Create pin group from pins.
|
|
1233
1244
|
|
|
1234
1245
|
Parameters
|
|
@@ -1279,7 +1290,7 @@ class Components(object):
|
|
|
1279
1290
|
pin_group.net = pins[0].net
|
|
1280
1291
|
return pin_group
|
|
1281
1292
|
|
|
1282
|
-
def delete_single_pin_rlc(self, deactivate_only=False) ->
|
|
1293
|
+
def delete_single_pin_rlc(self, deactivate_only: bool = False) -> List[str]:
|
|
1283
1294
|
"""Delete or deactivate single-pin RLC components.
|
|
1284
1295
|
|
|
1285
1296
|
Parameters
|
|
@@ -1310,7 +1321,7 @@ class Components(object):
|
|
|
1310
1321
|
self._pedb.logger.info("Deleted {} components".format(len(deleted_comps)))
|
|
1311
1322
|
return deleted_comps
|
|
1312
1323
|
|
|
1313
|
-
def delete(self, component_name) -> bool:
|
|
1324
|
+
def delete(self, component_name: str) -> bool:
|
|
1314
1325
|
"""Delete a component.
|
|
1315
1326
|
|
|
1316
1327
|
Parameters
|
|
@@ -1335,7 +1346,7 @@ class Components(object):
|
|
|
1335
1346
|
return True
|
|
1336
1347
|
return False
|
|
1337
1348
|
|
|
1338
|
-
def disable_rlc_component(self, component_name) -> bool:
|
|
1349
|
+
def disable_rlc_component(self, component_name: str) -> bool:
|
|
1339
1350
|
"""Disable RLC component.
|
|
1340
1351
|
|
|
1341
1352
|
Parameters
|
|
@@ -1369,16 +1380,16 @@ class Components(object):
|
|
|
1369
1380
|
|
|
1370
1381
|
def set_solder_ball(
|
|
1371
1382
|
self,
|
|
1372
|
-
component="",
|
|
1373
|
-
sball_diam=None,
|
|
1374
|
-
sball_height=None,
|
|
1375
|
-
shape="Cylinder",
|
|
1376
|
-
sball_mid_diam=None,
|
|
1377
|
-
chip_orientation="chip_down",
|
|
1378
|
-
auto_reference_size=True,
|
|
1379
|
-
reference_size_x=0,
|
|
1380
|
-
reference_size_y=0,
|
|
1381
|
-
reference_height=0,
|
|
1383
|
+
component: Union[str, Component] = "",
|
|
1384
|
+
sball_diam: Optional[float] = None,
|
|
1385
|
+
sball_height: Optional[float] = None,
|
|
1386
|
+
shape: str = "Cylinder",
|
|
1387
|
+
sball_mid_diam: Optional[float] = None,
|
|
1388
|
+
chip_orientation: str = "chip_down",
|
|
1389
|
+
auto_reference_size: bool = True,
|
|
1390
|
+
reference_size_x: float = 0,
|
|
1391
|
+
reference_size_y: float = 0,
|
|
1392
|
+
reference_height: float = 0,
|
|
1382
1393
|
) -> bool:
|
|
1383
1394
|
"""Set solder ball properties for a component.
|
|
1384
1395
|
|
|
@@ -1423,12 +1434,12 @@ class Components(object):
|
|
|
1423
1434
|
pin1 = list(cmp.pins.values())[0]
|
|
1424
1435
|
pin_layers = pin1.padstack_def.data.layer_names
|
|
1425
1436
|
pad_params = self._pedb.padstacks.get_pad_parameters(pin=pin1, layername=pin_layers[0], pad_type=0)
|
|
1426
|
-
_sb_diam = min([abs(
|
|
1437
|
+
_sb_diam = min([abs(Value(val)) for val in pad_params[1]])
|
|
1427
1438
|
sball_diam = 0.8 * _sb_diam
|
|
1428
1439
|
if sball_height:
|
|
1429
|
-
sball_height =
|
|
1440
|
+
sball_height = Value(sball_height)
|
|
1430
1441
|
else:
|
|
1431
|
-
sball_height =
|
|
1442
|
+
sball_height = Value(sball_diam)
|
|
1432
1443
|
|
|
1433
1444
|
if not sball_mid_diam:
|
|
1434
1445
|
sball_mid_diam = sball_diam
|
|
@@ -1449,28 +1460,28 @@ class Components(object):
|
|
|
1449
1460
|
cmp_property.die_property = ic_die_prop
|
|
1450
1461
|
|
|
1451
1462
|
solder_ball_prop = cmp_property.solder_ball_property
|
|
1452
|
-
solder_ball_prop.set_diameter(
|
|
1453
|
-
solder_ball_prop.height =
|
|
1463
|
+
solder_ball_prop.set_diameter(Value(sball_diam), Value(sball_mid_diam))
|
|
1464
|
+
solder_ball_prop.height = Value(sball_height)
|
|
1454
1465
|
|
|
1455
1466
|
solder_ball_prop.shape = sball_shape
|
|
1456
1467
|
cmp_property.solder_ball_property = solder_ball_prop
|
|
1457
1468
|
|
|
1458
1469
|
port_prop = cmp_property.port_property
|
|
1459
|
-
port_prop.reference_height =
|
|
1470
|
+
port_prop.reference_height = Value(reference_height)
|
|
1460
1471
|
port_prop.reference_size_auto = auto_reference_size
|
|
1461
1472
|
if not auto_reference_size:
|
|
1462
|
-
port_prop.set_reference_size(
|
|
1473
|
+
port_prop.set_reference_size(Value(reference_size_x), Value(reference_size_y))
|
|
1463
1474
|
cmp_property.port_property = port_prop
|
|
1464
1475
|
cmp.component_property = cmp_property
|
|
1465
1476
|
return True
|
|
1466
1477
|
|
|
1467
1478
|
def set_component_rlc(
|
|
1468
1479
|
self,
|
|
1469
|
-
componentname,
|
|
1470
|
-
res_value=None,
|
|
1471
|
-
ind_value=None,
|
|
1472
|
-
cap_value=None,
|
|
1473
|
-
isparallel=False,
|
|
1480
|
+
componentname: str,
|
|
1481
|
+
res_value: Optional[float] = None,
|
|
1482
|
+
ind_value: Optional[float] = None,
|
|
1483
|
+
cap_value: Optional[float] = None,
|
|
1484
|
+
isparallel: bool = False,
|
|
1474
1485
|
) -> bool:
|
|
1475
1486
|
"""Set RLC values for a component.
|
|
1476
1487
|
|
|
@@ -1509,17 +1520,17 @@ class Components(object):
|
|
|
1509
1520
|
rlc.is_parallel = isparallel
|
|
1510
1521
|
if res_value is not None:
|
|
1511
1522
|
rlc.r_enabled = True
|
|
1512
|
-
rlc.r =
|
|
1523
|
+
rlc.r = Value(res_value)
|
|
1513
1524
|
else:
|
|
1514
1525
|
rlc.r_enabled = False
|
|
1515
1526
|
if ind_value is not None:
|
|
1516
1527
|
rlc.l_enabled = True
|
|
1517
|
-
rlc.l =
|
|
1528
|
+
rlc.l = Value(ind_value)
|
|
1518
1529
|
else:
|
|
1519
1530
|
rlc.l_enabled = False
|
|
1520
1531
|
if cap_value is not None:
|
|
1521
1532
|
rlc.c_enabled = True
|
|
1522
|
-
rlc.c =
|
|
1533
|
+
rlc.c = Value(cap_value)
|
|
1523
1534
|
else:
|
|
1524
1535
|
rlc.CEnabled = False
|
|
1525
1536
|
pin_pair = (from_pin.name, to_pin.name)
|
|
@@ -1539,11 +1550,11 @@ class Components(object):
|
|
|
1539
1550
|
|
|
1540
1551
|
def update_rlc_from_bom(
|
|
1541
1552
|
self,
|
|
1542
|
-
bom_file,
|
|
1543
|
-
delimiter=";",
|
|
1544
|
-
valuefield="Func des",
|
|
1545
|
-
comptype="Prod name",
|
|
1546
|
-
refdes="Pos / Place",
|
|
1553
|
+
bom_file: str,
|
|
1554
|
+
delimiter: str = ";",
|
|
1555
|
+
valuefield: str = "Func des",
|
|
1556
|
+
comptype: str = "Prod name",
|
|
1557
|
+
refdes: str = "Pos / Place",
|
|
1547
1558
|
) -> bool:
|
|
1548
1559
|
"""Update RLC values from BOM file.
|
|
1549
1560
|
|
|
@@ -1604,12 +1615,12 @@ class Components(object):
|
|
|
1604
1615
|
|
|
1605
1616
|
def import_bom(
|
|
1606
1617
|
self,
|
|
1607
|
-
bom_file,
|
|
1608
|
-
delimiter=",",
|
|
1609
|
-
refdes_col=0,
|
|
1610
|
-
part_name_col=1,
|
|
1611
|
-
comp_type_col=2,
|
|
1612
|
-
value_col=3,
|
|
1618
|
+
bom_file: str,
|
|
1619
|
+
delimiter: str = ",",
|
|
1620
|
+
refdes_col: int = 0,
|
|
1621
|
+
part_name_col: int = 1,
|
|
1622
|
+
comp_type_col: int = 2,
|
|
1623
|
+
value_col: int = 3,
|
|
1613
1624
|
) -> bool:
|
|
1614
1625
|
"""Import BOM file.
|
|
1615
1626
|
|
|
@@ -1693,7 +1704,7 @@ class Components(object):
|
|
|
1693
1704
|
self.instances[comp].enabled = False
|
|
1694
1705
|
return True
|
|
1695
1706
|
|
|
1696
|
-
def export_bom(self, bom_file, delimiter=",") -> bool:
|
|
1707
|
+
def export_bom(self, bom_file: str, delimiter: str = ",") -> bool:
|
|
1697
1708
|
"""Export BOM file.
|
|
1698
1709
|
|
|
1699
1710
|
Parameters
|
|
@@ -1732,7 +1743,7 @@ class Components(object):
|
|
|
1732
1743
|
f.writelines([delimiter.join([refdes, part_name, comp_type, value + "\n"])])
|
|
1733
1744
|
return True
|
|
1734
1745
|
|
|
1735
|
-
def find_by_reference_designator(self, reference_designator) -> Component:
|
|
1746
|
+
def find_by_reference_designator(self, reference_designator: str) -> Component:
|
|
1736
1747
|
"""Find component by reference designator.
|
|
1737
1748
|
|
|
1738
1749
|
Parameters
|
|
@@ -1751,7 +1762,7 @@ class Components(object):
|
|
|
1751
1762
|
"""
|
|
1752
1763
|
return self.instances[reference_designator]
|
|
1753
1764
|
|
|
1754
|
-
def get_aedt_pin_name(self, pin) -> str:
|
|
1765
|
+
def get_aedt_pin_name(self, pin: Any) -> str:
|
|
1755
1766
|
"""Get AEDT pin name.
|
|
1756
1767
|
|
|
1757
1768
|
Parameters
|
|
@@ -1770,7 +1781,9 @@ class Components(object):
|
|
|
1770
1781
|
"""
|
|
1771
1782
|
return pin.aedt_name
|
|
1772
1783
|
|
|
1773
|
-
def get_pins(
|
|
1784
|
+
def get_pins(
|
|
1785
|
+
self, reference_designator: str, net_name: Optional[str] = None, pin_name: Optional[str] = None
|
|
1786
|
+
) -> Dict[str, Any]:
|
|
1774
1787
|
"""Get pins of a component.
|
|
1775
1788
|
|
|
1776
1789
|
Parameters
|
|
@@ -1802,7 +1815,7 @@ class Components(object):
|
|
|
1802
1815
|
|
|
1803
1816
|
return pins
|
|
1804
1817
|
|
|
1805
|
-
def get_pin_position(self, pin) ->
|
|
1818
|
+
def get_pin_position(self, pin: Any) -> List[float]:
|
|
1806
1819
|
"""Get pin position.
|
|
1807
1820
|
|
|
1808
1821
|
Parameters
|
|
@@ -1825,9 +1838,9 @@ class Components(object):
|
|
|
1825
1838
|
transformed_pt_pos = pt_pos
|
|
1826
1839
|
else:
|
|
1827
1840
|
transformed_pt_pos = pin.component.transform.transform_point(pt_pos)
|
|
1828
|
-
return [transformed_pt_pos[0]
|
|
1841
|
+
return [Value(transformed_pt_pos[0]), Value(transformed_pt_pos[1])]
|
|
1829
1842
|
|
|
1830
|
-
def get_pins_name_from_net(self, net_name, pin_list=None) ->
|
|
1843
|
+
def get_pins_name_from_net(self, net_name: str, pin_list: Optional[List[Any]] = None) -> List[str]:
|
|
1831
1844
|
"""Get pin names from net.
|
|
1832
1845
|
|
|
1833
1846
|
Parameters
|
|
@@ -1858,7 +1871,7 @@ class Components(object):
|
|
|
1858
1871
|
pin_names.append(self.get_aedt_pin_name(pin))
|
|
1859
1872
|
return pin_names
|
|
1860
1873
|
|
|
1861
|
-
def get_nets_from_pin_list(self, pins) ->
|
|
1874
|
+
def get_nets_from_pin_list(self, pins: List[Any]) -> List[str]:
|
|
1862
1875
|
"""Get nets from pin list.
|
|
1863
1876
|
|
|
1864
1877
|
Parameters
|
|
@@ -1877,7 +1890,7 @@ class Components(object):
|
|
|
1877
1890
|
"""
|
|
1878
1891
|
return list(set([pin.net.name for pin in pins]))
|
|
1879
1892
|
|
|
1880
|
-
def get_component_net_connection_info(self, refdes) ->
|
|
1893
|
+
def get_component_net_connection_info(self, refdes: str) -> Dict[str, List[str]]:
|
|
1881
1894
|
"""Get net connection info for a component.
|
|
1882
1895
|
|
|
1883
1896
|
Parameters
|
|
@@ -1905,7 +1918,7 @@ class Components(object):
|
|
|
1905
1918
|
data["net_name"].append(net_name)
|
|
1906
1919
|
return data
|
|
1907
1920
|
|
|
1908
|
-
def get_rats(self) ->
|
|
1921
|
+
def get_rats(self) -> List[Dict[str, List[str]]]:
|
|
1909
1922
|
"""Get RATS (Reference Designator, Pin, Net) information.
|
|
1910
1923
|
|
|
1911
1924
|
Returns
|
|
@@ -1923,7 +1936,7 @@ class Components(object):
|
|
|
1923
1936
|
df_list.append(df)
|
|
1924
1937
|
return df_list
|
|
1925
1938
|
|
|
1926
|
-
def get_through_resistor_list(self, threshold=1) ->
|
|
1939
|
+
def get_through_resistor_list(self, threshold: float = 1) -> List[str]:
|
|
1927
1940
|
"""Get through resistors below threshold.
|
|
1928
1941
|
|
|
1929
1942
|
Parameters
|
|
@@ -1953,7 +1966,9 @@ class Components(object):
|
|
|
1953
1966
|
|
|
1954
1967
|
return through_comp_list
|
|
1955
1968
|
|
|
1956
|
-
def short_component_pins(
|
|
1969
|
+
def short_component_pins(
|
|
1970
|
+
self, component_name: str, pins_to_short: Optional[List[str]] = None, width: float = 1e-3
|
|
1971
|
+
) -> bool:
|
|
1957
1972
|
"""Short component pins with traces.
|
|
1958
1973
|
|
|
1959
1974
|
Parameters
|
|
@@ -2006,8 +2021,8 @@ class Components(object):
|
|
|
2006
2021
|
w = min(pars[0], w)
|
|
2007
2022
|
elif pad.polygon_data: # pragma: no cover
|
|
2008
2023
|
bbox = pad.polygon_data.bbox()
|
|
2009
|
-
lower = [bbox[0].x
|
|
2010
|
-
upper = [bbox[1].x
|
|
2024
|
+
lower = [Value(bbox[0].x), Value(bbox[0].y)]
|
|
2025
|
+
upper = [Value(bbox[1].x), Value(bbox[1].y)]
|
|
2011
2026
|
pars = [abs(lower[0] - upper[0]), abs(lower[1] - upper[1])]
|
|
2012
2027
|
delta_pins.append(max(pars) + min(pars) / 2)
|
|
2013
2028
|
w = min(min(pars), w)
|
|
@@ -2089,7 +2104,9 @@ class Components(object):
|
|
|
2089
2104
|
i += 1
|
|
2090
2105
|
return True
|
|
2091
2106
|
|
|
2092
|
-
def create_pin_group(
|
|
2107
|
+
def create_pin_group(
|
|
2108
|
+
self, reference_designator: str, pin_numbers: Union[str, List[str]], group_name: Optional[str] = None
|
|
2109
|
+
) -> Union[Tuple[str, PinGroup], bool]:
|
|
2093
2110
|
"""Create pin group on a component.
|
|
2094
2111
|
|
|
2095
2112
|
Parameters
|
|
@@ -2134,7 +2151,9 @@ class Components(object):
|
|
|
2134
2151
|
return group_name, PinGroup(self._pedb, pingroup)
|
|
2135
2152
|
return False
|
|
2136
2153
|
|
|
2137
|
-
def create_pin_group_on_net(
|
|
2154
|
+
def create_pin_group_on_net(
|
|
2155
|
+
self, reference_designator: str, net_name: str, group_name: Optional[str] = None
|
|
2156
|
+
) -> PinGroup:
|
|
2138
2157
|
"""Create pin group by net name.
|
|
2139
2158
|
|
|
2140
2159
|
Parameters
|
|
@@ -2160,7 +2179,9 @@ class Components(object):
|
|
|
2160
2179
|
]
|
|
2161
2180
|
return self.create_pin_group(reference_designator, pins, group_name)
|
|
2162
2181
|
|
|
2163
|
-
def deactivate_rlc_component(
|
|
2182
|
+
def deactivate_rlc_component(
|
|
2183
|
+
self, component: Optional[str] = None, create_circuit_port: bool = False, pec_boundary: bool = False
|
|
2184
|
+
) -> bool:
|
|
2164
2185
|
"""Deactivate RLC component with a possibility to convert it to a circuit port.
|
|
2165
2186
|
|
|
2166
2187
|
Parameters
|
|
@@ -2207,7 +2228,43 @@ class Components(object):
|
|
|
2207
2228
|
component=component.refdes, circuit_ports=create_circuit_port, pec_boundary=pec_boundary
|
|
2208
2229
|
)
|
|
2209
2230
|
|
|
2210
|
-
def
|
|
2231
|
+
def add_port_on_rlc_component(
|
|
2232
|
+
self, component: Optional[Union[str, Component]] = None, circuit_ports: bool = True, pec_boundary: bool = False
|
|
2233
|
+
) -> bool:
|
|
2234
|
+
"""Deactivate RLC component and replace it with a circuit port.
|
|
2235
|
+
The circuit port supports only two-pin components.
|
|
2236
|
+
|
|
2237
|
+
Parameters
|
|
2238
|
+
----------
|
|
2239
|
+
component : str
|
|
2240
|
+
Reference designator of the RLC component.
|
|
2241
|
+
|
|
2242
|
+
circuit_ports : bool
|
|
2243
|
+
``True`` will replace RLC component by circuit ports, ``False`` gap ports compatible with HFSS 3D modeler
|
|
2244
|
+
export.
|
|
2245
|
+
|
|
2246
|
+
pec_boundary : bool, optional
|
|
2247
|
+
Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
|
|
2248
|
+
a perfect short is created between the pin and impedance is ignored. This
|
|
2249
|
+
parameter is only supported on a port created between two pins, such as
|
|
2250
|
+
when there is no pin group.
|
|
2251
|
+
|
|
2252
|
+
Returns
|
|
2253
|
+
-------
|
|
2254
|
+
bool
|
|
2255
|
+
``True`` when successful, ``False`` when failed.
|
|
2256
|
+
|
|
2257
|
+
Examples
|
|
2258
|
+
--------
|
|
2259
|
+
>>> from pyedb import Edb
|
|
2260
|
+
>>> edb = Edb()
|
|
2261
|
+
>>> edb.source_excitation.add_port_on_rlc_component("R1")
|
|
2262
|
+
"""
|
|
2263
|
+
return self._pedb.source_excitation.add_port_on_rlc_component(
|
|
2264
|
+
component=component, circuit_ports=circuit_ports, pec_boundary=pec_boundary
|
|
2265
|
+
)
|
|
2266
|
+
|
|
2267
|
+
def replace_rlc_by_gap_boundaries(self, component: Optional[Union[str, Component]] = None) -> bool:
|
|
2211
2268
|
"""Replace RLC component by RLC gap boundaries. These boundary types are compatible with 3D modeler export.
|
|
2212
2269
|
Only 2 pins RLC components are supported in this command.
|
|
2213
2270
|
|
|
@@ -2243,7 +2300,7 @@ class Components(object):
|
|
|
2243
2300
|
component.enabled = False
|
|
2244
2301
|
return self._pedb.source_excitation.add_rlc_boundary(component.refdes, False)
|
|
2245
2302
|
|
|
2246
|
-
def add_rlc_boundary(self, component=None, circuit_type=True):
|
|
2303
|
+
def add_rlc_boundary(self, component: Optional[Union[str, Component]] = None, circuit_type: bool = True) -> bool:
|
|
2247
2304
|
"""Add RLC gap boundary on component and replace it with a circuit port.
|
|
2248
2305
|
The circuit port supports only 2-pin components.
|
|
2249
2306
|
|