pyedb 0.54.0__py3-none-any.whl → 0.56.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 +19 -6
- pyedb/configuration/cfg_s_parameter_models.py +67 -172
- pyedb/configuration/cfg_setup.py +102 -295
- pyedb/configuration/configuration.py +64 -5
- pyedb/dotnet/database/Variables.py +26 -19
- 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 +63 -2
- pyedb/dotnet/database/cell/layout_obj.py +2 -2
- pyedb/dotnet/database/cell/primitive/path.py +6 -8
- pyedb/dotnet/database/cell/primitive/primitive.py +3 -24
- 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 +24 -24
- pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
- pyedb/dotnet/database/components.py +137 -124
- 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 +3 -199
- pyedb/dotnet/database/dotnet/primitive.py +3 -3
- 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 +23 -23
- pyedb/dotnet/database/edb_data/padstacks_data.py +63 -88
- 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 +1 -1
- pyedb/dotnet/database/geometry/point_data.py +14 -10
- pyedb/dotnet/database/geometry/polygon_data.py +3 -3
- pyedb/dotnet/database/hfss.py +46 -48
- pyedb/dotnet/database/layout_validation.py +14 -11
- pyedb/dotnet/database/materials.py +10 -11
- pyedb/dotnet/database/modeler.py +97 -91
- pyedb/dotnet/database/nets.py +19 -22
- pyedb/dotnet/database/padstack.py +171 -83
- pyedb/dotnet/database/siwave.py +42 -42
- pyedb/dotnet/database/stackup.py +140 -72
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +2 -2
- pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
- pyedb/dotnet/database/utilities/value.py +16 -16
- pyedb/dotnet/edb.py +230 -152
- pyedb/edb_logger.py +12 -27
- pyedb/extensions/create_cell_array.py +394 -0
- pyedb/extensions/via_design_backend.py +6 -3
- pyedb/generic/data_handlers.py +6 -7
- pyedb/generic/design_types.py +81 -30
- pyedb/generic/filesystem.py +5 -2
- pyedb/generic/general_methods.py +2 -122
- pyedb/generic/process.py +44 -108
- pyedb/generic/settings.py +79 -19
- pyedb/grpc/database/components.py +26 -4
- pyedb/grpc/database/control_file.py +5 -5
- pyedb/grpc/database/definition/materials.py +1 -1
- pyedb/grpc/database/definition/package_def.py +3 -3
- pyedb/grpc/database/definition/padstack_def.py +53 -0
- pyedb/grpc/database/geometry/polygon_data.py +1 -1
- pyedb/grpc/database/layout/layout.py +81 -5
- pyedb/grpc/database/layout_validation.py +5 -5
- pyedb/grpc/database/modeler.py +24 -16
- pyedb/grpc/database/net/net.py +15 -14
- pyedb/grpc/database/nets.py +70 -0
- pyedb/grpc/database/padstacks.py +122 -17
- pyedb/grpc/database/primitive/padstack_instance.py +175 -7
- pyedb/grpc/database/primitive/polygon.py +2 -2
- pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +3 -2
- pyedb/grpc/database/siwave.py +1 -1
- pyedb/grpc/database/source_excitations.py +12 -5
- pyedb/grpc/database/stackup.py +1 -1
- pyedb/grpc/database/terminal/bundle_terminal.py +1 -1
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +1 -1
- pyedb/grpc/database/terminal/pingroup_terminal.py +1 -1
- pyedb/grpc/database/utility/value.py +1 -0
- pyedb/grpc/database/utility/xml_control_file.py +5 -5
- pyedb/grpc/edb.py +80 -30
- pyedb/grpc/edb_init.py +3 -3
- pyedb/grpc/rpc_session.py +14 -13
- 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/modeler/geometry_operators.py +6 -6
- pyedb/siwave.py +6 -8
- pyedb/siwave_core/__init__.py +0 -0
- pyedb/siwave_core/cpa/__init__.py +0 -0
- {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/METADATA +1 -2
- {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/RECORD +105 -98
- {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/WHEEL +0 -0
- {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -128,15 +128,15 @@ class EdbPadstacks(object):
|
|
|
128
128
|
"""
|
|
129
129
|
|
|
130
130
|
if val == 0:
|
|
131
|
-
return self._edb.
|
|
131
|
+
return self._edb.Definition.PadType.RegularPad
|
|
132
132
|
elif val == 1:
|
|
133
|
-
return self._edb.
|
|
133
|
+
return self._edb.Definition.PadType.AntiPad
|
|
134
134
|
elif val == 2:
|
|
135
|
-
return self._edb.
|
|
135
|
+
return self._edb.Definition.PadType.ThermalPad
|
|
136
136
|
elif val == 3:
|
|
137
|
-
return self._edb.
|
|
137
|
+
return self._edb.Definition.PadType.Hole
|
|
138
138
|
elif val == 4:
|
|
139
|
-
return self._edb.
|
|
139
|
+
return self._edb.Definition.PadType.UnknownGeomType
|
|
140
140
|
else:
|
|
141
141
|
return val
|
|
142
142
|
|
|
@@ -153,29 +153,29 @@ class EdbPadstacks(object):
|
|
|
153
153
|
EDB.PadGeometryType enumerator value.
|
|
154
154
|
"""
|
|
155
155
|
if val == 0:
|
|
156
|
-
return self._edb.
|
|
156
|
+
return self._edb.Definition.PadGeometryType.NoGeometry
|
|
157
157
|
elif val == 1:
|
|
158
|
-
return self._edb.
|
|
158
|
+
return self._edb.Definition.PadGeometryType.Circle
|
|
159
159
|
elif val == 2:
|
|
160
|
-
return self._edb.
|
|
160
|
+
return self._edb.Definition.PadGeometryType.Square
|
|
161
161
|
elif val == 3:
|
|
162
|
-
return self._edb.
|
|
162
|
+
return self._edb.Definition.PadGeometryType.Rectangle
|
|
163
163
|
elif val == 4:
|
|
164
|
-
return self._edb.
|
|
164
|
+
return self._edb.Definition.PadGeometryType.Oval
|
|
165
165
|
elif val == 5:
|
|
166
|
-
return self._edb.
|
|
166
|
+
return self._edb.Definition.PadGeometryType.Bullet
|
|
167
167
|
elif val == 6:
|
|
168
|
-
return self._edb.
|
|
168
|
+
return self._edb.Definition.PadGeometryType.NSidedPolygon
|
|
169
169
|
elif val == 7:
|
|
170
|
-
return self._edb.
|
|
170
|
+
return self._edb.Definition.PadGeometryType.Polygon
|
|
171
171
|
elif val == 8:
|
|
172
|
-
return self._edb.
|
|
172
|
+
return self._edb.Definition.PadGeometryType.Round45
|
|
173
173
|
elif val == 9:
|
|
174
|
-
return self._edb.
|
|
174
|
+
return self._edb.Definition.PadGeometryType.Round90
|
|
175
175
|
elif val == 10:
|
|
176
|
-
return self._edb.
|
|
176
|
+
return self._edb.Definition.PadGeometryType.Square45
|
|
177
177
|
elif val == 11:
|
|
178
|
-
return self._edb.
|
|
178
|
+
return self._edb.Definition.PadGeometryType.Square90
|
|
179
179
|
else:
|
|
180
180
|
return val
|
|
181
181
|
|
|
@@ -189,10 +189,10 @@ class EdbPadstacks(object):
|
|
|
189
189
|
List of definitions via padstack definitions.
|
|
190
190
|
|
|
191
191
|
"""
|
|
192
|
-
if len(self._definitions) == len(self._pedb.
|
|
192
|
+
if len(self._definitions) == len(list(self._pedb._db.PadstackDefs)):
|
|
193
193
|
return self._definitions
|
|
194
194
|
self._definitions = {}
|
|
195
|
-
for padstackdef in self._pedb.
|
|
195
|
+
for padstackdef in list(self._pedb._db.PadstackDefs):
|
|
196
196
|
PadStackData = padstackdef.GetData()
|
|
197
197
|
if len(PadStackData.GetLayerNames()) >= 1:
|
|
198
198
|
self._definitions[padstackdef.GetName()] = EDBPadstack(padstackdef, self)
|
|
@@ -331,11 +331,11 @@ class EdbPadstacks(object):
|
|
|
331
331
|
|
|
332
332
|
class PadType:
|
|
333
333
|
(RegularPad, AntiPad, ThermalPad, Hole, UnknownGeomType) = (
|
|
334
|
-
self._edb.
|
|
335
|
-
self._edb.
|
|
336
|
-
self._edb.
|
|
337
|
-
self._edb.
|
|
338
|
-
self._edb.
|
|
334
|
+
self._edb.Definition.PadType.RegularPad,
|
|
335
|
+
self._edb.Definition.PadType.AntiPad,
|
|
336
|
+
self._edb.Definition.PadType.ThermalPad,
|
|
337
|
+
self._edb.Definition.PadType.Hole,
|
|
338
|
+
self._edb.Definition.PadType.UnknownGeomType,
|
|
339
339
|
)
|
|
340
340
|
|
|
341
341
|
return PadType
|
|
@@ -374,32 +374,32 @@ class EdbPadstacks(object):
|
|
|
374
374
|
Name of the padstack if the operation is successful.
|
|
375
375
|
"""
|
|
376
376
|
|
|
377
|
-
PadStack = self._edb.
|
|
378
|
-
new_PadStackData = self._edb.
|
|
377
|
+
PadStack = self._edb.Definition.PadstackDef.Create(self._layout.cell.GetDatabase(), padstackname)
|
|
378
|
+
new_PadStackData = self._edb.Definition.PadstackDefData.Create()
|
|
379
379
|
list_values = convert_py_list_to_net_list(
|
|
380
380
|
[self._get_edb_value(holediam), self._get_edb_value(paddiam), self._get_edb_value(antipaddiam)]
|
|
381
381
|
)
|
|
382
382
|
value0 = self._get_edb_value(0.0)
|
|
383
383
|
new_PadStackData.SetHoleParameters(
|
|
384
|
-
self._edb.
|
|
384
|
+
self._edb.Definition.PadGeometryType.Circle,
|
|
385
385
|
list_values,
|
|
386
386
|
value0,
|
|
387
387
|
value0,
|
|
388
388
|
value0,
|
|
389
389
|
)
|
|
390
|
-
new_PadStackData.SetHoleRange(self._edb.
|
|
390
|
+
new_PadStackData.SetHoleRange(self._edb.Definition.PadstackHoleRange.UpperPadToLowerPad)
|
|
391
391
|
layers = list(self._pedb.stackup.signal_layers.keys())
|
|
392
392
|
if not startlayer:
|
|
393
393
|
startlayer = layers[0]
|
|
394
394
|
if not endlayer:
|
|
395
395
|
endlayer = layers[len(layers) - 1]
|
|
396
396
|
|
|
397
|
-
antipad_shape = self._edb.
|
|
397
|
+
antipad_shape = self._edb.Definition.PadGeometryType.Circle
|
|
398
398
|
started = False
|
|
399
399
|
new_PadStackData.SetPadParameters(
|
|
400
400
|
"Default",
|
|
401
|
-
self._edb.
|
|
402
|
-
self._edb.
|
|
401
|
+
self._edb.Definition.PadType.RegularPad,
|
|
402
|
+
self._edb.Definition.PadGeometryType.Circle,
|
|
403
403
|
convert_py_list_to_net_list([self._get_edb_value(paddiam)]),
|
|
404
404
|
value0,
|
|
405
405
|
value0,
|
|
@@ -408,7 +408,7 @@ class EdbPadstacks(object):
|
|
|
408
408
|
|
|
409
409
|
new_PadStackData.SetPadParameters(
|
|
410
410
|
"Default",
|
|
411
|
-
self._edb.
|
|
411
|
+
self._edb.Definition.PadType.AntiPad,
|
|
412
412
|
antipad_shape,
|
|
413
413
|
convert_py_list_to_net_list([self._get_edb_value(antipaddiam)]),
|
|
414
414
|
value0,
|
|
@@ -423,8 +423,8 @@ class EdbPadstacks(object):
|
|
|
423
423
|
if started:
|
|
424
424
|
new_PadStackData.SetPadParameters(
|
|
425
425
|
layer,
|
|
426
|
-
self._edb.
|
|
427
|
-
self._edb.
|
|
426
|
+
self._edb.Definition.PadType.RegularPad,
|
|
427
|
+
self._edb.Definition.PadGeometryType.Circle,
|
|
428
428
|
convert_py_list_to_net_list([self._get_edb_value(paddiam)]),
|
|
429
429
|
value0,
|
|
430
430
|
value0,
|
|
@@ -432,7 +432,7 @@ class EdbPadstacks(object):
|
|
|
432
432
|
)
|
|
433
433
|
new_PadStackData.SetPadParameters(
|
|
434
434
|
layer,
|
|
435
|
-
self._edb.
|
|
435
|
+
self._edb.Definition.PadType.AntiPad,
|
|
436
436
|
antipad_shape,
|
|
437
437
|
convert_py_list_to_net_list([self._get_edb_value(antipaddiam)]),
|
|
438
438
|
value0,
|
|
@@ -493,13 +493,13 @@ class EdbPadstacks(object):
|
|
|
493
493
|
|
|
494
494
|
else:
|
|
495
495
|
psdef = padstackInst._edb_object.GetPadstackDef()
|
|
496
|
-
newdefdata = self._edb.
|
|
497
|
-
newdefdata.SetSolderBallShape(self._edb.
|
|
496
|
+
newdefdata = self._edb.Definition.PadstackDefData(psdef.GetData())
|
|
497
|
+
newdefdata.SetSolderBallShape(self._edb.Definition.SolderballShape.Cylinder)
|
|
498
498
|
newdefdata.SetSolderBallParameter(self._get_edb_value(ballDiam), self._get_edb_value(ballDiam))
|
|
499
499
|
sball_placement = (
|
|
500
|
-
self._edb.
|
|
500
|
+
self._edb.Definition.SolderballPlacement.AbovePadstack
|
|
501
501
|
if isTopPlaced
|
|
502
|
-
else self._edb.
|
|
502
|
+
else self._edb.Definition.SolderballPlacement.BelowPadstack
|
|
503
503
|
)
|
|
504
504
|
newdefdata.SetSolderBallPlacement(sball_placement)
|
|
505
505
|
psdef.SetData(newdefdata)
|
|
@@ -560,7 +560,7 @@ class EdbPadstacks(object):
|
|
|
560
560
|
if self._port_exist(port_name):
|
|
561
561
|
port_name = generate_unique_name(port_name, n=2)
|
|
562
562
|
self._logger.info("An existing port already has this same name. Renaming to {}.".format(port_name))
|
|
563
|
-
self._edb.
|
|
563
|
+
self._edb.Cell.Terminal.PadstackInstanceTerminal.Create(
|
|
564
564
|
self._active_layout,
|
|
565
565
|
padstackinstance.GetNet(),
|
|
566
566
|
port_name,
|
|
@@ -633,7 +633,7 @@ class EdbPadstacks(object):
|
|
|
633
633
|
else:
|
|
634
634
|
if not isinstance(pin, EDBPadstackInstance):
|
|
635
635
|
pin = EDBPadstackInstance(pin, self._pedb)
|
|
636
|
-
padparams = self._edb.
|
|
636
|
+
padparams = self._edb.Definition.PadstackDefData(
|
|
637
637
|
pin._edb_object.GetPadstackDef().GetData()
|
|
638
638
|
).GetPadParametersValue(layername, self.int_to_pad_type(pad_type))
|
|
639
639
|
if padparams[2]:
|
|
@@ -644,12 +644,12 @@ class EdbPadstacks(object):
|
|
|
644
644
|
rotation = padparams[5].ToDouble()
|
|
645
645
|
return geometry_type, parameters, offset_x, offset_y, rotation
|
|
646
646
|
else:
|
|
647
|
-
if isinstance(pin, self._edb.
|
|
648
|
-
padparams = self._edb.
|
|
647
|
+
if isinstance(pin, self._edb.Definition.PadstackDef):
|
|
648
|
+
padparams = self._edb.Definition.PadstackDefData(pin.GetData()).GetPolygonalPadParameters(
|
|
649
649
|
layername, self.int_to_pad_type(pad_type)
|
|
650
650
|
)
|
|
651
651
|
else:
|
|
652
|
-
padparams = self._edb.
|
|
652
|
+
padparams = self._edb.Definition.PadstackDefData(
|
|
653
653
|
pin._edb_object.GetPadstackDef().GetData()
|
|
654
654
|
).GetPolygonalPadParameters(layername, self.int_to_pad_type(pad_type))
|
|
655
655
|
|
|
@@ -682,7 +682,7 @@ class EdbPadstacks(object):
|
|
|
682
682
|
"""
|
|
683
683
|
if self.definitions:
|
|
684
684
|
for padstack in list(self.definitions.values()):
|
|
685
|
-
cloned_padstack_data = self._edb.
|
|
685
|
+
cloned_padstack_data = self._edb.Definition.PadstackDefData(padstack.edb_padstack.GetData())
|
|
686
686
|
layers_name = cloned_padstack_data.GetLayerNames()
|
|
687
687
|
all_succeed = True
|
|
688
688
|
for layer in layers_name:
|
|
@@ -693,11 +693,11 @@ class EdbPadstacks(object):
|
|
|
693
693
|
params = convert_py_list_to_net_list(
|
|
694
694
|
[self._pedb.edb_value(value)] * len(parameters)
|
|
695
695
|
) # pragma no cover
|
|
696
|
-
geom = self._edb.
|
|
696
|
+
geom = self._edb.Definition.PadGeometryType.Circle
|
|
697
697
|
offset_x = self._pedb.edb_value(offset_x)
|
|
698
698
|
offset_y = self._pedb.edb_value(offset_y)
|
|
699
699
|
rot = self._pedb.edb_value(rot)
|
|
700
|
-
antipad = self._edb.
|
|
700
|
+
antipad = self._edb.Definition.PadType.AntiPad
|
|
701
701
|
if cloned_padstack_data.SetPadParameters(
|
|
702
702
|
layer, antipad, geom, params, offset_x, offset_y, rot
|
|
703
703
|
): # pragma no cover
|
|
@@ -945,9 +945,9 @@ class EdbPadstacks(object):
|
|
|
945
945
|
if not padstackname:
|
|
946
946
|
padstackname = generate_unique_name("VIA")
|
|
947
947
|
# assert not self.isreadonly, "Write Functions are not available within AEDT"
|
|
948
|
-
padstackData = self._edb.
|
|
948
|
+
padstackData = self._edb.Definition.PadstackDefData.Create()
|
|
949
949
|
if has_hole and not polygon_hole:
|
|
950
|
-
ptype = self._edb.
|
|
950
|
+
ptype = self._edb.Definition.PadGeometryType.Circle
|
|
951
951
|
hole_param = Array[type(holediam)]([holediam])
|
|
952
952
|
padstackData.SetHoleParameters(ptype, hole_param, value0, value0, value0)
|
|
953
953
|
padstackData.SetHolePlatingPercentage(self._get_edb_value(20.0))
|
|
@@ -966,7 +966,7 @@ class EdbPadstacks(object):
|
|
|
966
966
|
padstackData.SetPolygonalHoleParameters(hole_param, value0, value0, value0)
|
|
967
967
|
padstackData.SetHolePlatingPercentage(self._get_edb_value(20.0))
|
|
968
968
|
else:
|
|
969
|
-
ptype = self._edb.
|
|
969
|
+
ptype = self._edb.Definition.PadGeometryType.NoGeometry
|
|
970
970
|
|
|
971
971
|
x_size = self._get_edb_value(x_size)
|
|
972
972
|
y_size = self._get_edb_value(y_size)
|
|
@@ -982,13 +982,13 @@ class EdbPadstacks(object):
|
|
|
982
982
|
anti_pad_y_size = self._get_edb_value(anti_pad_y_size)
|
|
983
983
|
|
|
984
984
|
if hole_range == "through": # pragma no cover
|
|
985
|
-
padstackData.SetHoleRange(self._edb.
|
|
985
|
+
padstackData.SetHoleRange(self._edb.Definition.PadstackHoleRange.Through)
|
|
986
986
|
elif hole_range == "begin_on_upper_pad": # pragma no cover
|
|
987
|
-
padstackData.SetHoleRange(self._edb.
|
|
987
|
+
padstackData.SetHoleRange(self._edb.Definition.PadstackHoleRange.BeginOnUpperPad)
|
|
988
988
|
elif hole_range == "end_on_lower_pad": # pragma no cover
|
|
989
|
-
padstackData.SetHoleRange(self._edb.
|
|
989
|
+
padstackData.SetHoleRange(self._edb.Definition.PadstackHoleRange.EndOnLowerPad)
|
|
990
990
|
elif hole_range == "upper_pad_to_lower_pad": # pragma no cover
|
|
991
|
-
padstackData.SetHoleRange(self._edb.
|
|
991
|
+
padstackData.SetHoleRange(self._edb.Definition.PadstackHoleRange.UpperPadToLowerPad)
|
|
992
992
|
else: # pragma no cover
|
|
993
993
|
self._logger.error("Unknown padstack hole range")
|
|
994
994
|
padstackData.SetMaterial("copper")
|
|
@@ -999,10 +999,10 @@ class EdbPadstacks(object):
|
|
|
999
999
|
layers = layers[: layers.index(stop_layer) + 1]
|
|
1000
1000
|
pad_array = Array[type(paddiam)]([paddiam])
|
|
1001
1001
|
if pad_shape == "Circle": # pragma no cover
|
|
1002
|
-
pad_shape = self._edb.
|
|
1002
|
+
pad_shape = self._edb.Definition.PadGeometryType.Circle
|
|
1003
1003
|
elif pad_shape == "Rectangle": # pragma no cover
|
|
1004
1004
|
pad_array = Array[type(x_size)]([x_size, y_size])
|
|
1005
|
-
pad_shape = self._edb.
|
|
1005
|
+
pad_shape = self._edb.Definition.PadGeometryType.Rectangle
|
|
1006
1006
|
elif pad_shape == "Polygon":
|
|
1007
1007
|
if isinstance(pad_polygon, list):
|
|
1008
1008
|
_poly = self._pedb.modeler.create_polygon(pad_polygon, layers[0], net_name="dummy")
|
|
@@ -1015,10 +1015,10 @@ class EdbPadstacks(object):
|
|
|
1015
1015
|
pad_array = pad_polygon
|
|
1016
1016
|
if antipad_shape == "Bullet": # pragma no cover
|
|
1017
1017
|
antipad_array = Array[type(x_size)]([x_size, y_size, corner_radius])
|
|
1018
|
-
antipad_shape = self._edb.
|
|
1018
|
+
antipad_shape = self._edb.Definition.PadGeometryType.Bullet
|
|
1019
1019
|
elif antipad_shape == "Rectangle": # pragma no cover
|
|
1020
1020
|
antipad_array = Array[type(anti_pad_x_size)]([anti_pad_x_size, anti_pad_y_size])
|
|
1021
|
-
antipad_shape = self._edb.
|
|
1021
|
+
antipad_shape = self._edb.Definition.PadGeometryType.Rectangle
|
|
1022
1022
|
elif antipad_shape == "Polygon":
|
|
1023
1023
|
if isinstance(antipad_polygon, list):
|
|
1024
1024
|
_poly = self._pedb.modeler.create_polygon(antipad_polygon, layers[0], net_name="dummy")
|
|
@@ -1031,14 +1031,14 @@ class EdbPadstacks(object):
|
|
|
1031
1031
|
antipad_array = antipad_polygon
|
|
1032
1032
|
else: # pragma no cover
|
|
1033
1033
|
antipad_array = Array[type(antipaddiam)]([antipaddiam])
|
|
1034
|
-
antipad_shape = self._edb.
|
|
1034
|
+
antipad_shape = self._edb.Definition.PadGeometryType.Circle
|
|
1035
1035
|
if add_default_layer: # pragma no cover
|
|
1036
1036
|
layers = layers + ["Default"]
|
|
1037
1037
|
if antipad_shape == "Polygon" and pad_shape == "Polygon":
|
|
1038
1038
|
for layer in layers:
|
|
1039
1039
|
padstackData.SetPolygonalPadParameters(
|
|
1040
1040
|
layer,
|
|
1041
|
-
self._edb.
|
|
1041
|
+
self._edb.Definition.PadType.RegularPad,
|
|
1042
1042
|
pad_array._edb_object,
|
|
1043
1043
|
pad_offset_x,
|
|
1044
1044
|
pad_offset_y,
|
|
@@ -1046,7 +1046,7 @@ class EdbPadstacks(object):
|
|
|
1046
1046
|
)
|
|
1047
1047
|
padstackData.SetPolygonalPadParameters(
|
|
1048
1048
|
layer,
|
|
1049
|
-
self._edb.
|
|
1049
|
+
self._edb.Definition.PadType.AntiPad,
|
|
1050
1050
|
antipad_array._edb_object,
|
|
1051
1051
|
pad_offset_x,
|
|
1052
1052
|
pad_offset_y,
|
|
@@ -1056,7 +1056,7 @@ class EdbPadstacks(object):
|
|
|
1056
1056
|
for layer in layers:
|
|
1057
1057
|
padstackData.SetPadParameters(
|
|
1058
1058
|
layer,
|
|
1059
|
-
self._edb.
|
|
1059
|
+
self._edb.Definition.PadType.RegularPad,
|
|
1060
1060
|
pad_shape,
|
|
1061
1061
|
pad_array,
|
|
1062
1062
|
pad_offset_x,
|
|
@@ -1066,7 +1066,7 @@ class EdbPadstacks(object):
|
|
|
1066
1066
|
|
|
1067
1067
|
padstackData.SetPadParameters(
|
|
1068
1068
|
layer,
|
|
1069
|
-
self._edb.
|
|
1069
|
+
self._edb.Definition.PadType.AntiPad,
|
|
1070
1070
|
antipad_shape,
|
|
1071
1071
|
antipad_array,
|
|
1072
1072
|
offset_x,
|
|
@@ -1074,7 +1074,7 @@ class EdbPadstacks(object):
|
|
|
1074
1074
|
rotation,
|
|
1075
1075
|
)
|
|
1076
1076
|
|
|
1077
|
-
padstackDefinition = self._edb.
|
|
1077
|
+
padstackDefinition = self._edb.Definition.PadstackDef.Create(self.db, padstackname)
|
|
1078
1078
|
padstackDefinition.SetData(padstackData)
|
|
1079
1079
|
self._logger.info("Padstack %s create correctly", padstackname)
|
|
1080
1080
|
return padstackname
|
|
@@ -1123,12 +1123,12 @@ class EdbPadstacks(object):
|
|
|
1123
1123
|
Name of the new padstack.
|
|
1124
1124
|
"""
|
|
1125
1125
|
p1 = self.definitions[target_padstack_name].edb_padstack.GetData()
|
|
1126
|
-
new_padstack_definition_data = self._edb.
|
|
1126
|
+
new_padstack_definition_data = self._edb.Definition.PadstackDefData(p1)
|
|
1127
1127
|
|
|
1128
1128
|
if not new_padstack_name:
|
|
1129
1129
|
new_padstack_name = generate_unique_name(target_padstack_name)
|
|
1130
1130
|
|
|
1131
|
-
padstack_definition = self._edb.
|
|
1131
|
+
padstack_definition = self._edb.Definition.PadstackDef.Create(self.db, new_padstack_name)
|
|
1132
1132
|
padstack_definition.SetData(new_padstack_definition_data)
|
|
1133
1133
|
|
|
1134
1134
|
return new_padstack_name
|
|
@@ -1177,7 +1177,8 @@ class EdbPadstacks(object):
|
|
|
1177
1177
|
for pad in list(self.definitions.keys()):
|
|
1178
1178
|
if pad == definition_name:
|
|
1179
1179
|
padstack = self.definitions[pad].edb_padstack
|
|
1180
|
-
position = self._edb.
|
|
1180
|
+
# position = self._edb.Geometry.PointData(position[0], position[1])
|
|
1181
|
+
position = self._pedb.pedb_class.database.geometry.point_data.PointData.create_from_xy(self._pedb, *position)
|
|
1181
1182
|
net = self._pedb.nets.find_or_create_net(net_name)
|
|
1182
1183
|
rotation = (
|
|
1183
1184
|
self._get_edb_value(rotation * math.pi / 180)
|
|
@@ -1204,20 +1205,20 @@ class EdbPadstacks(object):
|
|
|
1204
1205
|
if solderlayer:
|
|
1205
1206
|
solderlayer = sign_layers_values[solderlayer]._edb_layer
|
|
1206
1207
|
if padstack:
|
|
1207
|
-
padstack_instance = self._edb.
|
|
1208
|
+
padstack_instance = self._edb.Cell.Primitive.PadstackInstance.Create(
|
|
1208
1209
|
self._active_layout,
|
|
1209
|
-
net,
|
|
1210
|
+
net._edb_object,
|
|
1210
1211
|
via_name,
|
|
1211
1212
|
padstack,
|
|
1212
|
-
position,
|
|
1213
|
+
position._edb_object,
|
|
1213
1214
|
rotation,
|
|
1214
1215
|
fromlayer,
|
|
1215
1216
|
tolayer,
|
|
1216
1217
|
solderlayer,
|
|
1217
1218
|
None,
|
|
1218
1219
|
)
|
|
1219
|
-
padstack_instance.
|
|
1220
|
-
py_padstack_instance = EDBPadstackInstance(padstack_instance
|
|
1220
|
+
padstack_instance.SetIsLayoutPin(is_pin)
|
|
1221
|
+
py_padstack_instance = EDBPadstackInstance(padstack_instance, self._pedb)
|
|
1221
1222
|
|
|
1222
1223
|
return py_padstack_instance
|
|
1223
1224
|
else:
|
|
@@ -1292,12 +1293,12 @@ class EdbPadstacks(object):
|
|
|
1292
1293
|
bool
|
|
1293
1294
|
``True`` if successful.
|
|
1294
1295
|
"""
|
|
1295
|
-
pad_type = self._edb.
|
|
1296
|
-
pad_geo = self._edb.
|
|
1296
|
+
pad_type = self._edb.Definition.PadType.RegularPad
|
|
1297
|
+
pad_geo = self._edb.Definition.PadGeometryType.Circle
|
|
1297
1298
|
vals = self._get_edb_value(0)
|
|
1298
1299
|
params = convert_py_list_to_net_list([self._get_edb_value(0)])
|
|
1299
1300
|
p1 = self.definitions[padstack_name].edb_padstack.GetData()
|
|
1300
|
-
newPadstackDefinitionData = self._edb.
|
|
1301
|
+
newPadstackDefinitionData = self._edb.Definition.PadstackDefData(p1)
|
|
1301
1302
|
|
|
1302
1303
|
if not layer_name:
|
|
1303
1304
|
layer_name = list(self._pedb.stackup.signal_layers.keys())
|
|
@@ -1360,11 +1361,11 @@ class EdbPadstacks(object):
|
|
|
1360
1361
|
``True`` if successful.
|
|
1361
1362
|
"""
|
|
1362
1363
|
shape_dict = {
|
|
1363
|
-
"Circle": self._edb.
|
|
1364
|
-
"Square": self._edb.
|
|
1365
|
-
"Rectangle": self._edb.
|
|
1366
|
-
"Oval": self._edb.
|
|
1367
|
-
"Bullet": self._edb.
|
|
1364
|
+
"Circle": self._edb.Definition.PadGeometryType.Circle,
|
|
1365
|
+
"Square": self._edb.Definition.PadGeometryType.Square,
|
|
1366
|
+
"Rectangle": self._edb.Definition.PadGeometryType.Rectangle,
|
|
1367
|
+
"Oval": self._edb.Definition.PadGeometryType.Oval,
|
|
1368
|
+
"Bullet": self._edb.Definition.PadGeometryType.Bullet,
|
|
1368
1369
|
}
|
|
1369
1370
|
pad_shape = shape_dict[pad_shape]
|
|
1370
1371
|
if not isinstance(pad_params, list):
|
|
@@ -1383,7 +1384,7 @@ class EdbPadstacks(object):
|
|
|
1383
1384
|
antipad_rotation = self._get_edb_value(antipad_rotation)
|
|
1384
1385
|
|
|
1385
1386
|
p1 = self.definitions[padstack_name].edb_padstack.GetData()
|
|
1386
|
-
new_padstack_def = self._edb.
|
|
1387
|
+
new_padstack_def = self._edb.Definition.PadstackDefData(p1)
|
|
1387
1388
|
if not layer_name:
|
|
1388
1389
|
layer_name = list(self._pedb.stackup.signal_layers.keys())
|
|
1389
1390
|
elif isinstance(layer_name, str):
|
|
@@ -1391,7 +1392,7 @@ class EdbPadstacks(object):
|
|
|
1391
1392
|
for layer in layer_name:
|
|
1392
1393
|
new_padstack_def.SetPadParameters(
|
|
1393
1394
|
layer,
|
|
1394
|
-
self._edb.
|
|
1395
|
+
self._edb.Definition.PadType.RegularPad,
|
|
1395
1396
|
pad_shape,
|
|
1396
1397
|
pad_params,
|
|
1397
1398
|
pad_x_offset,
|
|
@@ -1400,7 +1401,7 @@ class EdbPadstacks(object):
|
|
|
1400
1401
|
)
|
|
1401
1402
|
new_padstack_def.SetPadParameters(
|
|
1402
1403
|
layer,
|
|
1403
|
-
self._edb.
|
|
1404
|
+
self._edb.Definition.PadType.AntiPad,
|
|
1404
1405
|
antipad_shape,
|
|
1405
1406
|
antipad_params,
|
|
1406
1407
|
antipad_x_offset,
|
|
@@ -1942,3 +1943,90 @@ class EdbPadstacks(object):
|
|
|
1942
1943
|
clusters[int(label)].append(padstack_ids[i])
|
|
1943
1944
|
|
|
1944
1945
|
return dict(clusters)
|
|
1946
|
+
|
|
1947
|
+
def reduce_via_by_density(
|
|
1948
|
+
self, padstacks: List[int], cell_size_x: float = 1e-3, cell_size_y: float = 1e-3, delete: bool = False
|
|
1949
|
+
) -> tuple[List[int], List[List[List[float]]]]:
|
|
1950
|
+
"""
|
|
1951
|
+
Reduce the number of vias by density. Keep only one via which is closest to the center of the cell. The cells
|
|
1952
|
+
are automatically populated based on the input vias.
|
|
1953
|
+
|
|
1954
|
+
Parameters
|
|
1955
|
+
----------
|
|
1956
|
+
padstacks: List[int]
|
|
1957
|
+
List of padstack ids to be reduced.
|
|
1958
|
+
|
|
1959
|
+
cell_size_x : float
|
|
1960
|
+
Width of each grid cell (default is 1e-3).
|
|
1961
|
+
|
|
1962
|
+
cell_size_y : float
|
|
1963
|
+
Height of each grid cell (default is 1e-3).
|
|
1964
|
+
|
|
1965
|
+
delete: bool
|
|
1966
|
+
If True, delete vias that are not kept (default is False).
|
|
1967
|
+
|
|
1968
|
+
Returns
|
|
1969
|
+
-------
|
|
1970
|
+
List[int]
|
|
1971
|
+
IDs of vias kept after reduction.
|
|
1972
|
+
|
|
1973
|
+
List[List[float]]
|
|
1974
|
+
coordinates for grid lines (for plotting).
|
|
1975
|
+
|
|
1976
|
+
"""
|
|
1977
|
+
to_keep = set()
|
|
1978
|
+
|
|
1979
|
+
all_instances = self.instances
|
|
1980
|
+
positions = np.array([all_instances[_id].position for _id in padstacks])
|
|
1981
|
+
|
|
1982
|
+
x_coords, y_coords = positions[:, 0], positions[:, 1]
|
|
1983
|
+
x_min, x_max = np.min(x_coords), np.max(x_coords)
|
|
1984
|
+
y_min, y_max = np.min(y_coords), np.max(y_coords)
|
|
1985
|
+
|
|
1986
|
+
padstacks_array = np.array(padstacks)
|
|
1987
|
+
cell_map = {} # {(cell_x, cell_y): [(id1, [x1, y1]), (id2, [x2, y2), ...]}
|
|
1988
|
+
grid = []
|
|
1989
|
+
|
|
1990
|
+
for idx, pos in enumerate(positions):
|
|
1991
|
+
i = int((pos[0] - x_min) // cell_size_x)
|
|
1992
|
+
j = int((pos[1] - y_min) // cell_size_y)
|
|
1993
|
+
cell_key = (i, j)
|
|
1994
|
+
cell_map.setdefault(cell_key, []).append((padstacks_array[idx], pos))
|
|
1995
|
+
|
|
1996
|
+
for (i, j), items in cell_map.items():
|
|
1997
|
+
# cell center
|
|
1998
|
+
cell_x_min = x_min + i * cell_size_x
|
|
1999
|
+
cell_y_min = y_min + j * cell_size_y
|
|
2000
|
+
cell_x_mid = cell_x_min + 0.5 * cell_size_x
|
|
2001
|
+
cell_y_mid = cell_y_min + 0.5 * cell_size_y
|
|
2002
|
+
|
|
2003
|
+
grid.append(
|
|
2004
|
+
[
|
|
2005
|
+
[
|
|
2006
|
+
cell_x_min,
|
|
2007
|
+
cell_x_min + cell_size_x,
|
|
2008
|
+
cell_x_min + cell_size_x,
|
|
2009
|
+
cell_x_min,
|
|
2010
|
+
cell_x_min,
|
|
2011
|
+
],
|
|
2012
|
+
[
|
|
2013
|
+
cell_y_min,
|
|
2014
|
+
cell_y_min,
|
|
2015
|
+
cell_y_min + cell_size_y,
|
|
2016
|
+
cell_y_min + cell_size_y,
|
|
2017
|
+
cell_y_min,
|
|
2018
|
+
],
|
|
2019
|
+
]
|
|
2020
|
+
)
|
|
2021
|
+
|
|
2022
|
+
# Find closest via to cell center
|
|
2023
|
+
distances = [np.linalg.norm(pos - [cell_x_mid, cell_y_mid]) for _, pos in items]
|
|
2024
|
+
closest_idx = np.argmin(distances)
|
|
2025
|
+
to_keep.add(items[closest_idx][0])
|
|
2026
|
+
|
|
2027
|
+
if delete:
|
|
2028
|
+
to_delete = set(padstacks) - to_keep
|
|
2029
|
+
for _id in to_delete:
|
|
2030
|
+
all_instances[_id].delete()
|
|
2031
|
+
|
|
2032
|
+
return list(to_keep), grid
|