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

FIX: bug in create pin group, replace logger.error with raise Value e… #967

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 7 additions & 8 deletions src/pyedb/configuration/cfg_pin_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,16 @@ def __init__(self, pedb, **kwargs):
def create(self):
"""Apply pin group on layout."""
if self.pins:
self._pedb.siwave.create_pin_group(self.reference_designator, list(self.pins), self.name)
pins = self.pins if isinstance(self.pins, list) else [self.pins]
self._pedb.siwave.create_pin_group(self.reference_designator, pins, self.name)
elif self.net:
if self.reference_designator in self._pedb.components.instances:
comp = self._pedb.components.instances[self.reference_designator]
else:
raise Exception(f"Component not found for creating pin group {self.name}.")
pins = [p for p, obj in comp.pins.items() if obj.net_name in self.net]
nets = self.net if isinstance(self.net, list) else [self.net]
comp = self._pedb.components.instances[self.reference_designator]
pins = [p for p, obj in comp.pins.items() if obj.net_name in nets]
if not self._pedb.siwave.create_pin_group(self.reference_designator, pins, self.name):
self._pedb.logger.error(f"Failed to create pin group {self.name}")
raise RuntimeError(f"Failed to create pin group {self.name}")
else:
self._pedb.logger.error(f"No net and pins defined for defining pin group {self.name}")
raise RuntimeError(f"No net and pins defined for defining pin group {self.name}")

def export_properties(self):
if self.pins:
Expand Down
3 changes: 1 addition & 2 deletions src/pyedb/dotnet/edb_core/siwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,7 @@ def create_pin_group(self, reference_designator, pin_numbers, group_name=None):
)

if edb_pingroup.IsNull(): # pragma: no cover
self._logger.error(f"Failed to create pin group {group_name}.")
return False
raise RuntimeError(f"Failed to create pin group {group_name}.")
else:
names = [i for i in pins if i.GetNet().GetName()]
edb_pingroup.SetNet(names[0].GetNet())
Expand Down
Loading