pyedb 0.42.0__py3-none-any.whl → 0.44.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_boundaries.py +155 -72
- pyedb/configuration/cfg_components.py +1 -1
- pyedb/configuration/cfg_general.py +34 -16
- pyedb/configuration/cfg_modeler.py +162 -67
- pyedb/configuration/cfg_nets.py +33 -17
- pyedb/configuration/cfg_operations.py +63 -31
- pyedb/configuration/cfg_package_definition.py +113 -52
- pyedb/configuration/cfg_padstacks.py +611 -256
- pyedb/configuration/cfg_pin_groups.py +75 -33
- pyedb/configuration/cfg_ports_sources.py +75 -15
- pyedb/configuration/cfg_s_parameter_models.py +125 -70
- pyedb/configuration/cfg_setup.py +301 -257
- pyedb/configuration/cfg_stackup.py +166 -90
- pyedb/configuration/configuration.py +342 -209
- pyedb/dotnet/database/edb_data/design_options.py +19 -1
- pyedb/dotnet/database/edb_data/padstacks_data.py +16 -6
- pyedb/dotnet/database/geometry/polygon_data.py +4 -2
- pyedb/dotnet/database/padstack.py +6 -2
- pyedb/dotnet/database/sim_setup_data/data/sweep_data.py +63 -10
- pyedb/dotnet/database/utilities/simulation_setup.py +14 -30
- pyedb/dotnet/database/utilities/siwave_simulation_setup.py +30 -0
- pyedb/dotnet/edb.py +75 -105
- pyedb/grpc/database/components.py +1 -1
- pyedb/grpc/database/definition/component_def.py +15 -0
- pyedb/grpc/database/definition/component_pin.py +1 -1
- pyedb/grpc/database/definition/materials.py +27 -0
- pyedb/grpc/database/definition/package_def.py +20 -2
- pyedb/grpc/database/definition/padstack_def.py +5 -2
- pyedb/grpc/database/hierarchy/component.py +4 -2
- pyedb/grpc/database/hierarchy/pingroup.py +12 -8
- pyedb/grpc/database/layers/layer.py +28 -0
- pyedb/grpc/database/layers/stackup_layer.py +281 -40
- pyedb/grpc/database/layout/layout.py +12 -6
- pyedb/grpc/database/modeler.py +8 -8
- pyedb/grpc/database/primitive/bondwire.py +3 -3
- pyedb/grpc/database/primitive/circle.py +1 -1
- pyedb/grpc/database/primitive/padstack_instance.py +13 -3
- pyedb/grpc/database/primitive/path.py +2 -2
- pyedb/grpc/database/primitive/polygon.py +3 -3
- pyedb/grpc/database/primitive/primitive.py +1 -1
- pyedb/grpc/database/primitive/rectangle.py +2 -2
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +73 -30
- pyedb/grpc/database/source_excitations.py +7 -7
- pyedb/grpc/database/stackup.py +14 -6
- pyedb/grpc/database/terminal/bundle_terminal.py +3 -3
- pyedb/grpc/database/terminal/edge_terminal.py +2 -2
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +42 -2
- pyedb/grpc/database/terminal/pingroup_terminal.py +35 -2
- pyedb/grpc/database/terminal/point_terminal.py +10 -1
- pyedb/grpc/database/terminal/terminal.py +4 -4
- pyedb/grpc/database/utility/hfss_extent_info.py +14 -10
- pyedb/grpc/edb.py +8 -8
- pyedb/misc/misc.py +13 -0
- {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/METADATA +1 -1
- {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/RECORD +58 -58
- {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/LICENSE +0 -0
- {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/WHEEL +0 -0
pyedb/__init__.py
CHANGED
|
@@ -24,81 +24,164 @@ from pyedb.configuration.cfg_common import CfgBase
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class CfgBoundaries(CfgBase):
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
self.pml_visible = boundary_data.get("pml_visible", None)
|
|
32
|
-
self.pml_operation_frequency = boundary_data.get("pml_operation_frequency", None)
|
|
33
|
-
self.pml_radiation_factor = boundary_data.get("pml_radiation_factor", None)
|
|
34
|
-
self.dielectric_extent_type = boundary_data.get("dielectric_extent_type", None)
|
|
35
|
-
# self.dielectric_base_polygon = self.**kwargs.get("dielectric_base_polygon", None)
|
|
36
|
-
self.horizontal_padding = boundary_data.get("horizontal_padding", None)
|
|
37
|
-
self.honor_primitives_on_dielectric_layers = boundary_data.get("honor_primitives_on_dielectric_layers", False)
|
|
38
|
-
self.air_box_extent_type = boundary_data.get("air_box_extent_type", None)
|
|
39
|
-
self.air_box_base_polygon = boundary_data.get("air_box_base_polygon", None)
|
|
40
|
-
self.air_box_truncate_model_ground_layers = boundary_data.get("air_box_truncate_model_ground_layers", None)
|
|
41
|
-
self.air_box_horizontal_padding = boundary_data.get("air_box_horizontal_padding", None)
|
|
42
|
-
self.air_box_positive_vertical_padding = boundary_data.get("air_box_positive_vertical_padding", None)
|
|
43
|
-
self.air_box_negative_vertical_padding = boundary_data.get("air_box_negative_vertical_padding", None)
|
|
27
|
+
class Grpc:
|
|
28
|
+
@property
|
|
29
|
+
def pyedb_obj(self):
|
|
30
|
+
return self.parent.pyedb_obj
|
|
44
31
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
self.
|
|
49
|
-
|
|
50
|
-
self.
|
|
51
|
-
|
|
52
|
-
self.
|
|
53
|
-
|
|
54
|
-
self.
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
def __init__(self, parent):
|
|
33
|
+
self.parent = parent
|
|
34
|
+
self._pedb = parent.pedb
|
|
35
|
+
self.open_region = self.parent.boundary_data.get("open_region", None)
|
|
36
|
+
self.open_region_type = self.parent.boundary_data.get("map_open_region_type", None)
|
|
37
|
+
self.pml_visible = self.parent.boundary_data.get("pml_visible", None)
|
|
38
|
+
self.pml_operation_frequency = self.parent.boundary_data.get("pml_operation_frequency", None)
|
|
39
|
+
self.pml_radiation_factor = self.parent.boundary_data.get("pml_radiation_factor", None)
|
|
40
|
+
self.dielectric_extent_type = self.parent.boundary_data.get("dielectric_extent_type", None)
|
|
41
|
+
self.horizontal_padding = self.parent.boundary_data.get("horizontal_padding", None)
|
|
42
|
+
self.honor_primitives_on_dielectric_layers = self.parent.boundary_data.get(
|
|
43
|
+
"honor_primitives_on_dielectric_layers", False
|
|
44
|
+
)
|
|
45
|
+
self.air_box_extent_type = self.parent.boundary_data.get("air_box_extent_type", None)
|
|
46
|
+
self.air_box_base_polygon = self.parent.boundary_data.get("air_box_base_polygon", None)
|
|
47
|
+
self.air_box_truncate_model_ground_layers = self.parent.boundary_data.get(
|
|
48
|
+
"air_box_truncate_model_ground_layers", None
|
|
49
|
+
)
|
|
50
|
+
self.air_box_horizontal_padding = self.parent.boundary_data.get("air_box_horizontal_padding", None)
|
|
51
|
+
self.air_box_positive_vertical_padding = self.parent.boundary_data.get(
|
|
52
|
+
"air_box_positive_vertical_padding", None
|
|
53
|
+
)
|
|
54
|
+
self.air_box_negative_vertical_padding = self.parent.boundary_data.get(
|
|
55
|
+
"air_box_negative_vertical_padding", None
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def set_parameters_to_edb(self):
|
|
59
|
+
if self.open_region is not None:
|
|
60
|
+
self._pedb.hfss.hfss_extent_info.use_open_region = self.open_region
|
|
61
|
+
if self.open_region_type:
|
|
62
|
+
self._pedb.hfss.hfss_extent_info.open_region_type = self.open_region_type.lower()
|
|
63
|
+
if self.pml_visible is not None:
|
|
64
|
+
self._pedb.hfss.hfss_extent_info.is_pml_visible = self.pml_visible
|
|
65
|
+
if self.pml_operation_frequency:
|
|
66
|
+
self._pedb.hfss.hfss_extent_info.operating_freq = self.pml_operation_frequency
|
|
67
|
+
if self.pml_radiation_factor:
|
|
57
68
|
self._pedb.hfss.hfss_extent_info.pml_radiation_factor = self.pml_radiation_factor
|
|
58
|
-
|
|
59
|
-
self._pedb.hfss.hfss_extent_info.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
if self.dielectric_extent_type:
|
|
70
|
+
self._pedb.hfss.hfss_extent_info.extent_type = self.dielectric_extent_type.lower()
|
|
71
|
+
if self.horizontal_padding:
|
|
72
|
+
self._pedb.hfss.hfss_extent_info.dielectric_extent_size = float(self.horizontal_padding)
|
|
73
|
+
if self.honor_primitives_on_dielectric_layers is not None:
|
|
74
|
+
self._pedb.hfss.hfss_extent_info.honor_user_dielectric = self.honor_primitives_on_dielectric_layers
|
|
75
|
+
if self.air_box_extent_type:
|
|
76
|
+
self._pedb.hfss.hfss_extent_info.extent_type = self.air_box_extent_type.lower()
|
|
77
|
+
if self.air_box_truncate_model_ground_layers is not None:
|
|
78
|
+
self._pedb.hfss.hfss_extent_info.truncate_air_box_at_ground = self.air_box_truncate_model_ground_layers
|
|
79
|
+
if self.air_box_horizontal_padding:
|
|
80
|
+
self._pedb.hfss.hfss_extent_info.air_box_horizontal_extent = float(self.air_box_horizontal_padding)
|
|
81
|
+
if self.air_box_positive_vertical_padding:
|
|
82
|
+
self._pedb.hfss.hfss_extent_info.parentair_box_positive_vertical_extent = float(
|
|
83
|
+
self.air_box_positive_vertical_padding
|
|
84
|
+
)
|
|
85
|
+
if self.air_box_negative_vertical_padding:
|
|
86
|
+
self._pedb.hfss.hfss_extent_info.air_box_negative_vertical_extent = float(
|
|
87
|
+
self.air_box_negative_vertical_padding
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
def get_parameters_from_edb(self):
|
|
91
|
+
self.parent.open_region = self._pedb.hfss.hfss_extent_info.use_open_region
|
|
92
|
+
self.parent.open_region_type = self._pedb.hfss.hfss_extent_info.open_region_type
|
|
93
|
+
self.parent.pml_visible = self._pedb.hfss.hfss_extent_info.is_pml_visible
|
|
94
|
+
self.parent.pml_operation_frequency = self._pedb.hfss.hfss_extent_info.operating_freq
|
|
95
|
+
self.parent.pml_radiation_factor = self._pedb.hfss.hfss_extent_info.pml_radiation_factor
|
|
96
|
+
self.parent.dielectric_extent_type = self._pedb.hfss.hfss_extent_info.extent_type
|
|
97
|
+
self.parent.horizontal_padding = self._pedb.hfss.hfss_extent_info.dielectric_extent_size
|
|
98
|
+
self.parent.honor_primitives_on_dielectric_layers = self._pedb.hfss.hfss_extent_info.honor_user_dielectric
|
|
99
|
+
self.parent.air_box_extent_type = self._pedb.hfss.hfss_extent_info.extent_type
|
|
100
|
+
self.parent.air_box_truncate_model_ground_layers = (
|
|
101
|
+
self._pedb.hfss.hfss_extent_info.truncate_air_box_at_ground
|
|
77
102
|
)
|
|
78
|
-
|
|
79
|
-
self.
|
|
80
|
-
self.
|
|
103
|
+
self.parent.air_box_horizontal_padding = self._pedb.hfss.hfss_extent_info.air_box_horizontal_extent
|
|
104
|
+
self.parent.air_box_positive_vertical_padding = (
|
|
105
|
+
self._pedb.hfss.hfss_extent_info.air_box_positive_vertical_extent
|
|
81
106
|
)
|
|
107
|
+
self.parent.air_box_negative_vertical_padding = (
|
|
108
|
+
self._pedb.hfss.hfss_extent_info.air_box_negative_vertical_extent
|
|
109
|
+
)
|
|
110
|
+
return self.parent.get_attributes(exclude="boundary_data")
|
|
82
111
|
|
|
83
|
-
|
|
84
|
-
self
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
self.
|
|
89
|
-
|
|
90
|
-
self.
|
|
91
|
-
|
|
92
|
-
self.pml_radiation_factor = self._pedb.hfss.hfss_extent_info.
|
|
112
|
+
class DotNet(Grpc):
|
|
113
|
+
def __init__(self, parent):
|
|
114
|
+
super().__init__(parent)
|
|
115
|
+
|
|
116
|
+
def get_parameters_from_edb(self):
|
|
117
|
+
self.parent.open_region = self._pedb.hfss.hfss_extent_info.use_open_region
|
|
118
|
+
self.parent.open_region_type = self._pedb.hfss.hfss_extent_info.open_region_type
|
|
119
|
+
self.parent.pml_visible = self._pedb.hfss.hfss_extent_info.is_pml_visible
|
|
120
|
+
self.parent.pml_operation_frequency = self._pedb.hfss.hfss_extent_info.operating_freq.tostring
|
|
121
|
+
self.parent.pml_radiation_factor = self._pedb.hfss.hfss_extent_info.radiation_level.tostring
|
|
122
|
+
self.parent.dielectric_extent_type = self._pedb.hfss.hfss_extent_info.extent_type
|
|
123
|
+
self.parent.horizontal_padding = self._pedb.hfss.hfss_extent_info.dielectric_extent_size
|
|
124
|
+
self.parent.honor_primitives_on_dielectric_layers = self._pedb.hfss.hfss_extent_info.honor_user_dielectric
|
|
125
|
+
self.parent.air_box_extent_type = self._pedb.hfss.hfss_extent_info.extent_type
|
|
126
|
+
self.parent.air_box_truncate_model_ground_layers = (
|
|
127
|
+
self._pedb.hfss.hfss_extent_info.truncate_air_box_at_ground
|
|
128
|
+
)
|
|
129
|
+
self.parent.air_box_horizontal_padding = self._pedb.hfss.hfss_extent_info.air_box_horizontal_extent
|
|
130
|
+
self.parent.air_box_positive_vertical_padding = (
|
|
131
|
+
self._pedb.hfss.hfss_extent_info.air_box_positive_vertical_extent
|
|
132
|
+
)
|
|
133
|
+
self.parent.air_box_negative_vertical_padding = (
|
|
134
|
+
self._pedb.hfss.hfss_extent_info.air_box_negative_vertical_extent
|
|
135
|
+
)
|
|
136
|
+
return self.parent.get_attributes(exclude="boundary_data")
|
|
137
|
+
|
|
138
|
+
def set_parameters_to_edb(self):
|
|
139
|
+
"""Imports boundary information from JSON."""
|
|
140
|
+
if self.open_region is not None:
|
|
141
|
+
self._pedb.hfss.hfss_extent_info.use_open_region = self.open_region
|
|
142
|
+
if self.open_region_type:
|
|
143
|
+
self._pedb.hfss.hfss_extent_info.open_region_type = self.open_region_type.lower()
|
|
144
|
+
if self.pml_visible is not None:
|
|
145
|
+
self._pedb.hfss.hfss_extent_info.is_pml_visible = self.pml_visible
|
|
146
|
+
if self.pml_operation_frequency:
|
|
147
|
+
self._pedb.hfss.hfss_extent_info.operating_freq = self.pml_operation_frequency
|
|
148
|
+
if self.pml_radiation_factor:
|
|
149
|
+
if self._pedb.grpc:
|
|
150
|
+
self._pedb.hfss.hfss_extent_info.pml_radiation_factor = self.pml_radiation_factor
|
|
151
|
+
else:
|
|
152
|
+
self._pedb.hfss.hfss_extent_info.radiation_level = self.pml_radiation_factor
|
|
153
|
+
if self.dielectric_extent_type:
|
|
154
|
+
self._pedb.hfss.hfss_extent_info.extent_type = self.dielectric_extent_type.lower()
|
|
155
|
+
if self.horizontal_padding:
|
|
156
|
+
self._pedb.hfss.hfss_extent_info.dielectric_extent_size = float(self.horizontal_padding)
|
|
157
|
+
if self.honor_primitives_on_dielectric_layers is not None:
|
|
158
|
+
self._pedb.hfss.hfss_extent_info.honor_user_dielectric = self.honor_primitives_on_dielectric_layers
|
|
159
|
+
if self.air_box_extent_type:
|
|
160
|
+
self._pedb.hfss.hfss_extent_info.extent_type = self.air_box_extent_type.lower()
|
|
161
|
+
if self.air_box_truncate_model_ground_layers is not None:
|
|
162
|
+
self._pedb.hfss.hfss_extent_info.truncate_air_box_at_ground = self.air_box_truncate_model_ground_layers
|
|
163
|
+
if self.air_box_horizontal_padding:
|
|
164
|
+
self._pedb.hfss.hfss_extent_info.air_box_horizontal_extent = float(self.air_box_horizontal_padding)
|
|
165
|
+
if self.air_box_positive_vertical_padding:
|
|
166
|
+
self._pedb.hfss.hfss_extent_info.air_box_positive_vertical_extent = float(
|
|
167
|
+
self.air_box_positive_vertical_padding
|
|
168
|
+
)
|
|
169
|
+
if self.air_box_negative_vertical_padding:
|
|
170
|
+
self._pedb.hfss.hfss_extent_info.air_box_negative_vertical_extent = float(
|
|
171
|
+
self.air_box_negative_vertical_padding
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
def __init__(self, pedb, boundary_data):
|
|
175
|
+
self.pedb = pedb
|
|
176
|
+
self.boundary_data = boundary_data
|
|
177
|
+
if self.pedb.grpc:
|
|
178
|
+
self.api = self.Grpc(self)
|
|
93
179
|
else:
|
|
94
|
-
self.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
self.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
self.air_box_positive_vertical_padding = self._pedb.hfss.hfss_extent_info.air_box_positive_vertical_extent
|
|
103
|
-
self.air_box_negative_vertical_padding = self._pedb.hfss.hfss_extent_info.air_box_negative_vertical_extent
|
|
104
|
-
return self.get_attributes()
|
|
180
|
+
self.api = self.DotNet(self)
|
|
181
|
+
|
|
182
|
+
def apply(self):
|
|
183
|
+
"""Imports boundary information from JSON."""
|
|
184
|
+
self.api.set_parameters_to_edb()
|
|
185
|
+
|
|
186
|
+
def get_data_from_db(self):
|
|
187
|
+
return self.api.get_parameters_from_edb()
|
|
@@ -262,7 +262,7 @@ class CfgComponent(CfgBase):
|
|
|
262
262
|
def set_parameters_to_edb(self):
|
|
263
263
|
if self.parent.type:
|
|
264
264
|
self.pyedb_obj.type = self.parent.type
|
|
265
|
-
if self.parent.enabled:
|
|
265
|
+
if self.parent.enabled is not None:
|
|
266
266
|
self.pyedb_obj.enabled = self.parent.enabled
|
|
267
267
|
|
|
268
268
|
self._set_model_properties_to_edb()
|
|
@@ -24,26 +24,44 @@
|
|
|
24
24
|
class CfgGeneral:
|
|
25
25
|
"""Manage configuration general settings."""
|
|
26
26
|
|
|
27
|
+
class Grpc:
|
|
28
|
+
def __init__(self, parent):
|
|
29
|
+
self.parent = parent
|
|
30
|
+
self.pedb = parent.pedb
|
|
31
|
+
|
|
32
|
+
def set_parameters_to_edb(self):
|
|
33
|
+
self.pedb.active_cell.anti_pads_always_on = self.parent.anti_pads_always_on
|
|
34
|
+
self.pedb.active_cell.suppress_pads = self.parent.suppress_pads
|
|
35
|
+
|
|
36
|
+
def get_parameters_from_edb(self):
|
|
37
|
+
anti_pads_always_on = self.pedb.design_options.antipads_always_on
|
|
38
|
+
suppress_pads = self.pedb.design_options.suppress_pads
|
|
39
|
+
data = {"anti_pads_always_on": anti_pads_always_on, "suppress_pads": suppress_pads}
|
|
40
|
+
return data
|
|
41
|
+
|
|
42
|
+
class DotNet(Grpc):
|
|
43
|
+
def __init__(self, parent):
|
|
44
|
+
super().__init__(parent)
|
|
45
|
+
|
|
46
|
+
def set_parameters_to_edb(self):
|
|
47
|
+
if self.parent.anti_pads_always_on is not None:
|
|
48
|
+
self.pedb.design_options.anti_pads_always_on = self.parent.anti_pads_always_on
|
|
49
|
+
if self.parent.suppress_pads is not None:
|
|
50
|
+
self.pedb.design_options.suppress_pads = self.parent.suppress_pads
|
|
51
|
+
|
|
27
52
|
def __init__(self, pedb, data):
|
|
28
|
-
self.
|
|
53
|
+
self.pedb = pedb
|
|
54
|
+
if self.pedb.grpc:
|
|
55
|
+
self.api = self.Grpc(self)
|
|
56
|
+
else:
|
|
57
|
+
self.api = self.DotNet(self)
|
|
29
58
|
self.spice_model_library = data.get("spice_model_library", "")
|
|
30
59
|
self.s_parameter_library = data.get("s_parameter_library", "")
|
|
31
|
-
self.anti_pads_always_on = data.get("anti_pads_always_on",
|
|
32
|
-
self.suppress_pads = data.get("suppress_pads",
|
|
60
|
+
self.anti_pads_always_on = data.get("anti_pads_always_on", None)
|
|
61
|
+
self.suppress_pads = data.get("suppress_pads", None)
|
|
33
62
|
|
|
34
63
|
def apply(self):
|
|
35
|
-
|
|
36
|
-
self._pedb.active_cell.anti_pads_always_on = self.anti_pads_always_on
|
|
37
|
-
self._pedb.active_cell.suppress_pads = self.suppress_pads
|
|
38
|
-
else:
|
|
39
|
-
self._pedb.design_options.antipads_always_on = self.anti_pads_always_on
|
|
40
|
-
self._pedb.design_options.suppress_pads = self.suppress_pads
|
|
64
|
+
self.api.set_parameters_to_edb()
|
|
41
65
|
|
|
42
66
|
def get_data_from_db(self):
|
|
43
|
-
|
|
44
|
-
self.suppress_pads = self._pedb.design_options.suppress_pads
|
|
45
|
-
|
|
46
|
-
data = {}
|
|
47
|
-
data["anti_pads_always_on"] = self.anti_pads_always_on
|
|
48
|
-
data["suppress_pads"] = self.suppress_pads
|
|
49
|
-
return data
|
|
67
|
+
return self.api.get_parameters_from_edb()
|
|
@@ -58,8 +58,169 @@ class CfgPlane:
|
|
|
58
58
|
class CfgModeler:
|
|
59
59
|
"""Manage configuration general settings."""
|
|
60
60
|
|
|
61
|
+
class Grpc:
|
|
62
|
+
def __init__(self, parent):
|
|
63
|
+
self.parent = parent
|
|
64
|
+
self._pedb = parent._pedb
|
|
65
|
+
|
|
66
|
+
def set_parameter_to_edb(self):
|
|
67
|
+
from ansys.edb.core.definition.padstack_def import (
|
|
68
|
+
PadstackDef as GrpcPadstackDef,
|
|
69
|
+
)
|
|
70
|
+
from ansys.edb.core.definition.padstack_def_data import (
|
|
71
|
+
PadstackDefData as GrpcPadstackDefData,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
from pyedb.grpc.database.definition.padstack_def import PadstackDef
|
|
75
|
+
|
|
76
|
+
if self.parent.traces:
|
|
77
|
+
for t in self.parent.traces:
|
|
78
|
+
obj = self._pedb.modeler.create_trace(
|
|
79
|
+
path_list=t.path,
|
|
80
|
+
layer_name=t.layer,
|
|
81
|
+
net_name=t.net_name,
|
|
82
|
+
width=t.width,
|
|
83
|
+
start_cap_style=t.start_cap_style,
|
|
84
|
+
end_cap_style=t.end_cap_style,
|
|
85
|
+
corner_style=t.corner_style,
|
|
86
|
+
)
|
|
87
|
+
obj.aedt_name = t.name
|
|
88
|
+
|
|
89
|
+
if self.parent.padstack_defs:
|
|
90
|
+
for p in self.parent.padstack_defs:
|
|
91
|
+
pdata = GrpcPadstackDefData.create()
|
|
92
|
+
pdef = GrpcPadstackDef.create(self._pedb.active_db, p.name)
|
|
93
|
+
pdef.data = pdata
|
|
94
|
+
pdef = PadstackDef(self._pedb, pdef)
|
|
95
|
+
p.pyedb_obj = pdef
|
|
96
|
+
p.api.set_parameters_to_edb()
|
|
97
|
+
|
|
98
|
+
if self.parent.padstack_instances:
|
|
99
|
+
for p in self.parent.padstack_instances:
|
|
100
|
+
p_inst = self._pedb.padstacks.place(
|
|
101
|
+
via_name=p.name,
|
|
102
|
+
net_name=p.net_name,
|
|
103
|
+
position=p.position,
|
|
104
|
+
definition_name=p.definition,
|
|
105
|
+
)
|
|
106
|
+
p.pyedb_obj = p_inst
|
|
107
|
+
p.api.set_parameters_to_edb()
|
|
108
|
+
|
|
109
|
+
if self.parent.planes:
|
|
110
|
+
for p in self.parent.planes:
|
|
111
|
+
if p.type == "rectangle":
|
|
112
|
+
obj = self._pedb.modeler.create_rectangle(
|
|
113
|
+
layer_name=p.layer,
|
|
114
|
+
net_name=p.net_name,
|
|
115
|
+
lower_left_point=p.lower_left_point,
|
|
116
|
+
upper_right_point=p.upper_right_point,
|
|
117
|
+
corner_radius=p.corner_radius,
|
|
118
|
+
rotation=p.rotation,
|
|
119
|
+
)
|
|
120
|
+
obj.aedt_name = p.name
|
|
121
|
+
elif p.type == "polygon":
|
|
122
|
+
obj = self._pedb.modeler.create_polygon(
|
|
123
|
+
points=p.points, layer_name=p.layer, net_name=p.net_name
|
|
124
|
+
)
|
|
125
|
+
obj.aedt_name = p.name
|
|
126
|
+
|
|
127
|
+
for v in p.voids:
|
|
128
|
+
for i in self._pedb.layout.primitives:
|
|
129
|
+
if i.aedt_name == v:
|
|
130
|
+
self._pedb.modeler.add_void(obj, i)
|
|
131
|
+
|
|
132
|
+
if self.parent.components:
|
|
133
|
+
pedb_p_inst = self._pedb.padstacks.instances_by_name
|
|
134
|
+
for c in self.parent.components:
|
|
135
|
+
obj = self._pedb.components.create(
|
|
136
|
+
[pedb_p_inst[i] for i in c.pins],
|
|
137
|
+
component_name=c.reference_designator,
|
|
138
|
+
placement_layer=c.placement_layer,
|
|
139
|
+
component_part_name=c.definition,
|
|
140
|
+
)
|
|
141
|
+
c.pyedb_obj = obj
|
|
142
|
+
c.api.set_parameters_to_edb()
|
|
143
|
+
|
|
144
|
+
class DotNet(Grpc):
|
|
145
|
+
def __init__(self, parent):
|
|
146
|
+
super().__init__(parent)
|
|
147
|
+
|
|
148
|
+
def set_parameter_to_edb(self):
|
|
149
|
+
if self.parent.traces:
|
|
150
|
+
for t in self.parent.traces:
|
|
151
|
+
obj = self._pedb.modeler.create_trace(
|
|
152
|
+
path_list=t.path,
|
|
153
|
+
layer_name=t.layer,
|
|
154
|
+
net_name=t.net_name,
|
|
155
|
+
width=t.width,
|
|
156
|
+
start_cap_style=t.start_cap_style,
|
|
157
|
+
end_cap_style=t.end_cap_style,
|
|
158
|
+
corner_style=t.corner_style,
|
|
159
|
+
)
|
|
160
|
+
obj.aedt_name = t.name
|
|
161
|
+
|
|
162
|
+
if self.parent.padstack_defs:
|
|
163
|
+
for p in self.parent.padstack_defs:
|
|
164
|
+
pdata = self._pedb._edb.Definition.PadstackDefData.Create()
|
|
165
|
+
pdef = self._pedb._edb.Definition.PadstackDef.Create(self._pedb.active_db, p.name)
|
|
166
|
+
pdef.SetData(pdata)
|
|
167
|
+
pdef = EDBPadstack(pdef, self._pedb.padstacks)
|
|
168
|
+
p.pyedb_obj = pdef
|
|
169
|
+
p.api.set_parameters_to_edb()
|
|
170
|
+
|
|
171
|
+
if self.parent.padstack_instances:
|
|
172
|
+
for p in self.parent.padstack_instances:
|
|
173
|
+
p_inst = self._pedb.padstacks.place(
|
|
174
|
+
via_name=p.name,
|
|
175
|
+
net_name=p.net_name,
|
|
176
|
+
position=p.position,
|
|
177
|
+
definition_name=p.definition,
|
|
178
|
+
rotation=p.rotation if p.rotation is not None else 0,
|
|
179
|
+
)
|
|
180
|
+
p.pyedb_obj = p_inst
|
|
181
|
+
p.api.set_parameters_to_edb()
|
|
182
|
+
|
|
183
|
+
if self.parent.planes:
|
|
184
|
+
for p in self.parent.planes:
|
|
185
|
+
if p.type == "rectangle":
|
|
186
|
+
obj = self._pedb.modeler.create_rectangle(
|
|
187
|
+
layer_name=p.layer,
|
|
188
|
+
net_name=p.net_name,
|
|
189
|
+
lower_left_point=p.lower_left_point,
|
|
190
|
+
upper_right_point=p.upper_right_point,
|
|
191
|
+
corner_radius=p.corner_radius,
|
|
192
|
+
rotation=p.rotation,
|
|
193
|
+
)
|
|
194
|
+
obj.aedt_name = p.name
|
|
195
|
+
elif p.type == "polygon":
|
|
196
|
+
obj = self._pedb.modeler.create_polygon(
|
|
197
|
+
main_shape=p.points, layer_name=p.layer, net_name=p.net_name
|
|
198
|
+
)
|
|
199
|
+
obj.aedt_name = p.name
|
|
200
|
+
|
|
201
|
+
for v in p.voids:
|
|
202
|
+
for i in self._pedb.layout.primitives:
|
|
203
|
+
if i.aedt_name == v:
|
|
204
|
+
self._pedb.modeler.add_void(obj, i)
|
|
205
|
+
|
|
206
|
+
if self.parent.components:
|
|
207
|
+
pedb_p_inst = self._pedb.padstacks.instances_by_name
|
|
208
|
+
for c in self.parent.components:
|
|
209
|
+
obj = self._pedb.components.create(
|
|
210
|
+
[pedb_p_inst[i] for i in c.pins],
|
|
211
|
+
component_name=c.reference_designator,
|
|
212
|
+
placement_layer=c.placement_layer,
|
|
213
|
+
component_part_name=c.definition,
|
|
214
|
+
)
|
|
215
|
+
c.pyedb_obj = obj
|
|
216
|
+
c.api.set_parameters_to_edb()
|
|
217
|
+
|
|
61
218
|
def __init__(self, pedb, data):
|
|
62
219
|
self._pedb = pedb
|
|
220
|
+
if self._pedb.grpc:
|
|
221
|
+
self.api = self.Grpc(self)
|
|
222
|
+
else:
|
|
223
|
+
self.api = self.DotNet(self)
|
|
63
224
|
self.traces = [CfgTrace(**i) for i in data.get("traces", [])]
|
|
64
225
|
self.padstack_defs = [
|
|
65
226
|
CfgPadstackDefinition(self._pedb, None, **i) for i in data.get("padstack_definitions", [])
|
|
@@ -71,70 +232,4 @@ class CfgModeler:
|
|
|
71
232
|
self.components = [CfgComponent(self._pedb, None, **i) for i in data.get("components", [])]
|
|
72
233
|
|
|
73
234
|
def apply(self):
|
|
74
|
-
|
|
75
|
-
for t in self.traces:
|
|
76
|
-
obj = self._pedb.modeler.create_trace(
|
|
77
|
-
path_list=t.path,
|
|
78
|
-
layer_name=t.layer,
|
|
79
|
-
net_name=t.net_name,
|
|
80
|
-
width=t.width,
|
|
81
|
-
start_cap_style=t.start_cap_style,
|
|
82
|
-
end_cap_style=t.end_cap_style,
|
|
83
|
-
corner_style=t.corner_style,
|
|
84
|
-
)
|
|
85
|
-
obj.aedt_name = t.name
|
|
86
|
-
|
|
87
|
-
if self.padstack_defs:
|
|
88
|
-
for p in self.padstack_defs:
|
|
89
|
-
pdata = self._pedb._edb.Definition.PadstackDefData.Create()
|
|
90
|
-
pdef = self._pedb._edb.Definition.PadstackDef.Create(self._pedb.active_db, p.name)
|
|
91
|
-
pdef.SetData(pdata)
|
|
92
|
-
pdef = EDBPadstack(pdef, self._pedb.padstacks)
|
|
93
|
-
p.pyedb_obj = pdef
|
|
94
|
-
p.api.set_parameters_to_edb()
|
|
95
|
-
|
|
96
|
-
if self.padstack_instances:
|
|
97
|
-
for p in self.padstack_instances:
|
|
98
|
-
p_inst = self._pedb.padstacks.place(
|
|
99
|
-
via_name=p.name,
|
|
100
|
-
net_name=p.net_name,
|
|
101
|
-
position=p.position,
|
|
102
|
-
definition_name=p.definition,
|
|
103
|
-
)
|
|
104
|
-
p.pyedb_obj = p_inst
|
|
105
|
-
p.api.set_parameters_to_edb()
|
|
106
|
-
|
|
107
|
-
if self.planes:
|
|
108
|
-
for p in self.planes:
|
|
109
|
-
if p.type == "rectangle":
|
|
110
|
-
obj = self._pedb.modeler.create_rectangle(
|
|
111
|
-
layer_name=p.layer,
|
|
112
|
-
net_name=p.net_name,
|
|
113
|
-
lower_left_point=p.lower_left_point,
|
|
114
|
-
upper_right_point=p.upper_right_point,
|
|
115
|
-
corner_radius=p.corner_radius,
|
|
116
|
-
rotation=p.rotation,
|
|
117
|
-
)
|
|
118
|
-
obj.aedt_name = p.name
|
|
119
|
-
elif p.type == "polygon":
|
|
120
|
-
obj = self._pedb.modeler.create_polygon(
|
|
121
|
-
main_shape=p.points, layer_name=p.layer, net_name=p.net_name
|
|
122
|
-
)
|
|
123
|
-
obj.aedt_name = p.name
|
|
124
|
-
|
|
125
|
-
for v in p.voids:
|
|
126
|
-
for i in self._pedb.layout.primitives:
|
|
127
|
-
if i.aedt_name == v:
|
|
128
|
-
self._pedb.modeler.add_void(obj, i)
|
|
129
|
-
|
|
130
|
-
if self.components:
|
|
131
|
-
pedb_p_inst = self._pedb.padstacks.instances_by_name
|
|
132
|
-
for c in self.components:
|
|
133
|
-
obj = self._pedb.components.create(
|
|
134
|
-
[pedb_p_inst[i] for i in c.pins],
|
|
135
|
-
component_name=c.reference_designator,
|
|
136
|
-
placement_layer=c.placement_layer,
|
|
137
|
-
component_part_name=c.definition,
|
|
138
|
-
)
|
|
139
|
-
c.pyedb_obj = obj
|
|
140
|
-
c.api.set_parameters_to_edb()
|
|
235
|
+
self.api.set_parameter_to_edb()
|
pyedb/configuration/cfg_nets.py
CHANGED
|
@@ -24,8 +24,39 @@
|
|
|
24
24
|
class CfgNets:
|
|
25
25
|
"""Manage configuration net class."""
|
|
26
26
|
|
|
27
|
+
class Grpc:
|
|
28
|
+
def __init__(self, parent):
|
|
29
|
+
self.parent = parent
|
|
30
|
+
self._pedb = parent._pedb
|
|
31
|
+
|
|
32
|
+
def set_parameter_to_edb(self):
|
|
33
|
+
for signal_net in self.parent.signal_nets:
|
|
34
|
+
if signal_net in self._pedb.nets:
|
|
35
|
+
self._pedb.nets.nets[signal_net].is_power_ground = False
|
|
36
|
+
for power_net in self.parent.power_nets:
|
|
37
|
+
if power_net in self._pedb.nets:
|
|
38
|
+
self._pedb.nets.nets[power_net].is_power_ground = True
|
|
39
|
+
|
|
40
|
+
def get_parameter_from_edb(self):
|
|
41
|
+
"""Get net information."""
|
|
42
|
+
for net in self._pedb.nets.signal:
|
|
43
|
+
self.parent.signal_nets.append(net)
|
|
44
|
+
for net in self._pedb.nets.power:
|
|
45
|
+
self.parent.power_nets.append(net)
|
|
46
|
+
data = {"signal_nets": self.parent.signal_nets, "power_ground_nets": self.parent.power_nets}
|
|
47
|
+
return data
|
|
48
|
+
|
|
49
|
+
class DotNet(Grpc):
|
|
50
|
+
def __init__(self, parent):
|
|
51
|
+
self.parent = parent
|
|
52
|
+
super().__init__(parent)
|
|
53
|
+
|
|
27
54
|
def __init__(self, pdata, signal_nets=None, power_nets=None):
|
|
28
55
|
self._pedb = pdata._pedb
|
|
56
|
+
if self._pedb.grpc:
|
|
57
|
+
self.api = self.Grpc(self)
|
|
58
|
+
else:
|
|
59
|
+
self.api = self.DotNet(self)
|
|
29
60
|
self.signal_nets = []
|
|
30
61
|
self.power_nets = []
|
|
31
62
|
if signal_nets:
|
|
@@ -35,23 +66,8 @@ class CfgNets:
|
|
|
35
66
|
|
|
36
67
|
def apply(self):
|
|
37
68
|
"""Apply net on layout."""
|
|
38
|
-
|
|
39
|
-
if signal_net in self._pedb.nets:
|
|
40
|
-
self._pedb.nets.nets[signal_net].is_power_ground = False
|
|
41
|
-
for power_net in self.power_nets:
|
|
42
|
-
if power_net in self._pedb.nets:
|
|
43
|
-
self._pedb.nets.nets[power_net].is_power_ground = True
|
|
44
|
-
|
|
45
|
-
def _load_data_from_db(self):
|
|
46
|
-
self.signal_nets = []
|
|
47
|
-
self.power_nets = []
|
|
48
|
-
for net in self._pedb.nets.signal:
|
|
49
|
-
self.signal_nets.append(net)
|
|
50
|
-
for net in self._pedb.nets.power:
|
|
51
|
-
self.power_nets.append(net)
|
|
69
|
+
self.api.set_parameter_to_edb()
|
|
52
70
|
|
|
53
71
|
def get_data_from_db(self):
|
|
54
72
|
"""Get net information."""
|
|
55
|
-
self.
|
|
56
|
-
data = {"signal_nets": self.signal_nets, "power_ground_nets": self.power_nets}
|
|
57
|
-
return data
|
|
73
|
+
return self.api.get_parameter_from_edb()
|