Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix refresh padsatck def after layer name changed #3939

Merged
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6f3b815
edb intersection bug fix
svandenb-dev Jun 29, 2023
c9c9183
Merge remote-tracking branch 'origin/main'
svandenb-dev Jun 29, 2023
2c93929
Merge remote-tracking branch 'origin/main'
svandenb-dev Jun 30, 2023
13681b3
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 11, 2023
44b29bd
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 14, 2023
fa118ee
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 14, 2023
4f5170d
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 17, 2023
c532310
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 19, 2023
0ed1957
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 24, 2023
9c1f90f
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 26, 2023
b17e28d
Merge remote-tracking branch 'origin/main'
svandenb-dev Jul 27, 2023
0775a9f
Merge remote-tracking branch 'origin/main'
svandenb-dev Aug 21, 2023
8efa6e0
Merge remote-tracking branch 'origin/main'
svandenb-dev Aug 24, 2023
c32599f
Merge remote-tracking branch 'origin/main'
svandenb-dev Aug 28, 2023
64b538b
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 6, 2023
a4735a4
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 15, 2023
7ebf925
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 18, 2023
5a2c70b
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 21, 2023
38be8d7
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 21, 2023
d3cb775
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 22, 2023
52870ae
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 25, 2023
befd2f0
Merge remote-tracking branch 'origin/main'
svandenb-dev Oct 2, 2023
c84e923
Merge remote-tracking branch 'origin/main'
svandenb-dev Oct 31, 2023
f89f32b
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 8, 2023
15c110e
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 9, 2023
7edbdf9
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 14, 2023
4cfe1b6
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 23, 2023
d999259
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 1, 2023
903527f
codecov fix
svandenb-dev Dec 4, 2023
24da273
codecov fix
svandenb-dev Dec 4, 2023
76b6a81
Merge branch 'main' into bug_fix_refresh_padsatck_def_after_layer_nam…
svandenb-dev Dec 4, 2023
522e2b3
removing internal useless command
svandenb-dev Dec 4, 2023
a966ef7
Merge remote-tracking branch 'origin/bug_fix_refresh_padsatck_def_aft…
svandenb-dev Dec 4, 2023
2dc8b5a
Update pyaedt/edb_core/edb_data/layer_data.py
svandenb-dev Dec 5, 2023
068d7ce
Merge branch 'main' into bug_fix_refresh_padsatck_def_after_layer_nam…
svandenb-dev Dec 5, 2023
e9cf9fe
codecov fix
svandenb-dev Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions _unittest/test_00_EDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -2993,3 +2993,21 @@ def test_152_simconfig_built_custom_sballs_height(self):
assert round(edbapp.components["X1"].solder_ball_height, 6) == 0.00025
assert round(edbapp.components["U1"].solder_ball_height, 6) == 0.00035
edbapp.close_edb()

def test_153_update_padstacks_after_layer_name_changed(self):
source_path = os.path.join(local_path, "example_models", test_subfolder, "ANSYS-HSD_V1.aedb")
target_path = os.path.join(self.local_scratch.path, "test_padstack_def_update", "ANSYS-HSD_V1.aedb")
self.local_scratch.copyfolder(source_path, target_path)

edbapp = Edb(target_path, edbversion=desktop_version)
signal_layer_list = [layer for layer in list(edbapp.stackup.stackup_layers.values()) if layer.type == "signal"]
old_layers = []
for n_layer, layer in enumerate(signal_layer_list):
new_name = f"new_signal_name_{n_layer}"
old_layers.append(layer.name)
layer.name = new_name
for layer_name in list(edbapp.stackup.stackup_layers.keys()):
print(f"New layer name is {layer_name}")
for padstack_inst in list(edbapp.padstacks.instances.values()):
assert not [lay for lay in padstack_inst.layer_range_names if lay in old_layers]
edbapp.close_edb()
4 changes: 3 additions & 1 deletion pyaedt/edb_core/edb_data/layer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ def name(self):
@name.setter
def name(self, name):
layer_clone = self._edb_layer
old_name = layer_clone.GetName()
layer_clone.SetName(name)
self._pclass._set_layout_stackup(layer_clone, "change_name", self._name)
self._name = name
for padstack_def in list(self._pclass._pedb.padstacks.definitions.values()):
padstack_def._update_layer_names(old_name=old_name, updated_name=name)

@property
def type(self):
Expand All @@ -108,7 +111,6 @@ def type(self):
def type(self, new_type):
if new_type == self.type:
return

layer_clone = self._edb_layer
if new_type == "signal":
layer_clone.SetLayerType(self._edb.cell.layer_type.SignalLayer)
Expand Down
101 changes: 101 additions & 0 deletions pyaedt/edb_core/edb_data/padstacks_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,107 @@
self._ppadstack._pedb.logger.info("Created {} new microvias.".format(i))
return new_instances

@pyaedt_function_handler()
def _update_layer_names(self, old_name, updated_name):
"""Update padstack definition layer name when layer name is edited with the layer name setter.

Parameters
----------
old_name
old name : str
updated_name
new name : str

Returns
-------
bool
``True`` when succeed ``False`` when failed.

"""
cloned_padstack_data = self._edb.definition.PadstackDefData(self.edb_padstack.GetData())
new_padstack_data = self._edb.definition.PadstackDefData.Create()
layers_name = cloned_padstack_data.GetLayerNames()
layers_to_add = []
for layer in layers_name:
if layer == old_name:
layers_to_add.append(updated_name)
else:
layers_to_add.append(layer)
new_padstack_data.AddLayers(convert_py_list_to_net_list(layers_to_add))
for layer in layers_name:
updated_pad = self.pad_by_layer[layer]
if not updated_pad.geometry_type == 0:
pad_type = self._edb.definition.PadType.RegularPad
geom_type = self.pad_by_layer[layer]._pad_parameter_value[1]
parameters = self.pad_by_layer[layer]._pad_parameter_value[2]
offset_x = self.pad_by_layer[layer]._pad_parameter_value[3]
offset_y = self.pad_by_layer[layer]._pad_parameter_value[4]
rot = self.pad_by_layer[layer]._pad_parameter_value[5]
if layer == old_name: # pragma no cover
new_padstack_data.SetPadParameters(
updated_name, pad_type, geom_type, parameters, offset_x, offset_y, rot
)
else:
new_padstack_data.SetPadParameters(layer, pad_type, geom_type, parameters, offset_x, offset_y, rot)

updated_anti_pad = self.antipad_by_layer[layer]
if not updated_anti_pad.geometry_type == 0:
pad_type = self._edb.definition.PadType.AntiPad
geom_type = self.pad_by_layer[layer]._pad_parameter_value[1]
parameters = self.pad_by_layer[layer]._pad_parameter_value[2]
offset_x = self.pad_by_layer[layer]._pad_parameter_value[3]
offset_y = self.pad_by_layer[layer]._pad_parameter_value[4]
rotation = self.pad_by_layer[layer]._pad_parameter_value[5]

Check warning on line 1025 in pyaedt/edb_core/edb_data/padstacks_data.py

View check run for this annotation

Codecov / codecov/patch

pyaedt/edb_core/edb_data/padstacks_data.py#L1020-L1025

Added lines #L1020 - L1025 were not covered by tests
if layer == old_name: # pragma no cover
new_padstack_data.SetPadParameters(
updated_name, pad_type, geom_type, parameters, offset_x, offset_y, rotation
)
else:
new_padstack_data.SetPadParameters(

Check warning on line 1031 in pyaedt/edb_core/edb_data/padstacks_data.py

View check run for this annotation

Codecov / codecov/patch

pyaedt/edb_core/edb_data/padstacks_data.py#L1031

Added line #L1031 was not covered by tests
layer, pad_type, geom_type, parameters, offset_x, offset_y, rotation
)

updated_thermal_pad = self.thermalpad_by_layer[layer]
if not updated_thermal_pad.geometry_type == 0:
pad_type = self._edb.definition.PadType.ThermalPad
geom_type = self.pad_by_layer[layer]._pad_parameter_value[1]
parameters = self.pad_by_layer[layer]._pad_parameter_value[2]
offset_x = self.pad_by_layer[layer]._pad_parameter_value[3]
offset_y = self.pad_by_layer[layer]._pad_parameter_value[4]
rotation = self.pad_by_layer[layer]._pad_parameter_value[5]

Check warning on line 1042 in pyaedt/edb_core/edb_data/padstacks_data.py

View check run for this annotation

Codecov / codecov/patch

pyaedt/edb_core/edb_data/padstacks_data.py#L1037-L1042

Added lines #L1037 - L1042 were not covered by tests
if layer == old_name: # pragma no cover
new_padstack_data.SetPadParameters(
updated_name, pad_type, geom_type, parameters, offset_x, offset_y, rotation
)
else:
new_padstack_data.SetPadParameters(

Check warning on line 1048 in pyaedt/edb_core/edb_data/padstacks_data.py

View check run for this annotation

Codecov / codecov/patch

pyaedt/edb_core/edb_data/padstacks_data.py#L1048

Added line #L1048 was not covered by tests
layer, pad_type, geom_type, parameters, offset_x, offset_y, rotation
)

hole_param = cloned_padstack_data.GetHoleParameters()
if hole_param[0]:
hole_geom = hole_param[1]
hole_params = convert_py_list_to_net_list([self._get_edb_value(i) for i in hole_param[2]])
hole_off_x = self._get_edb_value(hole_param[3])
hole_off_y = self._get_edb_value(hole_param[4])
hole_rot = self._get_edb_value(hole_param[5])
new_padstack_data.SetHoleParameters(hole_geom, hole_params, hole_off_x, hole_off_y, hole_rot)

new_padstack_data.SetHolePlatingPercentage(self._get_edb_value(cloned_padstack_data.GetHolePlatingPercentage()))

new_padstack_data.SetHoleRange(cloned_padstack_data.GetHoleRange())
new_padstack_data.SetMaterial(cloned_padstack_data.GetMaterial())
new_padstack_data.SetSolderBallMaterial(cloned_padstack_data.GetSolderBallMaterial())
solder_ball_param = cloned_padstack_data.GetSolderBallParameter()
if solder_ball_param[0]:
new_padstack_data.SetSolderBallParameter(
self._get_edb_value(solder_ball_param[1]), self._get_edb_value(solder_ball_param[2])
)
new_padstack_data.SetSolderBallPlacement(cloned_padstack_data.GetSolderBallPlacement())
new_padstack_data.SetSolderBallShape(cloned_padstack_data.GetSolderBallShape())
self.edb_padstack.SetData(new_padstack_data)
return True


class EDBPadstackInstance(EDBPrimitivesMain):
"""Manages EDB functionalities for a padstack.
Expand Down
Loading