From 1df26cb37e45d6e0a1094b64733854e5d4ef062d Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 21 Jun 2024 15:40:33 +0200 Subject: [PATCH 1/5] hfsspi SimsetupInfo bug fixed --- .../edb_core/edb_data/hfss_pi_simulation_setup_data.py | 2 +- src/pyedb/dotnet/edb_core/utilities/simulation_setup.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py b/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py index 299f839c7f..8d7e5d9e10 100644 --- a/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py +++ b/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py @@ -39,7 +39,7 @@ def __init__(self, pedb, edb_object=None): def create(self, name=None): """Create an HFSS setup.""" self._name = name - self._create(name) + self._create(name=name, simulation_setup_type=self._setup_type) return self @property diff --git a/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py b/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py index 4408f14fab..4bf44e4a78 100644 --- a/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py +++ b/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py @@ -100,7 +100,11 @@ def __init__(self, pedb, edb_object=None): @property def sim_setup_info(self): - return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo()) + if self.type not in ["hfss_pi", "raptor_x"]: + return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo()) + else: + if self._edb_setup_info: + return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_setup_info) @sim_setup_info.setter def sim_setup_info(self, sim_setup_info): From 19355561b973aa5de048dc47d0e27c105b858932 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Tue, 25 Jun 2024 20:12:45 +0200 Subject: [PATCH 2/5] temp --- .../dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py diff --git a/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py b/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py deleted file mode 100644 index e69de29bb2..0000000000 From cf70de21a881f084e3c9f1f1a222b71e3cdbf9e5 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Thu, 11 Jul 2024 11:41:43 +0200 Subject: [PATCH 3/5] create pingroup fix --- src/pyedb/dotnet/edb_core/modeler.py | 54 +++++++++++++++++++--------- tests/legacy/system/test_edb.py | 17 +++++++++ 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/pyedb/dotnet/edb_core/modeler.py b/src/pyedb/dotnet/edb_core/modeler.py index ae3892a47a..7d17323efc 100644 --- a/src/pyedb/dotnet/edb_core/modeler.py +++ b/src/pyedb/dotnet/edb_core/modeler.py @@ -1396,7 +1396,13 @@ def create_bondwire( net=self._pedb.nets[net]._edb_object, ) - def create_pin_group(self, name: str, pins_by_id: list[int] = None, pins_by_aedt_name: list[str] = None): + def create_pin_group( + self, + name: str, + pins_by_id: list[int] = None, + pins_by_aedt_name: list[str] = None, + pins_by_name: list[str] = None, + ): """Create a PinGroup. Parameters @@ -1406,23 +1412,39 @@ def create_pin_group(self, name: str, pins_by_id: list[int] = None, pins_by_aedt List of pins by ID. pins_by_aedt_name : list[str] or None List of pins by AEDT name. + pins_by_name : list[str] or None + List of pins by name. """ - pins = [] - - if pins_by_id is not None: + pins = {} + if pins_by_id: for p in pins_by_id: - pins.append(self._pedb.layout.find_object_by_id(p._edb_object)) - else: + edb_pin = self._pedb.layout.find_object_by_id(p) + if edb_pin and not p in pins: + pins[p] = edb_pin._edb_object + if not pins_by_aedt_name: + pins_by_aedt_name = [] + if not pins_by_name: + pins_by_name = [] + if pins_by_aedt_name or pins_by_name: p_inst = self._pedb.layout.padstack_instances - while True: - p = p_inst.pop(0) - if p.aedt_name in pins_by_aedt_name: - pins.append(p._edb_object) - pins_by_aedt_name.remove(p.aedt_name) - if len(pins_by_aedt_name) == 0: - break - - self._edb.cell.hierarchy.pin_group.Create( - self._pedb.layout._edb_object, name, convert_py_list_to_net_list(pins) + _pins = { + pin.id: pin._edb_object + for pin in p_inst + if pin.aedt_name in pins_by_aedt_name or pin.name in pins_by_name + } + if not pins: + pins = _pins + else: + for id, pin in _pins.items(): + if not id in pins: + pins[id] = pin + if not pins: + self._logger.error("Not pin found") + return False + pins = list(pins.values()) + obj = self._edb.cell.hierarchy.pin_group.Create( + self._pedb.active_layout, name, convert_py_list_to_net_list(pins) ) + if obj.IsNull(): + return False return self._pedb.siwave.pin_groups[name] diff --git a/tests/legacy/system/test_edb.py b/tests/legacy/system/test_edb.py index 2e6fb5549d..dca761bef5 100644 --- a/tests/legacy/system/test_edb.py +++ b/tests/legacy/system/test_edb.py @@ -1682,3 +1682,20 @@ def test_create_port_ob_component_no_ref_pins_in_component(self, edb_examples): sim_setup.do_cutout_subdesign = False edbapp.build_simulation_project(sim_setup) assert len(edbapp.ports) == 15 + + def test_create_ping_group(self, edb_examples): + edbapp = edb_examples.get_si_verse() + assert edbapp.modeler.create_pin_group( + name="test1", pins_by_id=[4294969495, 4294969494, 4294969496, 4294969497] + ) + + assert edbapp.modeler.create_pin_group( + name="test2", pins_by_id=[4294969502, 4294969503], pins_by_aedt_name=["U1-A11", "U1-A12", "U1-A13"] + ) + assert edbapp.modeler.create_pin_group( + name="test3", + pins_by_id=[4294969502, 4294969503], + pins_by_aedt_name=["U1-A11", "U1-A12", "U1-A13"], + pins_by_name=["A11", "A12", "A15", "A16"], + ) + edbapp.close() From 1d949d25563b2969042a8e8a1b9fc3284f858004 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Thu, 11 Jul 2024 11:45:27 +0200 Subject: [PATCH 4/5] create pingroup fix --- src/pyedb/dotnet/edb_core/modeler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pyedb/dotnet/edb_core/modeler.py b/src/pyedb/dotnet/edb_core/modeler.py index 7d17323efc..e4a00950fa 100644 --- a/src/pyedb/dotnet/edb_core/modeler.py +++ b/src/pyedb/dotnet/edb_core/modeler.py @@ -1439,12 +1439,13 @@ def create_pin_group( if not id in pins: pins[id] = pin if not pins: - self._logger.error("Not pin found") + self._logger.error("No pin found") return False pins = list(pins.values()) obj = self._edb.cell.hierarchy.pin_group.Create( self._pedb.active_layout, name, convert_py_list_to_net_list(pins) ) if obj.IsNull(): + self._logger.debug("Pin group creation returned Null obj.") return False return self._pedb.siwave.pin_groups[name] From b5660fe85723e5d2734d84dd504b12e1ff2261e1 Mon Sep 17 00:00:00 2001 From: svandenb-dev <74993647+svandenb-dev@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:12:44 +0200 Subject: [PATCH 5/5] Update src/pyedb/dotnet/edb_core/modeler.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com> --- src/pyedb/dotnet/edb_core/modeler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyedb/dotnet/edb_core/modeler.py b/src/pyedb/dotnet/edb_core/modeler.py index e4a00950fa..bdfee101d1 100644 --- a/src/pyedb/dotnet/edb_core/modeler.py +++ b/src/pyedb/dotnet/edb_core/modeler.py @@ -1439,7 +1439,7 @@ def create_pin_group( if not id in pins: pins[id] = pin if not pins: - self._logger.error("No pin found") + self._logger.error("No pin found.") return False pins = list(pins.values()) obj = self._edb.cell.hierarchy.pin_group.Create(