pyedb 0.19.0__py3-none-any.whl → 0.21.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyedb might be problematic. Click here for more details.
- pyedb/__init__.py +1 -1
- pyedb/dotnet/edb.py +311 -335
- pyedb/dotnet/edb_core/cell/connectable.py +64 -0
- pyedb/dotnet/edb_core/cell/hierarchy/component.py +12 -10
- pyedb/dotnet/edb_core/cell/hierarchy/hierarchy_obj.py +1 -1
- pyedb/dotnet/edb_core/cell/layout.py +253 -105
- pyedb/dotnet/edb_core/cell/layout_obj.py +4 -49
- pyedb/dotnet/edb_core/cell/primitive.py +14 -2
- pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py +1 -1
- pyedb/dotnet/edb_core/cell/terminal/point_terminal.py +1 -1
- pyedb/dotnet/edb_core/cell/terminal/terminal.py +1 -19
- pyedb/dotnet/edb_core/cell/voltage_regulator.py +2 -16
- pyedb/dotnet/edb_core/components.py +14 -13
- pyedb/dotnet/edb_core/dotnet/database.py +5 -10
- pyedb/dotnet/edb_core/dotnet/primitive.py +11 -1
- pyedb/dotnet/edb_core/edb_data/control_file.py +2 -12
- pyedb/dotnet/edb_core/edb_data/padstacks_data.py +20 -33
- pyedb/dotnet/edb_core/general.py +6 -9
- pyedb/dotnet/edb_core/hfss.py +4 -8
- pyedb/dotnet/edb_core/layout_obj_instance.py +30 -0
- pyedb/dotnet/edb_core/materials.py +4 -11
- pyedb/dotnet/edb_core/{layout.py → modeler.py} +153 -7
- pyedb/dotnet/edb_core/net_class.py +7 -8
- pyedb/dotnet/edb_core/nets.py +3 -9
- pyedb/dotnet/edb_core/padstack.py +13 -9
- pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +5 -2
- pyedb/dotnet/edb_core/siwave.py +5 -6
- pyedb/dotnet/edb_core/stackup.py +18 -23
- pyedb/dotnet/edb_core/utilities/simulation_setup.py +1 -4
- pyedb/generic/filesystem.py +2 -8
- pyedb/generic/general_methods.py +4 -10
- pyedb/generic/plot.py +26 -29
- pyedb/generic/process.py +2 -6
- pyedb/misc/downloads.py +3 -40
- pyedb/siwave.py +2 -5
- {pyedb-0.19.0.dist-info → pyedb-0.21.0.dist-info}/METADATA +2 -2
- {pyedb-0.19.0.dist-info → pyedb-0.21.0.dist-info}/RECORD +39 -38
- pyedb/dotnet/edb_core/dotnet/layout.py +0 -260
- {pyedb-0.19.0.dist-info → pyedb-0.21.0.dist-info}/LICENSE +0 -0
- {pyedb-0.19.0.dist-info → pyedb-0.21.0.dist-info}/WHEEL +0 -0
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
|
-
from pyedb.dotnet.edb_core.cell.
|
|
23
|
+
from pyedb.dotnet.edb_core.cell.connectable import Connectable
|
|
24
24
|
from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstackInstance
|
|
25
25
|
|
|
26
26
|
|
|
@@ -49,7 +49,7 @@ class VoltageRegulator(Connectable):
|
|
|
49
49
|
if value not in self._pedb.components.instances:
|
|
50
50
|
self._pedb.logger.error(f"component {value} not found in layout")
|
|
51
51
|
return
|
|
52
|
-
self._edb_object.SetGroup(self._pedb.components.instances[value].
|
|
52
|
+
self._edb_object.SetGroup(self._pedb.components.instances[value]._edb_object)
|
|
53
53
|
|
|
54
54
|
@property
|
|
55
55
|
def load_regulator_current(self):
|
|
@@ -71,16 +71,6 @@ class VoltageRegulator(Connectable):
|
|
|
71
71
|
_value = self._edb_object.edb_value(value)
|
|
72
72
|
self._edb_object.SetLoadRegulationPercent(_value)
|
|
73
73
|
|
|
74
|
-
@property
|
|
75
|
-
def name(self):
|
|
76
|
-
"""Retrieve voltage regulator name."""
|
|
77
|
-
return self._edb_object.GetName()
|
|
78
|
-
|
|
79
|
-
@name.setter
|
|
80
|
-
def name(self, value):
|
|
81
|
-
if isinstance(value, str):
|
|
82
|
-
self._edb_object.SetName(value)
|
|
83
|
-
|
|
84
74
|
@property
|
|
85
75
|
def negative_remote_sense_pin(self):
|
|
86
76
|
"""Retrieve negative remote sense pin."""
|
|
@@ -137,7 +127,3 @@ class VoltageRegulator(Connectable):
|
|
|
137
127
|
def is_active(self, value):
|
|
138
128
|
if isinstance(value, bool):
|
|
139
129
|
self._edb_object.SetIsActive(value)
|
|
140
|
-
|
|
141
|
-
@property
|
|
142
|
-
def is_null(self):
|
|
143
|
-
return self._edb_object.IsNull()
|
|
@@ -305,11 +305,10 @@ class Components(object):
|
|
|
305
305
|
def refresh_components(self):
|
|
306
306
|
"""Refresh the component dictionary."""
|
|
307
307
|
# self._logger.info("Refreshing the Components dictionary.")
|
|
308
|
-
self._cmp = {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
308
|
+
self._cmp = {}
|
|
309
|
+
for i in self._pedb.layout.groups:
|
|
310
|
+
if i.group_type == "component":
|
|
311
|
+
self._cmp[i.name] = i
|
|
313
312
|
return True
|
|
314
313
|
|
|
315
314
|
@property
|
|
@@ -487,11 +486,7 @@ class Components(object):
|
|
|
487
486
|
``True`` when successful, ``False`` when failed.
|
|
488
487
|
|
|
489
488
|
"""
|
|
490
|
-
|
|
491
|
-
if edbcmp is not None:
|
|
492
|
-
return edbcmp
|
|
493
|
-
else:
|
|
494
|
-
pass
|
|
489
|
+
return self._pedb.layout.find_component_by_name(name)
|
|
495
490
|
|
|
496
491
|
def get_components_from_nets(self, netlist=None):
|
|
497
492
|
"""Retrieve components from a net list.
|
|
@@ -675,9 +670,11 @@ class Components(object):
|
|
|
675
670
|
positive_pin_group = self.create_pingroup_from_pins(positive_pins)
|
|
676
671
|
if not positive_pin_group: # pragma: no cover
|
|
677
672
|
return False
|
|
673
|
+
positive_pin_group = self._pedb.siwave.pin_groups[positive_pin_group.GetName()]
|
|
678
674
|
negative_pin_group = self.create_pingroup_from_pins(negative_pins)
|
|
679
675
|
if not negative_pin_group: # pragma: no cover
|
|
680
676
|
return False
|
|
677
|
+
negative_pin_group = self._pedb.siwave.pin_groups[negative_pin_group.GetName()]
|
|
681
678
|
if source.source_type == SourceType.Vsource: # pragma: no cover
|
|
682
679
|
positive_pin_group_term = self._create_pin_group_terminal(
|
|
683
680
|
positive_pin_group,
|
|
@@ -848,7 +845,9 @@ class Components(object):
|
|
|
848
845
|
)
|
|
849
846
|
ref_group_name = "group_{}_ref".format(port_name)
|
|
850
847
|
ref_pin_group = self.create_pingroup_from_pins(reference_pins, ref_group_name)
|
|
848
|
+
ref_pin_group = self._pedb.siwave.pin_groups[ref_pin_group.GetName()]
|
|
851
849
|
ref_term = self._create_pin_group_terminal(pingroup=ref_pin_group, term_name=port_name + "_ref")
|
|
850
|
+
|
|
852
851
|
else:
|
|
853
852
|
ref_term = self._create_terminal(reference_pins[0].primitive_object, term_name=port_name + "_ref")
|
|
854
853
|
ref_term.SetIsCircuitPort(True)
|
|
@@ -1031,6 +1030,7 @@ class Components(object):
|
|
|
1031
1030
|
if not ref_pin_group:
|
|
1032
1031
|
self._logger.error(f"Failed to create reference pin group on component {component.GetName()}.")
|
|
1033
1032
|
return False
|
|
1033
|
+
ref_pin_group = self._pedb.siwave.pin_groups[ref_pin_group.GetName()]
|
|
1034
1034
|
ref_pin_group_term = self._create_pin_group_terminal(ref_pin_group, isref=False)
|
|
1035
1035
|
if not ref_pin_group_term:
|
|
1036
1036
|
self._logger.error(
|
|
@@ -1048,6 +1048,7 @@ class Components(object):
|
|
|
1048
1048
|
pin_group = self.create_pingroup_from_pins(pins)
|
|
1049
1049
|
if not pin_group:
|
|
1050
1050
|
return False
|
|
1051
|
+
pin_group = self._pedb.siwave.pin_groups[pin_group.GetName()]
|
|
1051
1052
|
pin_group_term = self._create_pin_group_terminal(pin_group)
|
|
1052
1053
|
if pin_group_term:
|
|
1053
1054
|
pin_group_term.SetReferenceTerminal(ref_pin_group_term)
|
|
@@ -1390,14 +1391,14 @@ class Components(object):
|
|
|
1390
1391
|
-------
|
|
1391
1392
|
Edb pin group terminal.
|
|
1392
1393
|
"""
|
|
1393
|
-
pin = list(pingroup.GetPins())[0]
|
|
1394
|
+
pin = list(pingroup._edb_object.GetPins())[0]
|
|
1394
1395
|
if term_name is None:
|
|
1395
1396
|
term_name = "{}.{}.{}".format(pin.GetComponent().GetName(), pin.GetName(), pin.GetNet().GetName())
|
|
1396
1397
|
for t in list(self._pedb.active_layout.Terminals):
|
|
1397
1398
|
if t.GetName() == term_name:
|
|
1398
1399
|
return t
|
|
1399
1400
|
pingroup_term = self._edb.cell.terminal.PinGroupTerminal.Create(
|
|
1400
|
-
self._active_layout, pingroup.GetNet(), term_name, pingroup, isref
|
|
1401
|
+
self._active_layout, pingroup._edb_object.GetNet(), term_name, pingroup._edb_object, isref
|
|
1401
1402
|
)
|
|
1402
1403
|
if term_type == "circuit":
|
|
1403
1404
|
pingroup_term.SetIsCircuitPort(True)
|
|
@@ -1985,7 +1986,7 @@ class Components(object):
|
|
|
1985
1986
|
|
|
1986
1987
|
"""
|
|
1987
1988
|
if not isinstance(component, self._pedb.edb_api.cell.hierarchy.component):
|
|
1988
|
-
edb_cmp = self.get_component_by_name(component)
|
|
1989
|
+
edb_cmp = self.get_component_by_name(component)._edb_object
|
|
1989
1990
|
cmp = self.instances[component]
|
|
1990
1991
|
else: # pragma: no cover
|
|
1991
1992
|
edb_cmp = component
|
|
@@ -32,7 +32,6 @@ from pyedb.generic.general_methods import (
|
|
|
32
32
|
env_path,
|
|
33
33
|
env_path_student,
|
|
34
34
|
env_value,
|
|
35
|
-
is_ironpython,
|
|
36
35
|
is_linux,
|
|
37
36
|
settings,
|
|
38
37
|
)
|
|
@@ -751,14 +750,10 @@ class EdbDotNet(object):
|
|
|
751
750
|
self.base_path = edb_path
|
|
752
751
|
sys.path.append(edb_path)
|
|
753
752
|
os.environ[env_value(self.edbversion)] = self.base_path
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
else:
|
|
759
|
-
_clr.AddReference("Ansys.Ansoft.Edb")
|
|
760
|
-
_clr.AddReference("Ansys.Ansoft.EdbBuilderUtils")
|
|
761
|
-
_clr.AddReference("Ansys.Ansoft.SimSetupData")
|
|
753
|
+
|
|
754
|
+
_clr.AddReference("Ansys.Ansoft.Edb")
|
|
755
|
+
_clr.AddReference("Ansys.Ansoft.EdbBuilderUtils")
|
|
756
|
+
_clr.AddReference("Ansys.Ansoft.SimSetupData")
|
|
762
757
|
else:
|
|
763
758
|
if settings.edb_dll_path:
|
|
764
759
|
self.base_path = settings.edb_dll_path
|
|
@@ -1234,7 +1229,7 @@ class Database(EdbDotNet):
|
|
|
1234
1229
|
-------
|
|
1235
1230
|
|
|
1236
1231
|
"""
|
|
1237
|
-
from pyedb.
|
|
1232
|
+
from pyedb.dotnet.clr_module import Convert
|
|
1238
1233
|
|
|
1239
1234
|
hdl = Convert.ToUInt64(hdb)
|
|
1240
1235
|
self._db = self.edb_api.database.Attach(hdl)
|
|
@@ -96,7 +96,17 @@ class PrimitiveDotNet:
|
|
|
96
96
|
_, name = self.prim_obj.GetProductProperty(self._app._edb.ProductId.Designer, 1, val)
|
|
97
97
|
name = str(name).strip("'")
|
|
98
98
|
if name == "":
|
|
99
|
-
|
|
99
|
+
if str(self.primitive_type) == "Path":
|
|
100
|
+
ptype = "line"
|
|
101
|
+
elif str(self.primitive_type) == "Rectangle":
|
|
102
|
+
ptype = "rect"
|
|
103
|
+
elif str(self.primitive_type) == "Polygon":
|
|
104
|
+
ptype = "poly"
|
|
105
|
+
elif str(self.primitive_type) == "Bondwire":
|
|
106
|
+
ptype = "bwr"
|
|
107
|
+
else:
|
|
108
|
+
ptype = str(self.primitive_type).lower()
|
|
109
|
+
name = "{}_{}".format(ptype, self.id)
|
|
100
110
|
self.prim_obj.SetProductProperty(self._app._edb.ProductId.Designer, 1, name)
|
|
101
111
|
return name
|
|
102
112
|
|
|
@@ -23,24 +23,14 @@
|
|
|
23
23
|
import copy
|
|
24
24
|
import os
|
|
25
25
|
import re
|
|
26
|
+
import subprocess
|
|
26
27
|
import sys
|
|
27
28
|
|
|
28
29
|
from pyedb.edb_logger import pyedb_logger
|
|
29
|
-
from pyedb.generic.general_methods import
|
|
30
|
-
ET,
|
|
31
|
-
env_path,
|
|
32
|
-
env_value,
|
|
33
|
-
is_ironpython,
|
|
34
|
-
is_linux,
|
|
35
|
-
)
|
|
30
|
+
from pyedb.generic.general_methods import ET, env_path, env_value, is_linux
|
|
36
31
|
from pyedb.misc.aedtlib_personalib_install import write_pretty_xml
|
|
37
32
|
from pyedb.misc.misc import list_installed_ansysem
|
|
38
33
|
|
|
39
|
-
if is_linux and is_ironpython:
|
|
40
|
-
import subprocessdotnet as subprocess
|
|
41
|
-
else:
|
|
42
|
-
import subprocess
|
|
43
|
-
|
|
44
34
|
|
|
45
35
|
def convert_technology_file(tech_file, edbversion=None, control_file=None):
|
|
46
36
|
"""Convert a technology file to edb control file (xml).
|
|
@@ -25,12 +25,12 @@ import math
|
|
|
25
25
|
import re
|
|
26
26
|
import warnings
|
|
27
27
|
|
|
28
|
-
from pyedb.dotnet.clr_module import String
|
|
28
|
+
from pyedb.dotnet.clr_module import String
|
|
29
29
|
from pyedb.dotnet.edb_core.cell.primitive import Primitive
|
|
30
30
|
from pyedb.dotnet.edb_core.dotnet.database import PolygonDataDotNet
|
|
31
31
|
from pyedb.dotnet.edb_core.edb_data.edbvalue import EdbValue
|
|
32
32
|
from pyedb.dotnet.edb_core.general import PadGeometryTpe, convert_py_list_to_net_list
|
|
33
|
-
from pyedb.generic.general_methods import generate_unique_name
|
|
33
|
+
from pyedb.generic.general_methods import generate_unique_name
|
|
34
34
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
35
35
|
|
|
36
36
|
|
|
@@ -1403,17 +1403,12 @@ class EDBPadstackInstance(Primitive):
|
|
|
1403
1403
|
layer = self._pedb.edb_api.cell.layer("", self._pedb.edb_api.cell.layer_type.SignalLayer)
|
|
1404
1404
|
val = self._pedb.edb_value(0)
|
|
1405
1405
|
offset = self._pedb.edb_value(0.0)
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
drill_to_layer
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
flag,
|
|
1413
|
-
drill_to_layer,
|
|
1414
|
-
offset,
|
|
1415
|
-
diameter,
|
|
1416
|
-
) = self._edb_padstackinstance.GetBackDrillParametersLayerValue(layer, offset, val, False)
|
|
1406
|
+
(
|
|
1407
|
+
flag,
|
|
1408
|
+
drill_to_layer,
|
|
1409
|
+
offset,
|
|
1410
|
+
diameter,
|
|
1411
|
+
) = self._edb_padstackinstance.GetBackDrillParametersLayerValue(layer, offset, val, False)
|
|
1417
1412
|
if flag:
|
|
1418
1413
|
if offset.ToDouble():
|
|
1419
1414
|
return drill_to_layer.GetName(), diameter.ToString(), offset.ToString()
|
|
@@ -1461,17 +1456,12 @@ class EDBPadstackInstance(Primitive):
|
|
|
1461
1456
|
layer = self._pedb.edb_api.cell.layer("", self._pedb.edb_api.cell.layer_type.SignalLayer)
|
|
1462
1457
|
val = self._pedb.edb_value(0)
|
|
1463
1458
|
offset = self._pedb.edb_value(0.0)
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
drill_to_layer
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
flag,
|
|
1471
|
-
drill_to_layer,
|
|
1472
|
-
offset,
|
|
1473
|
-
diameter,
|
|
1474
|
-
) = self._edb_padstackinstance.GetBackDrillParametersLayerValue(layer, offset, val, True)
|
|
1459
|
+
(
|
|
1460
|
+
flag,
|
|
1461
|
+
drill_to_layer,
|
|
1462
|
+
offset,
|
|
1463
|
+
diameter,
|
|
1464
|
+
) = self._edb_padstackinstance.GetBackDrillParametersLayerValue(layer, offset, val, True)
|
|
1475
1465
|
if flag:
|
|
1476
1466
|
if offset.ToDouble():
|
|
1477
1467
|
return drill_to_layer.GetName(), diameter.ToString(), offset.ToString()
|
|
@@ -1503,9 +1493,9 @@ class EDBPadstackInstance(Primitive):
|
|
|
1503
1493
|
val = self._pedb.edb_value(drill_diameter)
|
|
1504
1494
|
offset = self._pedb.edb_value(offset)
|
|
1505
1495
|
if offset.ToDouble():
|
|
1506
|
-
return self.
|
|
1496
|
+
return self._edb_object.SetBackDrillParameters(layer, offset, val, True)
|
|
1507
1497
|
else:
|
|
1508
|
-
return self.
|
|
1498
|
+
return self._edb_object.SetBackDrillParameters(layer, val, True)
|
|
1509
1499
|
|
|
1510
1500
|
@property
|
|
1511
1501
|
def start_layer(self):
|
|
@@ -1517,7 +1507,7 @@ class EDBPadstackInstance(Primitive):
|
|
|
1517
1507
|
Name of the starting layer.
|
|
1518
1508
|
"""
|
|
1519
1509
|
layer = self._pedb.edb_api.cell.layer("", self._pedb.edb_api.cell.layer_type.SignalLayer)
|
|
1520
|
-
_, start_layer, stop_layer = self.
|
|
1510
|
+
_, start_layer, stop_layer = self._edb_object.GetLayerRange()
|
|
1521
1511
|
|
|
1522
1512
|
if start_layer:
|
|
1523
1513
|
return start_layer.GetName()
|
|
@@ -1751,12 +1741,9 @@ class EDBPadstackInstance(Primitive):
|
|
|
1751
1741
|
>>> edbapp.padstacks.instances[111].get_aedt_pin_name()
|
|
1752
1742
|
|
|
1753
1743
|
"""
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
else:
|
|
1758
|
-
val = String("")
|
|
1759
|
-
_, name = self._edb_padstackinstance.GetProductProperty(self._pedb.edb_api.ProductId.Designer, 11, val)
|
|
1744
|
+
|
|
1745
|
+
val = String("")
|
|
1746
|
+
_, name = self._edb_padstackinstance.GetProductProperty(self._pedb.edb_api.ProductId.Designer, 11, val)
|
|
1760
1747
|
name = str(name).strip("'")
|
|
1761
1748
|
return name
|
|
1762
1749
|
|
pyedb/dotnet/edb_core/general.py
CHANGED
|
@@ -30,15 +30,12 @@ from __future__ import absolute_import # noreorder
|
|
|
30
30
|
import logging
|
|
31
31
|
|
|
32
32
|
from pyedb.dotnet.clr_module import Dictionary, List, Tuple
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Enum = None
|
|
40
|
-
else: # pragma: no cover
|
|
41
|
-
Enum = object
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
from enum import Enum
|
|
36
|
+
except ImportError:
|
|
37
|
+
Enum = None
|
|
38
|
+
|
|
42
39
|
|
|
43
40
|
logger = logging.getLogger(__name__)
|
|
44
41
|
|
pyedb/dotnet/edb_core/hfss.py
CHANGED
|
@@ -36,7 +36,7 @@ from pyedb.dotnet.edb_core.general import (
|
|
|
36
36
|
convert_pytuple_to_nettuple,
|
|
37
37
|
)
|
|
38
38
|
from pyedb.generic.constants import RadiationBoxType, SweepType
|
|
39
|
-
from pyedb.generic.general_methods import generate_unique_name
|
|
39
|
+
from pyedb.generic.general_methods import generate_unique_name
|
|
40
40
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
41
41
|
|
|
42
42
|
|
|
@@ -1258,13 +1258,9 @@ class EdbHfss(object):
|
|
|
1258
1258
|
adapt.AdaptiveFrequency = simulation_setup.mesh_freq
|
|
1259
1259
|
adapt.MaxPasses = int(simulation_setup.max_num_passes)
|
|
1260
1260
|
adapt.MaxDelta = str(simulation_setup.max_mag_delta_s)
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
else:
|
|
1265
|
-
simsetup_info.SimulationSettings.AdaptiveSettings.AdaptiveFrequencyDataList = (
|
|
1266
|
-
convert_py_list_to_net_list([adapt])
|
|
1267
|
-
)
|
|
1261
|
+
simsetup_info.SimulationSettings.AdaptiveSettings.AdaptiveFrequencyDataList = convert_py_list_to_net_list(
|
|
1262
|
+
[adapt]
|
|
1263
|
+
)
|
|
1268
1264
|
elif simulation_setup.ac_settings.adaptive_type == 2:
|
|
1269
1265
|
low_freq_adapt_data = self._pedb.simsetupdata.AdaptiveFrequencyData()
|
|
1270
1266
|
low_freq_adapt_data.MaxDelta = str(simulation_setup.max_mag_delta_s)
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
from pyedb.dotnet.edb_core.utilities.obj_base import ObjBase
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class LayoutObjInstance(ObjBase):
|
|
27
|
+
"""Manages EDB functionalities for the layout object instance."""
|
|
28
|
+
|
|
29
|
+
def __init__(self, pedb, edb_object):
|
|
30
|
+
super().__init__(pedb, edb_object)
|
|
@@ -32,10 +32,8 @@ import warnings
|
|
|
32
32
|
from pydantic import BaseModel, confloat
|
|
33
33
|
|
|
34
34
|
from pyedb import Edb
|
|
35
|
-
from pyedb.dotnet.clr_module import _clr
|
|
36
35
|
from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
|
|
37
36
|
from pyedb.exceptions import MaterialModelException
|
|
38
|
-
from pyedb.generic.general_methods import is_ironpython
|
|
39
37
|
|
|
40
38
|
logger = logging.getLogger(__name__)
|
|
41
39
|
|
|
@@ -426,16 +424,11 @@ class Material(object):
|
|
|
426
424
|
|
|
427
425
|
def __property_value(self, material_property_id):
|
|
428
426
|
"""Get property value from a material property id."""
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
return float(property_box)
|
|
427
|
+
_, property_box = self.__material_def.GetProperty(material_property_id)
|
|
428
|
+
if isinstance(property_box, float):
|
|
429
|
+
return property_box
|
|
433
430
|
else:
|
|
434
|
-
|
|
435
|
-
if isinstance(property_box, float):
|
|
436
|
-
return property_box
|
|
437
|
-
else:
|
|
438
|
-
return property_box.ToDouble()
|
|
431
|
+
return property_box.ToDouble()
|
|
439
432
|
|
|
440
433
|
# def __reset_property(self, name):
|
|
441
434
|
# """Reset a property using the default value of the EDB API.
|
|
@@ -26,6 +26,7 @@ This module contains these classes: `EdbLayout` and `Shape`.
|
|
|
26
26
|
import math
|
|
27
27
|
import warnings
|
|
28
28
|
|
|
29
|
+
from pyedb.dotnet.edb_core.cell.primitive import Bondwire
|
|
29
30
|
from pyedb.dotnet.edb_core.dotnet.primitive import (
|
|
30
31
|
CircleDotNet,
|
|
31
32
|
PathDotNet,
|
|
@@ -37,7 +38,7 @@ from pyedb.dotnet.edb_core.edb_data.utilities import EDBStatistics
|
|
|
37
38
|
from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
class
|
|
41
|
+
class Modeler(object):
|
|
41
42
|
"""Manages EDB methods for primitives management accessible from `Edb.modeler` property.
|
|
42
43
|
|
|
43
44
|
Examples
|
|
@@ -47,8 +48,31 @@ class EdbLayout(object):
|
|
|
47
48
|
>>> edb_layout = edbapp.modeler
|
|
48
49
|
"""
|
|
49
50
|
|
|
51
|
+
def __getitem__(self, name):
|
|
52
|
+
"""Get a layout instance from the Edb project.
|
|
53
|
+
|
|
54
|
+
Parameters
|
|
55
|
+
----------
|
|
56
|
+
name : str, int
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
:class:`pyedb.dotnet.edb_core.cell.hierarchy.component.EDBComponent`
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
for i in self.primitives:
|
|
64
|
+
if (
|
|
65
|
+
(isinstance(name, str) and i.aedt_name == name)
|
|
66
|
+
or (isinstance(name, str) and i.aedt_name == name.replace("__", "_"))
|
|
67
|
+
or (isinstance(name, int) and i.id == name)
|
|
68
|
+
):
|
|
69
|
+
return i
|
|
70
|
+
self._pedb.logger.error("Primitive not found.")
|
|
71
|
+
return
|
|
72
|
+
|
|
50
73
|
def __init__(self, p_edb):
|
|
51
74
|
self._pedb = p_edb
|
|
75
|
+
self._primitives = []
|
|
52
76
|
|
|
53
77
|
@property
|
|
54
78
|
def _edb(self):
|
|
@@ -124,11 +148,13 @@ class EdbLayout(object):
|
|
|
124
148
|
list of :class:`pyedb.dotnet.edb_core.edb_data.primitives_data.EDBPrimitives`
|
|
125
149
|
List of primitives.
|
|
126
150
|
"""
|
|
127
|
-
|
|
151
|
+
if len(self._primitives) == len(self._layout.primitives):
|
|
152
|
+
return self._primitives
|
|
153
|
+
self._primitives = []
|
|
128
154
|
if self._active_layout:
|
|
129
155
|
for lay_obj in self._layout.primitives:
|
|
130
|
-
|
|
131
|
-
return
|
|
156
|
+
self._primitives.append(cast(lay_obj, self._pedb))
|
|
157
|
+
return self._primitives
|
|
132
158
|
|
|
133
159
|
@property
|
|
134
160
|
def polygons_by_layer(self):
|
|
@@ -643,7 +669,7 @@ class EdbLayout(object):
|
|
|
643
669
|
new_points = self._edb.Geometry.PointData(pdata_0, pdata_1)
|
|
644
670
|
polygonData.SetPoint(idx, new_points)
|
|
645
671
|
|
|
646
|
-
elif isinstance(main_shape,
|
|
672
|
+
elif isinstance(main_shape, Modeler.Shape):
|
|
647
673
|
polygonData = self.shape_to_polygon_data(main_shape)
|
|
648
674
|
else:
|
|
649
675
|
polygonData = main_shape
|
|
@@ -654,7 +680,7 @@ class EdbLayout(object):
|
|
|
654
680
|
if isinstance(void, list):
|
|
655
681
|
void = self.Shape("polygon", points=void)
|
|
656
682
|
voidPolygonData = self.shape_to_polygon_data(void)
|
|
657
|
-
elif isinstance(void,
|
|
683
|
+
elif isinstance(void, Modeler.Shape):
|
|
658
684
|
voidPolygonData = self.shape_to_polygon_data(void)
|
|
659
685
|
else:
|
|
660
686
|
voidPolygonData = void
|
|
@@ -932,7 +958,7 @@ class EdbLayout(object):
|
|
|
932
958
|
|
|
933
959
|
Parameters
|
|
934
960
|
----------
|
|
935
|
-
shape : :class:`pyedb.dotnet.edb_core.
|
|
961
|
+
shape : :class:`pyedb.dotnet.edb_core.modeler.Modeler.Shape`
|
|
936
962
|
Type of the shape to convert. Options are ``"rectangle"`` and ``"polygon"``.
|
|
937
963
|
"""
|
|
938
964
|
if shape.type == "polygon":
|
|
@@ -1328,3 +1354,123 @@ class EdbLayout(object):
|
|
|
1328
1354
|
stat_model.occupying_surface[layer] = surface
|
|
1329
1355
|
stat_model.occupying_ratio[layer] = surface / outline_surface
|
|
1330
1356
|
return stat_model
|
|
1357
|
+
|
|
1358
|
+
def create_bondwire(
|
|
1359
|
+
self,
|
|
1360
|
+
definition_name,
|
|
1361
|
+
placement_layer,
|
|
1362
|
+
width,
|
|
1363
|
+
material,
|
|
1364
|
+
start_layer_name,
|
|
1365
|
+
start_x,
|
|
1366
|
+
start_y,
|
|
1367
|
+
end_layer_name,
|
|
1368
|
+
end_x,
|
|
1369
|
+
end_y,
|
|
1370
|
+
net,
|
|
1371
|
+
bondwire_type="jedec4",
|
|
1372
|
+
):
|
|
1373
|
+
"""Create a bondwire object.
|
|
1374
|
+
|
|
1375
|
+
Parameters
|
|
1376
|
+
----------
|
|
1377
|
+
bondwire_type : :class:`BondwireType`
|
|
1378
|
+
Type of bondwire: kAPDBondWire or kJDECBondWire types.
|
|
1379
|
+
definition_name : str
|
|
1380
|
+
Bondwire definition name.
|
|
1381
|
+
placement_layer : str
|
|
1382
|
+
Layer name this bondwire will be on.
|
|
1383
|
+
width : :class:`Value <ansys.edb.utility.Value>`
|
|
1384
|
+
Bondwire width.
|
|
1385
|
+
material : str
|
|
1386
|
+
Bondwire material name.
|
|
1387
|
+
start_layer_name : str
|
|
1388
|
+
Name of start layer.
|
|
1389
|
+
start_x : :class:`Value <ansys.edb.utility.Value>`
|
|
1390
|
+
X value of start point.
|
|
1391
|
+
start_y : :class:`Value <ansys.edb.utility.Value>`
|
|
1392
|
+
Y value of start point.
|
|
1393
|
+
end_layer_name : str
|
|
1394
|
+
Name of end layer.
|
|
1395
|
+
end_x : :class:`Value <ansys.edb.utility.Value>`
|
|
1396
|
+
X value of end point.
|
|
1397
|
+
end_y : :class:`Value <ansys.edb.utility.Value>`
|
|
1398
|
+
Y value of end point.
|
|
1399
|
+
net : str or :class:`Net <ansys.edb.net.Net>` or None
|
|
1400
|
+
Net of the Bondwire.
|
|
1401
|
+
|
|
1402
|
+
Returns
|
|
1403
|
+
-------
|
|
1404
|
+
:class:`pyedb.dotnet.edb_core.dotnet.primitive.BondwireDotNet`
|
|
1405
|
+
Bondwire object created.
|
|
1406
|
+
"""
|
|
1407
|
+
|
|
1408
|
+
return Bondwire(
|
|
1409
|
+
pedb=self._pedb,
|
|
1410
|
+
bondwire_type=bondwire_type,
|
|
1411
|
+
definition_name=definition_name,
|
|
1412
|
+
placement_layer=placement_layer,
|
|
1413
|
+
width=self._pedb.edb_value(width),
|
|
1414
|
+
material=material,
|
|
1415
|
+
start_layer_name=start_layer_name,
|
|
1416
|
+
start_x=self._pedb.edb_value(start_x),
|
|
1417
|
+
start_y=self._pedb.edb_value(start_y),
|
|
1418
|
+
end_layer_name=end_layer_name,
|
|
1419
|
+
end_x=self._pedb.edb_value(end_x),
|
|
1420
|
+
end_y=self._pedb.edb_value(end_y),
|
|
1421
|
+
net=self._pedb.nets[net]._edb_object,
|
|
1422
|
+
)
|
|
1423
|
+
|
|
1424
|
+
def create_pin_group(
|
|
1425
|
+
self,
|
|
1426
|
+
name: str,
|
|
1427
|
+
pins_by_id: list[int] = None,
|
|
1428
|
+
pins_by_aedt_name: list[str] = None,
|
|
1429
|
+
pins_by_name: list[str] = None,
|
|
1430
|
+
):
|
|
1431
|
+
"""Create a PinGroup.
|
|
1432
|
+
|
|
1433
|
+
Parameters
|
|
1434
|
+
name : str,
|
|
1435
|
+
Name of the PinGroup.
|
|
1436
|
+
pins_by_id : list[int] or None
|
|
1437
|
+
List of pins by ID.
|
|
1438
|
+
pins_by_aedt_name : list[str] or None
|
|
1439
|
+
List of pins by AEDT name.
|
|
1440
|
+
pins_by_name : list[str] or None
|
|
1441
|
+
List of pins by name.
|
|
1442
|
+
"""
|
|
1443
|
+
pins = {}
|
|
1444
|
+
if pins_by_id:
|
|
1445
|
+
for p in pins_by_id:
|
|
1446
|
+
edb_pin = self._pedb.layout.find_object_by_id(p)
|
|
1447
|
+
if edb_pin and not p in pins:
|
|
1448
|
+
pins[p] = edb_pin._edb_object
|
|
1449
|
+
if not pins_by_aedt_name:
|
|
1450
|
+
pins_by_aedt_name = []
|
|
1451
|
+
if not pins_by_name:
|
|
1452
|
+
pins_by_name = []
|
|
1453
|
+
if pins_by_aedt_name or pins_by_name:
|
|
1454
|
+
p_inst = self._pedb.layout.padstack_instances
|
|
1455
|
+
_pins = {
|
|
1456
|
+
pin.id: pin._edb_object
|
|
1457
|
+
for pin in p_inst
|
|
1458
|
+
if pin.aedt_name in pins_by_aedt_name or pin.name in pins_by_name
|
|
1459
|
+
}
|
|
1460
|
+
if not pins:
|
|
1461
|
+
pins = _pins
|
|
1462
|
+
else:
|
|
1463
|
+
for id, pin in _pins.items():
|
|
1464
|
+
if not id in pins:
|
|
1465
|
+
pins[id] = pin
|
|
1466
|
+
if not pins:
|
|
1467
|
+
self._logger.error("No pin found.")
|
|
1468
|
+
return False
|
|
1469
|
+
pins = list(pins.values())
|
|
1470
|
+
obj = self._edb.cell.hierarchy.pin_group.Create(
|
|
1471
|
+
self._pedb.active_layout, name, convert_py_list_to_net_list(pins)
|
|
1472
|
+
)
|
|
1473
|
+
if obj.IsNull():
|
|
1474
|
+
self._logger.debug("Pin group creation returned Null obj.")
|
|
1475
|
+
return False
|
|
1476
|
+
return self._pedb.siwave.pin_groups[name]
|