pyedb 0.56.0__py3-none-any.whl → 0.58.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_data.py +3 -0
- pyedb/configuration/cfg_pin_groups.py +2 -0
- pyedb/configuration/cfg_terminals.py +232 -0
- pyedb/configuration/configuration.py +146 -3
- pyedb/dotnet/clr_module.py +1 -2
- pyedb/dotnet/database/Variables.py +30 -22
- pyedb/dotnet/database/cell/hierarchy/component.py +2 -8
- pyedb/dotnet/database/cell/layout.py +5 -1
- pyedb/dotnet/database/cell/primitive/primitive.py +2 -2
- pyedb/dotnet/database/cell/terminal/bundle_terminal.py +12 -0
- pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/terminal.py +38 -0
- pyedb/dotnet/database/components.py +15 -19
- pyedb/dotnet/database/dotnet/database.py +1 -0
- pyedb/dotnet/database/edb_data/control_file.py +19 -8
- pyedb/dotnet/database/edb_data/nets_data.py +3 -3
- pyedb/dotnet/database/edb_data/padstacks_data.py +39 -14
- pyedb/dotnet/database/edb_data/ports.py +0 -25
- pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
- pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py +18 -19
- pyedb/dotnet/database/edb_data/simulation_configuration.py +3 -3
- pyedb/dotnet/database/edb_data/sources.py +21 -2
- pyedb/dotnet/database/general.py +1 -6
- pyedb/dotnet/database/hfss.py +9 -8
- pyedb/dotnet/database/layout_validation.py +14 -3
- pyedb/dotnet/database/materials.py +1 -3
- pyedb/dotnet/database/modeler.py +7 -3
- pyedb/dotnet/database/nets.py +27 -19
- pyedb/dotnet/database/padstack.py +4 -2
- pyedb/dotnet/database/sim_setup_data/io/siwave.py +54 -1
- pyedb/dotnet/database/siwave.py +4 -3
- pyedb/dotnet/database/stackup.py +55 -58
- pyedb/dotnet/database/utilities/heatsink.py +0 -1
- pyedb/dotnet/database/utilities/hfss_simulation_setup.py +81 -0
- pyedb/dotnet/database/utilities/simulation_setup.py +7 -5
- pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +1 -0
- pyedb/dotnet/database/utilities/siwave_simulation_setup.py +264 -13
- pyedb/dotnet/edb.py +65 -47
- pyedb/exceptions.py +1 -2
- pyedb/extensions/create_cell_array.py +67 -49
- pyedb/generic/data_handlers.py +13 -23
- pyedb/generic/design_types.py +9 -35
- pyedb/generic/filesystem.py +4 -2
- pyedb/generic/general_methods.py +28 -41
- pyedb/generic/plot.py +8 -23
- pyedb/generic/process.py +78 -10
- pyedb/grpc/database/_typing.py +0 -0
- pyedb/grpc/database/components.py +14 -13
- pyedb/grpc/database/control_file.py +27 -40
- pyedb/grpc/database/definition/materials.py +1 -1
- pyedb/grpc/database/definition/package_def.py +6 -3
- pyedb/grpc/database/definition/padstack_def.py +14 -12
- pyedb/grpc/database/hfss.py +1 -4
- pyedb/grpc/database/hierarchy/component.py +5 -13
- pyedb/grpc/database/hierarchy/pingroup.py +16 -3
- pyedb/grpc/database/layers/layer.py +1 -2
- pyedb/grpc/database/layers/stackup_layer.py +42 -19
- pyedb/grpc/database/layout/layout.py +43 -27
- pyedb/grpc/database/layout/voltage_regulator.py +6 -1
- pyedb/grpc/database/layout_validation.py +5 -2
- pyedb/grpc/database/modeler.py +254 -252
- pyedb/grpc/database/net/differential_pair.py +9 -2
- pyedb/grpc/database/net/extended_net.py +24 -9
- pyedb/grpc/database/net/net.py +14 -5
- pyedb/grpc/database/net/net_class.py +24 -7
- pyedb/grpc/database/nets.py +11 -43
- pyedb/grpc/database/padstacks.py +67 -119
- pyedb/grpc/database/primitive/bondwire.py +3 -67
- pyedb/grpc/database/primitive/circle.py +42 -3
- pyedb/grpc/database/primitive/padstack_instance.py +58 -31
- pyedb/grpc/database/primitive/path.py +160 -11
- pyedb/grpc/database/primitive/polygon.py +73 -7
- pyedb/grpc/database/primitive/primitive.py +2 -2
- pyedb/grpc/database/primitive/rectangle.py +105 -4
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +0 -2
- pyedb/grpc/database/simulation_setup/hfss_settings_options.py +0 -4
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +79 -0
- pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +1 -0
- pyedb/grpc/database/simulation_setup/sweep_data.py +1 -3
- pyedb/grpc/database/siwave.py +6 -13
- pyedb/grpc/database/source_excitations.py +46 -63
- pyedb/grpc/database/stackup.py +55 -60
- pyedb/grpc/database/terminal/bundle_terminal.py +10 -3
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +9 -11
- pyedb/grpc/database/terminal/pingroup_terminal.py +8 -1
- pyedb/grpc/database/terminal/point_terminal.py +30 -0
- pyedb/grpc/database/terminal/terminal.py +35 -10
- pyedb/grpc/database/utility/heat_sink.py +0 -1
- pyedb/grpc/database/utility/hfss_extent_info.py +2 -2
- pyedb/grpc/database/utility/xml_control_file.py +19 -8
- pyedb/grpc/edb.py +63 -32
- pyedb/grpc/edb_init.py +1 -0
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +6 -2
- pyedb/ipc2581/ecad/cad_data/step.py +1 -1
- pyedb/ipc2581/ipc2581.py +8 -7
- pyedb/libraries/common.py +3 -4
- pyedb/libraries/rf_libraries/base_functions.py +7 -16
- pyedb/libraries/rf_libraries/planar_antennas.py +3 -21
- pyedb/misc/aedtlib_personalib_install.py +2 -2
- pyedb/misc/downloads.py +19 -3
- pyedb/misc/misc.py +5 -2
- pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +3 -2
- pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py +0 -1
- pyedb/misc/utilities.py +0 -1
- pyedb/modeler/geometry_operators.py +3 -2
- {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/METADATA +6 -7
- {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/RECORD +110 -108
- {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/WHEEL +0 -0
- {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -21,11 +21,14 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
from typing import Union
|
|
25
|
+
|
|
24
26
|
from ansys.edb.core.primitive.rectangle import (
|
|
27
|
+
Rectangle as GrpcRectangle,
|
|
25
28
|
RectangleRepresentationType as GrpcRectangleRepresentationType,
|
|
26
29
|
)
|
|
27
|
-
from ansys.edb.core.primitive.rectangle import Rectangle as GrpcRectangle
|
|
28
30
|
|
|
31
|
+
from pyedb.grpc.database.layers.layer import Layer
|
|
29
32
|
from pyedb.grpc.database.primitive.primitive import Primitive
|
|
30
33
|
from pyedb.grpc.database.utility.value import Value
|
|
31
34
|
|
|
@@ -33,9 +36,10 @@ from pyedb.grpc.database.utility.value import Value
|
|
|
33
36
|
class Rectangle(GrpcRectangle, Primitive):
|
|
34
37
|
"""Class representing a rectangle object."""
|
|
35
38
|
|
|
36
|
-
def __init__(self, pedb, edb_object):
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
def __init__(self, pedb, edb_object=None):
|
|
40
|
+
if edb_object:
|
|
41
|
+
Primitive.__init__(self, pedb, edb_object)
|
|
42
|
+
GrpcRectangle.__init__(self, edb_object.msg)
|
|
39
43
|
self._pedb = pedb
|
|
40
44
|
self._mapping_representation_type = {
|
|
41
45
|
"center_width_height": GrpcRectangleRepresentationType.CENTER_WIDTH_HEIGHT,
|
|
@@ -71,6 +75,103 @@ class Rectangle(GrpcRectangle, Primitive):
|
|
|
71
75
|
else:
|
|
72
76
|
super().representation_type = self._mapping_representation_type[value]
|
|
73
77
|
|
|
78
|
+
def create(
|
|
79
|
+
self,
|
|
80
|
+
layout=None,
|
|
81
|
+
layer: Union[str, Layer] = None,
|
|
82
|
+
net: Union[str, "Net"] = None,
|
|
83
|
+
rep_type: str = "center_width_height",
|
|
84
|
+
param1: float = None,
|
|
85
|
+
param2: float = None,
|
|
86
|
+
param3: float = None,
|
|
87
|
+
param4: float = None,
|
|
88
|
+
corner_rad: float = 0.0,
|
|
89
|
+
rotation: float = 0.0,
|
|
90
|
+
):
|
|
91
|
+
"""
|
|
92
|
+
Create a rectangle primitive in the specified layout, layer, and net with the given parameters.
|
|
93
|
+
|
|
94
|
+
Parameters
|
|
95
|
+
----------
|
|
96
|
+
layout : Layout, optional
|
|
97
|
+
The layout in which the rectangle will be created. If not provided, the active layout of the `pedb` instance
|
|
98
|
+
will be used.
|
|
99
|
+
layer : Union[str, Layer], optional
|
|
100
|
+
The layer in which the rectangle will be created. This parameter is required and must be specified.
|
|
101
|
+
net : Union[str, Net], optional
|
|
102
|
+
The net to which the rectangle will belong. This parameter is required and must be specified.
|
|
103
|
+
rep_type : str, optional
|
|
104
|
+
The representation type of the rectangle. Options are `"center_width_height"` or `"lower_left_upper_right"`.
|
|
105
|
+
The default value is `"center_width_height"`.
|
|
106
|
+
param1 : float, optional
|
|
107
|
+
The first parameter defining the rectangle. Its meaning depends on the `rep_type`.
|
|
108
|
+
param2 : float, optional
|
|
109
|
+
The second parameter defining the rectangle. Its meaning depends on the `rep_type`.
|
|
110
|
+
param3 : float, optional
|
|
111
|
+
The third parameter defining the rectangle. Its meaning depends on the `rep_type`.
|
|
112
|
+
param4 : float, optional
|
|
113
|
+
The fourth parameter defining the rectangle. Its meaning depends on the `rep_type`.
|
|
114
|
+
corner_rad : float, optional
|
|
115
|
+
The corner radius of the rectangle. The default value is `0.0`.
|
|
116
|
+
rotation : float, optional
|
|
117
|
+
The rotation angle of the rectangle in degrees. The default value is `0.0`.
|
|
118
|
+
|
|
119
|
+
Returns
|
|
120
|
+
-------
|
|
121
|
+
Rectangle
|
|
122
|
+
The created rectangle primitive.
|
|
123
|
+
|
|
124
|
+
Raises
|
|
125
|
+
------
|
|
126
|
+
ValueError
|
|
127
|
+
If the `layer` parameter is not provided.
|
|
128
|
+
ValueError
|
|
129
|
+
If the `net` parameter is not provided.
|
|
130
|
+
|
|
131
|
+
Notes
|
|
132
|
+
-----
|
|
133
|
+
- The created rectangle is added to the modeler primitives of the `pedb` instance.
|
|
134
|
+
- The `rep_type` determines how the parameters are interpreted:
|
|
135
|
+
- `"center_width_height"`: `param1` and `param2` represent the center coordinates, while `param3` and
|
|
136
|
+
`param4` represent the width and height.
|
|
137
|
+
- `"lower_left_upper_right"`: `param1` and `param2` represent the lower-left corner coordinates, while
|
|
138
|
+
`param3` and `param4` represent the upper-right corner coordinates.
|
|
139
|
+
"""
|
|
140
|
+
if not layout:
|
|
141
|
+
layout = self._pedb.active_layout
|
|
142
|
+
if not layer:
|
|
143
|
+
raise ValueError("Layer must be provided.")
|
|
144
|
+
if not net:
|
|
145
|
+
raise ValueError("Net must be provided.")
|
|
146
|
+
|
|
147
|
+
rep_type_mapping = {
|
|
148
|
+
"center_width_height": GrpcRectangleRepresentationType.CENTER_WIDTH_HEIGHT,
|
|
149
|
+
"lower_left_upper_right": GrpcRectangleRepresentationType.LOWER_LEFT_UPPER_RIGHT,
|
|
150
|
+
}
|
|
151
|
+
rep_type = rep_type_mapping.get(rep_type, GrpcRectangleRepresentationType.INVALID_RECT_TYPE)
|
|
152
|
+
edb_object = super().create(
|
|
153
|
+
layout=layout,
|
|
154
|
+
layer=layer,
|
|
155
|
+
net=net,
|
|
156
|
+
rep_type=rep_type,
|
|
157
|
+
param1=Value(param1),
|
|
158
|
+
param2=Value(param2),
|
|
159
|
+
param3=Value(param3),
|
|
160
|
+
param4=Value(param4),
|
|
161
|
+
corner_rad=Value(corner_rad),
|
|
162
|
+
rotation=Value(rotation),
|
|
163
|
+
)
|
|
164
|
+
# keep cache synced
|
|
165
|
+
new_rect = Rectangle(self._pedb, edb_object)
|
|
166
|
+
self._pedb.modeler._add_primitive(new_rect)
|
|
167
|
+
return new_rect
|
|
168
|
+
|
|
169
|
+
def delete(self):
|
|
170
|
+
"""Delete the rectangle primitive from the layout."""
|
|
171
|
+
# Remove from cache
|
|
172
|
+
self._pedb.modeler._remove_primitive(self)
|
|
173
|
+
super().delete()
|
|
174
|
+
|
|
74
175
|
def get_parameters(self):
|
|
75
176
|
"""Get coordinates parameters.
|
|
76
177
|
|
|
@@ -23,11 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
from ansys.edb.core.simulation_setup.hfss_simulation_settings import (
|
|
25
25
|
BasisFunctionOrder as GrpcBasisFunctionOrder,
|
|
26
|
-
)
|
|
27
|
-
from ansys.edb.core.simulation_setup.hfss_simulation_settings import (
|
|
28
26
|
HFSSSettingsOptions as GrpcHFSSSettingsOptions,
|
|
29
|
-
)
|
|
30
|
-
from ansys.edb.core.simulation_setup.hfss_simulation_settings import (
|
|
31
27
|
SolverType as GrpcSolverType,
|
|
32
28
|
)
|
|
33
29
|
|
|
@@ -30,6 +30,7 @@ from ansys.edb.core.simulation_setup.hfss_simulation_settings import (
|
|
|
30
30
|
from ansys.edb.core.simulation_setup.hfss_simulation_setup import (
|
|
31
31
|
HfssSimulationSetup as GrpcHfssSimulationSetup,
|
|
32
32
|
)
|
|
33
|
+
from ansys.edb.core.simulation_setup.mesh_operation import LengthMeshOperation as GrpcLengthMeshOperation
|
|
33
34
|
|
|
34
35
|
from pyedb.generic.general_methods import generate_unique_name
|
|
35
36
|
from pyedb.grpc.database.simulation_setup.sweep_data import SweepData
|
|
@@ -411,3 +412,81 @@ class HfssSimulationSetup(GrpcHfssSimulationSetup):
|
|
|
411
412
|
else:
|
|
412
413
|
self._pedb.logger.error("Failed to add frequency sweep data")
|
|
413
414
|
return False
|
|
415
|
+
|
|
416
|
+
def auto_mesh_operation(
|
|
417
|
+
self,
|
|
418
|
+
trace_ratio_seeding: float = 3,
|
|
419
|
+
signal_via_side_number: int = 12,
|
|
420
|
+
power_ground_via_side_number: int = 6,
|
|
421
|
+
) -> bool:
|
|
422
|
+
"""
|
|
423
|
+
Automatically create and apply a length-based mesh operation for all nets in the design.
|
|
424
|
+
|
|
425
|
+
The method inspects every signal net, determines the smallest trace width, and
|
|
426
|
+
seeds a :class:`GrpcLengthMeshOperation` whose maximum element length is
|
|
427
|
+
``smallest_width * trace_ratio_seeding``. Signal vias (padstack instances) are
|
|
428
|
+
configured with the requested number of polygon sides, while power/ground vias
|
|
429
|
+
are updated through the global ``num_via_sides`` advanced setting.
|
|
430
|
+
|
|
431
|
+
Parameters
|
|
432
|
+
----------
|
|
433
|
+
trace_ratio_seeding : float, optional
|
|
434
|
+
Ratio used to compute the maximum allowed element length from the
|
|
435
|
+
smallest trace width found in the design. The resulting length is
|
|
436
|
+
``min_width * trace_ratio_seeding``. Defaults to ``3``.
|
|
437
|
+
signal_via_side_number : int, optional
|
|
438
|
+
Number of sides (i.e. faceting resolution) assigned to **signal**
|
|
439
|
+
padstack instances that belong to the nets being meshed.
|
|
440
|
+
Defaults to ``12``.
|
|
441
|
+
power_ground_via_side_number : int, optional
|
|
442
|
+
Number of sides assigned to **power/ground** vias via the global
|
|
443
|
+
``advanced.num_via_sides`` setting. Defaults to ``6``.
|
|
444
|
+
|
|
445
|
+
Returns
|
|
446
|
+
-------
|
|
447
|
+
bool
|
|
448
|
+
|
|
449
|
+
Raises
|
|
450
|
+
------
|
|
451
|
+
ValueError
|
|
452
|
+
If the design contains no terminals, making mesh seeding impossible.
|
|
453
|
+
|
|
454
|
+
Notes
|
|
455
|
+
-----
|
|
456
|
+
* Only primitives of type ``"path"`` are considered when determining the
|
|
457
|
+
smallest trace width.
|
|
458
|
+
* Every ``(net, layer, sheet)`` tuple required by the mesher is
|
|
459
|
+
automatically populated; sheet are explicitly marked as ``False``.
|
|
460
|
+
* Existing contents of :attr:`mesh_operations` are **replaced** by the
|
|
461
|
+
single new operation.
|
|
462
|
+
|
|
463
|
+
Examples
|
|
464
|
+
--------
|
|
465
|
+
>>> setup = edbapp.setups["my_setup"]
|
|
466
|
+
>>> setup.auto_mesh_operation(trace_ratio_seeding=4, signal_via_side_number=16)
|
|
467
|
+
>>> setup.mesh_operations[0].max_length
|
|
468
|
+
'2.5um'
|
|
469
|
+
"""
|
|
470
|
+
net_for_mesh_seeding = list(set([term.net.name for term in list(self._pedb.terminals.values())]))
|
|
471
|
+
if not net_for_mesh_seeding:
|
|
472
|
+
raise ValueError("No terminals found to seed the mesh operation.")
|
|
473
|
+
meshop = GrpcLengthMeshOperation(name=f"{self.name}_AutoMeshOp")
|
|
474
|
+
layer_info = []
|
|
475
|
+
smallest_width = 1e3
|
|
476
|
+
for net in net_for_mesh_seeding:
|
|
477
|
+
traces = [prim for prim in self._pedb.modeler.primitives_by_net[net] if prim.type == "path"]
|
|
478
|
+
_width = min([trace.width for trace in traces], default=1e3)
|
|
479
|
+
if _width < smallest_width:
|
|
480
|
+
smallest_width = _width
|
|
481
|
+
layers = list(set([trace.layer.name for trace in traces]))
|
|
482
|
+
for layer in layers:
|
|
483
|
+
layer_info.append((net, layer, False))
|
|
484
|
+
for inst in self._pedb.padstacks.instances_by_net[net]:
|
|
485
|
+
inst.side_number = signal_via_side_number
|
|
486
|
+
meshop.max_length = f"{round(float((smallest_width * trace_ratio_seeding)), 9) * 1e6}um"
|
|
487
|
+
meshop.net_layer_info = layer_info
|
|
488
|
+
self.mesh_operations = [meshop]
|
|
489
|
+
self.settings.advanced.num_via_sides = power_ground_via_side_number
|
|
490
|
+
if self.mesh_operations:
|
|
491
|
+
return True
|
|
492
|
+
return False
|
|
@@ -758,6 +758,7 @@ class SIWaveCPASimulationSetup:
|
|
|
758
758
|
self._pedb = pedb
|
|
759
759
|
self._channel_setup = ChannelSetup(pedb)
|
|
760
760
|
self._solver_options = SolverOptions(pedb)
|
|
761
|
+
self.type = "cpa"
|
|
761
762
|
if isinstance(siwave_cpa_setup_class, SIwaveCpaSetup):
|
|
762
763
|
self._apply_cfg_object(siwave_cpa_setup_class)
|
|
763
764
|
else:
|
|
@@ -22,11 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
from ansys.edb.core.simulation_setup.simulation_setup import (
|
|
24
24
|
Distribution as GrpcDistribution,
|
|
25
|
-
)
|
|
26
|
-
from ansys.edb.core.simulation_setup.simulation_setup import (
|
|
27
25
|
FrequencyData as GrpcFrequencyData,
|
|
26
|
+
SweepData as GrpcSweepData,
|
|
28
27
|
)
|
|
29
|
-
from ansys.edb.core.simulation_setup.simulation_setup import SweepData as GrpcSweepData
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
class SweepData(GrpcSweepData):
|
pyedb/grpc/database/siwave.py
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
This module contains these classes: ``CircuitPort``, ``CurrentSource``, ``EdbSiwave``,
|
|
25
25
|
``PinGroup``, ``ResistorSource``, ``Source``, ``SourceType``, and ``VoltageSource``.
|
|
26
26
|
"""
|
|
27
|
+
|
|
27
28
|
import os
|
|
28
29
|
from typing import Any, Dict, Optional, Union
|
|
29
30
|
import warnings
|
|
@@ -31,11 +32,9 @@ import warnings
|
|
|
31
32
|
from ansys.edb.core.database import ProductIdType as GrpcProductIdType
|
|
32
33
|
from ansys.edb.core.simulation_setup.simulation_setup import (
|
|
33
34
|
Distribution as GrpcDistribution,
|
|
34
|
-
)
|
|
35
|
-
from ansys.edb.core.simulation_setup.simulation_setup import (
|
|
36
35
|
FrequencyData as GrpcFrequencyData,
|
|
36
|
+
SweepData as GrpcSweepData,
|
|
37
37
|
)
|
|
38
|
-
from ansys.edb.core.simulation_setup.simulation_setup import SweepData as GrpcSweepData
|
|
39
38
|
|
|
40
39
|
from pyedb.grpc.database.simulation_setup.siwave_cpa_simulation_setup import (
|
|
41
40
|
SIWaveCPASimulationSetup,
|
|
@@ -335,7 +334,7 @@ class Siwave(object):
|
|
|
335
334
|
Use :func:`pyedb.grpc.core.excitations._check_gnd` instead.
|
|
336
335
|
"""
|
|
337
336
|
warnings.warn(
|
|
338
|
-
"`_check_gnd` is deprecated and is now located here
|
|
337
|
+
"`_check_gnd` is deprecated and is now located here `pyedb.grpc.core.excitations._check_gnd` instead.",
|
|
339
338
|
DeprecationWarning,
|
|
340
339
|
)
|
|
341
340
|
return self._pedb.source_excitation._check_gnd(component_name)
|
|
@@ -563,9 +562,7 @@ class Siwave(object):
|
|
|
563
562
|
>>> success = edbapp.siwave.create_exec_file(add_ac=True, add_syz=True)
|
|
564
563
|
>>> # Create exec file with Touchstone export
|
|
565
564
|
>>> success = edbapp.siwave.create_exec_file(
|
|
566
|
-
... add_ac=True,
|
|
567
|
-
... export_touchstone=True,
|
|
568
|
-
... touchstone_file_path="C:/temp/my_touchstone.s2p"
|
|
565
|
+
... add_ac=True, export_touchstone=True, touchstone_file_path="C:/temp/my_touchstone.s2p"
|
|
569
566
|
... )
|
|
570
567
|
"""
|
|
571
568
|
workdir = os.path.dirname(self._pedb.edbpath)
|
|
@@ -644,17 +641,13 @@ class Siwave(object):
|
|
|
644
641
|
>>> from pyedb import Edb
|
|
645
642
|
>>> edbapp = Edb("myaedbfolder", edbversion="2021.2")
|
|
646
643
|
>>> # Add SYZ analysis with linear sweep from 1kHz to 10GHz
|
|
647
|
-
>>> setup = edbapp.siwave.add_siwave_syz_analysis(
|
|
648
|
-
... start_freq=1e3,
|
|
649
|
-
... stop_freq=10e9,
|
|
650
|
-
... distribution="linear"
|
|
651
|
-
... )
|
|
644
|
+
>>> setup = edbapp.siwave.add_siwave_syz_analysis(start_freq=1e3, stop_freq=10e9, distribution="linear")
|
|
652
645
|
>>> # Add SYZ analysis with decade sweep
|
|
653
646
|
>>> setup = edbapp.siwave.add_siwave_syz_analysis(
|
|
654
647
|
... start_freq=1e3,
|
|
655
648
|
... stop_freq=10e9,
|
|
656
649
|
... distribution="decade_count",
|
|
657
|
-
... step_freq=10 # 10 points per decade
|
|
650
|
+
... step_freq=10, # 10 points per decade
|
|
658
651
|
... )
|
|
659
652
|
"""
|
|
660
653
|
setup = self._pedb.create_siwave_syz_setup()
|
|
@@ -25,8 +25,7 @@ from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
|
|
25
25
|
from ansys.edb.core.database import ProductIdType as GrpcProductIdType
|
|
26
26
|
from ansys.edb.core.geometry.point_data import PointData as GrpcPointData
|
|
27
27
|
from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData
|
|
28
|
-
from ansys.edb.core.terminal.edge_terminal import EdgeTerminal as GrpcEdgeTerminal
|
|
29
|
-
from ansys.edb.core.terminal.edge_terminal import PrimitiveEdge as GrpcPrimitiveEdge
|
|
28
|
+
from ansys.edb.core.terminal.edge_terminal import EdgeTerminal as GrpcEdgeTerminal, PrimitiveEdge as GrpcPrimitiveEdge
|
|
30
29
|
from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType
|
|
31
30
|
from ansys.edb.core.utility.rlc import Rlc as GrpcRlc
|
|
32
31
|
|
|
@@ -66,14 +65,14 @@ class SourceExcitation:
|
|
|
66
65
|
>>> # Create voltage source on component pins
|
|
67
66
|
>>> from pyedb.grpc.database.utility.sources import Source, SourceType
|
|
68
67
|
>>> source = Source(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
... source_type=SourceType.Vsource,
|
|
69
|
+
... name="V1",
|
|
70
|
+
... positive_node=("U1", "VCC"),
|
|
71
|
+
... negative_node=("U1", "GND"),
|
|
72
|
+
... amplitude="1V",
|
|
73
|
+
... phase="0deg",
|
|
74
|
+
... impedance="50ohm",
|
|
75
|
+
... )
|
|
77
76
|
>>> source_excitations.create_source_on_component([source])
|
|
78
77
|
|
|
79
78
|
>>> # 2. create_port
|
|
@@ -85,21 +84,14 @@ class SourceExcitation:
|
|
|
85
84
|
>>> # 3. create_port_on_pins
|
|
86
85
|
>>> # Create circuit port between component pins
|
|
87
86
|
>>> port_term = source_excitations.create_port_on_pins(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
>>> reference_pins=["GND_Pin1", "GND_Pin2"],
|
|
91
|
-
>>> impedance=50,
|
|
92
|
-
>>> port_name="Port1"
|
|
93
|
-
>>> )
|
|
87
|
+
... refdes="U1", pins="Pin1", reference_pins=["GND_Pin1", "GND_Pin2"], impedance=50, port_name="Port1"
|
|
88
|
+
... )
|
|
94
89
|
|
|
95
90
|
>>> # 4. create_port_on_component
|
|
96
91
|
>>> # Create coaxial ports on component nets
|
|
97
92
|
>>> source_excitations.create_port_on_component(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
>>> port_type=SourceType.CoaxPort,
|
|
101
|
-
>>> reference_net="GND"
|
|
102
|
-
>>> )
|
|
93
|
+
... component="U1", net_list=["PCIe_RX0", "PCIe_RX1"], port_type=SourceType.CoaxPort, reference_net="GND"
|
|
94
|
+
... )
|
|
103
95
|
|
|
104
96
|
>>> # 5. add_port_on_rlc_component
|
|
105
97
|
>>> # Replace RLC component with circuit port
|
|
@@ -153,35 +145,26 @@ class SourceExcitation:
|
|
|
153
145
|
>>> # 16. create_coax_port_on_component
|
|
154
146
|
>>> # Create coaxial ports on component
|
|
155
147
|
>>> ports = source_excitations.create_coax_port_on_component(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
>>> delete_existing_terminal=True
|
|
159
|
-
>>> )
|
|
148
|
+
... ["U1", "U2"], ["PCIe_RX0", "PCIe_TX0"], delete_existing_terminal=True
|
|
149
|
+
... )
|
|
160
150
|
|
|
161
151
|
>>> # 17. create_differential_wave_port
|
|
162
152
|
>>> # Create differential wave port
|
|
163
153
|
>>> pos_prim = edb.modeler.primitives[0]
|
|
164
154
|
>>> neg_prim = edb.modeler.primitives[1]
|
|
165
155
|
>>> port_name, diff_port = source_excitations.create_differential_wave_port(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
>>> "DiffPort"
|
|
169
|
-
>>> )
|
|
156
|
+
... pos_prim.id, [0, 0], neg_prim.id, [0, 0.2], "DiffPort"
|
|
157
|
+
... )
|
|
170
158
|
|
|
171
159
|
>>> # 18. create_wave_port
|
|
172
160
|
>>> # Create wave port
|
|
173
|
-
>>> port_name, wave_port = source_excitations.create_wave_port(
|
|
174
|
-
>>> pos_prim.id, [0, 0],
|
|
175
|
-
>>> "WavePort"
|
|
176
|
-
>>> )
|
|
161
|
+
>>> port_name, wave_port = source_excitations.create_wave_port(pos_prim.id, [0, 0], "WavePort")
|
|
177
162
|
|
|
178
163
|
>>> # 19. create_bundle_wave_port
|
|
179
164
|
>>> # Create bundle wave port
|
|
180
165
|
>>> port_name, bundle_port = source_excitations.create_bundle_wave_port(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
>>> "BundlePort"
|
|
184
|
-
>>> )
|
|
166
|
+
... [pos_prim.id, neg_prim.id], [[0, 0], [0, 0.2]], "BundlePort"
|
|
167
|
+
... )
|
|
185
168
|
|
|
186
169
|
>>> # 20. create_dc_terminal
|
|
187
170
|
>>> # Create DC terminal
|
|
@@ -194,10 +177,8 @@ class SourceExcitation:
|
|
|
194
177
|
>>> # 22. place_voltage_probe
|
|
195
178
|
>>> # Place voltage probe between points
|
|
196
179
|
>>> source_excitations.place_voltage_probe(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
>>> "GND", [0.1, 0.1], "BottomLayer"
|
|
200
|
-
>>> )
|
|
180
|
+
... "Probe1", "SignalNet", [0, 0], "TopLayer", "GND", [0.1, 0.1], "BottomLayer"
|
|
181
|
+
... )
|
|
201
182
|
|
|
202
183
|
>>> # Save and close EDB
|
|
203
184
|
>>> edb.save()
|
|
@@ -505,22 +486,22 @@ class SourceExcitation:
|
|
|
505
486
|
|
|
506
487
|
def create_port_on_component(
|
|
507
488
|
self,
|
|
508
|
-
component: Union[str,
|
|
489
|
+
component: Union[str, Component],
|
|
509
490
|
net_list: Union[str, List[str]],
|
|
510
|
-
port_type:
|
|
491
|
+
port_type: str = "coax_port",
|
|
511
492
|
do_pingroup: Optional[bool] = True,
|
|
512
493
|
reference_net: Optional[str] = None,
|
|
513
494
|
port_name: Optional[List[str]] = None,
|
|
514
|
-
solder_balls_height:
|
|
515
|
-
solder_balls_size:
|
|
516
|
-
solder_balls_mid_size:
|
|
495
|
+
solder_balls_height: Union[float, str] = None,
|
|
496
|
+
solder_balls_size: Union[float, str] = None,
|
|
497
|
+
solder_balls_mid_size: Union[float, str] = None,
|
|
517
498
|
extend_reference_pins_outside_component: Optional[bool] = False,
|
|
518
499
|
) -> List[str]:
|
|
519
500
|
"""Create ports on a component.
|
|
520
501
|
|
|
521
502
|
Parameters
|
|
522
503
|
----------
|
|
523
|
-
component : str or
|
|
504
|
+
component : str or Component
|
|
524
505
|
EDB component or str component name.
|
|
525
506
|
net_list : str or list of string.
|
|
526
507
|
List of nets where ports must be created on the component.
|
|
@@ -584,8 +565,11 @@ class SourceExcitation:
|
|
|
584
565
|
net_name = net.name
|
|
585
566
|
if net_name:
|
|
586
567
|
net_list.append(net_name)
|
|
587
|
-
except:
|
|
588
|
-
|
|
568
|
+
except Exception as e:
|
|
569
|
+
self._logger.warning(
|
|
570
|
+
f"A(n) {type(e).__name__} error occurred while attempting to append 'name' "
|
|
571
|
+
f"of net {net} to list of nets {net_list}: {str(e)}"
|
|
572
|
+
)
|
|
589
573
|
if isinstance(reference_net, str) or isinstance(reference_net, Net):
|
|
590
574
|
reference_net = [reference_net]
|
|
591
575
|
_reference_net = [ref.name for ref in reference_net if isinstance(ref, Net)]
|
|
@@ -1656,8 +1640,7 @@ class SourceExcitation:
|
|
|
1656
1640
|
|
|
1657
1641
|
if not source_name:
|
|
1658
1642
|
source_name = (
|
|
1659
|
-
f"Vsource_{positive_component_name}_{positive_net_name}_"
|
|
1660
|
-
f"{negative_component_name}_{negative_net_name}"
|
|
1643
|
+
f"Vsource_{positive_component_name}_{positive_net_name}_{negative_component_name}_{negative_net_name}"
|
|
1661
1644
|
)
|
|
1662
1645
|
return self.create_pin_group_terminal(
|
|
1663
1646
|
positive_pins=pos_node_pins,
|
|
@@ -1720,8 +1703,7 @@ class SourceExcitation:
|
|
|
1720
1703
|
|
|
1721
1704
|
if not source_name:
|
|
1722
1705
|
source_name = (
|
|
1723
|
-
f"Vsource_{positive_component_name}_{positive_net_name}_"
|
|
1724
|
-
f"{negative_component_name}_{negative_net_name}"
|
|
1706
|
+
f"Vsource_{positive_component_name}_{positive_net_name}_{negative_component_name}_{negative_net_name}"
|
|
1725
1707
|
)
|
|
1726
1708
|
return self.create_pin_group_terminal(
|
|
1727
1709
|
positive_pins=pos_node_pins,
|
|
@@ -1865,7 +1847,7 @@ class SourceExcitation:
|
|
|
1865
1847
|
--------
|
|
1866
1848
|
>>> from pyedb import Edb
|
|
1867
1849
|
>>> edb = Edb()
|
|
1868
|
-
>>> port_name, port = edb.source_excitation.create_differential_wave_port(0, [0,0], 1, [0,0.2])
|
|
1850
|
+
>>> port_name, port = edb.source_excitation.create_differential_wave_port(0, [0, 0], 1, [0, 0.2])
|
|
1869
1851
|
"""
|
|
1870
1852
|
if not port_name:
|
|
1871
1853
|
port_name = generate_unique_name("diff")
|
|
@@ -1939,7 +1921,7 @@ class SourceExcitation:
|
|
|
1939
1921
|
--------
|
|
1940
1922
|
>>> from pyedb import Edb
|
|
1941
1923
|
>>> edb = Edb()
|
|
1942
|
-
>>> port_name, port = edb.source_excitation.create_wave_port(0, [0,0])
|
|
1924
|
+
>>> port_name, port = edb.source_excitation.create_wave_port(0, [0, 0])
|
|
1943
1925
|
"""
|
|
1944
1926
|
if not port_name:
|
|
1945
1927
|
port_name = generate_unique_name("Terminal_")
|
|
@@ -2007,7 +1989,7 @@ class SourceExcitation:
|
|
|
2007
1989
|
--------
|
|
2008
1990
|
>>> from pyedb import Edb
|
|
2009
1991
|
>>> edb = Edb()
|
|
2010
|
-
>>> term = edb.source_excitation.create_edge_port_vertical(0, [0,0], reference_layer="TopLayer")
|
|
1992
|
+
>>> term = edb.source_excitation.create_edge_port_vertical(0, [0, 0], reference_layer="TopLayer")
|
|
2011
1993
|
"""
|
|
2012
1994
|
if not port_name:
|
|
2013
1995
|
port_name = generate_unique_name("Terminal_")
|
|
@@ -2079,7 +2061,7 @@ class SourceExcitation:
|
|
|
2079
2061
|
--------
|
|
2080
2062
|
>>> from pyedb import Edb
|
|
2081
2063
|
>>> edb = Edb()
|
|
2082
|
-
>>> edb.source_excitation.create_edge_port_horizontal(0, [0,0], 1, [0,0.1], "EdgePort")
|
|
2064
|
+
>>> edb.source_excitation.create_edge_port_horizontal(0, [0, 0], 1, [0, 0.1], "EdgePort")
|
|
2083
2065
|
"""
|
|
2084
2066
|
pos_edge_term = self._create_edge_terminal(prim_id, point_on_edge, port_name)
|
|
2085
2067
|
neg_edge_term = self._create_edge_terminal(ref_prim_id, point_on_ref_edge, port_name + "_ref", is_ref=True)
|
|
@@ -2350,7 +2332,7 @@ class SourceExcitation:
|
|
|
2350
2332
|
--------
|
|
2351
2333
|
>>> from pyedb import Edb
|
|
2352
2334
|
>>> edb = Edb()
|
|
2353
|
-
>>> port_name, port = edb.source_excitation.create_bundle_wave_port([0,1], [[0,0],[0,0.2]])
|
|
2335
|
+
>>> port_name, port = edb.source_excitation.create_bundle_wave_port([0, 1], [[0, 0], [0, 0.2]])
|
|
2354
2336
|
"""
|
|
2355
2337
|
if not port_name:
|
|
2356
2338
|
port_name = generate_unique_name("bundle_port")
|
|
@@ -2453,7 +2435,7 @@ class SourceExcitation:
|
|
|
2453
2435
|
--------
|
|
2454
2436
|
>>> from pyedb import Edb
|
|
2455
2437
|
>>> edb = Edb()
|
|
2456
|
-
>>> term = edb.source_excitation.get_point_terminal("Term1", "Net1", [0,0], "TopLayer")
|
|
2438
|
+
>>> term = edb.source_excitation.get_point_terminal("Term1", "Net1", [0, 0], "TopLayer")
|
|
2457
2439
|
"""
|
|
2458
2440
|
from pyedb.grpc.database.terminal.point_terminal import PointTerminal
|
|
2459
2441
|
|
|
@@ -2571,7 +2553,7 @@ class SourceExcitation:
|
|
|
2571
2553
|
>>> edb = Edb()
|
|
2572
2554
|
>>> poly = edb.modeler.primitives[0]
|
|
2573
2555
|
>>> ref_poly = edb.modeler.primitives[1]
|
|
2574
|
-
>>> edb.source_excitation.create_edge_port_on_polygon(poly, ref_poly, [0,0], [0.1,0])
|
|
2556
|
+
>>> edb.source_excitation.create_edge_port_on_polygon(poly, ref_poly, [0, 0], [0.1, 0])
|
|
2575
2557
|
"""
|
|
2576
2558
|
if not polygon:
|
|
2577
2559
|
self._logger.error("No polygon provided for port {} creation".format(port_name))
|
|
@@ -2679,7 +2661,7 @@ class SourceExcitation:
|
|
|
2679
2661
|
for __pin in pins_name:
|
|
2680
2662
|
if __pin in pins:
|
|
2681
2663
|
pin = pins[__pin]
|
|
2682
|
-
term_name = f"{pin.component.name}_{pin.net.name}_{pin.component}"
|
|
2664
|
+
term_name = f"{pin.component.name}_{pin.net.name}_{pin.component.name}"
|
|
2683
2665
|
start_layer, stop_layer = pin.get_layer_range()
|
|
2684
2666
|
if start_layer:
|
|
2685
2667
|
positive_terminal = PadstackInstanceTerminal.create(
|
|
@@ -3081,8 +3063,9 @@ class SourceExcitation:
|
|
|
3081
3063
|
--------
|
|
3082
3064
|
>>> from pyedb import Edb
|
|
3083
3065
|
>>> edb = Edb()
|
|
3084
|
-
>>> probe = edb.source_excitation.place_voltage_probe(
|
|
3085
|
-
...
|
|
3066
|
+
>>> probe = edb.source_excitation.place_voltage_probe(
|
|
3067
|
+
... "Probe1", "Net1", [0, 0], "TopLayer", "GND", [0.1, 0], "TopLayer"
|
|
3068
|
+
... )
|
|
3086
3069
|
"""
|
|
3087
3070
|
p_terminal = PointTerminal.create(
|
|
3088
3071
|
layout=self._pedb.active_layout,
|