diff --git a/src/pyedb/configuration/cfg_pin_groups.py b/src/pyedb/configuration/cfg_pin_groups.py index 14838d288e..c60cf44b1d 100644 --- a/src/pyedb/configuration/cfg_pin_groups.py +++ b/src/pyedb/configuration/cfg_pin_groups.py @@ -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: diff --git a/src/pyedb/dotnet/edb_core/siwave.py b/src/pyedb/dotnet/edb_core/siwave.py index 8025510ed5..7a0a4fe481 100644 --- a/src/pyedb/dotnet/edb_core/siwave.py +++ b/src/pyedb/dotnet/edb_core/siwave.py @@ -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())