pyedb 0.50.1__py3-none-any.whl → 0.51.2__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_ports_sources.py +79 -239
- pyedb/configuration/configuration.py +27 -0
- pyedb/dotnet/clr_module.py +9 -3
- pyedb/dotnet/database/cell/layout.py +10 -1
- pyedb/dotnet/database/dotnet/database.py +0 -2
- pyedb/dotnet/database/layout_validation.py +17 -13
- pyedb/dotnet/database/modeler.py +0 -1
- pyedb/dotnet/edb.py +7 -1
- pyedb/generic/design_types.py +183 -62
- pyedb/grpc/database/components.py +110 -0
- pyedb/grpc/database/control_file.py +150 -17
- pyedb/grpc/database/definitions.py +36 -2
- pyedb/grpc/database/hfss.py +15 -0
- pyedb/grpc/database/hierarchy/component.py +10 -2
- pyedb/grpc/database/layout_validation.py +58 -7
- pyedb/grpc/database/nets.py +233 -4
- pyedb/grpc/database/padstacks.py +97 -0
- pyedb/grpc/database/primitive/padstack_instance.py +1 -1
- pyedb/grpc/database/primitive/polygon.py +1 -1
- pyedb/grpc/database/siwave.py +63 -3
- pyedb/grpc/database/source_excitations.py +307 -40
- pyedb/grpc/database/stackup.py +107 -2
- pyedb/grpc/database/terminal/point_terminal.py +2 -2
- pyedb/grpc/database/terminal/terminal.py +1 -1
- pyedb/grpc/edb.py +134 -81
- pyedb/grpc/edb_init.py +50 -3
- {pyedb-0.50.1.dist-info → pyedb-0.51.2.dist-info}/METADATA +1 -1
- {pyedb-0.50.1.dist-info → pyedb-0.51.2.dist-info}/RECORD +31 -31
- {pyedb-0.50.1.dist-info → pyedb-0.51.2.dist-info}/LICENSE +0 -0
- {pyedb-0.50.1.dist-info → pyedb-0.51.2.dist-info}/WHEEL +0 -0
pyedb/grpc/database/stackup.py
CHANGED
|
@@ -94,7 +94,14 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
94
94
|
self._pedb = pedb
|
|
95
95
|
|
|
96
96
|
def update_layout(self):
|
|
97
|
-
"""Update the layout with the current layer collection.
|
|
97
|
+
"""Update the layout with the current layer collection.
|
|
98
|
+
|
|
99
|
+
Examples
|
|
100
|
+
--------
|
|
101
|
+
>>> from pyedb import Edb
|
|
102
|
+
>>> edb = Edb()
|
|
103
|
+
>>> edb.stackup.update_layout()
|
|
104
|
+
"""
|
|
98
105
|
self._pedb.layout.layer_collection = self
|
|
99
106
|
|
|
100
107
|
def add_layer_top(self, name, layer_type="signal", **kwargs):
|
|
@@ -115,6 +122,13 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
115
122
|
-------
|
|
116
123
|
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
117
124
|
Layer object created.
|
|
125
|
+
|
|
126
|
+
Examples
|
|
127
|
+
--------
|
|
128
|
+
>>> from pyedb import Edb
|
|
129
|
+
>>> edb = Edb()
|
|
130
|
+
>>> top_layer = edb.stackup.add_layer_top("NewTopLayer", layer_type="signal", thickness="0.1mm",
|
|
131
|
+
... material="copper")
|
|
118
132
|
"""
|
|
119
133
|
thickness = GrpcValue(0.0)
|
|
120
134
|
if "thickness" in kwargs:
|
|
@@ -147,6 +161,13 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
147
161
|
-------
|
|
148
162
|
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
149
163
|
Layer object created.
|
|
164
|
+
|
|
165
|
+
Examples
|
|
166
|
+
--------
|
|
167
|
+
>>> from pyedb import Edb
|
|
168
|
+
>>> edb = Edb()
|
|
169
|
+
>>> bot_layer = edb.stackup.add_layer_bottom("NewBottomLayer", layer_type="signal", thickness="0.1mm",
|
|
170
|
+
... material="copper")
|
|
150
171
|
"""
|
|
151
172
|
thickness = GrpcValue(0.0)
|
|
152
173
|
layer_type_map = {"dielectric": GrpcLayerType.DIELECTRIC_LAYER, "signal": GrpcLayerType.SIGNAL_LAYER}
|
|
@@ -188,6 +209,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
188
209
|
-------
|
|
189
210
|
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
190
211
|
Layer object created.
|
|
212
|
+
|
|
213
|
+
Examples
|
|
214
|
+
--------
|
|
215
|
+
>>> from pyedb import Edb
|
|
216
|
+
>>> edb = Edb()
|
|
217
|
+
>>> new_layer = edb.stackup.add_layer_below("NewLayer", "TopLayer", layer_type="dielectric", thickness="0.05mm")
|
|
191
218
|
"""
|
|
192
219
|
thickness = GrpcValue(0.0)
|
|
193
220
|
if "thickness" in kwargs:
|
|
@@ -229,6 +256,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
229
256
|
-------
|
|
230
257
|
:class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`
|
|
231
258
|
Layer object created.
|
|
259
|
+
|
|
260
|
+
Examples
|
|
261
|
+
--------
|
|
262
|
+
>>> from pyedb import Edb
|
|
263
|
+
>>> edb = Edb()
|
|
264
|
+
>>> new_layer = edb.stackup.add_layer_above("NewLayer", "BottomLayer", layer_type="signal", thickness="0.05mm")
|
|
232
265
|
"""
|
|
233
266
|
thickness = GrpcValue(0.0)
|
|
234
267
|
if "thickness" in kwargs:
|
|
@@ -258,6 +291,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
258
291
|
-------
|
|
259
292
|
:class:`pyedb.grpc.database.layers.layer.Layer`
|
|
260
293
|
Layer object created.
|
|
294
|
+
|
|
295
|
+
Examples
|
|
296
|
+
--------
|
|
297
|
+
>>> from pyedb import Edb
|
|
298
|
+
>>> edb = Edb()
|
|
299
|
+
>>> outline_layer = edb.stackup.add_document_layer("Outline", layer_type="outline")
|
|
261
300
|
"""
|
|
262
301
|
added_layer = self.add_layer_top(name)
|
|
263
302
|
added_layer.type = GrpcLayerType.USER_LAYER
|
|
@@ -286,6 +325,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
286
325
|
-------
|
|
287
326
|
dict[str, :class:`pyedb.grpc.database.layers.layer.Layer`]
|
|
288
327
|
Dictionary of non-stackup layers.
|
|
328
|
+
|
|
329
|
+
Examples
|
|
330
|
+
--------
|
|
331
|
+
>>> from pyedb import Edb
|
|
332
|
+
>>> edb = Edb()
|
|
333
|
+
>>> non_stackup = edb.stackup.non_stackup_layers
|
|
289
334
|
"""
|
|
290
335
|
return {
|
|
291
336
|
layer.name: Layer(self._pedb, layer) for layer in self.get_layers(GrpcLayerTypeSet.NON_STACKUP_LAYER_SET)
|
|
@@ -299,6 +344,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
299
344
|
-------
|
|
300
345
|
dict[str, :class:`pyedb.grpc.database.layers.layer.Layer`]
|
|
301
346
|
Dictionary of all layers.
|
|
347
|
+
|
|
348
|
+
Examples
|
|
349
|
+
--------
|
|
350
|
+
>>> from pyedb import Edb
|
|
351
|
+
>>> edb = Edb()
|
|
352
|
+
>>> all_layers = edb.stackup.all_layers
|
|
302
353
|
"""
|
|
303
354
|
return {layer.name: Layer(self._pedb, layer) for layer in self.get_layers(GrpcLayerTypeSet.ALL_LAYER_SET)}
|
|
304
355
|
|
|
@@ -310,6 +361,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
310
361
|
-------
|
|
311
362
|
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
312
363
|
Dictionary of signal layers.
|
|
364
|
+
|
|
365
|
+
Examples
|
|
366
|
+
--------
|
|
367
|
+
>>> from pyedb import Edb
|
|
368
|
+
>>> edb = Edb()
|
|
369
|
+
>>> signal_layers = edb.stackup.signal_layers
|
|
313
370
|
"""
|
|
314
371
|
return {
|
|
315
372
|
layer.name: StackupLayer(self._pedb, layer) for layer in self.get_layers(GrpcLayerTypeSet.SIGNAL_LAYER_SET)
|
|
@@ -323,6 +380,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
323
380
|
-------
|
|
324
381
|
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
325
382
|
Dictionary of dielectric layers.
|
|
383
|
+
|
|
384
|
+
Examples
|
|
385
|
+
--------
|
|
386
|
+
>>> from pyedb import Edb
|
|
387
|
+
>>> edb = Edb()
|
|
388
|
+
>>> dielectric_layers = edb.stackup.dielectric_layers
|
|
326
389
|
"""
|
|
327
390
|
return {
|
|
328
391
|
layer.name: StackupLayer(self._pedb, layer)
|
|
@@ -337,6 +400,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
337
400
|
-------
|
|
338
401
|
list[list[int, str]]
|
|
339
402
|
List of layers with their IDs and names.
|
|
403
|
+
|
|
404
|
+
Examples
|
|
405
|
+
--------
|
|
406
|
+
>>> from pyedb import Edb
|
|
407
|
+
>>> edb = Edb()
|
|
408
|
+
>>> layers_by_id = edb.stackup.layers_by_id
|
|
340
409
|
"""
|
|
341
410
|
return [[obj.id, name] for name, obj in self.all_layers.items()]
|
|
342
411
|
|
|
@@ -348,6 +417,12 @@ class LayerCollection(GrpcLayerCollection):
|
|
|
348
417
|
-------
|
|
349
418
|
dict[str, :class:`pyedb.grpc.database.layers.stackup_layer.StackupLayer`]
|
|
350
419
|
Dictionary of stackup layers.
|
|
420
|
+
|
|
421
|
+
Examples
|
|
422
|
+
--------
|
|
423
|
+
>>> from pyedb import Edb
|
|
424
|
+
>>> edb = Edb()
|
|
425
|
+
>>> layers = edb.stackup.layers
|
|
351
426
|
"""
|
|
352
427
|
return {obj.name: StackupLayer(self._pedb, obj) for obj in self.get_layers(GrpcLayerTypeSet.STACKUP_LAYER_SET)}
|
|
353
428
|
|
|
@@ -418,6 +493,12 @@ class Stackup(LayerCollection):
|
|
|
418
493
|
-------
|
|
419
494
|
float
|
|
420
495
|
Stackup thickness.
|
|
496
|
+
|
|
497
|
+
Examples
|
|
498
|
+
--------
|
|
499
|
+
>>> from pyedb import Edb
|
|
500
|
+
>>> edb = Edb()
|
|
501
|
+
>>> thickness = edb.stackup.thickness
|
|
421
502
|
"""
|
|
422
503
|
return self.get_layout_thickness()
|
|
423
504
|
|
|
@@ -429,6 +510,12 @@ class Stackup(LayerCollection):
|
|
|
429
510
|
-------
|
|
430
511
|
int
|
|
431
512
|
Number of layers.
|
|
513
|
+
|
|
514
|
+
Examples
|
|
515
|
+
--------
|
|
516
|
+
>>> from pyedb import Edb
|
|
517
|
+
>>> edb = Edb()
|
|
518
|
+
>>> num_layers = edb.stackup.num_layers
|
|
432
519
|
"""
|
|
433
520
|
return len(list(self.layers.keys()))
|
|
434
521
|
|
|
@@ -441,7 +528,7 @@ class Stackup(LayerCollection):
|
|
|
441
528
|
dielectric_material="FR4_epoxy",
|
|
442
529
|
soldermask=True,
|
|
443
530
|
soldermask_thickness="20um",
|
|
444
|
-
): # pragma: no cover
|
|
531
|
+
) -> bool: # pragma: no cover
|
|
445
532
|
"""Create a symmetric stackup.
|
|
446
533
|
|
|
447
534
|
Parameters
|
|
@@ -465,6 +552,12 @@ class Stackup(LayerCollection):
|
|
|
465
552
|
-------
|
|
466
553
|
bool
|
|
467
554
|
``True`` when successful, ``False`` when failed.
|
|
555
|
+
|
|
556
|
+
Examples
|
|
557
|
+
--------
|
|
558
|
+
>>> from pyedb import Edb
|
|
559
|
+
>>> edb = Edb()
|
|
560
|
+
>>> edb.stackup.create_symmetric_stackup(layer_count=4)
|
|
468
561
|
"""
|
|
469
562
|
if not np:
|
|
470
563
|
self._pedb.logger.error("Numpy is needed. Please, install it first.")
|
|
@@ -566,6 +659,12 @@ class Stackup(LayerCollection):
|
|
|
566
659
|
- ``"laminate"``
|
|
567
660
|
- ``"overlapping"``
|
|
568
661
|
- ``"multizone"``
|
|
662
|
+
|
|
663
|
+
Examples
|
|
664
|
+
--------
|
|
665
|
+
>>> from pyedb import Edb
|
|
666
|
+
>>> edb = Edb()
|
|
667
|
+
>>> mode = edb.stackup.mode
|
|
569
668
|
"""
|
|
570
669
|
return super().mode.name.lower()
|
|
571
670
|
|
|
@@ -699,6 +798,12 @@ class Stackup(LayerCollection):
|
|
|
699
798
|
-------
|
|
700
799
|
bool
|
|
701
800
|
``True`` when successful.
|
|
801
|
+
|
|
802
|
+
Examples
|
|
803
|
+
--------
|
|
804
|
+
>>> from pyedb import Edb
|
|
805
|
+
>>> edb = Edb()
|
|
806
|
+
>>> edb.stackup.add_outline_layer()
|
|
702
807
|
"""
|
|
703
808
|
return self.add_document_layer(name="Outline", layer_type="outline")
|
|
704
809
|
|
|
@@ -69,7 +69,7 @@ class PointTerminal(GrpcPointTerminal):
|
|
|
69
69
|
super(PointTerminal, self.__class__).layer.__set__(self, value)
|
|
70
70
|
|
|
71
71
|
@property
|
|
72
|
-
def ref_terminal(self) ->
|
|
72
|
+
def ref_terminal(self) -> any:
|
|
73
73
|
"""Reference terminal.
|
|
74
74
|
|
|
75
75
|
Returns
|
|
@@ -84,7 +84,7 @@ class PointTerminal(GrpcPointTerminal):
|
|
|
84
84
|
super().reference_terminal = value
|
|
85
85
|
|
|
86
86
|
@property
|
|
87
|
-
def reference_terminal(self) ->
|
|
87
|
+
def reference_terminal(self) -> any:
|
|
88
88
|
"""Reference terminal.
|
|
89
89
|
|
|
90
90
|
Returns
|
pyedb/grpc/edb.py
CHANGED
|
@@ -378,23 +378,6 @@ class Edb(EdbInit):
|
|
|
378
378
|
except:
|
|
379
379
|
self.logger.info(f"Failed to delete AEDT project-related file {file}.")
|
|
380
380
|
|
|
381
|
-
def _clean_variables(self):
|
|
382
|
-
"""Initialize internal variables and perform garbage collection."""
|
|
383
|
-
self.grpc = True
|
|
384
|
-
self._materials = None
|
|
385
|
-
self._components = None
|
|
386
|
-
self._core_primitives = None
|
|
387
|
-
self._stackup = None
|
|
388
|
-
self._padstack = None
|
|
389
|
-
self._siwave = None
|
|
390
|
-
self._hfss = None
|
|
391
|
-
self._nets = None
|
|
392
|
-
self._layout_instance = None
|
|
393
|
-
self._variables = None
|
|
394
|
-
self._active_cell = None
|
|
395
|
-
self._layout = None
|
|
396
|
-
self._configuration = None
|
|
397
|
-
|
|
398
381
|
def _init_objects(self):
|
|
399
382
|
self._components = Components(self)
|
|
400
383
|
self._stackup = Stackup(self, self.layout.layer_collection)
|
|
@@ -579,19 +562,24 @@ class Edb(EdbInit):
|
|
|
579
562
|
terms = [term for term in self.layout.terminals if term.boundary_type.value == 8]
|
|
580
563
|
return {ter.name: ter for ter in terms}
|
|
581
564
|
|
|
582
|
-
def
|
|
565
|
+
def open(self, restart_rpc_server=False) -> bool:
|
|
583
566
|
"""Open EDB database.
|
|
584
567
|
|
|
585
568
|
Returns
|
|
586
569
|
-------
|
|
587
570
|
bool
|
|
588
571
|
True if successful, False otherwise.
|
|
572
|
+
|
|
573
|
+
Examples
|
|
574
|
+
--------
|
|
575
|
+
Open an existing EDB database:
|
|
576
|
+
>>> edb = Edb("myproject.aedb")
|
|
589
577
|
"""
|
|
590
578
|
self.standalone = self.standalone
|
|
591
579
|
n_try = 10
|
|
592
580
|
while not self.db and n_try:
|
|
593
581
|
try:
|
|
594
|
-
self.
|
|
582
|
+
self._open(
|
|
595
583
|
self.edbpath,
|
|
596
584
|
self.isreadonly,
|
|
597
585
|
restart_rpc_server=restart_rpc_server,
|
|
@@ -621,7 +609,21 @@ class Edb(EdbInit):
|
|
|
621
609
|
self.logger.error("Builder was not initialized.")
|
|
622
610
|
return True
|
|
623
611
|
|
|
624
|
-
def
|
|
612
|
+
def open_edb(self, restart_rpc_server=False) -> bool:
|
|
613
|
+
"""Open EDB database.
|
|
614
|
+
|
|
615
|
+
.. deprecated:: 0.50.1
|
|
616
|
+
Use :func:`open` instead.
|
|
617
|
+
|
|
618
|
+
Returns
|
|
619
|
+
-------
|
|
620
|
+
bool
|
|
621
|
+
True if successful, False otherwise.
|
|
622
|
+
"""
|
|
623
|
+
warnings.warn("`open_edb` is deprecated use `open` instead.", DeprecationWarning)
|
|
624
|
+
return self.open(restart_rpc_server)
|
|
625
|
+
|
|
626
|
+
def create(self, restart_rpc_server=False) -> any:
|
|
625
627
|
"""Create new EDB database.
|
|
626
628
|
|
|
627
629
|
Returns
|
|
@@ -636,7 +638,7 @@ class Edb(EdbInit):
|
|
|
636
638
|
n_try = 10
|
|
637
639
|
while not self.db and n_try:
|
|
638
640
|
try:
|
|
639
|
-
self.
|
|
641
|
+
self._create(self.edbpath, restart_rpc_server=restart_rpc_server)
|
|
640
642
|
n_try -= 1
|
|
641
643
|
except Exception as e:
|
|
642
644
|
self.logger.error(e.args[0])
|
|
@@ -651,9 +653,22 @@ class Edb(EdbInit):
|
|
|
651
653
|
)
|
|
652
654
|
if self._active_cell:
|
|
653
655
|
self._init_objects()
|
|
654
|
-
return
|
|
656
|
+
return self
|
|
655
657
|
return None
|
|
656
658
|
|
|
659
|
+
def create_edb(self, restart_rpc_server=False) -> bool:
|
|
660
|
+
"""
|
|
661
|
+
.. deprecated:: 0.50.1
|
|
662
|
+
Use :func:`create` instead.
|
|
663
|
+
|
|
664
|
+
Returns
|
|
665
|
+
-------
|
|
666
|
+
bool
|
|
667
|
+
True if successful, False otherwise.
|
|
668
|
+
"""
|
|
669
|
+
warnings.warn("`create_edb` is deprecated use `create` instead.", DeprecationWarning)
|
|
670
|
+
return self.create(restart_rpc_server)
|
|
671
|
+
|
|
657
672
|
def import_layout_pcb(
|
|
658
673
|
self,
|
|
659
674
|
input_file,
|
|
@@ -746,6 +761,13 @@ class Edb(EdbInit):
|
|
|
746
761
|
-------
|
|
747
762
|
Full path to the AEDB file : str
|
|
748
763
|
|
|
764
|
+
Examples
|
|
765
|
+
--------
|
|
766
|
+
Import a BRD file:
|
|
767
|
+
>>> edb.import_layout_file("my_board.brd", r"C:/project")
|
|
768
|
+
|
|
769
|
+
Import a GDS file with control file:
|
|
770
|
+
>>> edb.import_layout_file("layout.gds", control_file="control.xml")
|
|
749
771
|
"""
|
|
750
772
|
self._components = None
|
|
751
773
|
self._core_primitives = None
|
|
@@ -806,6 +828,11 @@ class Edb(EdbInit):
|
|
|
806
828
|
-------
|
|
807
829
|
str or bool
|
|
808
830
|
Output file path if successful, False otherwise.
|
|
831
|
+
|
|
832
|
+
Examples
|
|
833
|
+
--------
|
|
834
|
+
Export to IPC2581 format:
|
|
835
|
+
>>> edb.export_to_ipc2581("output.xml")
|
|
809
836
|
"""
|
|
810
837
|
if units.lower() not in ["millimeter", "inch", "micron"]: # pragma no cover
|
|
811
838
|
self.logger.warning("The wrong unit is entered. Setting to the default, millimeter.")
|
|
@@ -1182,18 +1209,6 @@ class Edb(EdbInit):
|
|
|
1182
1209
|
else:
|
|
1183
1210
|
return PointData(x, y)
|
|
1184
1211
|
|
|
1185
|
-
@staticmethod
|
|
1186
|
-
def _is_file_existing_and_released(filename) -> bool:
|
|
1187
|
-
if os.path.exists(filename):
|
|
1188
|
-
try:
|
|
1189
|
-
os.rename(filename, filename + "_")
|
|
1190
|
-
os.rename(filename + "_", filename)
|
|
1191
|
-
return True
|
|
1192
|
-
except OSError as e:
|
|
1193
|
-
return False
|
|
1194
|
-
else:
|
|
1195
|
-
return False
|
|
1196
|
-
|
|
1197
1212
|
@staticmethod
|
|
1198
1213
|
def _is_file_existing(filename) -> bool:
|
|
1199
1214
|
if os.path.exists(filename):
|
|
@@ -1201,18 +1216,6 @@ class Edb(EdbInit):
|
|
|
1201
1216
|
else:
|
|
1202
1217
|
return False
|
|
1203
1218
|
|
|
1204
|
-
def _wait_for_file_release(self, timeout=30, file_to_release=None) -> bool:
|
|
1205
|
-
if not file_to_release:
|
|
1206
|
-
file_to_release = os.path.join(self.edbpath)
|
|
1207
|
-
tstart = time.time()
|
|
1208
|
-
while True:
|
|
1209
|
-
if self._is_file_existing_and_released(file_to_release):
|
|
1210
|
-
return True
|
|
1211
|
-
elif time.time() - tstart > timeout:
|
|
1212
|
-
return False
|
|
1213
|
-
else:
|
|
1214
|
-
time.sleep(0.250)
|
|
1215
|
-
|
|
1216
1219
|
def _wait_for_file_exists(self, timeout=30, file_to_release=None, wait_count=4):
|
|
1217
1220
|
if not file_to_release:
|
|
1218
1221
|
file_to_release = os.path.join(self.edbpath)
|
|
@@ -1234,37 +1237,47 @@ class Edb(EdbInit):
|
|
|
1234
1237
|
def close_edb(self) -> bool:
|
|
1235
1238
|
"""Close EDB and clean up resources.
|
|
1236
1239
|
|
|
1240
|
+
..deprecated:: 0.51.0
|
|
1241
|
+
Use: func:`close` instead.
|
|
1242
|
+
|
|
1237
1243
|
Returns
|
|
1238
1244
|
-------
|
|
1239
1245
|
bool
|
|
1240
1246
|
True if successful, False otherwise.
|
|
1247
|
+
|
|
1248
|
+
Examples
|
|
1249
|
+
--------
|
|
1250
|
+
Close the EDB session:
|
|
1251
|
+
>>> edb.close_edb()
|
|
1241
1252
|
"""
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
self._wait_for_file_release()
|
|
1245
|
-
elapsed_time = time.time() - start_time
|
|
1246
|
-
self.logger.info("EDB file release time: {0:.2f}ms".format(elapsed_time * 1000.0))
|
|
1247
|
-
self._clean_variables()
|
|
1248
|
-
return True
|
|
1253
|
+
warnings.warn("Use method close instead.", DeprecationWarning)
|
|
1254
|
+
return self.close()
|
|
1249
1255
|
|
|
1250
1256
|
def save_edb(self) -> bool:
|
|
1251
1257
|
"""Save current EDB database.
|
|
1252
1258
|
|
|
1259
|
+
..deprecated:: 0.51.0
|
|
1260
|
+
Use: func:`save` instead.
|
|
1261
|
+
|
|
1253
1262
|
Returns
|
|
1254
1263
|
-------
|
|
1255
1264
|
bool
|
|
1256
1265
|
True if successful, False otherwise.
|
|
1266
|
+
|
|
1267
|
+
Examples
|
|
1268
|
+
--------
|
|
1269
|
+
Save the current EDB:
|
|
1270
|
+
>>> edb.save_edb()
|
|
1257
1271
|
"""
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
self._wait_for_file_release()
|
|
1261
|
-
elapsed_time = time.time() - start_time
|
|
1262
|
-
self.logger.info("EDB file save time: {0:.2f}ms".format(elapsed_time * 1000.0))
|
|
1263
|
-
return True
|
|
1272
|
+
warnings.warn("Use method save instead.", DeprecationWarning)
|
|
1273
|
+
return self.save()
|
|
1264
1274
|
|
|
1265
1275
|
def save_edb_as(self, fname) -> bool:
|
|
1266
1276
|
"""Save EDB database to new location.
|
|
1267
1277
|
|
|
1278
|
+
..deprecated:: 0.51.0
|
|
1279
|
+
Use: func:`save_as` instead.
|
|
1280
|
+
|
|
1268
1281
|
Parameters
|
|
1269
1282
|
----------
|
|
1270
1283
|
fname : str
|
|
@@ -1274,17 +1287,14 @@ class Edb(EdbInit):
|
|
|
1274
1287
|
-------
|
|
1275
1288
|
bool
|
|
1276
1289
|
True if successful, False otherwise.
|
|
1290
|
+
|
|
1291
|
+
Examples
|
|
1292
|
+
--------
|
|
1293
|
+
Save EDB to new location:
|
|
1294
|
+
>>> edb.save_edb_as("new_location.aedb")
|
|
1277
1295
|
"""
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
self._wait_for_file_release()
|
|
1281
|
-
elapsed_time = time.time() - start_time
|
|
1282
|
-
self.logger.info("EDB file save time: {0:.2f}ms".format(elapsed_time * 1000.0))
|
|
1283
|
-
self.edbpath = self.directory
|
|
1284
|
-
self.log_name = os.path.join(
|
|
1285
|
-
os.path.dirname(fname), "pyedb_" + os.path.splitext(os.path.split(fname)[-1])[0] + ".log"
|
|
1286
|
-
)
|
|
1287
|
-
return True
|
|
1296
|
+
warnings.warn("Use method save_as instead.", DeprecationWarning)
|
|
1297
|
+
return self.save_as(fname)
|
|
1288
1298
|
|
|
1289
1299
|
def execute(self, func):
|
|
1290
1300
|
"""Execute EDB utility command (Not implemented in gRPC).
|
|
@@ -1694,6 +1704,15 @@ class Edb(EdbInit):
|
|
|
1694
1704
|
-------
|
|
1695
1705
|
list or bool
|
|
1696
1706
|
Cutout boundary points if successful, False otherwise.
|
|
1707
|
+
|
|
1708
|
+
Examples
|
|
1709
|
+
--------
|
|
1710
|
+
Create a basic cutout:
|
|
1711
|
+
>>> edb.cutout(signal_list=["Net1"], reference_list=["GND"])
|
|
1712
|
+
|
|
1713
|
+
Create cutout with custom polygon:
|
|
1714
|
+
>>> custom_poly = [[0,0], [10e-3,0], [10e-3,10e-3], [0,10e-3]]
|
|
1715
|
+
>>> edb.cutout(custom_extent=custom_poly)
|
|
1697
1716
|
"""
|
|
1698
1717
|
if expansion_factor > 0:
|
|
1699
1718
|
expansion_size = self.calculate_initial_extent(expansion_factor)
|
|
@@ -1770,7 +1789,7 @@ class Edb(EdbInit):
|
|
|
1770
1789
|
break
|
|
1771
1790
|
self.close_edb()
|
|
1772
1791
|
self.edbpath = legacy_path
|
|
1773
|
-
self.
|
|
1792
|
+
self.open()
|
|
1774
1793
|
i += 1
|
|
1775
1794
|
expansion = expansion_size * i
|
|
1776
1795
|
if working_cutout:
|
|
@@ -1856,15 +1875,15 @@ class Edb(EdbInit):
|
|
|
1856
1875
|
# _cutout.simulation_setups = self.active_cell.simulation_setups see bug #433 status.
|
|
1857
1876
|
_dbCells = [_cutout]
|
|
1858
1877
|
if output_aedb_path:
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1878
|
+
from ansys.edb.core.database import Database as GrpcDatabase
|
|
1879
|
+
|
|
1880
|
+
db2 = GrpcDatabase.create(output_aedb_path)
|
|
1862
1881
|
db2.copy_cells(_dbCells) # Copies cutout cell/design to db2 project
|
|
1863
|
-
if len(list(db2.
|
|
1864
|
-
for net in db2.
|
|
1882
|
+
if len(list(db2.top_circuit_cells)) > 0:
|
|
1883
|
+
for net in db2.top_circuit_cells[0].layout.nets:
|
|
1865
1884
|
if not net.name in included_nets_list:
|
|
1866
1885
|
net.delete()
|
|
1867
|
-
|
|
1886
|
+
db2.save()
|
|
1868
1887
|
for c in self.active_db.top_circuit_cells:
|
|
1869
1888
|
if c.name == _cutout.name:
|
|
1870
1889
|
c.delete()
|
|
@@ -1890,7 +1909,7 @@ class Edb(EdbInit):
|
|
|
1890
1909
|
for _cmp in _cmps:
|
|
1891
1910
|
_cmp.delete()
|
|
1892
1911
|
except:
|
|
1893
|
-
self.
|
|
1912
|
+
self.logger.error("Failed to remove single pin components.")
|
|
1894
1913
|
db2.close()
|
|
1895
1914
|
source = os.path.join(output_aedb_path, "edb.def.tmp")
|
|
1896
1915
|
target = os.path.join(output_aedb_path, "edb.def")
|
|
@@ -2342,7 +2361,9 @@ class Edb(EdbInit):
|
|
|
2342
2361
|
|
|
2343
2362
|
_dbCells = [_cutout]
|
|
2344
2363
|
if output_aedb_path:
|
|
2345
|
-
|
|
2364
|
+
from ansys.edb.core.database import Database as GrpcDatabase
|
|
2365
|
+
|
|
2366
|
+
db2 = GrpcDatabase.create(output_aedb_path)
|
|
2346
2367
|
db2.save()
|
|
2347
2368
|
cell_copied = db2.copy_cells(_dbCells) # Copies cutout cell/design to db2 project
|
|
2348
2369
|
cell = cell_copied[0]
|
|
@@ -2352,7 +2373,7 @@ class Edb(EdbInit):
|
|
|
2352
2373
|
if c.name == _cutout.name:
|
|
2353
2374
|
c.delete()
|
|
2354
2375
|
if open_cutout_at_end: # pragma: no cover
|
|
2355
|
-
|
|
2376
|
+
db2.save()
|
|
2356
2377
|
self._db = db2
|
|
2357
2378
|
self.edbpath = output_aedb_path
|
|
2358
2379
|
self._active_cell = cell
|
|
@@ -2436,6 +2457,11 @@ class Edb(EdbInit):
|
|
|
2436
2457
|
-------
|
|
2437
2458
|
str
|
|
2438
2459
|
Path to generated AEDT file.
|
|
2460
|
+
|
|
2461
|
+
Examples
|
|
2462
|
+
--------
|
|
2463
|
+
Export to HFSS project:
|
|
2464
|
+
>>> edb.export_hfss(r"C:/output", net_list=["SignalNet"])
|
|
2439
2465
|
"""
|
|
2440
2466
|
siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
|
|
2441
2467
|
return siwave_s.export_3d_cad("HFSS", path_to_output, net_list, num_cores, aedt_file_name, hidden=hidden)
|
|
@@ -2467,6 +2493,11 @@ class Edb(EdbInit):
|
|
|
2467
2493
|
-------
|
|
2468
2494
|
str
|
|
2469
2495
|
Path to generated AEDT file.
|
|
2496
|
+
|
|
2497
|
+
Examples
|
|
2498
|
+
--------
|
|
2499
|
+
Export to Q3D project:
|
|
2500
|
+
>>> edb.export_q3d(r"C:/output")
|
|
2470
2501
|
"""
|
|
2471
2502
|
siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
|
|
2472
2503
|
return siwave_s.export_3d_cad(
|
|
@@ -2505,6 +2536,11 @@ class Edb(EdbInit):
|
|
|
2505
2536
|
-------
|
|
2506
2537
|
str
|
|
2507
2538
|
Path to generated AEDT file.
|
|
2539
|
+
|
|
2540
|
+
Examples
|
|
2541
|
+
--------
|
|
2542
|
+
Export to Maxwell project:
|
|
2543
|
+
>>> edb.export_maxwell(r"C:/output")
|
|
2508
2544
|
"""
|
|
2509
2545
|
siwave_s = SiwaveSolve(self.edbpath, aedt_installer_path=self.base_path)
|
|
2510
2546
|
return siwave_s.export_3d_cad(
|
|
@@ -2523,6 +2559,11 @@ class Edb(EdbInit):
|
|
|
2523
2559
|
-------
|
|
2524
2560
|
str
|
|
2525
2561
|
Path to SIwave project.
|
|
2562
|
+
|
|
2563
|
+
Examples
|
|
2564
|
+
--------
|
|
2565
|
+
Solve with SIwave:
|
|
2566
|
+
>>> edb.solve_siwave()
|
|
2526
2567
|
"""
|
|
2527
2568
|
process = SiwaveSolve(self.edbpath, aedt_version=self.edbversion)
|
|
2528
2569
|
try:
|
|
@@ -2761,7 +2802,10 @@ class Edb(EdbInit):
|
|
|
2761
2802
|
return True
|
|
2762
2803
|
self.logger.reset_timer()
|
|
2763
2804
|
if not common_reference:
|
|
2764
|
-
|
|
2805
|
+
ref_terminals = [term for term in all_sources if term.is_reference_terminal]
|
|
2806
|
+
common_reference = list(
|
|
2807
|
+
set([i.reference_terminal.net.name for i in all_sources if i.is_reference_terminal])
|
|
2808
|
+
)
|
|
2765
2809
|
if len(common_reference) > 1:
|
|
2766
2810
|
self.logger.error("More than 1 reference found.")
|
|
2767
2811
|
return False
|
|
@@ -3036,7 +3080,7 @@ class Edb(EdbInit):
|
|
|
3036
3080
|
for port in self.excitations.values():
|
|
3037
3081
|
nets.append(port.net.name)
|
|
3038
3082
|
for port in self.sources.values():
|
|
3039
|
-
nets.append(port.
|
|
3083
|
+
nets.append(port.net.name)
|
|
3040
3084
|
nets = list(set(nets))
|
|
3041
3085
|
max_width = 0
|
|
3042
3086
|
for net in nets:
|
|
@@ -3438,6 +3482,15 @@ class Edb(EdbInit):
|
|
|
3438
3482
|
-------
|
|
3439
3483
|
list[str]
|
|
3440
3484
|
Created parameter names.
|
|
3485
|
+
|
|
3486
|
+
Examples
|
|
3487
|
+
--------
|
|
3488
|
+
Parametrize design elements:
|
|
3489
|
+
>>> params = edb.auto_parametrize_design(
|
|
3490
|
+
... layers=True,
|
|
3491
|
+
... materials=True,
|
|
3492
|
+
... trace_net_filter=["Clock"]
|
|
3493
|
+
... )
|
|
3441
3494
|
"""
|
|
3442
3495
|
edb_original_path = self.edbpath
|
|
3443
3496
|
if output_aedb_path:
|