pyedb 0.52.0__py3-none-any.whl → 0.54.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/configuration/cfg_common.py +12 -15
- pyedb/configuration/cfg_data.py +2 -2
- pyedb/configuration/cfg_modeler.py +163 -234
- pyedb/configuration/cfg_ports_sources.py +6 -8
- pyedb/configuration/cfg_stackup.py +62 -249
- pyedb/configuration/configuration.py +272 -170
- pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/database/cell/layout.py +1 -1
- pyedb/dotnet/database/cell/layout_obj.py +3 -3
- pyedb/dotnet/database/cell/primitive/path.py +1 -1
- pyedb/dotnet/database/cell/primitive/primitive.py +8 -8
- 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 +24 -26
- pyedb/dotnet/database/components.py +33 -27
- pyedb/dotnet/database/definition/component_def.py +3 -3
- pyedb/dotnet/database/definition/component_model.py +1 -1
- pyedb/dotnet/database/definition/package_def.py +1 -1
- pyedb/dotnet/database/dotnet/database.py +47 -38
- pyedb/dotnet/database/dotnet/primitive.py +16 -16
- pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
- pyedb/dotnet/database/edb_data/layer_data.py +17 -15
- pyedb/dotnet/database/edb_data/padstacks_data.py +12 -12
- pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
- pyedb/dotnet/database/edb_data/sources.py +6 -6
- pyedb/dotnet/database/edb_data/variables.py +7 -3
- pyedb/dotnet/database/geometry/point_data.py +1 -1
- pyedb/dotnet/database/geometry/polygon_data.py +2 -4
- pyedb/dotnet/database/hfss.py +7 -7
- pyedb/dotnet/database/materials.py +2 -2
- pyedb/dotnet/database/modeler.py +8 -11
- pyedb/dotnet/database/nets.py +1 -1
- pyedb/dotnet/database/padstack.py +72 -1
- 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 +19 -5
- pyedb/dotnet/database/stackup.py +80 -137
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +1 -1
- pyedb/dotnet/database/utilities/simulation_setup.py +1 -1
- pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +894 -0
- pyedb/dotnet/database/utilities/siwave_simulation_setup.py +15 -0
- pyedb/dotnet/database/utilities/value.py +116 -0
- pyedb/dotnet/edb.py +58 -45
- pyedb/generic/design_types.py +39 -1
- pyedb/generic/grpc_warnings.py +5 -0
- pyedb/grpc/__init__.py +0 -0
- pyedb/grpc/database/components.py +155 -98
- pyedb/grpc/database/control_file.py +240 -193
- pyedb/grpc/database/definition/materials.py +23 -30
- pyedb/grpc/database/definition/package_def.py +15 -15
- pyedb/grpc/database/definition/padstack_def.py +51 -51
- pyedb/grpc/database/definitions.py +7 -5
- 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 +3 -2
- 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 +9 -8
- pyedb/grpc/database/layout/voltage_regulator.py +7 -7
- pyedb/grpc/database/layout_validation.py +13 -12
- pyedb/grpc/database/modeler.py +156 -131
- pyedb/grpc/database/nets.py +42 -31
- pyedb/grpc/database/padstacks.py +270 -175
- 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 +18 -18
- 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_cpa_simulation_setup.py +961 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +17 -1
- pyedb/grpc/database/siwave.py +44 -24
- pyedb/grpc/database/source_excitations.py +333 -229
- pyedb/grpc/database/stackup.py +164 -147
- pyedb/grpc/database/terminal/bundle_terminal.py +17 -7
- pyedb/grpc/database/terminal/edge_terminal.py +10 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +15 -4
- pyedb/grpc/database/terminal/pingroup_terminal.py +11 -10
- 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/edb.py +129 -45
- pyedb/grpc/edb_init.py +0 -7
- pyedb/siwave_core/cpa/simulation_setup_data_model.py +132 -0
- pyedb/siwave_core/product_properties.py +198 -0
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info}/METADATA +15 -13
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info}/RECORD +97 -89
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info}/WHEEL +1 -1
- {pyedb-0.52.0.dist-info → pyedb-0.54.0.dist-info/licenses}/LICENSE +0 -0
pyedb/grpc/database/modeler.py
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
This module contains these classes: `EdbLayout` and `Shape`.
|
|
25
25
|
"""
|
|
26
26
|
import math
|
|
27
|
+
from typing import Any, Dict, List, Optional, Union
|
|
27
28
|
|
|
28
29
|
from ansys.edb.core.geometry.arc_data import ArcData as GrpcArcData
|
|
29
30
|
from ansys.edb.core.geometry.point_data import PointData as GrpcPointData
|
|
@@ -39,7 +40,6 @@ from ansys.edb.core.primitive.path import PathEndCapType as GrpcPathEndCapType
|
|
|
39
40
|
from ansys.edb.core.primitive.rectangle import (
|
|
40
41
|
RectangleRepresentationType as GrpcRectangleRepresentationType,
|
|
41
42
|
)
|
|
42
|
-
from ansys.edb.core.utility.value import Value as GrpcValue
|
|
43
43
|
|
|
44
44
|
from pyedb.grpc.database.primitive.bondwire import Bondwire
|
|
45
45
|
from pyedb.grpc.database.primitive.circle import Circle
|
|
@@ -48,6 +48,7 @@ from pyedb.grpc.database.primitive.polygon import Polygon
|
|
|
48
48
|
from pyedb.grpc.database.primitive.primitive import Primitive
|
|
49
49
|
from pyedb.grpc.database.primitive.rectangle import Rectangle
|
|
50
50
|
from pyedb.grpc.database.utility.layout_statistics import LayoutStatistics
|
|
51
|
+
from pyedb.grpc.database.utility.value import Value
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
class Modeler(object):
|
|
@@ -60,8 +61,8 @@ class Modeler(object):
|
|
|
60
61
|
>>> edb_layout = edbapp.modeler
|
|
61
62
|
"""
|
|
62
63
|
|
|
63
|
-
def __getitem__(self, name):
|
|
64
|
-
"""Get a primitive
|
|
64
|
+
def __getitem__(self, name: Union[str, int]) -> Optional[Primitive]:
|
|
65
|
+
"""Get a primitive by name or ID.
|
|
65
66
|
|
|
66
67
|
Parameters
|
|
67
68
|
----------
|
|
@@ -88,13 +89,13 @@ class Modeler(object):
|
|
|
88
89
|
self._pedb.logger.error("Primitive not found.")
|
|
89
90
|
return
|
|
90
91
|
|
|
91
|
-
def __init__(self, p_edb):
|
|
92
|
+
def __init__(self, p_edb) -> None:
|
|
92
93
|
"""Initialize Modeler instance."""
|
|
93
94
|
self._pedb = p_edb
|
|
94
95
|
self._primitives = []
|
|
95
96
|
|
|
96
97
|
@property
|
|
97
|
-
def _edb(self):
|
|
98
|
+
def _edb(self) -> Any:
|
|
98
99
|
"""EDB API object.
|
|
99
100
|
|
|
100
101
|
Returns
|
|
@@ -105,7 +106,7 @@ class Modeler(object):
|
|
|
105
106
|
return self._pedb
|
|
106
107
|
|
|
107
108
|
@property
|
|
108
|
-
def _logger(self):
|
|
109
|
+
def _logger(self) -> Any:
|
|
109
110
|
"""Logger instance.
|
|
110
111
|
|
|
111
112
|
Returns
|
|
@@ -116,7 +117,7 @@ class Modeler(object):
|
|
|
116
117
|
return self._pedb.logger
|
|
117
118
|
|
|
118
119
|
@property
|
|
119
|
-
def _active_layout(self):
|
|
120
|
+
def _active_layout(self) -> Any:
|
|
120
121
|
"""Active layout.
|
|
121
122
|
|
|
122
123
|
Returns
|
|
@@ -127,7 +128,7 @@ class Modeler(object):
|
|
|
127
128
|
return self._pedb.active_layout
|
|
128
129
|
|
|
129
130
|
@property
|
|
130
|
-
def _layout(self):
|
|
131
|
+
def _layout(self) -> Any:
|
|
131
132
|
"""Current layout.
|
|
132
133
|
|
|
133
134
|
Returns
|
|
@@ -138,7 +139,7 @@ class Modeler(object):
|
|
|
138
139
|
return self._pedb.layout
|
|
139
140
|
|
|
140
141
|
@property
|
|
141
|
-
def _cell(self):
|
|
142
|
+
def _cell(self) -> Any:
|
|
142
143
|
"""Active cell.
|
|
143
144
|
|
|
144
145
|
Returns
|
|
@@ -149,18 +150,18 @@ class Modeler(object):
|
|
|
149
150
|
return self._pedb.active_cell
|
|
150
151
|
|
|
151
152
|
@property
|
|
152
|
-
def db(self):
|
|
153
|
+
def db(self) -> Any:
|
|
153
154
|
"""Database object.
|
|
154
155
|
|
|
155
156
|
Returns
|
|
156
157
|
-------
|
|
157
|
-
|
|
158
|
+
ansys.edb.core.database.Database
|
|
158
159
|
Database object.
|
|
159
160
|
"""
|
|
160
161
|
return self._pedb.active_db
|
|
161
162
|
|
|
162
163
|
@property
|
|
163
|
-
def layers(self):
|
|
164
|
+
def layers(self) -> Dict[str, object]:
|
|
164
165
|
"""Dictionary of layers.
|
|
165
166
|
|
|
166
167
|
Returns
|
|
@@ -170,7 +171,7 @@ class Modeler(object):
|
|
|
170
171
|
"""
|
|
171
172
|
return self._pedb.stackup.layers
|
|
172
173
|
|
|
173
|
-
def get_primitive(self, primitive_id):
|
|
174
|
+
def get_primitive(self, primitive_id: int) -> Optional[Primitive]:
|
|
174
175
|
"""Retrieve primitive by ID.
|
|
175
176
|
|
|
176
177
|
Parameters
|
|
@@ -210,7 +211,7 @@ class Modeler(object):
|
|
|
210
211
|
return False
|
|
211
212
|
|
|
212
213
|
@property
|
|
213
|
-
def primitives(self):
|
|
214
|
+
def primitives(self) -> List[Primitive]:
|
|
214
215
|
"""All primitives in the layout.
|
|
215
216
|
|
|
216
217
|
Returns
|
|
@@ -218,10 +219,10 @@ class Modeler(object):
|
|
|
218
219
|
list
|
|
219
220
|
List of :class:`pyedb.dotnet.database.edb_data.primitives_data.Primitive` objects.
|
|
220
221
|
"""
|
|
221
|
-
return
|
|
222
|
+
return self._pedb.layout.primitives
|
|
222
223
|
|
|
223
224
|
@property
|
|
224
|
-
def polygons_by_layer(self):
|
|
225
|
+
def polygons_by_layer(self) -> Dict[str, List[Primitive]]:
|
|
225
226
|
"""Primitives organized by layer names.
|
|
226
227
|
|
|
227
228
|
Returns
|
|
@@ -235,7 +236,7 @@ class Modeler(object):
|
|
|
235
236
|
return _primitives_by_layer
|
|
236
237
|
|
|
237
238
|
@property
|
|
238
|
-
def primitives_by_net(self):
|
|
239
|
+
def primitives_by_net(self) -> Dict[str, List[Primitive]]:
|
|
239
240
|
"""Primitives organized by net names.
|
|
240
241
|
|
|
241
242
|
Returns
|
|
@@ -249,7 +250,7 @@ class Modeler(object):
|
|
|
249
250
|
return _prim_by_net
|
|
250
251
|
|
|
251
252
|
@property
|
|
252
|
-
def primitives_by_layer(self):
|
|
253
|
+
def primitives_by_layer(self) -> Dict[str, List[Primitive]]:
|
|
253
254
|
"""Primitives organized by layer names.
|
|
254
255
|
|
|
255
256
|
Returns
|
|
@@ -272,7 +273,7 @@ class Modeler(object):
|
|
|
272
273
|
return _primitives_by_layer
|
|
273
274
|
|
|
274
275
|
@property
|
|
275
|
-
def rectangles(self):
|
|
276
|
+
def rectangles(self) -> List[Rectangle]:
|
|
276
277
|
"""All rectangle primitives.
|
|
277
278
|
|
|
278
279
|
Returns
|
|
@@ -283,7 +284,7 @@ class Modeler(object):
|
|
|
283
284
|
return [Rectangle(self._pedb, i) for i in self.primitives if i.type == "rectangle"]
|
|
284
285
|
|
|
285
286
|
@property
|
|
286
|
-
def circles(self):
|
|
287
|
+
def circles(self) -> List[Circle]:
|
|
287
288
|
"""All circle primitives.
|
|
288
289
|
|
|
289
290
|
Returns
|
|
@@ -294,7 +295,7 @@ class Modeler(object):
|
|
|
294
295
|
return [Circle(self._pedb, i) for i in self.primitives if i.type == "circle"]
|
|
295
296
|
|
|
296
297
|
@property
|
|
297
|
-
def paths(self):
|
|
298
|
+
def paths(self) -> List[Path]:
|
|
298
299
|
"""All path primitives.
|
|
299
300
|
|
|
300
301
|
Returns
|
|
@@ -305,7 +306,7 @@ class Modeler(object):
|
|
|
305
306
|
return [Path(self._pedb, i) for i in self.primitives if i.type == "path"]
|
|
306
307
|
|
|
307
308
|
@property
|
|
308
|
-
def polygons(self):
|
|
309
|
+
def polygons(self) -> List[Polygon]:
|
|
309
310
|
"""All polygon primitives.
|
|
310
311
|
|
|
311
312
|
Returns
|
|
@@ -315,7 +316,7 @@ class Modeler(object):
|
|
|
315
316
|
"""
|
|
316
317
|
return [Polygon(self._pedb, i) for i in self.primitives if i.type == "polygon"]
|
|
317
318
|
|
|
318
|
-
def get_polygons_by_layer(self, layer_name, net_list=None):
|
|
319
|
+
def get_polygons_by_layer(self, layer_name: str, net_list: Optional[List[str]] = None) -> List[Primitive]:
|
|
319
320
|
"""Retrieve polygons by layer.
|
|
320
321
|
|
|
321
322
|
Parameters
|
|
@@ -340,7 +341,12 @@ class Modeler(object):
|
|
|
340
341
|
objinst.append(el)
|
|
341
342
|
return objinst
|
|
342
343
|
|
|
343
|
-
def get_primitive_by_layer_and_point(
|
|
344
|
+
def get_primitive_by_layer_and_point(
|
|
345
|
+
self,
|
|
346
|
+
point: Optional[List[float]] = None,
|
|
347
|
+
layer: Optional[Union[str, List[str]]] = None,
|
|
348
|
+
nets: Optional[Union[str, List[str]]] = None,
|
|
349
|
+
) -> List[Primitive]:
|
|
344
350
|
"""Get primitive at specified point on layer.
|
|
345
351
|
|
|
346
352
|
Parameters
|
|
@@ -405,7 +411,7 @@ class Modeler(object):
|
|
|
405
411
|
return returned_obj
|
|
406
412
|
|
|
407
413
|
@staticmethod
|
|
408
|
-
def get_polygon_bounding_box(polygon):
|
|
414
|
+
def get_polygon_bounding_box(polygon: Primitive) -> List[float]:
|
|
409
415
|
"""Get bounding box of polygon.
|
|
410
416
|
|
|
411
417
|
Parameters
|
|
@@ -419,15 +425,10 @@ class Modeler(object):
|
|
|
419
425
|
Bounding box coordinates [min_x, min_y, max_x, max_y].
|
|
420
426
|
"""
|
|
421
427
|
bounding_box = polygon.polygon_data.bbox()
|
|
422
|
-
return [
|
|
423
|
-
bounding_box[0].x.value,
|
|
424
|
-
bounding_box[0].y.value,
|
|
425
|
-
bounding_box[1].x.value,
|
|
426
|
-
bounding_box[1].y.value,
|
|
427
|
-
]
|
|
428
|
+
return [Value(bounding_box[0].x), Value(bounding_box[0].y), Value(bounding_box[1].x), Value(bounding_box[1].y)]
|
|
428
429
|
|
|
429
430
|
@staticmethod
|
|
430
|
-
def get_polygon_points(polygon):
|
|
431
|
+
def get_polygon_points(polygon) -> List[List[float]]:
|
|
431
432
|
"""Get points defining a polygon.
|
|
432
433
|
|
|
433
434
|
Parameters
|
|
@@ -449,9 +450,9 @@ class Modeler(object):
|
|
|
449
450
|
point = polygon.polygon_data.points[i]
|
|
450
451
|
if prev_point != point:
|
|
451
452
|
if point.is_arc:
|
|
452
|
-
points.append([point.x
|
|
453
|
+
points.append([Value(point.x)])
|
|
453
454
|
else:
|
|
454
|
-
points.append([point.x
|
|
455
|
+
points.append([Value(point.x), Value(point.y)])
|
|
455
456
|
prev_point = point
|
|
456
457
|
i += 1
|
|
457
458
|
else:
|
|
@@ -460,7 +461,7 @@ class Modeler(object):
|
|
|
460
461
|
continue_iterate = False
|
|
461
462
|
return points
|
|
462
463
|
|
|
463
|
-
def parametrize_polygon(self, polygon, selection_polygon, offset_name="offsetx", origin=None):
|
|
464
|
+
def parametrize_polygon(self, polygon, selection_polygon, offset_name="offsetx", origin=None) -> bool:
|
|
464
465
|
"""Parametrize polygon points based on another polygon.
|
|
465
466
|
|
|
466
467
|
Parameters
|
|
@@ -507,8 +508,8 @@ class Modeler(object):
|
|
|
507
508
|
polygon_data = polygon.polygon_data
|
|
508
509
|
bound_center = polygon_data.bounding_circle()[0]
|
|
509
510
|
bound_center2 = selection_polygon_data.bounding_circle()[0]
|
|
510
|
-
center = [bound_center.x
|
|
511
|
-
center2 = [bound_center2.x
|
|
511
|
+
center = [Value(bound_center.x), Value(bound_center.y)]
|
|
512
|
+
center2 = [Value(bound_center2.x), Value(bound_center2.y)]
|
|
512
513
|
x1, y1 = calc_slope(center2, center)
|
|
513
514
|
|
|
514
515
|
if not origin:
|
|
@@ -523,12 +524,12 @@ class Modeler(object):
|
|
|
523
524
|
if prev_point != point:
|
|
524
525
|
check_inside = selection_polygon_data.is_inside(point)
|
|
525
526
|
if check_inside:
|
|
526
|
-
xcoeff, ycoeff = calc_slope([point.x
|
|
527
|
+
xcoeff, ycoeff = calc_slope([Value(point.x), Value(point.x)], origin)
|
|
527
528
|
|
|
528
529
|
new_points = GrpcPointData(
|
|
529
530
|
[
|
|
530
|
-
|
|
531
|
-
|
|
531
|
+
Value(str(Value(point.x) + f"{xcoeff}*{offset_name}")),
|
|
532
|
+
Value(str(Value(point.y)) + f"{ycoeff}*{offset_name}"),
|
|
532
533
|
]
|
|
533
534
|
)
|
|
534
535
|
polygon_data.points[i] = new_points
|
|
@@ -604,12 +605,12 @@ class Modeler(object):
|
|
|
604
605
|
for pt in points:
|
|
605
606
|
_pt = []
|
|
606
607
|
for coord in pt:
|
|
607
|
-
coord =
|
|
608
|
+
coord = Value(coord, self._pedb.active_cell)
|
|
608
609
|
_pt.append(coord)
|
|
609
610
|
_points.append(_pt)
|
|
610
611
|
points = _points
|
|
611
612
|
|
|
612
|
-
width =
|
|
613
|
+
width = Value(width, self._pedb.active_cell)
|
|
613
614
|
|
|
614
615
|
polygon_data = GrpcPolygonData(points=[GrpcPointData(i) for i in points])
|
|
615
616
|
path = Path.create(
|
|
@@ -629,14 +630,14 @@ class Modeler(object):
|
|
|
629
630
|
|
|
630
631
|
def create_trace(
|
|
631
632
|
self,
|
|
632
|
-
path_list,
|
|
633
|
-
layer_name,
|
|
634
|
-
width=1,
|
|
635
|
-
net_name="",
|
|
636
|
-
start_cap_style="Round",
|
|
637
|
-
end_cap_style="Round",
|
|
638
|
-
corner_style="Round",
|
|
639
|
-
):
|
|
633
|
+
path_list: List[List[float]],
|
|
634
|
+
layer_name: str,
|
|
635
|
+
width: float = 1,
|
|
636
|
+
net_name: str = "",
|
|
637
|
+
start_cap_style: str = "Round",
|
|
638
|
+
end_cap_style: str = "Round",
|
|
639
|
+
corner_style: str = "Round",
|
|
640
|
+
) -> Optional[Primitive]:
|
|
640
641
|
"""Create trace path.
|
|
641
642
|
|
|
642
643
|
Parameters
|
|
@@ -674,7 +675,13 @@ class Modeler(object):
|
|
|
674
675
|
|
|
675
676
|
return primitive
|
|
676
677
|
|
|
677
|
-
def create_polygon(
|
|
678
|
+
def create_polygon(
|
|
679
|
+
self,
|
|
680
|
+
points: Union[List[List[float]], GrpcPolygonData],
|
|
681
|
+
layer_name: str,
|
|
682
|
+
voids: Optional[List[Any]] = [],
|
|
683
|
+
net_name: str = "",
|
|
684
|
+
) -> Optional[Primitive]:
|
|
678
685
|
"""Create polygon primitive.
|
|
679
686
|
|
|
680
687
|
Parameters
|
|
@@ -698,7 +705,7 @@ class Modeler(object):
|
|
|
698
705
|
new_points = []
|
|
699
706
|
for idx, i in enumerate(points):
|
|
700
707
|
new_points.append(
|
|
701
|
-
GrpcPointData([
|
|
708
|
+
GrpcPointData([Value(i[0], self._pedb.active_cell), Value(i[1], self._pedb.active_cell)])
|
|
702
709
|
)
|
|
703
710
|
polygon_data = GrpcPolygonData(points=new_points)
|
|
704
711
|
|
|
@@ -726,17 +733,17 @@ class Modeler(object):
|
|
|
726
733
|
|
|
727
734
|
def create_rectangle(
|
|
728
735
|
self,
|
|
729
|
-
layer_name,
|
|
730
|
-
net_name="",
|
|
731
|
-
lower_left_point="",
|
|
732
|
-
upper_right_point="",
|
|
733
|
-
center_point="",
|
|
734
|
-
width="",
|
|
735
|
-
height="",
|
|
736
|
-
representation_type="lower_left_upper_right",
|
|
737
|
-
corner_radius="0mm",
|
|
738
|
-
rotation="0deg",
|
|
739
|
-
):
|
|
736
|
+
layer_name: str,
|
|
737
|
+
net_name: str = "",
|
|
738
|
+
lower_left_point: str = "",
|
|
739
|
+
upper_right_point: str = "",
|
|
740
|
+
center_point: str = "",
|
|
741
|
+
width: Union[str, float] = "",
|
|
742
|
+
height: Union[str, float] = "",
|
|
743
|
+
representation_type: str = "lower_left_upper_right",
|
|
744
|
+
corner_radius: str = "0mm",
|
|
745
|
+
rotation: str = "0deg",
|
|
746
|
+
) -> Optional[Primitive]:
|
|
740
747
|
"""Create rectangle primitive.
|
|
741
748
|
|
|
742
749
|
Parameters
|
|
@@ -775,46 +782,48 @@ class Modeler(object):
|
|
|
775
782
|
layer=layer_name,
|
|
776
783
|
net=edb_net,
|
|
777
784
|
rep_type=rep_type,
|
|
778
|
-
param1=
|
|
779
|
-
param2=
|
|
780
|
-
param3=
|
|
781
|
-
param4=
|
|
782
|
-
corner_rad=
|
|
783
|
-
rotation=
|
|
785
|
+
param1=Value(lower_left_point[0]),
|
|
786
|
+
param2=Value(lower_left_point[1]),
|
|
787
|
+
param3=Value(upper_right_point[0]),
|
|
788
|
+
param4=Value(upper_right_point[1]),
|
|
789
|
+
corner_rad=Value(corner_radius),
|
|
790
|
+
rotation=Value(rotation),
|
|
784
791
|
)
|
|
785
792
|
else:
|
|
786
793
|
rep_type = GrpcRectangleRepresentationType.CENTER_WIDTH_HEIGHT
|
|
787
794
|
if isinstance(width, str):
|
|
788
795
|
if width in self._pedb.variables:
|
|
789
|
-
width =
|
|
796
|
+
width = Value(width, self._pedb.active_cell)
|
|
790
797
|
else:
|
|
791
|
-
width =
|
|
798
|
+
width = Value(width)
|
|
792
799
|
else:
|
|
793
|
-
width =
|
|
800
|
+
width = Value(width)
|
|
794
801
|
if isinstance(height, str):
|
|
795
802
|
if height in self._pedb.variables:
|
|
796
|
-
height =
|
|
803
|
+
height = Value(height, self._pedb.active_cell)
|
|
797
804
|
else:
|
|
798
|
-
height =
|
|
805
|
+
height = Value(width)
|
|
799
806
|
else:
|
|
800
|
-
height =
|
|
807
|
+
height = Value(width)
|
|
801
808
|
rect = Rectangle.create(
|
|
802
809
|
layout=self._active_layout,
|
|
803
810
|
layer=layer_name,
|
|
804
811
|
net=edb_net,
|
|
805
812
|
rep_type=rep_type,
|
|
806
|
-
param1=
|
|
807
|
-
param2=
|
|
808
|
-
param3=
|
|
809
|
-
param4=
|
|
810
|
-
corner_rad=
|
|
811
|
-
rotation=
|
|
813
|
+
param1=Value(center_point[0]),
|
|
814
|
+
param2=Value(center_point[1]),
|
|
815
|
+
param3=Value(width),
|
|
816
|
+
param4=Value(height),
|
|
817
|
+
corner_rad=Value(corner_radius),
|
|
818
|
+
rotation=Value(rotation),
|
|
812
819
|
)
|
|
813
820
|
if not rect.is_null:
|
|
814
821
|
return Rectangle(self._pedb, rect)
|
|
815
822
|
return False
|
|
816
823
|
|
|
817
|
-
def create_circle(
|
|
824
|
+
def create_circle(
|
|
825
|
+
self, layer_name: str, x: Union[float, str], y: Union[float, str], radius: Union[float, str], net_name: str = ""
|
|
826
|
+
) -> Optional[Primitive]:
|
|
818
827
|
"""Create circle primitive.
|
|
819
828
|
|
|
820
829
|
Parameters
|
|
@@ -841,15 +850,15 @@ class Modeler(object):
|
|
|
841
850
|
layout=self._active_layout,
|
|
842
851
|
layer=layer_name,
|
|
843
852
|
net=edb_net,
|
|
844
|
-
center_x=
|
|
845
|
-
center_y=
|
|
846
|
-
radius=
|
|
853
|
+
center_x=Value(x),
|
|
854
|
+
center_y=Value(y),
|
|
855
|
+
radius=Value(radius),
|
|
847
856
|
)
|
|
848
857
|
if not circle.is_null:
|
|
849
858
|
return Circle(self._pedb, circle)
|
|
850
859
|
return False
|
|
851
860
|
|
|
852
|
-
def delete_primitives(self, net_names):
|
|
861
|
+
def delete_primitives(self, net_names: Union[str, List[str]]) -> bool:
|
|
853
862
|
"""Delete primitives by net name(s).
|
|
854
863
|
|
|
855
864
|
Parameters
|
|
@@ -870,7 +879,13 @@ class Modeler(object):
|
|
|
870
879
|
p.delete()
|
|
871
880
|
return True
|
|
872
881
|
|
|
873
|
-
def get_primitives(
|
|
882
|
+
def get_primitives(
|
|
883
|
+
self,
|
|
884
|
+
net_name: Optional[str] = None,
|
|
885
|
+
layer_name: Optional[str] = None,
|
|
886
|
+
prim_type: Optional[str] = None,
|
|
887
|
+
is_void: bool = False,
|
|
888
|
+
) -> List[Primitive]:
|
|
874
889
|
"""Get primitives with filtering.
|
|
875
890
|
|
|
876
891
|
Parameters
|
|
@@ -907,7 +922,7 @@ class Modeler(object):
|
|
|
907
922
|
prims.append(el)
|
|
908
923
|
return prims
|
|
909
924
|
|
|
910
|
-
def fix_circle_void_for_clipping(self):
|
|
925
|
+
def fix_circle_void_for_clipping(self) -> bool:
|
|
911
926
|
"""Fix circle void clipping issues.
|
|
912
927
|
|
|
913
928
|
Returns
|
|
@@ -924,9 +939,9 @@ class Modeler(object):
|
|
|
924
939
|
layout=self._active_layout,
|
|
925
940
|
layer=void_circle.layer_name,
|
|
926
941
|
net=void_circle.net,
|
|
927
|
-
center_x=
|
|
928
|
-
center_y=
|
|
929
|
-
radius=
|
|
942
|
+
center_x=Value(circ_params[0]),
|
|
943
|
+
center_y=Value(circ_params[1]),
|
|
944
|
+
radius=Value(circ_params[2]),
|
|
930
945
|
)
|
|
931
946
|
if not cloned_circle.is_null:
|
|
932
947
|
cloned_circle.is_negative = True
|
|
@@ -934,7 +949,8 @@ class Modeler(object):
|
|
|
934
949
|
return True
|
|
935
950
|
|
|
936
951
|
@staticmethod
|
|
937
|
-
|
|
952
|
+
@staticmethod
|
|
953
|
+
def add_void(shape: "Primitive", void_shape: Union["Primitive", List["Primitive"]]) -> bool:
|
|
938
954
|
"""Add void to shape.
|
|
939
955
|
|
|
940
956
|
Parameters
|
|
@@ -979,8 +995,8 @@ class Modeler(object):
|
|
|
979
995
|
|
|
980
996
|
if not self._validatePoint(endPoint):
|
|
981
997
|
return None
|
|
982
|
-
startPoint = [
|
|
983
|
-
endPoint = [
|
|
998
|
+
startPoint = [Value(i) for i in startPoint]
|
|
999
|
+
endPoint = [Value(i) for i in endPoint]
|
|
984
1000
|
if len(endPoint) == 2:
|
|
985
1001
|
is_parametric = (
|
|
986
1002
|
is_parametric
|
|
@@ -1038,7 +1054,7 @@ class Modeler(object):
|
|
|
1038
1054
|
else:
|
|
1039
1055
|
k = 0
|
|
1040
1056
|
for pt in points:
|
|
1041
|
-
point = [
|
|
1057
|
+
point = [Value(i) for i in pt]
|
|
1042
1058
|
new_points = GrpcPointData(point)
|
|
1043
1059
|
if len(point) > 2:
|
|
1044
1060
|
k += 1
|
|
@@ -1106,11 +1122,11 @@ class Modeler(object):
|
|
|
1106
1122
|
|
|
1107
1123
|
def parametrize_trace_width(
|
|
1108
1124
|
self,
|
|
1109
|
-
nets_name,
|
|
1110
|
-
layers_name=None,
|
|
1111
|
-
parameter_name="trace_width",
|
|
1112
|
-
variable_value=None,
|
|
1113
|
-
):
|
|
1125
|
+
nets_name: Union[str, List[str]],
|
|
1126
|
+
layers_name: Optional[Union[str, List[str]]] = None,
|
|
1127
|
+
parameter_name: str = "trace_width",
|
|
1128
|
+
variable_value: Optional[Union[float, str]] = None,
|
|
1129
|
+
) -> bool:
|
|
1114
1130
|
"""Parametrize trace width.
|
|
1115
1131
|
|
|
1116
1132
|
Parameters
|
|
@@ -1142,17 +1158,22 @@ class Modeler(object):
|
|
|
1142
1158
|
if not variable_value:
|
|
1143
1159
|
variable_value = p.width
|
|
1144
1160
|
self._pedb.active_cell.add_variable(
|
|
1145
|
-
name=_parameter_name, value=
|
|
1161
|
+
name=_parameter_name, value=Value(variable_value), is_param=True
|
|
1146
1162
|
)
|
|
1147
|
-
p.width =
|
|
1163
|
+
p.width = Value(_parameter_name, self._pedb.active_cell)
|
|
1148
1164
|
elif p.layer.name in layers_name:
|
|
1149
1165
|
if not variable_value:
|
|
1150
1166
|
variable_value = p.width
|
|
1151
1167
|
self._pedb.add_design_variable(parameter_name, variable_value, True)
|
|
1152
|
-
p.width =
|
|
1168
|
+
p.width = Value(_parameter_name, self._pedb.active_cell)
|
|
1153
1169
|
return True
|
|
1154
1170
|
|
|
1155
|
-
def unite_polygons_on_layer(
|
|
1171
|
+
def unite_polygons_on_layer(
|
|
1172
|
+
self,
|
|
1173
|
+
layer_name: Optional[Union[str, List[str]]] = None,
|
|
1174
|
+
delete_padstack_gemometries: bool = False,
|
|
1175
|
+
net_names_list: Optional[List[str]] = None,
|
|
1176
|
+
) -> bool:
|
|
1156
1177
|
"""Unite polygons on layer.
|
|
1157
1178
|
|
|
1158
1179
|
Parameters
|
|
@@ -1173,6 +1194,8 @@ class Modeler(object):
|
|
|
1173
1194
|
layer_name = [layer_name]
|
|
1174
1195
|
if not layer_name:
|
|
1175
1196
|
layer_name = list(self._pedb.stackup.signal_layers.keys())
|
|
1197
|
+
if net_names_list is None:
|
|
1198
|
+
net_names_list = []
|
|
1176
1199
|
|
|
1177
1200
|
for lay in layer_name:
|
|
1178
1201
|
self._logger.info(f"Uniting Objects on layer {lay}.")
|
|
@@ -1223,7 +1246,7 @@ class Modeler(object):
|
|
|
1223
1246
|
self._pedb.padstacks.remove_pads_from_padstack(pad)
|
|
1224
1247
|
return True
|
|
1225
1248
|
|
|
1226
|
-
def defeature_polygon(self, poly, tolerance=0.001):
|
|
1249
|
+
def defeature_polygon(self, poly: Polygon, tolerance: float = 0.001) -> bool:
|
|
1227
1250
|
"""Defeature polygon.
|
|
1228
1251
|
|
|
1229
1252
|
Parameters
|
|
@@ -1247,7 +1270,9 @@ class Modeler(object):
|
|
|
1247
1270
|
poly.polygon_data = new_poly
|
|
1248
1271
|
return True
|
|
1249
1272
|
|
|
1250
|
-
def get_layout_statistics(
|
|
1273
|
+
def get_layout_statistics(
|
|
1274
|
+
self, evaluate_area: bool = False, net_list: Optional[List[str]] = None
|
|
1275
|
+
) -> LayoutStatistics:
|
|
1251
1276
|
"""Get layout statistics.
|
|
1252
1277
|
|
|
1253
1278
|
Parameters
|
|
@@ -1291,7 +1316,7 @@ class Modeler(object):
|
|
|
1291
1316
|
primitives = self.primitives_by_layer[layer]
|
|
1292
1317
|
for prim in primitives:
|
|
1293
1318
|
if prim.primitive_type.name == "PATH":
|
|
1294
|
-
surface += Path(self._pedb, prim).length * prim.cast().width
|
|
1319
|
+
surface += Path(self._pedb, prim).length * Value(prim.cast().width)
|
|
1295
1320
|
if prim.primitive_type.name == "POLYGON":
|
|
1296
1321
|
surface += prim.polygon_data.area()
|
|
1297
1322
|
stat_model.occupying_surface[layer] = round(surface, 6)
|
|
@@ -1300,21 +1325,21 @@ class Modeler(object):
|
|
|
1300
1325
|
|
|
1301
1326
|
def create_bondwire(
|
|
1302
1327
|
self,
|
|
1303
|
-
definition_name,
|
|
1304
|
-
placement_layer,
|
|
1305
|
-
width,
|
|
1306
|
-
material,
|
|
1307
|
-
start_layer_name,
|
|
1308
|
-
start_x,
|
|
1309
|
-
start_y,
|
|
1310
|
-
end_layer_name,
|
|
1311
|
-
end_x,
|
|
1312
|
-
end_y,
|
|
1313
|
-
net,
|
|
1314
|
-
start_cell_instance_name=None,
|
|
1315
|
-
end_cell_instance_name=None,
|
|
1316
|
-
bondwire_type="jedec4",
|
|
1317
|
-
):
|
|
1328
|
+
definition_name: str,
|
|
1329
|
+
placement_layer: str,
|
|
1330
|
+
width: Union[float, str],
|
|
1331
|
+
material: str,
|
|
1332
|
+
start_layer_name: str,
|
|
1333
|
+
start_x: Union[float, str],
|
|
1334
|
+
start_y: Union[float, str],
|
|
1335
|
+
end_layer_name: str,
|
|
1336
|
+
end_x: Union[float, str],
|
|
1337
|
+
end_y: Union[float, str],
|
|
1338
|
+
net: str,
|
|
1339
|
+
start_cell_instance_name: Optional[str] = None,
|
|
1340
|
+
end_cell_instance_name: Optional[str] = None,
|
|
1341
|
+
bondwire_type: str = "jedec4",
|
|
1342
|
+
) -> Optional[Primitive]:
|
|
1318
1343
|
"""Create bondwire.
|
|
1319
1344
|
|
|
1320
1345
|
Parameters
|
|
@@ -1390,14 +1415,14 @@ class Modeler(object):
|
|
|
1390
1415
|
bondwire_type=bondwire_type,
|
|
1391
1416
|
definition_name=definition_name,
|
|
1392
1417
|
placement_layer=placement_layer,
|
|
1393
|
-
width=
|
|
1418
|
+
width=Value(width),
|
|
1394
1419
|
material=material,
|
|
1395
1420
|
start_layer_name=start_layer_name,
|
|
1396
|
-
start_x=
|
|
1397
|
-
start_y=
|
|
1421
|
+
start_x=Value(start_x),
|
|
1422
|
+
start_y=Value(start_y),
|
|
1398
1423
|
end_layer_name=end_layer_name,
|
|
1399
|
-
end_x=
|
|
1400
|
-
end_y=
|
|
1424
|
+
end_x=Value(end_x),
|
|
1425
|
+
end_y=Value(end_y),
|
|
1401
1426
|
net=net,
|
|
1402
1427
|
end_context=end_cell_inst,
|
|
1403
1428
|
start_context=start_cell_inst,
|
|
@@ -1407,10 +1432,10 @@ class Modeler(object):
|
|
|
1407
1432
|
def create_pin_group(
|
|
1408
1433
|
self,
|
|
1409
1434
|
name: str,
|
|
1410
|
-
pins_by_id=None,
|
|
1411
|
-
pins_by_aedt_name=None,
|
|
1412
|
-
pins_by_name=None,
|
|
1413
|
-
):
|
|
1435
|
+
pins_by_id: Optional[List[int]] = None,
|
|
1436
|
+
pins_by_aedt_name: Optional[List[str]] = None,
|
|
1437
|
+
pins_by_name: Optional[List[str]] = None,
|
|
1438
|
+
) -> bool:
|
|
1414
1439
|
"""Create pin group.
|
|
1415
1440
|
|
|
1416
1441
|
Parameters
|