From 1df26cb37e45d6e0a1094b64733854e5d4ef062d Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 21 Jun 2024 15:40:33 +0200 Subject: [PATCH 1/8] 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/8] 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 9c6c6e3d1f79191944630e7c89964c7c445c0a51 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Wed, 10 Jul 2024 14:51:13 +0200 Subject: [PATCH 3/8] ex --- examples/legacy_standalone/03_rename_nets_and_ports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/legacy_standalone/03_rename_nets_and_ports.py b/examples/legacy_standalone/03_rename_nets_and_ports.py index 4fb99e31c4..f6c356230e 100644 --- a/examples/legacy_standalone/03_rename_nets_and_ports.py +++ b/examples/legacy_standalone/03_rename_nets_and_ports.py @@ -22,7 +22,7 @@ """ EDB: Rename nets and ports -------------------- +-------------------------- This example shows how you can use PyEDB to rename ports and nets. """ From 68e5f06e6c9e2a0ce7c7a257fde6ba4276975758 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Wed, 10 Jul 2024 15:03:19 +0200 Subject: [PATCH 4/8] added diff wave port example --- .../11_post_layout_parameterization.py | 8 +- .../12_create_differential_wave_port.py | 104 ++++++++++++++++++ 2 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 examples/legacy_standalone/12_create_differential_wave_port.py diff --git a/examples/legacy_standalone/11_post_layout_parameterization.py b/examples/legacy_standalone/11_post_layout_parameterization.py index 03e1138390..f259ebb197 100644 --- a/examples/legacy_standalone/11_post_layout_parameterization.py +++ b/examples/legacy_standalone/11_post_layout_parameterization.py @@ -28,7 +28,7 @@ ############################################################################### # Define input parameters -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~ signal_net_name = "DDR4_ALERT3" coplanar_plane_net_name = "1V0" # Specify coplanar plane net name for adding clearance layers = ["16_Bottom"] # Specify layers to be parameterized @@ -55,7 +55,7 @@ ############################################################################### # Cutout -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~ appedb.cutout([signal_net_name], [coplanar_plane_net_name, "GND"], remove_single_pin_components=True) ############################################################################### @@ -82,7 +82,7 @@ ############################################################################### # Delete existing clearance -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~ for p in trace_segments: for g in appedb.modeler.get_polygons_by_layer(p.layer_name, coplanar_plane_net_name): for v in g.voids: @@ -108,7 +108,7 @@ ############################################################################### # Save and close Edb -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~ save_edb_fpath = os.path.join(temppath, generate_unique_name("post_layout_parameterization") + ".aedb") appedb.save_edb_as(save_edb_fpath) diff --git a/examples/legacy_standalone/12_create_differential_wave_port.py b/examples/legacy_standalone/12_create_differential_wave_port.py new file mode 100644 index 0000000000..c40eef552a --- /dev/null +++ b/examples/legacy_standalone/12_create_differential_wave_port.py @@ -0,0 +1,104 @@ +# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +EDB: Differential wave port +--------------------------------- +This example shows how to create a simple design with differential pairs and assign wave port on them. +""" + + +############################################################################### +# Import EDB library +# ~~~~~~~~~~~~~~~~~~ +from pyedb import Edb + +############################################################################### +# Create an empty EDB +# ~~~~~~~~~~~~~~~~~~~ +edb = Edb() + +############################################################################### +# Define a layer stackup +# ~~~~~~~~~~~~~~~~~~~~~~ +edb.stackup.add_layer("GND", "Gap") +edb.stackup.add_layer("Substrat", "GND", layer_type="dielectric", thickness="0.2mm", material="Duroid (tm)") +edb.stackup.add_layer("TOP", "Substrat") + +############################################################################### +# Define parameters +# ~~~~~~~~~~~~~~~~~ +trace_length = 10e-3 +trace_width = 200e-6 +design_width = 10e-3 +trace_gap = 1e-3 + +############################################################################### +# Create ground plane +# ~~~~~~~~~~~~~~~~~~~ +gnd_plane = edb.modeler.create_polygon( + main_shape=[ + [-design_width / 2, 0.0], + [-design_width / 2, trace_length], + [design_width / 2, trace_length], + [design_width / 2, 0.0], + ], + layer_name="GND", + net_name="gnd", +) + +############################################################################### +# Create differential traces +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +trace1 = edb.modeler.create_trace( + path_list=[[-trace_gap / 2, 0.0], [-trace_gap / 2, trace_length]], + layer_name="TOP", + width=trace_width, + net_name="signal1", + start_cap_style="Flat", + end_cap_style="Flat", +) +trace2 = edb.modeler.create_trace( + path_list=[[trace_gap / 2, 0.0], [trace_gap / 2, trace_length]], + layer_name="TOP", + width=trace_width, + net_name="signal2", + start_cap_style="Flat", + end_cap_style="Flat", +) + +############################################################################### +# Create wave ports on traces end +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +edb.hfss.create_bundle_wave_port( + primitives_id=[trace1.id, trace2.id], points_on_edge=[[-trace_gap / 2, 0.0], [trace_gap / 2, 0.0]] +) +edb.hfss.create_bundle_wave_port( + primitives_id=[trace1.id, trace2.id], points_on_edge=[[-trace_gap / 2, trace_length], [trace_gap / 2, trace_length]] +) + +############################################################################### +# Save and closed EDB +# ~~~~~~~~~~~~~~~~~~~ +edb.save() +edb.close() From fe511024ec72cb5bc60a045ababe0b06b95be845 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Thu, 11 Jul 2024 09:22:04 +0200 Subject: [PATCH 5/8] added diff wave port example --- examples/legacy_standalone/13_via_fence.py | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 examples/legacy_standalone/13_via_fence.py diff --git a/examples/legacy_standalone/13_via_fence.py b/examples/legacy_standalone/13_via_fence.py new file mode 100644 index 0000000000..df72c2fbe7 --- /dev/null +++ b/examples/legacy_standalone/13_via_fence.py @@ -0,0 +1,45 @@ +# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +EDB: Differential wave port +--------------------------------- +This example shows how to create a simple design with differential pairs and assign wave port on them. +""" + + +############################################################################### +# Import EDB library +# ~~~~~~~~~~~~~~~~~~ +from pyedb import Edb +from pyedb.generic.general_methods import generate_unique_folder_name +from pyedb.misc.downloads import download_file + +temp_folder = generate_unique_folder_name() +targetfolder = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) + +edb_path = r"D:\Data\pyedb\infineon\Ansys_4Layers_TAS_RF_PCB.aedb" +# edb_path = r"D:\Data\pyedb\infineon\via_clustering\test\test_board_extract.aedb" +edb = Edb(edbpath=edb_path, edbversion=edb_version) +edb.padstacks.merge_via_along_lines(net_name="gnd", distance_threshold=0.1e-3, minimum_via_number=4) +edb.save_as(r"D:\Temp\test.aedb") +edb.close() From 818341c70f8347769ad12729e74f9f9c2079f730 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 12 Jul 2024 14:43:38 +0200 Subject: [PATCH 6/8] lib doc dependencies --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 47bcee03c2..59c4b9e102 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,10 @@ doc = [ "imageio>=2.30.0,<2.35", "ipython>=8.13.0,<8.27", "jupyterlab>=4.0.0,<4.3", - "matplotlib>=3.5.0,<3.10", + "matplotlib>=3.5.0,<3.9", + "nbsphinx>=0.9.0,<0.10", + "numpydoc>=1.5.0,<1.8", + "pyvista>=0.38.0,<0.44", "nbsphinx>=0.9.0,<0.10", "numpydoc>=1.5.0,<1.8", "pypandoc>=1.10.0,<1.14", From 8aab48d61db9714b48bd27e5ab124f6d2c7c0fbe Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 12 Jul 2024 14:44:59 +0200 Subject: [PATCH 7/8] lib doc dependencies --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 59c4b9e102..4829f2806b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,6 @@ doc = [ "nbsphinx>=0.9.0,<0.10", "numpydoc>=1.5.0,<1.8", "pyvista>=0.38.0,<0.44", - "nbsphinx>=0.9.0,<0.10", "numpydoc>=1.5.0,<1.8", "pypandoc>=1.10.0,<1.14", # NOTE: Remove recommonmark once examples are reworked. From e18e43fb09f10c01734ce0bb37c75afd6546ca3b Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 12 Jul 2024 14:56:41 +0200 Subject: [PATCH 8/8] lib doc dependencies --- .../12_create_differential_wave_port.py | 32 +++++-------- examples/legacy_standalone/13_via_fence.py | 45 ------------------- 2 files changed, 11 insertions(+), 66 deletions(-) delete mode 100644 examples/legacy_standalone/13_via_fence.py diff --git a/examples/legacy_standalone/12_create_differential_wave_port.py b/examples/legacy_standalone/12_create_differential_wave_port.py index c40eef552a..13abaf7719 100644 --- a/examples/legacy_standalone/12_create_differential_wave_port.py +++ b/examples/legacy_standalone/12_create_differential_wave_port.py @@ -20,41 +20,35 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -EDB: Differential wave port ---------------------------------- -This example shows how to create a simple design with differential pairs and assign wave port on them. -""" +# # EDB: Differential wave port +# +# This example shows how to create a simple design with differential pairs and assign wave port on them. -############################################################################### # Import EDB library -# ~~~~~~~~~~~~~~~~~~ + from pyedb import Edb -############################################################################### # Create an empty EDB -# ~~~~~~~~~~~~~~~~~~~ + edb = Edb() -############################################################################### + # Define a layer stackup -# ~~~~~~~~~~~~~~~~~~~~~~ + edb.stackup.add_layer("GND", "Gap") edb.stackup.add_layer("Substrat", "GND", layer_type="dielectric", thickness="0.2mm", material="Duroid (tm)") edb.stackup.add_layer("TOP", "Substrat") -############################################################################### # Define parameters -# ~~~~~~~~~~~~~~~~~ + trace_length = 10e-3 trace_width = 200e-6 design_width = 10e-3 trace_gap = 1e-3 -############################################################################### # Create ground plane -# ~~~~~~~~~~~~~~~~~~~ + gnd_plane = edb.modeler.create_polygon( main_shape=[ [-design_width / 2, 0.0], @@ -66,9 +60,8 @@ net_name="gnd", ) -############################################################################### # Create differential traces -# ~~~~~~~~~~~~~~~~~~~~~~~~~~ + trace1 = edb.modeler.create_trace( path_list=[[-trace_gap / 2, 0.0], [-trace_gap / 2, trace_length]], layer_name="TOP", @@ -86,9 +79,7 @@ end_cap_style="Flat", ) -############################################################################### # Create wave ports on traces end -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ edb.hfss.create_bundle_wave_port( primitives_id=[trace1.id, trace2.id], points_on_edge=[[-trace_gap / 2, 0.0], [trace_gap / 2, 0.0]] @@ -97,8 +88,7 @@ primitives_id=[trace1.id, trace2.id], points_on_edge=[[-trace_gap / 2, trace_length], [trace_gap / 2, trace_length]] ) -############################################################################### # Save and closed EDB -# ~~~~~~~~~~~~~~~~~~~ + edb.save() edb.close() diff --git a/examples/legacy_standalone/13_via_fence.py b/examples/legacy_standalone/13_via_fence.py deleted file mode 100644 index df72c2fbe7..0000000000 --- a/examples/legacy_standalone/13_via_fence.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates. -# SPDX-License-Identifier: MIT -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -""" -EDB: Differential wave port ---------------------------------- -This example shows how to create a simple design with differential pairs and assign wave port on them. -""" - - -############################################################################### -# Import EDB library -# ~~~~~~~~~~~~~~~~~~ -from pyedb import Edb -from pyedb.generic.general_methods import generate_unique_folder_name -from pyedb.misc.downloads import download_file - -temp_folder = generate_unique_folder_name() -targetfolder = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) - -edb_path = r"D:\Data\pyedb\infineon\Ansys_4Layers_TAS_RF_PCB.aedb" -# edb_path = r"D:\Data\pyedb\infineon\via_clustering\test\test_board_extract.aedb" -edb = Edb(edbpath=edb_path, edbversion=edb_version) -edb.padstacks.merge_via_along_lines(net_name="gnd", distance_threshold=0.1e-3, minimum_via_number=4) -edb.save_as(r"D:\Temp\test.aedb") -edb.close()