pyedb 0.53.0__py3-none-any.whl → 0.55.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 -8
- pyedb/configuration/cfg_boundaries.py +69 -151
- pyedb/configuration/cfg_components.py +201 -460
- pyedb/configuration/cfg_data.py +4 -2
- pyedb/configuration/cfg_general.py +13 -36
- pyedb/configuration/cfg_modeler.py +2 -1
- pyedb/configuration/cfg_nets.py +21 -35
- pyedb/configuration/cfg_operations.py +22 -151
- pyedb/configuration/cfg_package_definition.py +56 -112
- pyedb/configuration/cfg_padstacks.py +292 -688
- pyedb/configuration/cfg_pin_groups.py +32 -79
- pyedb/configuration/cfg_ports_sources.py +20 -9
- pyedb/configuration/cfg_s_parameter_models.py +67 -172
- pyedb/configuration/cfg_setup.py +102 -295
- pyedb/configuration/configuration.py +66 -6
- pyedb/dotnet/database/cell/connectable.py +38 -9
- pyedb/dotnet/database/cell/hierarchy/component.py +28 -28
- pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/database/cell/layout.py +64 -3
- pyedb/dotnet/database/cell/layout_obj.py +3 -3
- pyedb/dotnet/database/cell/primitive/path.py +6 -8
- pyedb/dotnet/database/cell/primitive/primitive.py +10 -31
- pyedb/dotnet/database/cell/terminal/edge_terminal.py +2 -2
- pyedb/dotnet/database/cell/terminal/padstack_instance_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/terminal.py +26 -28
- pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
- pyedb/dotnet/database/components.py +99 -91
- pyedb/dotnet/database/definition/component_def.py +4 -4
- pyedb/dotnet/database/definition/component_model.py +1 -1
- pyedb/dotnet/database/definition/package_def.py +2 -3
- pyedb/dotnet/database/dotnet/database.py +27 -218
- pyedb/dotnet/database/dotnet/primitive.py +16 -16
- pyedb/dotnet/database/edb_data/control_file.py +5 -5
- pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
- pyedb/dotnet/database/edb_data/layer_data.py +35 -35
- pyedb/dotnet/database/edb_data/padstacks_data.py +65 -90
- pyedb/dotnet/database/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/database/edb_data/sources.py +6 -6
- pyedb/dotnet/database/edb_data/variables.py +8 -4
- pyedb/dotnet/database/geometry/point_data.py +14 -10
- pyedb/dotnet/database/geometry/polygon_data.py +3 -5
- pyedb/dotnet/database/hfss.py +50 -52
- pyedb/dotnet/database/layout_validation.py +14 -11
- pyedb/dotnet/database/materials.py +10 -11
- pyedb/dotnet/database/modeler.py +104 -101
- pyedb/dotnet/database/nets.py +20 -23
- pyedb/dotnet/database/padstack.py +156 -84
- pyedb/dotnet/database/sim_setup_data/data/settings.py +24 -0
- pyedb/dotnet/database/sim_setup_data/io/siwave.py +26 -1
- pyedb/dotnet/database/siwave.py +47 -47
- pyedb/dotnet/database/stackup.py +152 -87
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +3 -3
- pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
- pyedb/dotnet/database/utilities/value.py +116 -0
- pyedb/dotnet/edb.py +248 -170
- pyedb/edb_logger.py +12 -27
- pyedb/extensions/via_design_backend.py +6 -3
- pyedb/generic/design_types.py +68 -21
- pyedb/generic/general_methods.py +0 -120
- pyedb/generic/process.py +44 -108
- pyedb/generic/settings.py +75 -19
- pyedb/grpc/__init__.py +0 -0
- pyedb/grpc/database/components.py +55 -17
- pyedb/grpc/database/control_file.py +5 -5
- pyedb/grpc/database/definition/materials.py +24 -31
- pyedb/grpc/database/definition/package_def.py +18 -18
- pyedb/grpc/database/definition/padstack_def.py +104 -51
- pyedb/grpc/database/geometry/arc_data.py +7 -5
- pyedb/grpc/database/geometry/point_3d_data.py +8 -7
- pyedb/grpc/database/geometry/polygon_data.py +4 -3
- pyedb/grpc/database/hierarchy/component.py +43 -38
- pyedb/grpc/database/hierarchy/pin_pair_model.py +15 -14
- pyedb/grpc/database/hierarchy/pingroup.py +9 -9
- pyedb/grpc/database/layers/stackup_layer.py +45 -44
- pyedb/grpc/database/layout/layout.py +17 -13
- pyedb/grpc/database/layout/voltage_regulator.py +7 -7
- pyedb/grpc/database/layout_validation.py +16 -15
- pyedb/grpc/database/modeler.py +60 -58
- pyedb/grpc/database/net/net.py +15 -14
- pyedb/grpc/database/nets.py +112 -31
- pyedb/grpc/database/padstacks.py +303 -190
- pyedb/grpc/database/ports/ports.py +5 -6
- pyedb/grpc/database/primitive/bondwire.py +8 -7
- pyedb/grpc/database/primitive/circle.py +4 -4
- pyedb/grpc/database/primitive/padstack_instance.py +191 -23
- pyedb/grpc/database/primitive/path.py +7 -7
- pyedb/grpc/database/primitive/polygon.py +3 -3
- pyedb/grpc/database/primitive/primitive.py +13 -17
- pyedb/grpc/database/primitive/rectangle.py +13 -13
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +10 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +17 -1
- pyedb/grpc/database/siwave.py +31 -25
- pyedb/grpc/database/source_excitations.py +335 -233
- pyedb/grpc/database/stackup.py +165 -148
- pyedb/grpc/database/terminal/bundle_terminal.py +18 -8
- pyedb/grpc/database/terminal/edge_terminal.py +10 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +16 -5
- pyedb/grpc/database/terminal/pingroup_terminal.py +12 -11
- pyedb/grpc/database/terminal/point_terminal.py +4 -3
- pyedb/grpc/database/terminal/terminal.py +9 -9
- pyedb/grpc/database/utility/value.py +109 -0
- pyedb/grpc/database/utility/xml_control_file.py +5 -5
- pyedb/grpc/edb.py +130 -63
- pyedb/grpc/edb_init.py +3 -10
- pyedb/grpc/rpc_session.py +10 -10
- pyedb/libraries/common.py +366 -0
- pyedb/libraries/rf_libraries/base_functions.py +1358 -0
- pyedb/libraries/rf_libraries/planar_antennas.py +628 -0
- pyedb/misc/decorators.py +61 -0
- pyedb/misc/misc.py +0 -13
- pyedb/siwave.py +2 -2
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/METADATA +2 -3
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/RECORD +119 -112
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/WHEEL +0 -0
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/licenses/LICENSE +0 -0
pyedb/dotnet/database/modeler.py
CHANGED
|
@@ -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.clr_module import Tuple
|
|
29
30
|
from pyedb.dotnet.database.cell.primitive.bondwire import Bondwire
|
|
30
31
|
from pyedb.dotnet.database.dotnet.primitive import CircleDotNet, RectangleDotNet
|
|
31
32
|
from pyedb.dotnet.database.edb_data.primitives_data import Primitive, cast
|
|
@@ -70,7 +71,7 @@ class Modeler(object):
|
|
|
70
71
|
|
|
71
72
|
@property
|
|
72
73
|
def _edb(self):
|
|
73
|
-
return self._pedb.
|
|
74
|
+
return self._pedb.core
|
|
74
75
|
|
|
75
76
|
def _get_edb_value(self, value):
|
|
76
77
|
return self._pedb.edb_value(value)
|
|
@@ -289,20 +290,20 @@ class Modeler(object):
|
|
|
289
290
|
if not isinstance(point, list) and len(point) == 2:
|
|
290
291
|
self._logger.error("Provided point must be a list of two values")
|
|
291
292
|
return False
|
|
292
|
-
pt = self._edb.
|
|
293
|
-
if
|
|
294
|
-
nets
|
|
295
|
-
|
|
293
|
+
pt = self._edb.Geometry.PointData(self._pedb.edb_value(point[0]), self._pedb.edb_value(point[1]))
|
|
294
|
+
if nets:
|
|
295
|
+
if isinstance(nets, str):
|
|
296
|
+
nets = [nets]
|
|
296
297
|
_nets = []
|
|
297
298
|
for net in nets:
|
|
298
299
|
if net not in self._pedb.nets:
|
|
299
|
-
self._logger.
|
|
300
|
+
self._logger.warning(
|
|
300
301
|
f"Net {net} used to find primitive from layer point and net not found, skipping it."
|
|
301
302
|
)
|
|
302
303
|
else:
|
|
303
304
|
_nets.append(self._pedb.nets[net].net_obj)
|
|
304
305
|
if _nets:
|
|
305
|
-
nets = _nets
|
|
306
|
+
nets = convert_py_list_to_net_list(_nets)
|
|
306
307
|
_obj_instances = list(self._pedb.layout_instance.FindLayoutObjInstance(pt, None, nets).Items)
|
|
307
308
|
returned_obj = []
|
|
308
309
|
if layer:
|
|
@@ -324,10 +325,7 @@ class Modeler(object):
|
|
|
324
325
|
else:
|
|
325
326
|
for obj in _obj_instances:
|
|
326
327
|
obj_id = obj.GetLayoutObj().GetId()
|
|
327
|
-
[
|
|
328
|
-
returned_obj.append(Primitive(p, self._pedb))
|
|
329
|
-
for p in [obj for obj in self.primitives if obj.id == obj_id]
|
|
330
|
-
]
|
|
328
|
+
[returned_obj.append(p) for p in [obj for obj in self.primitives if obj.id == obj_id]]
|
|
331
329
|
return returned_obj
|
|
332
330
|
|
|
333
331
|
def get_polygon_bounding_box(self, polygon):
|
|
@@ -539,30 +537,30 @@ class Modeler(object):
|
|
|
539
537
|
"""
|
|
540
538
|
net = self._pedb.nets.find_or_create_net(net_name)
|
|
541
539
|
if start_cap_style.lower() == "round":
|
|
542
|
-
start_cap_style = self._edb.
|
|
540
|
+
start_cap_style = self._edb.Cell.Primitive.PathEndCapStyle.Round
|
|
543
541
|
elif start_cap_style.lower() == "extended":
|
|
544
|
-
start_cap_style = self._edb.
|
|
542
|
+
start_cap_style = self._edb.Cell.Primitive.PathEndCapStyle.Extended # pragma: no cover
|
|
545
543
|
else:
|
|
546
|
-
start_cap_style = self._edb.
|
|
544
|
+
start_cap_style = self._edb.Cell.Primitive.PathEndCapStyle.Flat # pragma: no cover
|
|
547
545
|
if end_cap_style.lower() == "round":
|
|
548
|
-
end_cap_style = self._edb.
|
|
546
|
+
end_cap_style = self._edb.Cell.Primitive.PathEndCapStyle.Round # pragma: no cover
|
|
549
547
|
elif end_cap_style.lower() == "extended":
|
|
550
|
-
end_cap_style = self._edb.
|
|
548
|
+
end_cap_style = self._edb.Cell.Primitive.PathEndCapStyle.Extended # pragma: no cover
|
|
551
549
|
else:
|
|
552
|
-
end_cap_style = self._edb.
|
|
550
|
+
end_cap_style = self._edb.Cell.Primitive.PathEndCapStyle.Flat
|
|
553
551
|
if corner_style.lower() == "round":
|
|
554
|
-
corner_style = self._edb.
|
|
552
|
+
corner_style = self._edb.Cell.Primitive.PathCornerStyle.RoundCorner
|
|
555
553
|
elif corner_style.lower() == "sharp":
|
|
556
|
-
corner_style = self._edb.
|
|
554
|
+
corner_style = self._edb.Cell.Primitive.PathCornerStyle.SharpCorner # pragma: no cover
|
|
557
555
|
else:
|
|
558
|
-
corner_style = self._edb.
|
|
556
|
+
corner_style = self._edb.Cell.Primitive.PathCornerStyle.MiterCorner # pragma: no cover
|
|
559
557
|
|
|
560
558
|
pointlists = [self._pedb.point_data(i[0], i[1]) for i in path_list.points]
|
|
561
|
-
polygonData = self._edb.
|
|
562
|
-
polygon = self._edb.
|
|
559
|
+
polygonData = self._edb.Geometry.PolygonData(convert_py_list_to_net_list(pointlists), False)
|
|
560
|
+
polygon = self._edb.Cell.Primitive.Path.Create(
|
|
563
561
|
self._active_layout,
|
|
564
562
|
layer_name,
|
|
565
|
-
net,
|
|
563
|
+
net._edb_object,
|
|
566
564
|
self._get_edb_value(width),
|
|
567
565
|
start_cap_style,
|
|
568
566
|
end_cap_style,
|
|
@@ -570,10 +568,9 @@ class Modeler(object):
|
|
|
570
568
|
polygonData,
|
|
571
569
|
)
|
|
572
570
|
|
|
573
|
-
if polygon.
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
polygon = self._pedb.layout.find_object_by_id(polygon.prim_obj.GetId())
|
|
571
|
+
if polygon.IsNull(): # pragma: no cover
|
|
572
|
+
raise RuntimeError("Failed to create path.")
|
|
573
|
+
polygon = self._pedb.layout.find_object_by_id(polygon.GetId())
|
|
577
574
|
return polygon
|
|
578
575
|
|
|
579
576
|
def create_trace(
|
|
@@ -723,11 +720,10 @@ class Modeler(object):
|
|
|
723
720
|
if isinstance(polygonData, PolygonData):
|
|
724
721
|
polygonData = polygonData._edb_object
|
|
725
722
|
polygon = self._pedb._edb.Cell.Primitive.Polygon.Create(
|
|
726
|
-
self._active_layout, layer_name, net.
|
|
723
|
+
self._active_layout, layer_name, net._edb_object, polygonData
|
|
727
724
|
)
|
|
728
725
|
if polygon.IsNull() or polygonData is False: # pragma: no cover
|
|
729
|
-
|
|
730
|
-
return False
|
|
726
|
+
raise RuntimeError("Null polygon created")
|
|
731
727
|
else:
|
|
732
728
|
return cast(polygon, self._pedb)
|
|
733
729
|
|
|
@@ -805,11 +801,11 @@ class Modeler(object):
|
|
|
805
801
|
"""
|
|
806
802
|
edb_net = self._pedb.nets.find_or_create_net(net_name)
|
|
807
803
|
if representation_type == "LowerLeftUpperRight":
|
|
808
|
-
rep_type = self._edb.
|
|
809
|
-
rect = self._edb.
|
|
804
|
+
rep_type = self._edb.Cell.Primitive.RectangleRepresentationType.LowerLeftUpperRight
|
|
805
|
+
rect = self._edb.Cell.Primitive.Rectangle.Create(
|
|
810
806
|
self._active_layout,
|
|
811
807
|
layer_name,
|
|
812
|
-
edb_net.
|
|
808
|
+
edb_net._edb_object,
|
|
813
809
|
rep_type,
|
|
814
810
|
self._get_edb_value(lower_left_point[0]),
|
|
815
811
|
self._get_edb_value(lower_left_point[1]),
|
|
@@ -819,11 +815,11 @@ class Modeler(object):
|
|
|
819
815
|
self._get_edb_value(rotation),
|
|
820
816
|
)
|
|
821
817
|
else:
|
|
822
|
-
rep_type = self._edb.
|
|
823
|
-
rect = self._edb.
|
|
818
|
+
rep_type = self._edb.Cell.Primitive.RectangleRepresentationType.CenterWidthHeight
|
|
819
|
+
rect = self._edb.Cell.Primitive.Rectangle.Create(
|
|
824
820
|
self._active_layout,
|
|
825
821
|
layer_name,
|
|
826
|
-
edb_net.
|
|
822
|
+
edb_net._edb_object,
|
|
827
823
|
rep_type,
|
|
828
824
|
self._get_edb_value(center_point[0]),
|
|
829
825
|
self._get_edb_value(center_point[1]),
|
|
@@ -832,8 +828,8 @@ class Modeler(object):
|
|
|
832
828
|
self._get_edb_value(corner_radius),
|
|
833
829
|
self._get_edb_value(rotation),
|
|
834
830
|
)
|
|
835
|
-
if rect:
|
|
836
|
-
return self._pedb.layout.find_object_by_id(rect.
|
|
831
|
+
if not rect.IsNull():
|
|
832
|
+
return self._pedb.layout.find_object_by_id(rect.GetId())
|
|
837
833
|
return False # pragma: no cover
|
|
838
834
|
|
|
839
835
|
def create_circle(self, layer_name, x, y, radius, net_name=""):
|
|
@@ -860,16 +856,16 @@ class Modeler(object):
|
|
|
860
856
|
"""
|
|
861
857
|
edb_net = self._pedb.nets.find_or_create_net(net_name)
|
|
862
858
|
|
|
863
|
-
circle = self._edb.
|
|
859
|
+
circle = self._edb.Cell.Primitive.Circle.Create(
|
|
864
860
|
self._active_layout,
|
|
865
861
|
layer_name,
|
|
866
|
-
edb_net,
|
|
862
|
+
edb_net._edb_object,
|
|
867
863
|
self._get_edb_value(x),
|
|
868
864
|
self._get_edb_value(y),
|
|
869
865
|
self._get_edb_value(radius),
|
|
870
866
|
)
|
|
871
|
-
if circle:
|
|
872
|
-
return self._pedb.layout.find_object_by_id(circle.
|
|
867
|
+
if not circle.IsNull():
|
|
868
|
+
return self._pedb.layout.find_object_by_id(circle.GetId())
|
|
873
869
|
return False # pragma: no cover
|
|
874
870
|
|
|
875
871
|
def delete_primitives(self, net_names):
|
|
@@ -952,7 +948,7 @@ class Modeler(object):
|
|
|
952
948
|
radius,
|
|
953
949
|
) = void_circle.primitive_object.GetParameters()
|
|
954
950
|
|
|
955
|
-
cloned_circle = self._edb.
|
|
951
|
+
cloned_circle = self._edb.Cell.Primitive.Circle.Create(
|
|
956
952
|
self._active_layout,
|
|
957
953
|
void_circle.layer_name,
|
|
958
954
|
void_circle.net,
|
|
@@ -1035,7 +1031,7 @@ class Modeler(object):
|
|
|
1035
1031
|
or endPoint[0].IsParametric()
|
|
1036
1032
|
or endPoint[1].IsParametric()
|
|
1037
1033
|
)
|
|
1038
|
-
arc = self._edb.
|
|
1034
|
+
arc = self._edb.Geometry.ArcData(
|
|
1039
1035
|
self._pedb.point_data(startPoint[0].ToDouble(), startPoint[1].ToDouble()),
|
|
1040
1036
|
self._pedb.point_data(endPoint[0].ToDouble(), endPoint[1].ToDouble()),
|
|
1041
1037
|
)
|
|
@@ -1049,10 +1045,10 @@ class Modeler(object):
|
|
|
1049
1045
|
or endPoint[1].IsParametric()
|
|
1050
1046
|
or endPoint[2].IsParametric()
|
|
1051
1047
|
)
|
|
1052
|
-
arc = self._edb.
|
|
1048
|
+
arc = self._edb.Geometry.Arc_data(
|
|
1053
1049
|
self._pedb.point_data(startPoint[0].ToDouble(), startPoint[1].ToDouble()),
|
|
1054
1050
|
self._pedb.point_data(endPoint[0].ToDouble(), endPoint[1].ToDouble()),
|
|
1055
|
-
endPoint[2].ToDouble(),
|
|
1051
|
+
# endPoint[2].ToDouble(), # This argument is never used in the original code. There might be a bug.
|
|
1056
1052
|
)
|
|
1057
1053
|
arcs.append(arc)
|
|
1058
1054
|
elif len(endPoint) == 5:
|
|
@@ -1065,29 +1061,27 @@ class Modeler(object):
|
|
|
1065
1061
|
or endPoint[3].IsParametric()
|
|
1066
1062
|
or endPoint[4].IsParametric()
|
|
1067
1063
|
)
|
|
1068
|
-
rotationDirection = self._edb.geometry.geometry.RotationDirection.Colinear
|
|
1069
1064
|
if endPoint[2].ToString() == "cw":
|
|
1070
1065
|
rotationDirection = self._edb.geometry.geometry.RotationDirection.CW
|
|
1071
1066
|
elif endPoint[2].ToString() == "ccw":
|
|
1072
1067
|
rotationDirection = self._edb.geometry.geometry.RotationDirection.CCW
|
|
1073
1068
|
else:
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
arc = self._edb.geometry.arc_data(
|
|
1069
|
+
raise ValueError("Invalid rotation direction %s is specified.", endPoint[2])
|
|
1070
|
+
arc = self._edb.Geometry.ArcData(
|
|
1077
1071
|
self._pedb.point_data(startPoint[0].ToDouble(), startPoint[1].ToDouble()),
|
|
1078
1072
|
self._pedb.point_data(endPoint[0].ToDouble(), endPoint[1].ToDouble()),
|
|
1079
1073
|
rotationDirection,
|
|
1080
1074
|
self._pedb.point_data(endPoint[3].ToDouble(), endPoint[4].ToDouble()),
|
|
1081
1075
|
)
|
|
1082
1076
|
arcs.append(arc)
|
|
1083
|
-
polygon = self._edb.
|
|
1077
|
+
polygon = self._edb.Geometry.PolygonData.CreateFromArcs(convert_py_list_to_net_list(arcs), True)
|
|
1084
1078
|
if not is_parametric:
|
|
1085
1079
|
return polygon
|
|
1086
1080
|
else:
|
|
1087
1081
|
k = 0
|
|
1088
1082
|
for pt in points:
|
|
1089
1083
|
point = [self._get_edb_value(i) for i in pt]
|
|
1090
|
-
new_points = self._edb.
|
|
1084
|
+
new_points = self._edb.Geometry.PointData(point[0], point[1])
|
|
1091
1085
|
if len(point) > 2:
|
|
1092
1086
|
k += 1
|
|
1093
1087
|
polygon.SetPoint(k, new_points)
|
|
@@ -1144,13 +1138,14 @@ class Modeler(object):
|
|
|
1144
1138
|
def _createPolygonDataFromRectangle(self, shape):
|
|
1145
1139
|
if not self._validatePoint(shape.pointA, False) or not self._validatePoint(shape.pointB, False):
|
|
1146
1140
|
return None
|
|
1147
|
-
pointA = self._edb.
|
|
1141
|
+
pointA = self._edb.Geometry.PointData(
|
|
1148
1142
|
self._get_edb_value(shape.pointA[0]), self._get_edb_value(shape.pointA[1])
|
|
1149
1143
|
)
|
|
1150
|
-
pointB = self._edb.
|
|
1144
|
+
pointB = self._edb.Geometry.PointData(
|
|
1151
1145
|
self._get_edb_value(shape.pointB[0]), self._get_edb_value(shape.pointB[1])
|
|
1152
1146
|
)
|
|
1153
|
-
|
|
1147
|
+
points = Tuple[self._pedb.core.Geometry.PointData, self._pedb.core.Geometry.PointData](pointA, pointB)
|
|
1148
|
+
return self._edb.Geometry.PolygonData.CreateFromBBox(points)
|
|
1154
1149
|
|
|
1155
1150
|
class Shape(object):
|
|
1156
1151
|
"""Shape class.
|
|
@@ -1243,7 +1238,7 @@ class Modeler(object):
|
|
|
1243
1238
|
p.width = self._pedb.edb_value(parameter_name)
|
|
1244
1239
|
return True
|
|
1245
1240
|
|
|
1246
|
-
def unite_polygons_on_layer(self, layer_name=None, delete_padstack_gemometries=False, net_names_list=
|
|
1241
|
+
def unite_polygons_on_layer(self, layer_name=None, delete_padstack_gemometries=False, net_names_list=None):
|
|
1247
1242
|
"""Try to unite all Polygons on specified layer.
|
|
1248
1243
|
|
|
1249
1244
|
Parameters
|
|
@@ -1260,51 +1255,59 @@ class Modeler(object):
|
|
|
1260
1255
|
bool
|
|
1261
1256
|
``True`` is successful.
|
|
1262
1257
|
"""
|
|
1263
|
-
|
|
1264
|
-
|
|
1258
|
+
|
|
1259
|
+
def unite_polygons(polygons: list):
|
|
1260
|
+
"""Unite a list of polygons.
|
|
1261
|
+
|
|
1262
|
+
Parameters
|
|
1263
|
+
----------
|
|
1264
|
+
polygons
|
|
1265
|
+
"""
|
|
1266
|
+
if len(polygons) < 2:
|
|
1267
|
+
raise ValueError("At least two polygons are required to unite.")
|
|
1268
|
+
layer = set([i.layer_name for i in polygons])
|
|
1269
|
+
if len(layer) > 1:
|
|
1270
|
+
raise ValueError("Polygons must be on the same layer.")
|
|
1271
|
+
layer = list(layer)[0]
|
|
1272
|
+
|
|
1273
|
+
new_polygon_data = self._pedb.core.Geometry.PolygonData.Unite(
|
|
1274
|
+
convert_py_list_to_net_list([i.polygon_data._edb_object for i in polygons])
|
|
1275
|
+
)
|
|
1276
|
+
voids = []
|
|
1277
|
+
for i in polygons:
|
|
1278
|
+
voids.extend(i.voids)
|
|
1279
|
+
|
|
1280
|
+
new_polygons = []
|
|
1281
|
+
for pdata in new_polygon_data:
|
|
1282
|
+
voids_ = [i for i in voids if int(pdata.GetIntersectionType(i.polygon_data._edb_object)) == 2]
|
|
1283
|
+
|
|
1284
|
+
new_polygons.append(self.create_polygon(pdata, layer, voids_, polygons[0].net_name))
|
|
1285
|
+
|
|
1286
|
+
for i in polygons:
|
|
1287
|
+
i.delete()
|
|
1288
|
+
return new_polygons
|
|
1289
|
+
|
|
1265
1290
|
if not layer_name:
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
if
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
list_polygon_data.append(i.GetPolygonData())
|
|
1287
|
-
delete_list.append(i)
|
|
1288
|
-
all_voids.append(i.Voids)
|
|
1289
|
-
a = self._edb.geometry.polygon_data.unite(convert_py_list_to_net_list(list_polygon_data))
|
|
1290
|
-
for item in a:
|
|
1291
|
-
for v in all_voids:
|
|
1292
|
-
for void in v:
|
|
1293
|
-
if int(item.GetIntersectionType(void.GetPolygonData())) == 2:
|
|
1294
|
-
item.AddHole(void.GetPolygonData())
|
|
1295
|
-
self.create_polygon(item, layer_name=lay, voids=[], net_name=net)
|
|
1296
|
-
for v in all_voids:
|
|
1297
|
-
for void in v:
|
|
1298
|
-
for poly in poly_by_nets[net]: # pragma no cover
|
|
1299
|
-
if int(void.GetPolygonData().GetIntersectionType(poly.GetPolygonData())) >= 2:
|
|
1300
|
-
try:
|
|
1301
|
-
id = delete_list.index(poly)
|
|
1302
|
-
except ValueError:
|
|
1303
|
-
id = -1
|
|
1304
|
-
if id >= 0:
|
|
1305
|
-
delete_list.pop(id)
|
|
1306
|
-
for poly in delete_list:
|
|
1307
|
-
poly.Delete()
|
|
1291
|
+
layers = list(self._pedb.stackup.signal_layers.keys())
|
|
1292
|
+
elif isinstance(layer_name, str):
|
|
1293
|
+
layers = [layer_name]
|
|
1294
|
+
else:
|
|
1295
|
+
layers = layer_name
|
|
1296
|
+
|
|
1297
|
+
for layer in layers:
|
|
1298
|
+
self._logger.info("Uniting Objects on layer %s.", layer)
|
|
1299
|
+
if net_names_list:
|
|
1300
|
+
polygons = [
|
|
1301
|
+
i
|
|
1302
|
+
for i in self._pedb.layout.find_primitive(layer_name=layer, net_name=net_names_list)
|
|
1303
|
+
if i.primitive_type == "polygon"
|
|
1304
|
+
]
|
|
1305
|
+
else:
|
|
1306
|
+
polygons = [
|
|
1307
|
+
i for i in self._pedb.layout.find_primitive(layer_name=layer) if i.primitive_type == "polygon"
|
|
1308
|
+
]
|
|
1309
|
+
if len(polygons) > 1:
|
|
1310
|
+
unite_polygons(polygons)
|
|
1308
1311
|
|
|
1309
1312
|
if delete_padstack_gemometries:
|
|
1310
1313
|
self._logger.info("Deleting Padstack Definitions")
|
|
@@ -1509,7 +1512,7 @@ class Modeler(object):
|
|
|
1509
1512
|
self._logger.error("No pin found.")
|
|
1510
1513
|
return False
|
|
1511
1514
|
pins = list(pins.values())
|
|
1512
|
-
obj = self._edb.
|
|
1515
|
+
obj = self._edb.Cell.Hierarchy.PinGroup.Create(
|
|
1513
1516
|
self._pedb.active_layout, name, convert_py_list_to_net_list(pins)
|
|
1514
1517
|
)
|
|
1515
1518
|
if obj.IsNull():
|
pyedb/dotnet/database/nets.py
CHANGED
|
@@ -77,7 +77,7 @@ class EdbNets(CommonNets):
|
|
|
77
77
|
@property
|
|
78
78
|
def _edb(self):
|
|
79
79
|
""" """
|
|
80
|
-
return self._pedb.
|
|
80
|
+
return self._pedb.core
|
|
81
81
|
|
|
82
82
|
@property
|
|
83
83
|
def _active_layout(self):
|
|
@@ -205,9 +205,9 @@ class EdbNets(CommonNets):
|
|
|
205
205
|
total_trace_area = 0.0
|
|
206
206
|
for primitive in net.primitives:
|
|
207
207
|
primitive = primitive._edb_object
|
|
208
|
-
if primitive.GetPrimitiveType() == self._edb.
|
|
208
|
+
if primitive.GetPrimitiveType() == self._edb.Cell.Primitive.PrimitiveType.Bondwire:
|
|
209
209
|
continue
|
|
210
|
-
if primitive.GetPrimitiveType() != self._edb.
|
|
210
|
+
if primitive.GetPrimitiveType() != self._edb.Cell.Primitive.PrimitiveType.Path:
|
|
211
211
|
total_plane_area += float(primitive.GetPolygonData().Area())
|
|
212
212
|
else:
|
|
213
213
|
total_trace_area += float(primitive.GetPolygonData().Area())
|
|
@@ -551,9 +551,10 @@ class EdbNets(CommonNets):
|
|
|
551
551
|
|
|
552
552
|
def get_net_by_name(self, net_name):
|
|
553
553
|
"""Find a net by name."""
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
|
|
555
|
+
edb_net = self._edb.Cell.Net.FindByName(self._active_layout, net_name)
|
|
556
|
+
if not edb_net.IsNull():
|
|
557
|
+
return self._pedb.pedb_class.database.edb_data.nets_data.EDBNetsData(edb_net, self._pedb)
|
|
557
558
|
|
|
558
559
|
def delete_nets(self, netlist):
|
|
559
560
|
"""Delete one or more nets from EDB.
|
|
@@ -635,54 +636,50 @@ class EdbNets(CommonNets):
|
|
|
635
636
|
"""
|
|
636
637
|
if not net_name and not start_with and not contain and not end_with:
|
|
637
638
|
net_name = generate_unique_name("NET_")
|
|
638
|
-
|
|
639
|
-
return
|
|
639
|
+
self._edb.Cell.Net.Create(self._active_layout, net_name)
|
|
640
|
+
return self.nets[net_name]
|
|
640
641
|
else:
|
|
641
642
|
if not start_with and not contain and not end_with:
|
|
642
|
-
net = self._edb.
|
|
643
|
-
if net.
|
|
644
|
-
net = self._edb.
|
|
645
|
-
return
|
|
643
|
+
net = self._edb.Cell.Net.FindByName(self._active_layout, net_name)
|
|
644
|
+
if net.IsNull():
|
|
645
|
+
net = self._edb.Cell.Net.Create(self._active_layout, net_name)
|
|
646
|
+
return self.nets[net_name]
|
|
646
647
|
elif start_with:
|
|
647
|
-
nets_found = [
|
|
648
|
-
self.nets[net].net_object for net in list(self.nets.keys()) if net.lower().startswith(start_with)
|
|
649
|
-
]
|
|
648
|
+
nets_found = [self.nets[net] for net in list(self.nets.keys()) if net.lower().startswith(start_with)]
|
|
650
649
|
return nets_found
|
|
651
650
|
elif start_with and end_with:
|
|
652
651
|
nets_found = [
|
|
653
|
-
self.nets[net]
|
|
652
|
+
self.nets[net]
|
|
654
653
|
for net in list(self.nets.keys())
|
|
655
654
|
if net.lower().startswith(start_with) and net.lower().endswith(end_with)
|
|
656
655
|
]
|
|
657
656
|
return nets_found
|
|
658
657
|
elif start_with and contain and end_with:
|
|
659
658
|
nets_found = [
|
|
660
|
-
self.nets[net]
|
|
659
|
+
self.nets[net]
|
|
661
660
|
for net in list(self.nets.keys())
|
|
662
661
|
if net.lower().startswith(start_with) and net.lower().endswith(end_with) and contain in net.lower()
|
|
663
662
|
]
|
|
664
663
|
return nets_found
|
|
665
664
|
elif start_with and contain:
|
|
666
665
|
nets_found = [
|
|
667
|
-
self.nets[net]
|
|
666
|
+
self.nets[net]
|
|
668
667
|
for net in list(self.nets.keys())
|
|
669
668
|
if net.lower().startswith(start_with) and contain in net.lower()
|
|
670
669
|
]
|
|
671
670
|
return nets_found
|
|
672
671
|
elif contain and end_with:
|
|
673
672
|
nets_found = [
|
|
674
|
-
self.nets[net]
|
|
673
|
+
self.nets[net]
|
|
675
674
|
for net in list(self.nets.keys())
|
|
676
675
|
if net.lower().endswith(end_with) and contain in net.lower()
|
|
677
676
|
]
|
|
678
677
|
return nets_found
|
|
679
678
|
elif end_with and not start_with and not contain:
|
|
680
|
-
nets_found = [
|
|
681
|
-
self.nets[net].net_object for net in list(self.nets.keys()) if net.lower().endswith(end_with)
|
|
682
|
-
]
|
|
679
|
+
nets_found = [self.nets[net] for net in list(self.nets.keys()) if net.lower().endswith(end_with)]
|
|
683
680
|
return nets_found
|
|
684
681
|
elif contain and not start_with and not end_with:
|
|
685
|
-
nets_found = [self.nets[net]
|
|
682
|
+
nets_found = [self.nets[net] for net in list(self.nets.keys()) if contain in net.lower()]
|
|
686
683
|
return nets_found
|
|
687
684
|
|
|
688
685
|
def is_net_in_component(self, component_name, net_name):
|