pyedb 0.50.0__py3-none-any.whl → 0.50.1__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/dotnet/database/cell/hierarchy/component.py +3 -3
- pyedb/dotnet/database/edb_data/padstacks_data.py +13 -0
- pyedb/grpc/database/components.py +494 -652
- pyedb/grpc/database/control_file.py +458 -149
- pyedb/grpc/database/definition/component_def.py +17 -14
- pyedb/grpc/database/definition/materials.py +27 -27
- pyedb/grpc/database/definition/package_def.py +8 -8
- pyedb/grpc/database/definition/padstack_def.py +31 -33
- pyedb/grpc/database/geometry/arc_data.py +5 -5
- pyedb/grpc/database/geometry/point_3d_data.py +3 -3
- pyedb/grpc/database/geometry/polygon_data.py +5 -5
- pyedb/grpc/database/hfss.py +397 -395
- pyedb/grpc/database/hierarchy/component.py +58 -57
- pyedb/grpc/database/hierarchy/pin_pair_model.py +6 -6
- pyedb/grpc/database/hierarchy/pingroup.py +13 -11
- pyedb/grpc/database/hierarchy/s_parameter_model.py +1 -1
- pyedb/grpc/database/hierarchy/spice_model.py +1 -1
- pyedb/grpc/database/layers/layer.py +2 -2
- pyedb/grpc/database/layers/stackup_layer.py +26 -23
- pyedb/grpc/database/layout/layout.py +12 -12
- pyedb/grpc/database/layout/voltage_regulator.py +8 -8
- pyedb/grpc/database/modeler.py +248 -245
- pyedb/grpc/database/net/differential_pair.py +4 -4
- pyedb/grpc/database/net/extended_net.py +7 -8
- pyedb/grpc/database/net/net.py +57 -46
- pyedb/grpc/database/nets.py +139 -122
- pyedb/grpc/database/padstacks.py +174 -190
- pyedb/grpc/database/ports/ports.py +23 -17
- pyedb/grpc/database/primitive/padstack_instance.py +45 -30
- pyedb/grpc/database/primitive/path.py +6 -6
- pyedb/grpc/database/primitive/polygon.py +9 -9
- pyedb/grpc/database/primitive/primitive.py +21 -21
- pyedb/grpc/database/primitive/rectangle.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_settings_options.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +6 -6
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +2 -2
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +2 -2
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +1 -1
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +3 -3
- pyedb/grpc/database/siwave.py +166 -214
- pyedb/grpc/database/stackup.py +365 -292
- pyedb/grpc/database/terminal/bundle_terminal.py +12 -12
- pyedb/grpc/database/terminal/edge_terminal.py +6 -5
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +13 -13
- pyedb/grpc/database/terminal/pingroup_terminal.py +12 -12
- pyedb/grpc/database/terminal/point_terminal.py +6 -6
- pyedb/grpc/database/terminal/terminal.py +26 -26
- pyedb/grpc/database/utility/heat_sink.py +5 -5
- pyedb/grpc/database/utility/hfss_extent_info.py +21 -21
- pyedb/grpc/database/utility/layout_statistics.py +13 -13
- pyedb/grpc/database/utility/rlc.py +3 -3
- pyedb/grpc/database/utility/sources.py +1 -1
- pyedb/grpc/database/utility/sweep_data_distribution.py +1 -1
- pyedb/grpc/edb.py +422 -672
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/METADATA +1 -1
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/RECORD +61 -62
- pyedb/grpc/database/utility/simulation_configuration.py +0 -3305
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/LICENSE +0 -0
- {pyedb-0.50.0.dist-info → pyedb-0.50.1.dist-info}/WHEEL +0 -0
pyedb/grpc/database/stackup.py
CHANGED
|
@@ -78,7 +78,15 @@ logger = logging.getLogger(__name__)
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
class LayerCollection(GrpcLayerCollection):
|
|
81
|
-
"""
|
|
81
|
+
"""Manages layer collections in an EDB database.
|
|
82
|
+
|
|
83
|
+
Parameters
|
|
84
|
+
----------
|
|
85
|
+
pedb : :class:`pyedb.Edb`
|
|
86
|
+
EDB object.
|
|
87
|
+
edb_object : :class:`ansys.edb.core.layer.LayerCollection`
|
|
88
|
+
EDB layer collection object.
|
|
89
|
+
"""
|
|
82
90
|
|
|
83
91
|
def __init__(self, pedb, edb_object):
|
|
84
92
|
super().__init__(edb_object.msg)
|
|
@@ -86,12 +94,7 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
86
94
|
self._pedb = pedb
|
|
87
95
|
|
|
88
96
|
def update_layout(self):
|
|
89
|
-
"""
|
|
90
|
-
|
|
91
|
-
Parameters
|
|
92
|
-
----------
|
|
93
|
-
stackup
|
|
94
|
-
"""
|
|
97
|
+
"""Update the layout with the current layer collection."""
|
|
95
98
|
self._pedb.layout.layer_collection = self
|
|
96
99
|
|
|
97
100
|
def add_layer_top(self, name, layer_type="signal", **kwargs):
|
|
@@ -101,13 +104,17 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
101
104
|
----------
|
|
102
105
|
name : str
|
|
103
106
|
Name of the layer.
|
|
104
|
-
layer_type: str, optional
|
|
105
|
-
Type of the layer. The default
|
|
106
|
-
kwargs
|
|
107
|
+
layer_type : str, optional
|
|
108
|
+
Type of the layer. The default is ``"signal"``. Options are ``"signal"`` and ``"dielectric"``.
|
|
109
|
+
**kwargs : dict, optional
|
|
110
|
+
Additional keyword arguments. Possible keys are:
|
|
111
|
+
- ``thickness`` : float, layer thickness.
|
|
112
|
+
- ``material`` : str, layer material.
|
|
107
113
|
|
|
108
114
|
Returns
|
|
109
115
|
-------
|
|
110
|
-
|
|
116
|
+
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
117
|
+
Layer object created.
|
|
111
118
|
"""
|
|
112
119
|
thickness = GrpcValue(0.0)
|
|
113
120
|
if "thickness" in kwargs:
|
|
@@ -122,19 +129,24 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
122
129
|
return self._layer_collection.add_layer_top(layer)
|
|
123
130
|
|
|
124
131
|
def add_layer_bottom(self, name, layer_type="signal", **kwargs):
|
|
125
|
-
"""Add a layer
|
|
132
|
+
"""Add a layer at the bottom of the stackup.
|
|
126
133
|
|
|
127
134
|
Parameters
|
|
128
135
|
----------
|
|
129
136
|
name : str
|
|
130
137
|
Name of the layer.
|
|
131
|
-
layer_type: str, optional
|
|
132
|
-
Type of the layer. The default
|
|
133
|
-
kwargs
|
|
138
|
+
layer_type : str, optional
|
|
139
|
+
Type of the layer. The default is ``"signal"``. Options are ``"signal"`` and ``"dielectric"``.
|
|
140
|
+
**kwargs : dict, optional
|
|
141
|
+
Additional keyword arguments. Possible keys are:
|
|
142
|
+
- ``thickness`` : float, layer thickness.
|
|
143
|
+
- ``material`` : str, layer material.
|
|
144
|
+
- ``fill_material`` : str, fill material.
|
|
134
145
|
|
|
135
146
|
Returns
|
|
136
147
|
-------
|
|
137
|
-
|
|
148
|
+
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
149
|
+
Layer object created.
|
|
138
150
|
"""
|
|
139
151
|
thickness = GrpcValue(0.0)
|
|
140
152
|
layer_type_map = {"dielectric": GrpcLayerType.DIELECTRIC_LAYER, "signal": GrpcLayerType.SIGNAL_LAYER}
|
|
@@ -157,21 +169,25 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
157
169
|
return self._layer_collection.add_layer_bottom(layer)
|
|
158
170
|
|
|
159
171
|
def add_layer_below(self, name, base_layer_name, layer_type="signal", **kwargs):
|
|
160
|
-
"""Add a layer below a layer.
|
|
172
|
+
"""Add a layer below a specified layer.
|
|
161
173
|
|
|
162
174
|
Parameters
|
|
163
175
|
----------
|
|
164
176
|
name : str
|
|
165
177
|
Name of the layer.
|
|
166
|
-
base_layer_name: str
|
|
178
|
+
base_layer_name : str
|
|
167
179
|
Name of the base layer.
|
|
168
|
-
layer_type: str, optional
|
|
169
|
-
Type of the layer. The default
|
|
170
|
-
kwargs
|
|
180
|
+
layer_type : str, optional
|
|
181
|
+
Type of the layer. The default is ``"signal"``. Options are ``"signal"`` and ``"dielectric"``.
|
|
182
|
+
**kwargs : dict, optional
|
|
183
|
+
Additional keyword arguments. Possible keys are:
|
|
184
|
+
- ``thickness`` : float, layer thickness.
|
|
185
|
+
- ``material`` : str, layer material.
|
|
171
186
|
|
|
172
187
|
Returns
|
|
173
188
|
-------
|
|
174
|
-
|
|
189
|
+
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
190
|
+
Layer object created.
|
|
175
191
|
"""
|
|
176
192
|
thickness = GrpcValue(0.0)
|
|
177
193
|
if "thickness" in kwargs:
|
|
@@ -194,21 +210,25 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
194
210
|
return self._layer_collection.add_layer_below(layer, base_layer_name)
|
|
195
211
|
|
|
196
212
|
def add_layer_above(self, name, base_layer_name, layer_type="signal", **kwargs):
|
|
197
|
-
"""Add a layer above a layer.
|
|
213
|
+
"""Add a layer above a specified layer.
|
|
198
214
|
|
|
199
215
|
Parameters
|
|
200
216
|
----------
|
|
201
217
|
name : str
|
|
202
218
|
Name of the layer.
|
|
203
|
-
base_layer_name: str
|
|
219
|
+
base_layer_name : str
|
|
204
220
|
Name of the base layer.
|
|
205
|
-
layer_type: str, optional
|
|
206
|
-
Type of the layer. The default
|
|
207
|
-
kwargs
|
|
221
|
+
layer_type : str, optional
|
|
222
|
+
Type of the layer. The default is ``"signal"``. Options are ``"signal"`` and ``"dielectric"``.
|
|
223
|
+
**kwargs : dict, optional
|
|
224
|
+
Additional keyword arguments. Possible keys are:
|
|
225
|
+
- ``thickness`` : float, layer thickness.
|
|
226
|
+
- ``material`` : str, layer material.
|
|
208
227
|
|
|
209
228
|
Returns
|
|
210
229
|
-------
|
|
211
|
-
|
|
230
|
+
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
231
|
+
Layer object created.
|
|
212
232
|
"""
|
|
213
233
|
thickness = GrpcValue(0.0)
|
|
214
234
|
if "thickness" in kwargs:
|
|
@@ -229,13 +249,15 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
229
249
|
----------
|
|
230
250
|
name : str
|
|
231
251
|
Name of the layer.
|
|
232
|
-
layer_type: str, optional
|
|
233
|
-
Type of the layer. The default is ``"user"``. Options are ``"user"
|
|
234
|
-
kwargs
|
|
252
|
+
layer_type : str, optional
|
|
253
|
+
Type of the layer. The default is ``"user"``. Options are ``"user"`` and ``"outline"``.
|
|
254
|
+
**kwargs : dict, optional
|
|
255
|
+
Additional keyword arguments.
|
|
235
256
|
|
|
236
257
|
Returns
|
|
237
258
|
-------
|
|
238
|
-
|
|
259
|
+
:class:`pyedb.grpc.database.layers.layer.Layer`
|
|
260
|
+
Layer object created.
|
|
239
261
|
"""
|
|
240
262
|
added_layer = self.add_layer_top(name)
|
|
241
263
|
added_layer.type = GrpcLayerType.USER_LAYER
|
|
@@ -243,29 +265,65 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
243
265
|
|
|
244
266
|
@property
|
|
245
267
|
def stackup_layers(self):
|
|
246
|
-
"""Retrieve the dictionary of signal and dielectric layers.
|
|
268
|
+
"""Retrieve the dictionary of signal and dielectric layers.
|
|
269
|
+
|
|
270
|
+
.. deprecated:: 0.6.61
|
|
271
|
+
Use :func:`layers` instead.
|
|
272
|
+
|
|
273
|
+
Returns
|
|
274
|
+
-------
|
|
275
|
+
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
276
|
+
Dictionary of stackup layers.
|
|
277
|
+
"""
|
|
247
278
|
warnings.warn("Use new property :func:`layers` instead.", DeprecationWarning)
|
|
248
279
|
return self.layers
|
|
249
280
|
|
|
250
281
|
@property
|
|
251
282
|
def non_stackup_layers(self):
|
|
252
|
-
"""Retrieve the dictionary of
|
|
283
|
+
"""Retrieve the dictionary of non-stackup layers.
|
|
284
|
+
|
|
285
|
+
Returns
|
|
286
|
+
-------
|
|
287
|
+
dict[str, :class:`pyedb.grpc.database.layers.layer.Layer`]
|
|
288
|
+
Dictionary of non-stackup layers.
|
|
289
|
+
"""
|
|
253
290
|
return {
|
|
254
291
|
layer.name: Layer(self._pedb, layer) for layer in self.get_layers(GrpcLayerTypeSet.NON_STACKUP_LAYER_SET)
|
|
255
292
|
}
|
|
256
293
|
|
|
257
294
|
@property
|
|
258
295
|
def all_layers(self):
|
|
296
|
+
"""Retrieve all layers.
|
|
297
|
+
|
|
298
|
+
Returns
|
|
299
|
+
-------
|
|
300
|
+
dict[str, :class:`pyedb.grpc.database.layers.layer.Layer`]
|
|
301
|
+
Dictionary of all layers.
|
|
302
|
+
"""
|
|
259
303
|
return {layer.name: Layer(self._pedb, layer) for layer in self.get_layers(GrpcLayerTypeSet.ALL_LAYER_SET)}
|
|
260
304
|
|
|
261
305
|
@property
|
|
262
306
|
def signal_layers(self):
|
|
307
|
+
"""Retrieve the dictionary of signal layers.
|
|
308
|
+
|
|
309
|
+
Returns
|
|
310
|
+
-------
|
|
311
|
+
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
312
|
+
Dictionary of signal layers.
|
|
313
|
+
"""
|
|
263
314
|
return {
|
|
264
315
|
layer.name: StackupLayer(self._pedb, layer) for layer in self.get_layers(GrpcLayerTypeSet.SIGNAL_LAYER_SET)
|
|
265
316
|
}
|
|
266
317
|
|
|
267
318
|
@property
|
|
268
319
|
def dielectric_layers(self):
|
|
320
|
+
"""Retrieve the dictionary of dielectric layers.
|
|
321
|
+
|
|
322
|
+
Returns
|
|
323
|
+
-------
|
|
324
|
+
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
325
|
+
Dictionary of dielectric layers.
|
|
326
|
+
"""
|
|
269
327
|
return {
|
|
270
328
|
layer.name: StackupLayer(self._pedb, layer)
|
|
271
329
|
for layer in self.get_layers(GrpcLayerTypeSet.DIELECTRIC_LAYER_SET)
|
|
@@ -273,25 +331,46 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
273
331
|
|
|
274
332
|
@property
|
|
275
333
|
def layers_by_id(self):
|
|
276
|
-
"""Retrieve the list of layers with their
|
|
334
|
+
"""Retrieve the list of layers with their IDs.
|
|
335
|
+
|
|
336
|
+
Returns
|
|
337
|
+
-------
|
|
338
|
+
list[list[int, str]]
|
|
339
|
+
List of layers with their IDs and names.
|
|
340
|
+
"""
|
|
277
341
|
return [[obj.id, name] for name, obj in self.all_layers.items()]
|
|
278
342
|
|
|
279
343
|
@property
|
|
280
344
|
def layers(self):
|
|
281
|
-
"""Retrieve the dictionary of layers.
|
|
345
|
+
"""Retrieve the dictionary of stackup layers (signal and dielectric).
|
|
282
346
|
|
|
283
347
|
Returns
|
|
284
348
|
-------
|
|
285
|
-
|
|
349
|
+
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
350
|
+
Dictionary of stackup layers.
|
|
286
351
|
"""
|
|
287
352
|
return {obj.name: StackupLayer(self._pedb, obj) for obj in self.get_layers(GrpcLayerTypeSet.STACKUP_LAYER_SET)}
|
|
288
353
|
|
|
289
354
|
def find_layer_by_name(self, name: str):
|
|
290
|
-
"""
|
|
355
|
+
"""Find a layer by its name.
|
|
356
|
+
|
|
357
|
+
.. deprecated:: 0.29.0
|
|
358
|
+
Use :func:`find_by_name` instead.
|
|
359
|
+
|
|
360
|
+
Parameters
|
|
361
|
+
----------
|
|
362
|
+
name : str
|
|
363
|
+
Name of the layer.
|
|
291
364
|
|
|
292
|
-
|
|
293
|
-
|
|
365
|
+
Returns
|
|
366
|
+
-------
|
|
367
|
+
:class:`ansys.edb.core.layer.Layer`
|
|
368
|
+
Layer object found.
|
|
294
369
|
|
|
370
|
+
Raises
|
|
371
|
+
------
|
|
372
|
+
ValueError
|
|
373
|
+
If no layer with the given name is found.
|
|
295
374
|
"""
|
|
296
375
|
warnings.warn(
|
|
297
376
|
"`find_layer_by_name` is deprecated and is now located here "
|
|
@@ -305,7 +384,15 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
305
384
|
|
|
306
385
|
|
|
307
386
|
class Stackup(LayerCollection):
|
|
308
|
-
"""Manages EDB methods for stackup.
|
|
387
|
+
"""Manages EDB methods for stackup operations.
|
|
388
|
+
|
|
389
|
+
Parameters
|
|
390
|
+
----------
|
|
391
|
+
pedb : :class:`pyedb.Edb`
|
|
392
|
+
EDB object.
|
|
393
|
+
edb_object : :class:`ansys.edb.core.layer.LayerCollection`, optional
|
|
394
|
+
EDB layer collection object. The default is ``None``.
|
|
395
|
+
"""
|
|
309
396
|
|
|
310
397
|
def __init__(self, pedb, edb_object=None):
|
|
311
398
|
super().__init__(pedb, edb_object)
|
|
@@ -325,25 +412,23 @@ class Stackup(LayerCollection):
|
|
|
325
412
|
|
|
326
413
|
@property
|
|
327
414
|
def thickness(self):
|
|
328
|
-
"""Retrieve
|
|
415
|
+
"""Retrieve the stackup thickness.
|
|
329
416
|
|
|
330
417
|
Returns
|
|
331
418
|
-------
|
|
332
419
|
float
|
|
333
|
-
|
|
334
|
-
|
|
420
|
+
Stackup thickness.
|
|
335
421
|
"""
|
|
336
422
|
return self.get_layout_thickness()
|
|
337
423
|
|
|
338
424
|
@property
|
|
339
425
|
def num_layers(self):
|
|
340
|
-
"""Retrieve the
|
|
426
|
+
"""Retrieve the number of layers in the stackup.
|
|
341
427
|
|
|
342
428
|
Returns
|
|
343
429
|
-------
|
|
344
430
|
int
|
|
345
|
-
|
|
346
|
-
|
|
431
|
+
Number of layers.
|
|
347
432
|
"""
|
|
348
433
|
return len(list(self.layers.keys()))
|
|
349
434
|
|
|
@@ -362,7 +447,7 @@ class Stackup(LayerCollection):
|
|
|
362
447
|
Parameters
|
|
363
448
|
----------
|
|
364
449
|
layer_count : int
|
|
365
|
-
Number of
|
|
450
|
+
Number of layers. Must be even.
|
|
366
451
|
inner_layer_thickness : str, float, optional
|
|
367
452
|
Thickness of inner conductor layer.
|
|
368
453
|
outer_layer_thickness : str, float, optional
|
|
@@ -372,13 +457,14 @@ class Stackup(LayerCollection):
|
|
|
372
457
|
dielectric_material : str, optional
|
|
373
458
|
Material of dielectric layer.
|
|
374
459
|
soldermask : bool, optional
|
|
375
|
-
Whether to create soldermask layers. The default is``True``.
|
|
460
|
+
Whether to create soldermask layers. The default is ``True``.
|
|
376
461
|
soldermask_thickness : str, optional
|
|
377
462
|
Thickness of soldermask layer.
|
|
378
463
|
|
|
379
464
|
Returns
|
|
380
465
|
-------
|
|
381
466
|
bool
|
|
467
|
+
``True`` when successful, ``False`` when failed.
|
|
382
468
|
"""
|
|
383
469
|
if not np:
|
|
384
470
|
self._pedb.logger.error("Numpy is needed. Please, install it first.")
|
|
@@ -475,12 +561,11 @@ class Stackup(LayerCollection):
|
|
|
475
561
|
|
|
476
562
|
Returns
|
|
477
563
|
-------
|
|
478
|
-
|
|
479
|
-
Type of the stackup mode
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
* 2 - MultiZone
|
|
564
|
+
str
|
|
565
|
+
Type of the stackup mode. Options are:
|
|
566
|
+
- ``"laminate"``
|
|
567
|
+
- ``"overlapping"``
|
|
568
|
+
- ``"multizone"``
|
|
484
569
|
"""
|
|
485
570
|
return super().mode.name.lower()
|
|
486
571
|
|
|
@@ -504,16 +589,19 @@ class Stackup(LayerCollection):
|
|
|
504
589
|
|
|
505
590
|
Parameters
|
|
506
591
|
----------
|
|
507
|
-
layer_clone : :class:`
|
|
592
|
+
layer_clone : :class:`ansys.edb.core.layer.StackupLayer`
|
|
593
|
+
Layer object to apply.
|
|
508
594
|
operation : str
|
|
509
|
-
Options are ``"change_attribute"``, ``"change_name"
|
|
510
|
-
|
|
595
|
+
Operation to perform. Options are ``"change_attribute"``, ``"change_name"``, ``"change_position"``,
|
|
596
|
+
``"insert_below"``, ``"insert_above"``, ``"add_on_top"``, ``"add_on_bottom"``, ``"non_stackup"``,
|
|
597
|
+
and ``"add_at_elevation"``.
|
|
511
598
|
base_layer : str, optional
|
|
512
599
|
Name of the base layer. The default value is ``None``.
|
|
513
600
|
|
|
514
601
|
Returns
|
|
515
602
|
-------
|
|
516
|
-
|
|
603
|
+
bool
|
|
604
|
+
``True`` when successful.
|
|
517
605
|
"""
|
|
518
606
|
lc = self._pedb.layout.layer_collection
|
|
519
607
|
if operation in ["change_position", "change_attribute", "change_name"]:
|
|
@@ -605,17 +693,15 @@ class Stackup(LayerCollection):
|
|
|
605
693
|
return result
|
|
606
694
|
|
|
607
695
|
def add_outline_layer(self, outline_name="Outline"):
|
|
608
|
-
"""Add an outline layer named
|
|
696
|
+
"""Add an outline layer named "Outline" if it is not present.
|
|
609
697
|
|
|
610
698
|
Returns
|
|
611
699
|
-------
|
|
612
700
|
bool
|
|
613
|
-
|
|
701
|
+
``True`` when successful.
|
|
614
702
|
"""
|
|
615
703
|
return self.add_document_layer(name="Outline", layer_type="outline")
|
|
616
704
|
|
|
617
|
-
# TODO: Update optional argument material into material_name and fillMaterial into fill_material_name
|
|
618
|
-
|
|
619
705
|
def add_layer(
|
|
620
706
|
self,
|
|
621
707
|
layer_name,
|
|
@@ -639,12 +725,29 @@ class Stackup(LayerCollection):
|
|
|
639
725
|
base_layer : str, optional
|
|
640
726
|
Name of the base layer.
|
|
641
727
|
method : str, optional
|
|
642
|
-
Where to insert the new layer. The default is ``"add_on_top"``. Options are
|
|
643
|
-
|
|
728
|
+
Where to insert the new layer. The default is ``"add_on_top"``. Options are:
|
|
729
|
+
- ``"add_on_top"``
|
|
730
|
+
- ``"add_on_bottom"``
|
|
731
|
+
- ``"insert_above"``
|
|
732
|
+
- ``"insert_below"``
|
|
733
|
+
- ``"add_at_elevation"``
|
|
644
734
|
layer_type : str, optional
|
|
645
|
-
Type of layer. The default is ``"signal"``. Options are
|
|
646
|
-
|
|
647
|
-
|
|
735
|
+
Type of layer. The default is ``"signal"``. Options are:
|
|
736
|
+
- ``"signal"``
|
|
737
|
+
- ``"dielectric"``
|
|
738
|
+
- ``"conducting"``
|
|
739
|
+
- ``"air_lines"``
|
|
740
|
+
- ``"error"``
|
|
741
|
+
- ``"symbol"``
|
|
742
|
+
- ``"measure"``
|
|
743
|
+
- ``"assembly"``
|
|
744
|
+
- ``"silkscreen"``
|
|
745
|
+
- ``"solder_mask"``
|
|
746
|
+
- ``"solder_paste"``
|
|
747
|
+
- ``"glue"``
|
|
748
|
+
- ``"wirebond"``
|
|
749
|
+
- ``"hfss_region"``
|
|
750
|
+
- ``"user"``
|
|
648
751
|
material : str, optional
|
|
649
752
|
Material of the layer.
|
|
650
753
|
fillMaterial : str, optional
|
|
@@ -662,7 +765,8 @@ class Stackup(LayerCollection):
|
|
|
662
765
|
|
|
663
766
|
Returns
|
|
664
767
|
-------
|
|
665
|
-
:class:`pyedb.
|
|
768
|
+
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
769
|
+
Layer object created.
|
|
666
770
|
"""
|
|
667
771
|
if layer_name in self.layers:
|
|
668
772
|
logger.error("layer {} exists.".format(layer_name))
|
|
@@ -721,7 +825,8 @@ class Stackup(LayerCollection):
|
|
|
721
825
|
|
|
722
826
|
Returns
|
|
723
827
|
-------
|
|
724
|
-
|
|
828
|
+
bool
|
|
829
|
+
``True`` when successful.
|
|
725
830
|
"""
|
|
726
831
|
new_layer_collection = LayerCollection.create()
|
|
727
832
|
for layer_name, lyr in self.layers.items():
|
|
@@ -732,19 +837,26 @@ class Stackup(LayerCollection):
|
|
|
732
837
|
return True
|
|
733
838
|
|
|
734
839
|
def export(self, fpath, file_format="xml", include_material_with_layer=False):
|
|
735
|
-
"""Export stackup definition to a
|
|
840
|
+
"""Export stackup definition to a file.
|
|
736
841
|
|
|
737
842
|
Parameters
|
|
738
843
|
----------
|
|
739
844
|
fpath : str
|
|
740
|
-
File path to
|
|
845
|
+
File path to export to.
|
|
741
846
|
file_format : str, optional
|
|
742
|
-
Format of the file to export. The default is ``"
|
|
743
|
-
``"
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
847
|
+
Format of the file to export. The default is ``"xml"``. Options are:
|
|
848
|
+
- ``"csv"``
|
|
849
|
+
- ``"xlsx"``
|
|
850
|
+
- ``"json"``
|
|
851
|
+
- ``"xml"``
|
|
852
|
+
include_material_with_layer : bool, optional
|
|
853
|
+
Whether to include the material definition inside layer objects. This parameter is only used
|
|
854
|
+
when a JSON file is exported. The default is ``False``.
|
|
855
|
+
|
|
856
|
+
Returns
|
|
857
|
+
-------
|
|
858
|
+
bool
|
|
859
|
+
``True`` when successful.
|
|
748
860
|
|
|
749
861
|
Examples
|
|
750
862
|
--------
|
|
@@ -768,7 +880,7 @@ class Stackup(LayerCollection):
|
|
|
768
880
|
return False
|
|
769
881
|
|
|
770
882
|
def export_stackup(self, fpath, file_format="xml", include_material_with_layer=False):
|
|
771
|
-
"""Export stackup definition to a
|
|
883
|
+
"""Export stackup definition to a file.
|
|
772
884
|
|
|
773
885
|
.. deprecated:: 0.6.61
|
|
774
886
|
Use :func:`export` instead.
|
|
@@ -776,14 +888,15 @@ class Stackup(LayerCollection):
|
|
|
776
888
|
Parameters
|
|
777
889
|
----------
|
|
778
890
|
fpath : str
|
|
779
|
-
File path to
|
|
891
|
+
File path to export to.
|
|
780
892
|
file_format : str, optional
|
|
781
|
-
Format of the file to export. The default is ``"
|
|
782
|
-
|
|
783
|
-
|
|
893
|
+
Format of the file to export. The default is ``"xml"``. Options are:
|
|
894
|
+
- ``"csv"``
|
|
895
|
+
- ``"xlsx"``
|
|
896
|
+
- ``"json"``
|
|
897
|
+
include_material_with_layer : bool, optional
|
|
784
898
|
Whether to include the material definition inside layer objects. This parameter is only used
|
|
785
|
-
when a JSON file is exported. The default is ``False
|
|
786
|
-
section in the JSON file. If ``True``, the material definition is included inside the layer ones.
|
|
899
|
+
when a JSON file is exported. The default is ``False``.
|
|
787
900
|
|
|
788
901
|
Examples
|
|
789
902
|
--------
|
|
@@ -855,57 +968,6 @@ class Stackup(LayerCollection):
|
|
|
855
968
|
else:
|
|
856
969
|
return False
|
|
857
970
|
|
|
858
|
-
# TODO: This method might need some refactoring
|
|
859
|
-
|
|
860
|
-
def _import_layer_stackup(self, input_file=None):
|
|
861
|
-
if input_file:
|
|
862
|
-
f = open(input_file)
|
|
863
|
-
json_dict = json.load(f) # pragma: no cover
|
|
864
|
-
for k, v in json_dict.items():
|
|
865
|
-
if k == "materials":
|
|
866
|
-
for material in v.values():
|
|
867
|
-
material_name = material["name"]
|
|
868
|
-
del material["name"]
|
|
869
|
-
if material_name not in self._pedb.materials:
|
|
870
|
-
self._pedb.materials.add_material(material_name, **material)
|
|
871
|
-
else:
|
|
872
|
-
self._pedb.materials.update_material(material_name, material)
|
|
873
|
-
if k == "layers":
|
|
874
|
-
if len(list(v.values())) == len(list(self.layers.values())):
|
|
875
|
-
imported_layers_list = [l_dict["name"] for l_dict in list(v.values())]
|
|
876
|
-
layout_layer_list = list(self.layers.keys())
|
|
877
|
-
for layer_name in imported_layers_list:
|
|
878
|
-
layer_index = imported_layers_list.index(layer_name)
|
|
879
|
-
if layout_layer_list[layer_index] != layer_name:
|
|
880
|
-
self.layers[layout_layer_list[layer_index]].name = layer_name
|
|
881
|
-
prev_layer = None
|
|
882
|
-
for layer_name, layer in v.items():
|
|
883
|
-
if layer["name"] not in self.layers:
|
|
884
|
-
if not prev_layer:
|
|
885
|
-
self.add_layer(
|
|
886
|
-
layer_name,
|
|
887
|
-
method="add_on_top",
|
|
888
|
-
layer_type=layer["type"],
|
|
889
|
-
material=layer["material"],
|
|
890
|
-
fillMaterial=layer["dielectric_fill"],
|
|
891
|
-
thickness=layer["thickness"],
|
|
892
|
-
)
|
|
893
|
-
prev_layer = layer_name
|
|
894
|
-
else:
|
|
895
|
-
self.add_layer(
|
|
896
|
-
layer_name,
|
|
897
|
-
base_layer=layer_name,
|
|
898
|
-
method="insert_below",
|
|
899
|
-
layer_type=layer["type"],
|
|
900
|
-
material=layer["material"],
|
|
901
|
-
fillMaterial=layer["dielectric_fill"],
|
|
902
|
-
thickness=layer["thickness"],
|
|
903
|
-
)
|
|
904
|
-
prev_layer = layer_name
|
|
905
|
-
if layer_name in self.layers:
|
|
906
|
-
self.layers[layer["name"]]._load_layer(layer)
|
|
907
|
-
return True
|
|
908
|
-
|
|
909
971
|
def limits(self, only_metals=False):
|
|
910
972
|
"""Retrieve stackup limits.
|
|
911
973
|
|
|
@@ -916,8 +978,12 @@ class Stackup(LayerCollection):
|
|
|
916
978
|
|
|
917
979
|
Returns
|
|
918
980
|
-------
|
|
919
|
-
|
|
920
|
-
|
|
981
|
+
tuple
|
|
982
|
+
Tuple containing:
|
|
983
|
+
- Upper layer name
|
|
984
|
+
- Upper layer top elevation
|
|
985
|
+
- Lower layer name
|
|
986
|
+
- Lower layer bottom elevation
|
|
921
987
|
"""
|
|
922
988
|
if only_metals:
|
|
923
989
|
input_layers = GrpcLayerTypeSet.SIGNAL_LAYER_SET
|
|
@@ -937,11 +1003,11 @@ class Stackup(LayerCollection):
|
|
|
937
1003
|
Returns
|
|
938
1004
|
-------
|
|
939
1005
|
bool
|
|
940
|
-
``True`` when
|
|
1006
|
+
``True`` when successful.
|
|
941
1007
|
|
|
942
1008
|
Examples
|
|
943
1009
|
--------
|
|
944
|
-
>>> edb = Edb(edbpath=targetfile,
|
|
1010
|
+
>>> edb = Edb(edbpath=targetfile, edbversion="2021.2")
|
|
945
1011
|
>>> edb.stackup.flip_design()
|
|
946
1012
|
>>> edb.save()
|
|
947
1013
|
>>> edb.close_edb()
|
|
@@ -1037,7 +1103,7 @@ class Stackup(LayerCollection):
|
|
|
1037
1103
|
Returns
|
|
1038
1104
|
-------
|
|
1039
1105
|
float
|
|
1040
|
-
|
|
1106
|
+
Thickness value.
|
|
1041
1107
|
"""
|
|
1042
1108
|
layers = list(self.layers.values())
|
|
1043
1109
|
layers.sort(key=lambda lay: lay.lower_elevation)
|
|
@@ -1069,13 +1135,15 @@ class Stackup(LayerCollection):
|
|
|
1069
1135
|
val.component_property = comp_prop
|
|
1070
1136
|
|
|
1071
1137
|
def adjust_solder_dielectrics(self):
|
|
1072
|
-
"""Adjust the stack-up by adding or modifying dielectric layers that
|
|
1073
|
-
|
|
1074
|
-
the
|
|
1138
|
+
"""Adjust the stack-up by adding or modifying dielectric layers that contain solder balls.
|
|
1139
|
+
|
|
1140
|
+
This method identifies the solder-ball height and adjusts the dielectric thickness on top (or bottom)
|
|
1141
|
+
to fit the thickness in order to merge another layout.
|
|
1075
1142
|
|
|
1076
1143
|
Returns
|
|
1077
1144
|
-------
|
|
1078
1145
|
bool
|
|
1146
|
+
``True`` when successful.
|
|
1079
1147
|
"""
|
|
1080
1148
|
for el, val in self._pedb.components.instances.items():
|
|
1081
1149
|
if val.solder_ball_height:
|
|
@@ -1113,33 +1181,33 @@ class Stackup(LayerCollection):
|
|
|
1113
1181
|
flipped_stackup=True,
|
|
1114
1182
|
place_on_top=True,
|
|
1115
1183
|
):
|
|
1116
|
-
"""Place current
|
|
1117
|
-
|
|
1184
|
+
"""Place current cell into another cell using layer placement method.
|
|
1185
|
+
|
|
1186
|
+
Flip the current layer stackup of a layout if requested.
|
|
1118
1187
|
|
|
1119
1188
|
Parameters
|
|
1120
1189
|
----------
|
|
1121
|
-
edb : Edb
|
|
1122
|
-
|
|
1123
|
-
angle :
|
|
1124
|
-
|
|
1125
|
-
offset_x :
|
|
1126
|
-
|
|
1127
|
-
offset_y :
|
|
1128
|
-
|
|
1190
|
+
edb : :class:`pyedb.Edb`
|
|
1191
|
+
Target Edb object.
|
|
1192
|
+
angle : float, optional
|
|
1193
|
+
Rotation angle in degrees. The default is ``0.0``.
|
|
1194
|
+
offset_x : float, optional
|
|
1195
|
+
X offset value. The default is ``0.0``.
|
|
1196
|
+
offset_y : float, optional
|
|
1197
|
+
Y offset value. The default is ``0.0``.
|
|
1129
1198
|
flipped_stackup : bool, optional
|
|
1130
|
-
|
|
1131
|
-
If `True` and place_on_top is `True` the stackup will be flipped before the merge.
|
|
1199
|
+
Whether to flip the current layout. The default is ``True``.
|
|
1132
1200
|
place_on_top : bool, optional
|
|
1133
|
-
|
|
1201
|
+
Whether to place the current layout on top of the destination layout. The default is ``True``.
|
|
1134
1202
|
|
|
1135
1203
|
Returns
|
|
1136
1204
|
-------
|
|
1137
1205
|
bool
|
|
1138
|
-
``True`` when
|
|
1206
|
+
``True`` when successful.
|
|
1139
1207
|
|
|
1140
1208
|
Examples
|
|
1141
1209
|
--------
|
|
1142
|
-
>>> edb1 = Edb(edbpath=targetfile1,
|
|
1210
|
+
>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
|
|
1143
1211
|
>>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
|
|
1144
1212
|
|
|
1145
1213
|
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
|
|
@@ -1202,36 +1270,35 @@ class Stackup(LayerCollection):
|
|
|
1202
1270
|
place_on_top=True,
|
|
1203
1271
|
solder_height=0,
|
|
1204
1272
|
):
|
|
1205
|
-
"""Place current
|
|
1206
|
-
|
|
1273
|
+
"""Place current cell into another cell using 3D placement method.
|
|
1274
|
+
|
|
1275
|
+
Flip the current layer stackup of a layout if requested.
|
|
1207
1276
|
|
|
1208
1277
|
Parameters
|
|
1209
1278
|
----------
|
|
1210
|
-
edb : Edb
|
|
1211
|
-
|
|
1212
|
-
angle :
|
|
1213
|
-
|
|
1214
|
-
offset_x :
|
|
1215
|
-
|
|
1216
|
-
offset_y :
|
|
1217
|
-
|
|
1279
|
+
edb : :class:`pyedb.Edb`
|
|
1280
|
+
Target Edb object.
|
|
1281
|
+
angle : float, optional
|
|
1282
|
+
Rotation angle in degrees. The default is ``0.0``.
|
|
1283
|
+
offset_x : float, optional
|
|
1284
|
+
X offset value. The default is ``0.0``.
|
|
1285
|
+
offset_y : float, optional
|
|
1286
|
+
Y offset value. The default is ``0.0``.
|
|
1218
1287
|
flipped_stackup : bool, optional
|
|
1219
|
-
|
|
1220
|
-
If `True` and place_on_top is `True` the stackup will be flipped before the merge.
|
|
1288
|
+
Whether to flip the current layout. The default is ``True``.
|
|
1221
1289
|
place_on_top : bool, optional
|
|
1222
|
-
|
|
1290
|
+
Whether to place the current layout on top of the destination layout. The default is ``True``.
|
|
1223
1291
|
solder_height : float, optional
|
|
1224
|
-
Solder
|
|
1225
|
-
This value will be added to the elevation to align the two layouts.
|
|
1292
|
+
Solder ball or bumps height. This value will be added to the elevation to align the two layouts.
|
|
1226
1293
|
|
|
1227
1294
|
Returns
|
|
1228
1295
|
-------
|
|
1229
1296
|
bool
|
|
1230
|
-
``True`` when
|
|
1297
|
+
``True`` when successful.
|
|
1231
1298
|
|
|
1232
1299
|
Examples
|
|
1233
1300
|
--------
|
|
1234
|
-
>>> edb1 = Edb(edbpath=targetfile1,
|
|
1301
|
+
>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
|
|
1235
1302
|
>>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
|
|
1236
1303
|
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
|
|
1237
1304
|
>>> mounted_cmp = edb2.components.get_component_by_name("BGA")
|
|
@@ -1335,48 +1402,31 @@ class Stackup(LayerCollection):
|
|
|
1335
1402
|
place_on_top=True,
|
|
1336
1403
|
solder_height=0,
|
|
1337
1404
|
):
|
|
1338
|
-
"""Place
|
|
1339
|
-
Flip the current layer stackup of a layout if requested. Transform parameters currently not supported.
|
|
1405
|
+
"""Place a component instance in the layout using 3D placement.
|
|
1340
1406
|
|
|
1341
1407
|
Parameters
|
|
1342
1408
|
----------
|
|
1343
|
-
component_edb : Edb
|
|
1344
|
-
|
|
1345
|
-
angle :
|
|
1346
|
-
|
|
1347
|
-
offset_x :
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
The default
|
|
1353
|
-
offset_z : double, optional
|
|
1354
|
-
The z offset value. (i.e. elevation offset for placement relative to the top layer conductor).
|
|
1355
|
-
The default value is ``0.0``, which places the cell layout on top of the top conductor
|
|
1356
|
-
layer of the target EDB.
|
|
1409
|
+
component_edb : :class:`pyedb.Edb`
|
|
1410
|
+
Component Edb object to place.
|
|
1411
|
+
angle : float, optional
|
|
1412
|
+
Rotation angle in degrees. The default is ``0.0``.
|
|
1413
|
+
offset_x : float, optional
|
|
1414
|
+
X offset value. The default is ``0.0``.
|
|
1415
|
+
offset_y : float, optional
|
|
1416
|
+
Y offset value. The default is ``0.0``.
|
|
1417
|
+
offset_z : float, optional
|
|
1418
|
+
Z offset value (elevation offset). The default is ``0.0``.
|
|
1357
1419
|
flipped_stackup : bool, optional
|
|
1358
|
-
|
|
1359
|
-
If `True` and place_on_top is `True` the stackup will be flipped before the merge.
|
|
1420
|
+
Whether to flip the component stackup. The default is ``True``.
|
|
1360
1421
|
place_on_top : bool, optional
|
|
1361
|
-
|
|
1422
|
+
Whether to place the component on top of the target layout. The default is ``True``.
|
|
1362
1423
|
solder_height : float, optional
|
|
1363
|
-
Solder
|
|
1364
|
-
This value will be added to the elevation to align the two layouts.
|
|
1424
|
+
Solder ball or bumps height. The default is ``0``.
|
|
1365
1425
|
|
|
1366
1426
|
Returns
|
|
1367
1427
|
-------
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
Examples
|
|
1372
|
-
--------
|
|
1373
|
-
>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
|
|
1374
|
-
>>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
|
|
1375
|
-
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
|
|
1376
|
-
>>> mounted_cmp = edb2.components.get_component_by_name("BGA")
|
|
1377
|
-
>>> edb1.stackup.place_instance(edb2, angle=0.0, offset_x="1mm",
|
|
1378
|
-
... offset_y="2mm", flipped_stackup=False, place_on_top=True,
|
|
1379
|
-
... )
|
|
1428
|
+
:class:`ansys.edb.core.hierarchy.CellInstance`
|
|
1429
|
+
Cell instance created.
|
|
1380
1430
|
"""
|
|
1381
1431
|
_angle = angle * math.pi / 180.0
|
|
1382
1432
|
|
|
@@ -1482,37 +1532,35 @@ class Stackup(LayerCollection):
|
|
|
1482
1532
|
offset_z=0.0,
|
|
1483
1533
|
place_on_top=True,
|
|
1484
1534
|
) -> bool:
|
|
1485
|
-
"""Place a 3D
|
|
1486
|
-
|
|
1487
|
-
|
|
1535
|
+
"""Place a 3D component into the current layout.
|
|
1536
|
+
|
|
1537
|
+
3D Component ports are not visible via EDB. They will be visible after the EDB has been opened in Ansys
|
|
1538
|
+
Electronics Desktop as a project.
|
|
1488
1539
|
|
|
1489
1540
|
Parameters
|
|
1490
1541
|
----------
|
|
1491
1542
|
a3dcomp_path : str
|
|
1492
|
-
Path to the 3D Component file (
|
|
1493
|
-
angle :
|
|
1543
|
+
Path to the 3D Component file (``*.a3dcomp``) to place.
|
|
1544
|
+
angle : float, optional
|
|
1494
1545
|
Clockwise rotation angle applied to the a3dcomp.
|
|
1495
|
-
offset_x :
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
The default
|
|
1501
|
-
offset_z : double, optional
|
|
1502
|
-
The z offset value. (i.e. elevation)
|
|
1503
|
-
The default value is ``0.0``.
|
|
1546
|
+
offset_x : float, optional
|
|
1547
|
+
X offset value. The default is ``0.0``.
|
|
1548
|
+
offset_y : float, optional
|
|
1549
|
+
Y offset value. The default is ``0.0``.
|
|
1550
|
+
offset_z : float, optional
|
|
1551
|
+
Z offset value (elevation). The default is ``0.0``.
|
|
1504
1552
|
place_on_top : bool, optional
|
|
1505
|
-
Whether to place the 3D
|
|
1506
|
-
|
|
1553
|
+
Whether to place the 3D component on the top or the bottom of this layout. If ``False``, the 3D component
|
|
1554
|
+
will be flipped over around its X axis.
|
|
1507
1555
|
|
|
1508
1556
|
Returns
|
|
1509
1557
|
-------
|
|
1510
1558
|
bool
|
|
1511
|
-
``True`` if successful
|
|
1559
|
+
``True`` if successful, ``False`` if not.
|
|
1512
1560
|
|
|
1513
1561
|
Examples
|
|
1514
1562
|
--------
|
|
1515
|
-
>>> edb1 = Edb(edbpath=targetfile1,
|
|
1563
|
+
>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
|
|
1516
1564
|
>>> a3dcomp_path = "connector.a3dcomp"
|
|
1517
1565
|
>>> edb1.stackup.place_a3dcomp_3d_placement(a3dcomp_path, angle=0.0, offset_x="1mm",
|
|
1518
1566
|
... offset_y="2mm", flipped_stackup=False, place_on_top=True,
|
|
@@ -1558,11 +1606,11 @@ class Stackup(LayerCollection):
|
|
|
1558
1606
|
Returns
|
|
1559
1607
|
-------
|
|
1560
1608
|
dict
|
|
1561
|
-
|
|
1609
|
+
Dictionary of copper area per layer.
|
|
1562
1610
|
|
|
1563
1611
|
Examples
|
|
1564
1612
|
--------
|
|
1565
|
-
>>> edb = Edb(edbpath=targetfile1,
|
|
1613
|
+
>>> edb = Edb(edbpath=targetfile1, edbversion="2021.2")
|
|
1566
1614
|
>>> edb.stackup.residual_copper_area_per_layer()
|
|
1567
1615
|
"""
|
|
1568
1616
|
temp_data = {name: 0 for name, _ in self.signal_layers.items()}
|
|
@@ -1581,10 +1629,21 @@ class Stackup(LayerCollection):
|
|
|
1581
1629
|
temp_data = {name: area / outline_area * 100 for name, area in temp_data.items()}
|
|
1582
1630
|
return temp_data
|
|
1583
1631
|
|
|
1584
|
-
# TODO: This method might need some refactoring
|
|
1585
|
-
|
|
1586
1632
|
def _import_dict(self, json_dict, rename=False):
|
|
1587
|
-
"""Import stackup from a dictionary.
|
|
1633
|
+
"""Import stackup from a dictionary.
|
|
1634
|
+
|
|
1635
|
+
Parameters
|
|
1636
|
+
----------
|
|
1637
|
+
json_dict : dict
|
|
1638
|
+
Dictionary containing stackup information.
|
|
1639
|
+
rename : bool, optional
|
|
1640
|
+
Whether to rename layers. The default is ``False``.
|
|
1641
|
+
|
|
1642
|
+
Returns
|
|
1643
|
+
-------
|
|
1644
|
+
bool
|
|
1645
|
+
``True`` when successful.
|
|
1646
|
+
"""
|
|
1588
1647
|
if not "materials" in json_dict:
|
|
1589
1648
|
self._logger.info("Configuration file does not have material definition. Using aedb and syslib materials.")
|
|
1590
1649
|
else:
|
|
@@ -1725,7 +1784,20 @@ class Stackup(LayerCollection):
|
|
|
1725
1784
|
return True
|
|
1726
1785
|
|
|
1727
1786
|
def _import_json(self, file_path, rename=False):
|
|
1728
|
-
"""Import stackup from a
|
|
1787
|
+
"""Import stackup from a JSON file.
|
|
1788
|
+
|
|
1789
|
+
Parameters
|
|
1790
|
+
----------
|
|
1791
|
+
file_path : str
|
|
1792
|
+
Path to the JSON file.
|
|
1793
|
+
rename : bool, optional
|
|
1794
|
+
Whether to rename layers. The default is ``False``.
|
|
1795
|
+
|
|
1796
|
+
Returns
|
|
1797
|
+
-------
|
|
1798
|
+
bool
|
|
1799
|
+
``True`` when successful.
|
|
1800
|
+
"""
|
|
1729
1801
|
if file_path:
|
|
1730
1802
|
f = open(file_path)
|
|
1731
1803
|
json_dict = json.load(f) # pragma: no cover
|
|
@@ -1738,6 +1810,11 @@ class Stackup(LayerCollection):
|
|
|
1738
1810
|
----------
|
|
1739
1811
|
file_path : str
|
|
1740
1812
|
File path to the CSV file.
|
|
1813
|
+
|
|
1814
|
+
Returns
|
|
1815
|
+
-------
|
|
1816
|
+
bool
|
|
1817
|
+
``True`` when successful.
|
|
1741
1818
|
"""
|
|
1742
1819
|
if not pd:
|
|
1743
1820
|
self._pedb.logger.error("Pandas is needed. You must install it first.")
|
|
@@ -1779,16 +1856,19 @@ class Stackup(LayerCollection):
|
|
|
1779
1856
|
|
|
1780
1857
|
Parameters
|
|
1781
1858
|
----------
|
|
1782
|
-
layers: dict
|
|
1859
|
+
layers : dict, optional
|
|
1783
1860
|
Dictionary containing layer information.
|
|
1784
|
-
materials: dict
|
|
1861
|
+
materials : dict, optional
|
|
1785
1862
|
Dictionary containing material information.
|
|
1786
|
-
roughness: dict
|
|
1863
|
+
roughness : dict, optional
|
|
1787
1864
|
Dictionary containing roughness information.
|
|
1865
|
+
non_stackup_layers : dict, optional
|
|
1866
|
+
Dictionary containing non-stackup layer information.
|
|
1788
1867
|
|
|
1789
1868
|
Returns
|
|
1790
1869
|
-------
|
|
1791
|
-
|
|
1870
|
+
bool
|
|
1871
|
+
``True`` when successful.
|
|
1792
1872
|
"""
|
|
1793
1873
|
if materials:
|
|
1794
1874
|
self._add_materials_from_dictionary(materials)
|
|
@@ -1905,9 +1985,14 @@ class Stackup(LayerCollection):
|
|
|
1905
1985
|
def _get(self):
|
|
1906
1986
|
"""Get stackup information from layout.
|
|
1907
1987
|
|
|
1908
|
-
Returns
|
|
1909
|
-
|
|
1910
|
-
|
|
1988
|
+
Returns
|
|
1989
|
+
-------
|
|
1990
|
+
tuple
|
|
1991
|
+
Tuple containing:
|
|
1992
|
+
- layers (dict)
|
|
1993
|
+
- materials (dict)
|
|
1994
|
+
- roughness_models (dict)
|
|
1995
|
+
- non_stackup_layers (dict)
|
|
1911
1996
|
"""
|
|
1912
1997
|
layers = OrderedDict()
|
|
1913
1998
|
roughness_models = OrderedDict()
|
|
@@ -1972,39 +2057,30 @@ class Stackup(LayerCollection):
|
|
|
1972
2057
|
def _add_materials_from_dictionary(self, material_dict):
|
|
1973
2058
|
materials = self.self._pedb.materials.materials
|
|
1974
2059
|
for name, material_properties in material_dict.items():
|
|
1975
|
-
if
|
|
1976
|
-
|
|
1977
|
-
materials.add_conductor_material(name, material_properties["Conductivity"])
|
|
1978
|
-
else:
|
|
1979
|
-
materials.add_dielectric_material(
|
|
1980
|
-
name,
|
|
1981
|
-
material_properties["Permittivity"],
|
|
1982
|
-
material_properties["DielectricLossTangent"],
|
|
1983
|
-
)
|
|
2060
|
+
if "Conductivity" in material_properties:
|
|
2061
|
+
materials.add_conductor_material(name, material_properties["Conductivity"])
|
|
1984
2062
|
else:
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
material.loss_tanget = material_properties["DielectricLossTangent"]
|
|
2063
|
+
materials.add_dielectric_material(
|
|
2064
|
+
name,
|
|
2065
|
+
material_properties["Permittivity"],
|
|
2066
|
+
material_properties["DielectricLossTangent"],
|
|
2067
|
+
)
|
|
1991
2068
|
return True
|
|
1992
2069
|
|
|
1993
2070
|
def _import_xml(self, file_path, rename=False):
|
|
1994
|
-
"""Read external
|
|
1995
|
-
You can use xml file to import layer stackup but using json file is recommended.
|
|
1996
|
-
see :class:`pyedb.dotnet.database.edb_data.simulation_configuration.SimulationConfiguration´ class to
|
|
1997
|
-
generate files`.
|
|
2071
|
+
"""Read external XML file and convert into JSON format.
|
|
1998
2072
|
|
|
1999
2073
|
Parameters
|
|
2000
2074
|
----------
|
|
2001
|
-
file_path: str
|
|
2075
|
+
file_path : str
|
|
2002
2076
|
Path to external XML file.
|
|
2077
|
+
rename : bool, optional
|
|
2078
|
+
Whether to rename layers. The default is ``False``.
|
|
2003
2079
|
|
|
2004
2080
|
Returns
|
|
2005
2081
|
-------
|
|
2006
2082
|
bool
|
|
2007
|
-
``True`` when successful
|
|
2083
|
+
``True`` when successful.
|
|
2008
2084
|
"""
|
|
2009
2085
|
if not colors:
|
|
2010
2086
|
self._pedb.logger.error("Matplotlib is needed. Please, install it first.")
|
|
@@ -2063,17 +2139,17 @@ class Stackup(LayerCollection):
|
|
|
2063
2139
|
return self._pedb.configuration.load(cfg, apply_file=True)
|
|
2064
2140
|
|
|
2065
2141
|
def _export_xml(self, file_path):
|
|
2066
|
-
"""Export stackup information to an external
|
|
2142
|
+
"""Export stackup information to an external XML file.
|
|
2067
2143
|
|
|
2068
2144
|
Parameters
|
|
2069
2145
|
----------
|
|
2070
|
-
file_path: str
|
|
2146
|
+
file_path : str
|
|
2071
2147
|
Path to external XML file.
|
|
2072
2148
|
|
|
2073
2149
|
Returns
|
|
2074
2150
|
-------
|
|
2075
2151
|
bool
|
|
2076
|
-
``True`` when successful
|
|
2152
|
+
``True`` when successful.
|
|
2077
2153
|
"""
|
|
2078
2154
|
layers, materials, roughness, non_stackup_layers = self._get()
|
|
2079
2155
|
|
|
@@ -2113,25 +2189,23 @@ class Stackup(LayerCollection):
|
|
|
2113
2189
|
return True
|
|
2114
2190
|
|
|
2115
2191
|
def load(self, file_path, rename=False):
|
|
2116
|
-
"""Import stackup from a file.
|
|
2117
|
-
have the same number of signal layers. Signals layers can be renamed. Dielectric layers can be
|
|
2118
|
-
added and deleted.
|
|
2192
|
+
"""Import stackup from a file.
|
|
2119
2193
|
|
|
2194
|
+
Supported formats: XML, CSV, JSON.
|
|
2120
2195
|
|
|
2121
2196
|
Parameters
|
|
2122
2197
|
----------
|
|
2123
|
-
file_path : str
|
|
2124
|
-
Path to stackup file or
|
|
2125
|
-
rename : bool
|
|
2126
|
-
If
|
|
2127
|
-
|
|
2128
|
-
in the layout, layers are renamed according the file.
|
|
2129
|
-
Note that layer order matters, and has to be writtent from top to bottom layer in the file.
|
|
2198
|
+
file_path : str or dict
|
|
2199
|
+
Path to stackup file or dictionary with stackup details.
|
|
2200
|
+
rename : bool, optional
|
|
2201
|
+
If ``False``, layers in layout not found in the stackup file are deleted.
|
|
2202
|
+
If ``True`` and the number of layers in the stackup file equals the number of stackup layers
|
|
2203
|
+
in the layout, layers are renamed according to the file.
|
|
2130
2204
|
|
|
2131
2205
|
Returns
|
|
2132
2206
|
-------
|
|
2133
2207
|
bool
|
|
2134
|
-
``True`` when successful
|
|
2208
|
+
``True`` when successful.
|
|
2135
2209
|
|
|
2136
2210
|
Examples
|
|
2137
2211
|
--------
|
|
@@ -2161,32 +2235,31 @@ class Stackup(LayerCollection):
|
|
|
2161
2235
|
scale_elevation=True,
|
|
2162
2236
|
show=True,
|
|
2163
2237
|
):
|
|
2164
|
-
"""Plot current stackup and
|
|
2165
|
-
|
|
2238
|
+
"""Plot the current stackup and optionally overlap padstack definitions.
|
|
2239
|
+
|
|
2240
|
+
Only supports 'Laminate' and 'Overlapping' stackup types.
|
|
2166
2241
|
|
|
2167
2242
|
Parameters
|
|
2168
2243
|
----------
|
|
2169
2244
|
save_plot : str, optional
|
|
2170
|
-
|
|
2171
|
-
If ``save_plot`` is provided, the ``show`` parameter is ignored.
|
|
2245
|
+
Path to save the plot image. If provided, ``show`` is ignored.
|
|
2172
2246
|
size : tuple, optional
|
|
2173
|
-
Image size in
|
|
2174
|
-
plot_definitions : str
|
|
2175
|
-
List of padstack definitions to plot on the stackup.
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
Last layer to plot from the bottom. Default is `None` to plot up to top layer.
|
|
2247
|
+
Image size in pixels (width, height). Default is ``(2000, 1500)``.
|
|
2248
|
+
plot_definitions : str or list, optional
|
|
2249
|
+
List of padstack definitions to plot on the stackup. Only supported for Laminate mode.
|
|
2250
|
+
first_layer : str or :class:`pyedb.grpc.database.layers.layer.Layer`, optional
|
|
2251
|
+
First layer to plot from the bottom. Default is ``None`` (start from bottom).
|
|
2252
|
+
last_layer : str or :class:`pyedb.grpc.database.layers.layer.Layer`, optional
|
|
2253
|
+
Last layer to plot from the bottom. Default is ``None`` (plot up to top layer).
|
|
2181
2254
|
scale_elevation : bool, optional
|
|
2182
|
-
|
|
2183
|
-
Default is `True`.
|
|
2255
|
+
Scale real layer thickness so that max_thickness = 3 * min_thickness. Default is ``True``.
|
|
2184
2256
|
show : bool, optional
|
|
2185
|
-
Whether to show the plot
|
|
2257
|
+
Whether to show the plot. Default is ``True``.
|
|
2186
2258
|
|
|
2187
2259
|
Returns
|
|
2188
2260
|
-------
|
|
2189
|
-
:class:`matplotlib.
|
|
2261
|
+
:class:`matplotlib.pyplot`
|
|
2262
|
+
Matplotlib plot object.
|
|
2190
2263
|
"""
|
|
2191
2264
|
|
|
2192
2265
|
from pyedb.generic.constants import CSS4_COLORS
|
|
@@ -2389,7 +2462,7 @@ class Stackup(LayerCollection):
|
|
|
2389
2462
|
width = len(columns) + 1
|
|
2390
2463
|
for i, c in enumerate(columns[:-1]):
|
|
2391
2464
|
for j, r in enumerate(c):
|
|
2392
|
-
if r != 0: # and dname == r[0].name
|
|
2465
|
+
if r != 0: # and dname == r[0].name
|
|
2393
2466
|
if columns[i + 1][j] == 0:
|
|
2394
2467
|
# nothing on the right, so expand the fill
|
|
2395
2468
|
x = r[1]
|