pyedb 0.15.dev0__py3-none-any.whl → 0.17.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.

Files changed (42) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_common.py +1 -3
  3. pyedb/configuration/cfg_components.py +49 -5
  4. pyedb/configuration/cfg_data.py +3 -6
  5. pyedb/configuration/cfg_package_definition.py +3 -5
  6. pyedb/configuration/cfg_setup.py +214 -176
  7. pyedb/configuration/cfg_stackup.py +4 -4
  8. pyedb/configuration/configuration.py +9 -5
  9. pyedb/dotnet/edb.py +64 -44
  10. pyedb/dotnet/edb_core/cell/__init__.py +0 -0
  11. pyedb/dotnet/edb_core/cell/hierarchy/component.py +12 -17
  12. pyedb/dotnet/edb_core/cell/hierarchy/hierarchy_obj.py +50 -0
  13. pyedb/dotnet/edb_core/cell/layout.py +0 -6
  14. pyedb/dotnet/edb_core/cell/voltage_regulator.py +143 -0
  15. pyedb/dotnet/edb_core/components.py +2 -2
  16. pyedb/dotnet/edb_core/dotnet/primitive.py +129 -3
  17. pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py +0 -460
  18. pyedb/dotnet/edb_core/edb_data/primitives_data.py +38 -38
  19. pyedb/dotnet/edb_core/edb_data/raptor_x_simulation_setup_data.py +1 -1
  20. pyedb/dotnet/edb_core/layout.py +25 -1
  21. pyedb/dotnet/edb_core/layout_validation.py +26 -0
  22. pyedb/dotnet/edb_core/nets.py +1 -1
  23. pyedb/dotnet/edb_core/sim_setup_data/data/mesh_operation.py +63 -49
  24. pyedb/dotnet/edb_core/sim_setup_data/data/settings.py +1 -1
  25. pyedb/dotnet/edb_core/sim_setup_data/data/sim_setup_info.py +81 -0
  26. pyedb/dotnet/edb_core/sim_setup_data/data/simulation_settings.py +424 -0
  27. pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +131 -96
  28. pyedb/dotnet/edb_core/siwave.py +63 -0
  29. pyedb/dotnet/edb_core/utilities/hfss_simulation_setup.py +469 -0
  30. pyedb/dotnet/edb_core/utilities/simulation_setup.py +112 -773
  31. pyedb/dotnet/edb_core/utilities/siwave_simulation_setup.py +369 -0
  32. pyedb/misc/siw_feature_config/xtalk_scan/fd_xtalk_scan_config.py +91 -0
  33. pyedb/misc/siw_feature_config/xtalk_scan/impedance_scan_config.py +70 -0
  34. pyedb/misc/siw_feature_config/xtalk_scan/net.py +69 -0
  35. pyedb/misc/siw_feature_config/xtalk_scan/pins.py +60 -0
  36. pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py +88 -0
  37. pyedb/misc/siw_feature_config/xtalk_scan/td_xtalk_config.py +104 -0
  38. pyedb/workflow.py +32 -0
  39. {pyedb-0.15.dev0.dist-info → pyedb-0.17.0.dist-info}/METADATA +1 -1
  40. {pyedb-0.15.dev0.dist-info → pyedb-0.17.0.dist-info}/RECORD +42 -28
  41. {pyedb-0.15.dev0.dist-info → pyedb-0.17.0.dist-info}/LICENSE +0 -0
  42. {pyedb-0.15.dev0.dist-info → pyedb-0.17.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,469 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ import warnings
24
+
25
+ from pyedb.dotnet.edb_core.sim_setup_data.data.mesh_operation import (
26
+ LengthMeshOperation,
27
+ SkinDepthMeshOperation,
28
+ )
29
+ from pyedb.dotnet.edb_core.sim_setup_data.data.settings import (
30
+ AdaptiveSettings,
31
+ AdvancedMeshSettings,
32
+ CurveApproxSettings,
33
+ DcrSettings,
34
+ DefeatureSettings,
35
+ HfssPortSettings,
36
+ HfssSolverSettings,
37
+ ViaSettings,
38
+ )
39
+ from pyedb.dotnet.edb_core.sim_setup_data.data.sim_setup_info import SimSetupInfo
40
+ from pyedb.dotnet.edb_core.sim_setup_data.data.simulation_settings import (
41
+ HFSSPISimulationSettings,
42
+ )
43
+ from pyedb.dotnet.edb_core.sim_setup_data.data.sweep_data import SweepData
44
+ from pyedb.dotnet.edb_core.utilities.simulation_setup import SimulationSetup
45
+ from pyedb.generic.general_methods import generate_unique_name
46
+
47
+
48
+ class HfssSimulationSetup(SimulationSetup):
49
+ """Manages EDB methods for HFSS simulation setup."""
50
+
51
+ def __init__(self, pedb, edb_object=None, name: str = None):
52
+ super().__init__(pedb, edb_object)
53
+ self._simulation_setup_builder = self._pedb._edb.Utility.HFSSSimulationSetup
54
+ if edb_object is None:
55
+ self._name = name
56
+
57
+ sim_setup_info = SimSetupInfo(self._pedb, sim_setup=self, setup_type="kHFSS", name=name)
58
+ self._edb_object = self._simulation_setup_builder(sim_setup_info._edb_object)
59
+ self._update_setup()
60
+
61
+ @property
62
+ def get_sim_setup_info(self):
63
+ """Get simulation setup information."""
64
+ warnings.warn("Use new property :func:`sim_setup_info` instead.", DeprecationWarning)
65
+ return self.sim_setup_info._edb_object
66
+
67
+ @property
68
+ def solver_slider_type(self):
69
+ """Solver slider type.
70
+ Options are:
71
+ 1 - ``kFast``.
72
+ 2 - ``kMedium``.
73
+ 3 - ``kAccurate``.
74
+ 4 - ``kNumSliderTypes``.
75
+
76
+ Returns
77
+ -------
78
+ str
79
+ """
80
+ return self.get_sim_setup_info.SimulationSettings.TSolveSliderType.ToString()
81
+
82
+ @solver_slider_type.setter
83
+ def solver_slider_type(self, value):
84
+ """Set solver slider type."""
85
+ solver_types = {
86
+ "kFast": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaWirebond,
87
+ "kMedium": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaRibbon,
88
+ "kAccurate": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaMesh,
89
+ "kNumSliderTypes": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaField,
90
+ }
91
+ self.get_sim_setup_info.SimulationSettings.TSolveSliderType = solver_types[value]
92
+ self._update_setup()
93
+
94
+ @property
95
+ def is_auto_setup(self):
96
+ """Flag indicating if automatic setup is enabled."""
97
+ return self.get_sim_setup_info.SimulationSettings.IsAutoSetup
98
+
99
+ @is_auto_setup.setter
100
+ def is_auto_setup(self, value):
101
+ self.get_sim_setup_info.SimulationSettings.IsAutoSetup = value
102
+ self._update_setup()
103
+
104
+ @property
105
+ def hfss_solver_settings(self):
106
+ """Manages EDB methods for HFSS solver settings.
107
+
108
+ Returns
109
+ -------
110
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.HfssSolverSettings`
111
+
112
+ """
113
+ return HfssSolverSettings(self)
114
+
115
+ @property
116
+ def adaptive_settings(self):
117
+ """Adaptive Settings Class.
118
+
119
+ Returns
120
+ -------
121
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdaptiveSettings`
122
+
123
+ """
124
+ return AdaptiveSettings(self)
125
+
126
+ @property
127
+ def defeature_settings(self):
128
+ """Defeature settings Class.
129
+
130
+ Returns
131
+ -------
132
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.DefeatureSettings`
133
+
134
+ """
135
+ return DefeatureSettings(self)
136
+
137
+ @property
138
+ def via_settings(self):
139
+ """Via settings Class.
140
+
141
+ Returns
142
+ -------
143
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.ViaSettings`
144
+
145
+ """
146
+ return ViaSettings(self)
147
+
148
+ @property
149
+ def advanced_mesh_settings(self):
150
+ """Advanced mesh settings Class.
151
+
152
+ Returns
153
+ -------
154
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdvancedMeshSettings`
155
+
156
+ """
157
+ return AdvancedMeshSettings(self)
158
+
159
+ @property
160
+ def curve_approx_settings(self):
161
+ """Curve approximation settings Class.
162
+
163
+ Returns
164
+ -------
165
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.CurveApproxSettings`
166
+
167
+ """
168
+ return CurveApproxSettings(self)
169
+
170
+ @property
171
+ def dcr_settings(self):
172
+ """Dcr settings Class.
173
+
174
+ Returns
175
+ -------
176
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.DcrSettings`
177
+
178
+ """
179
+ return DcrSettings(self)
180
+
181
+ @property
182
+ def hfss_port_settings(self):
183
+ """HFSS port settings Class.
184
+
185
+ Returns
186
+ -------
187
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.HfssPortSettings`
188
+
189
+ """
190
+ return HfssPortSettings(self)
191
+
192
+ @property
193
+ def mesh_operations(self):
194
+ """Mesh operations settings Class.
195
+
196
+ Returns
197
+ -------
198
+ List of :class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.MeshOperation`
199
+
200
+ """
201
+ settings = self.sim_setup_info.simulation_settings.MeshOperations
202
+ mesh_operations = {}
203
+ for i in list(settings):
204
+ if i.MeshOpType == i.TMeshOpType.kMeshSetupLength:
205
+ mesh_operations[i.Name] = LengthMeshOperation(self, i)
206
+ elif i.MeshOpType == i.TMeshOpType.kMeshSetupSkinDepth:
207
+ mesh_operations[i.Name] = SkinDepthMeshOperation(self, i)
208
+ elif i.MeshOpType == i.TMeshOpType.kMeshSetupBase:
209
+ mesh_operations[i.Name] = SkinDepthMeshOperation(self, i)
210
+
211
+ return mesh_operations
212
+
213
+ def add_length_mesh_operation(
214
+ self,
215
+ net_layer_list,
216
+ name=None,
217
+ max_elements=1000,
218
+ max_length="1mm",
219
+ restrict_elements=True,
220
+ restrict_length=True,
221
+ refine_inside=False,
222
+ mesh_region=None,
223
+ ):
224
+ """Add a mesh operation to the setup.
225
+
226
+ Parameters
227
+ ----------
228
+ net_layer_list : dict
229
+ Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
230
+ name : str, optional
231
+ Mesh operation name.
232
+ max_elements : int, optional
233
+ Maximum number of elements. Default is ``1000``.
234
+ max_length : str, optional
235
+ Maximum length of elements. Default is ``1mm``.
236
+ restrict_elements : bool, optional
237
+ Whether to restrict number of elements. Default is ``True``.
238
+ restrict_length : bool, optional
239
+ Whether to restrict length of elements. Default is ``True``.
240
+ mesh_region : str, optional
241
+ Mesh region name.
242
+ refine_inside : bool, optional
243
+ Whether to refine inside or not. Default is ``False``.
244
+
245
+ Returns
246
+ -------
247
+ :class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.LengthMeshOperation`
248
+ """
249
+ if not name:
250
+ name = generate_unique_name("skin")
251
+ mop = LengthMeshOperation(self, self._pedb.simsetupdata.LengthMeshOperation())
252
+ mop.mesh_region = mesh_region
253
+ mop.name = name
254
+ mop.nets_layers_list = net_layer_list
255
+ mop.refine_inside = refine_inside
256
+ mop.max_elements = max_elements
257
+ mop.max_length = max_length
258
+ mop.restrict_length = restrict_length
259
+ mop.restrict_max_elements = restrict_elements
260
+ self.sim_setup_info.simulation_settings.MeshOperations.Add(mop._edb_object)
261
+ self._update_setup()
262
+ return mop
263
+
264
+ def add_skin_depth_mesh_operation(
265
+ self,
266
+ net_layer_list,
267
+ name=None,
268
+ max_elements=1000,
269
+ skin_depth="1um",
270
+ restrict_elements=True,
271
+ surface_triangle_length="1mm",
272
+ number_of_layers=2,
273
+ refine_inside=False,
274
+ mesh_region=None,
275
+ ):
276
+ """Add a mesh operation to the setup.
277
+
278
+ Parameters
279
+ ----------
280
+ net_layer_list : dict
281
+ Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
282
+ name : str, optional
283
+ Mesh operation name.
284
+ max_elements : int, optional
285
+ Maximum number of elements. Default is ``1000``.
286
+ skin_depth : str, optional
287
+ Skin Depth. Default is ``1um``.
288
+ restrict_elements : bool, optional
289
+ Whether to restrict number of elements. Default is ``True``.
290
+ surface_triangle_length : bool, optional
291
+ Surface Triangle length. Default is ``1mm``.
292
+ number_of_layers : int, str, optional
293
+ Number of layers. Default is ``2``.
294
+ mesh_region : str, optional
295
+ Mesh region name.
296
+ refine_inside : bool, optional
297
+ Whether to refine inside or not. Default is ``False``.
298
+
299
+ Returns
300
+ -------
301
+ :class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.LengthMeshOperation`
302
+ """
303
+ if not name:
304
+ name = generate_unique_name("length")
305
+ mesh_operation = SkinDepthMeshOperation(self, self._pedb.simsetupdata.SkinDepthMeshOperation())
306
+ mesh_operation.mesh_region = mesh_region
307
+ mesh_operation.name = name
308
+ mesh_operation.nets_layers_list = net_layer_list
309
+ mesh_operation.refine_inside = refine_inside
310
+ mesh_operation.max_elements = max_elements
311
+ mesh_operation.skin_depth = skin_depth
312
+ mesh_operation.number_of_layer_elements = number_of_layers
313
+ mesh_operation.surface_triangle_length = surface_triangle_length
314
+ mesh_operation.restrict_max_elements = restrict_elements
315
+ self.sim_setup_info.simulation_settings.MeshOperations.Add(mesh_operation._edb_object)
316
+ self._update_setup()
317
+ return mesh_operation
318
+
319
+ def set_solution_single_frequency(self, frequency="5GHz", max_num_passes=10, max_delta_s=0.02):
320
+ """Set single-frequency solution.
321
+
322
+ Parameters
323
+ ----------
324
+ frequency : str, float, optional
325
+ Adaptive frequency. The default is ``5GHz``.
326
+ max_num_passes : int, optional
327
+ Maximum number of passes. The default is ``10``.
328
+ max_delta_s : float, optional
329
+ Maximum delta S. The default is ``0.02``.
330
+
331
+ Returns
332
+ -------
333
+ bool
334
+
335
+ """
336
+ self.adaptive_settings.adapt_type = "kSingle"
337
+ self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
338
+ return self.adaptive_settings.add_adaptive_frequency_data(frequency, max_num_passes, max_delta_s)
339
+
340
+ def set_solution_multi_frequencies(self, frequencies=("5GHz", "10GHz"), max_num_passes=10, max_delta_s="0.02"):
341
+ """Set multi-frequency solution.
342
+
343
+ Parameters
344
+ ----------
345
+ frequencies : list, tuple, optional
346
+ List or tuple of adaptive frequencies. The default is ``5GHz``.
347
+ max_num_passes : int, optional
348
+ Maximum number of passes. Default is ``10``.
349
+ max_delta_s : float, optional
350
+ Maximum delta S. The default is ``0.02``.
351
+
352
+ Returns
353
+ -------
354
+ bool
355
+
356
+ """
357
+ self.adaptive_settings.adapt_type = "kMultiFrequencies"
358
+ self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
359
+ for i in frequencies:
360
+ if not self.adaptive_settings.add_adaptive_frequency_data(i, max_num_passes, max_delta_s):
361
+ return False
362
+ return True
363
+
364
+ def set_solution_broadband(
365
+ self, low_frequency="5GHz", high_frequency="10GHz", max_num_passes=10, max_delta_s="0.02"
366
+ ):
367
+ """Set broadband solution.
368
+
369
+ Parameters
370
+ ----------
371
+ low_frequency : str, float, optional
372
+ Low frequency. The default is ``5GHz``.
373
+ high_frequency : str, float, optional
374
+ High frequency. The default is ``10GHz``.
375
+ max_num_passes : int, optional
376
+ Maximum number of passes. The default is ``10``.
377
+ max_delta_s : float, optional
378
+ Maximum Delta S. Default is ``0.02``.
379
+
380
+ Returns
381
+ -------
382
+ bool
383
+ """
384
+ self.adaptive_settings.adapt_type = "kBroadband"
385
+ self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
386
+ if not self.adaptive_settings.add_broadband_adaptive_frequency_data(
387
+ low_frequency, high_frequency, max_num_passes, max_delta_s
388
+ ): # pragma no cover
389
+ return False
390
+ return True
391
+
392
+
393
+ class HFSSPISimulationSetup(SimulationSetup):
394
+ """Manages EDB methods for HFSSPI simulation setup."""
395
+
396
+ def __init__(self, pedb, edb_object=None):
397
+ super().__init__(pedb, edb_object)
398
+ self._edb_object = edb_object
399
+ self._pedb = pedb
400
+ self._setup_type = "kHFSSPI"
401
+ self._edb_setup_info = None
402
+ self.logger = self._pedb.logger
403
+
404
+ def create(self, name=None):
405
+ """Create an HFSS setup."""
406
+ self._name = name
407
+ self._create(name=name, simulation_setup_type=self._setup_type)
408
+ return self
409
+
410
+ @property
411
+ def setup_type(self):
412
+ return self._setup_type
413
+
414
+ @property
415
+ def settings(self):
416
+ return HFSSPISimulationSettings(self._edb_setup_info, self._pedb, self._edb_object)
417
+
418
+ @property
419
+ def enabled(self):
420
+ return self.settings.enabled
421
+
422
+ @enabled.setter
423
+ def enabled(self, value):
424
+ if isinstance(value, bool):
425
+ self.settings.enabled = value
426
+ else:
427
+ self.logger.error(f"Property enabled expects a boolean value while the provided value is {value}.")
428
+
429
+ @property
430
+ def position(self):
431
+ return self._edb_setup_info.Position
432
+
433
+ @position.setter
434
+ def position(self, value):
435
+ if isinstance(value, int):
436
+ self._edb_setup_info.Position = value
437
+ else:
438
+ self.logger.error(f"Property position expects an integer value while the provided value is {value}.")
439
+
440
+ def add_frequency_sweep(self, name=None, frequency_sweep=None):
441
+ """Add frequency sweep.
442
+
443
+ Parameters
444
+ ----------
445
+ name : str, optional
446
+ Name of the frequency sweep.
447
+ frequency_sweep : list, optional
448
+ List of frequency points.
449
+
450
+ Returns
451
+ -------
452
+ :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.EdbFrequencySweep`wheen succeeded, ``False``
453
+ when failed.
454
+
455
+ Examples
456
+ --------
457
+ >>> setup1 = edbapp.create_hfss_setup("setup1")
458
+ >>> setup1.add_frequency_sweep(frequency_sweep=[
459
+ ... ["linear count", "0", "1kHz", 1],
460
+ ... ["log scale", "1kHz", "0.1GHz", 10],
461
+ ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
462
+ ... ])
463
+ """
464
+ if name in self.frequency_sweeps:
465
+ self.logger.error("Frequency sweep with same name already defined.")
466
+ return False
467
+ if not name:
468
+ name = generate_unique_name("sweep")
469
+ return SweepData(self, frequency_sweep, name)