Skip to content

Commit

Permalink
reverting extending ref pins search
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenb-dev committed Jul 24, 2024
1 parent a62b8f8 commit a791a61
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions src/pyedb/dotnet/edb_core/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,8 @@ def create_port_on_component(
]
if not ref_pins:
self._logger.error(
"No reference pins found on component. You might consider"
"using Circuit port instead since reference pins can be extended"
"outside the component automatically when not found."
"No reference pins found on component, no current return path which will defined causing wrong "
"results. Please check your design."
)
return False
pad_params = self._padstack.get_pad_parameters(pin=cmp_pins[0], layername=pin_layers[0], pad_type=0)
Expand Down Expand Up @@ -1005,7 +1004,7 @@ def create_port_on_component(
shape=sball_shape,
)
for pin in cmp_pins:
self._padstack.create_coax_port(padstackinstance=pin, name=port_name)
return self._padstack.create_coax_port(padstackinstance=pin, name=port_name)

elif port_type == SourceType.CircPort: # pragma no cover
ref_pins = [
Expand All @@ -1017,8 +1016,10 @@ def create_port_on_component(
if not p.IsLayoutPin():
p.SetIsLayoutPin(True)
if not ref_pins:
self._logger.warning("No reference pins found on component, the closest pin will be selected.")
do_pingroup = False
self._logger.warning(
f"No reference pins found on component {component.GetName()}. Please check your" f"design."
)
return False
if do_pingroup:
if len(ref_pins) == 1:
ref_pins.is_pin = True
Expand All @@ -1043,35 +1044,23 @@ def create_port_on_component(
if len(pins) == 1:
pin_term = self._create_terminal(pins[0])
if pin_term:
pin_term.SetReferenceTerminal(ref_pin_group_term)
return pin_term.SetReferenceTerminal(ref_pin_group_term)
else:
pin_group = self.create_pingroup_from_pins(pins)
if not pin_group:
return False
pin_group = self._pedb.siwave.pin_groups[pin_group.GetName()]
pin_group_term = self._create_pin_group_terminal(pin_group)
if pin_group_term:
pin_group_term.SetReferenceTerminal(ref_pin_group_term)
return pin_group_term.SetReferenceTerminal(ref_pin_group_term)
else:
self._logger.info("No pins found on component {} for the net {}".format(component, net))
else:
for net in net_list:
pins = [pin for pin in cmp_pins if pin.GetNet().GetName() == net]
for pin in pins:
if ref_pins:
self.create_port_on_pins(component, pin, ref_pins)
else:
_pin = EDBPadstackInstance(pin, self._pedb)
ref_pin = _pin.get_reference_pins(
reference_net=reference_net[0], max_limit=1, component_only=False, search_radius=3e-3
)
if ref_pin:
self.create_port_on_pins(
component,
[EDBPadstackInstance(pin, self._pedb).name],
[EDBPadstackInstance(ref_pin[0], self._pedb).id],
)
return True
return self.create_port_on_pins(component, pin, ref_pins)
return False

def _create_terminal(self, pin, term_name=None):
"""Create terminal on component pin.
Expand Down

0 comments on commit a791a61

Please sign in to comment.