Skip to content

Commit

Permalink
Merge pull request #36 from ansys-internal/doc
Browse files Browse the repository at this point in the history
Doc
  • Loading branch information
svandenb-dev authored Oct 24, 2023
2 parents a2e2341 + a338bd1 commit 16b4142
Show file tree
Hide file tree
Showing 25 changed files with 382 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/clipped_layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/layout_plot_all_nets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/layout_plot_gnd_nets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/stackup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions doc/source/Scripts_resources/SI/add_simulation_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout

# Ansys release version
desktop_version = "2023.2"

#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

simple_hfss_setup = edbapp.create_hfss_setup("MySimpleSetup")
simple_hfss_setup.set_solution_single_frequency(frequency="5GHz", max_num_passes=30, max_delta_s=0.05)
simple_hfss_setup.add_frequency_sweep(name="MySweep", frequency_sweep=[["linear scale", "0GHz", "10GHz", "0.01GHz"]])

multi_freq_setup = edbapp.create_hfss_setup("MyMultiFreqSetup")
multi_freq_setup.set_solution_multi_frequencies(frequencies=["5GHz", "7GHz", "10GHz"], max_num_passes=30, max_delta_s=0.02)
multi_freq_setup.add_frequency_sweep(name="MySweep", frequency_sweep=[["linear scale", "0GHz", "20GHz", "0.01GHz"]])

broad_band_sweep = edbapp.create_hfss_setup("MyBroadbandSetup")
broad_band_sweep.set_solution_broadband(low_frequency="5GHz", high_frequency="10GHz", max_num_passes=20, max_delta_s=0.01)
broad_band_sweep.add_frequency_sweep(name="MySweep", frequency_sweep=[["linear scale", "0GHz", "20GHz", "0.01GHz"]])

# adding frequency sweeps
multi_freq_sweep_setup = edbapp.create_hfss_setup("MyMultiFrequencySweepSetup")
multi_freq_sweep_setup.set_solution_single_frequency(frequency="5GHz", max_num_passes=30, max_delta_s=0.02)
multi_freq_sweep_setup.add_frequency_sweep(frequency_sweep=[["linear count", "0", "1kHz", 1],
["log scale", "1kHz", "0.1GHz", 10],
["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
])

# save and close project
edbapp.save_edb()
edbapp.close_edb()
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
hfss.release_desktop(close_desktop=False, close_projects=False)

33 changes: 33 additions & 0 deletions doc/source/Scripts_resources/SI/advanced_circuit_port_creation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout
from pyaedt.generic.constants import SourceType

# Ansys release version
desktop_version = "2023.2"

# download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

signal_nets = ["DDR4_DQ0", "DDR4_DQ1", "DDR4_DQ2", "DDR4_DQ3", "DDR4_DQ4", "DDR4_DQ5", "DDR4_DQ6", "DDR4_DQ7"]
reference_nets = ["GND"]

# processing cutout
edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=0.01)

# creating ports on specific component pins
component = edbapp.components["U1"]
for net in signal_nets:
pins = [pin for pin in list(component.pins.values()) if pin.net_name == net]
for pin in pins:
ref_pins = pin.get_reference_pins(reference_net="GND", search_radius=5e-3, max_limit=3, component_only=True)
edbapp.components.create_port_on_pins(refdes="U1", pins=pin, reference_pins=ref_pins)

# save and close project
edbapp.save_edb()
edbapp.close_edb()
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
hfss.release_desktop(close_desktop=False, close_projects=False)
29 changes: 29 additions & 0 deletions doc/source/Scripts_resources/SI/clipping_design.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout

# Ansys release version
desktop_version = "2023.2"

#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

# selecting signal nets to evaluate the extent for clipping the layout
signal_nets = ["DDR4_DQ0", "DDR4_DQ1", "DDR4_DQ2", "DDR4_DQ3", "DDR4_DQ4", "DDR4_DQ5", "DDR4_DQ6", "DDR4_DQ7"]
# at least one reference net must be inclulded. Reference nets are included in the design but clipped.
reference_nets = ["GND"]
# defining the expansion factor. The value gives the distance for evaluating the cutout extent. Here we define a cutout
expansion = 0.01 # 1cm in this case
# processing cutout
edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=expansion)
# save and close project
edbapp.save_edb()
edbapp.close_edb()
# opening resulting in AEDT to visualize the resulting project.
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
# After opening AEDT with PyAEDT, if you want to be able to close manually the project you have to release
# AEDT from PyAEDT.
hfss.release_desktop(close_desktop=False, close_projects=False)
30 changes: 30 additions & 0 deletions doc/source/Scripts_resources/SI/create_hfss_excitation_ports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout

# Ansys release version
desktop_version = "2023.2"

#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

signal_nets = ["DDR4_DQ0", "DDR4_DQ1", "DDR4_DQ2", "DDR4_DQ3", "DDR4_DQ4", "DDR4_DQ5", "DDR4_DQ6", "DDR4_DQ7"]
reference_nets = ["GND"]

# processing cutout
edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=0.01)

if not edbapp.components.create_port_on_component(component="U1", net_list=signal_nets, reference_net="GND"):
edbapp.logger.error("Failed to create ports on component U1")
if not edbapp.components.create_port_on_component(component="U15", net_list=signal_nets, reference_net="GND"):
edbapp.logger.error("Failed to create port on component U15")


# save and close project
edbapp.save_edb()
edbapp.close_edb()
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
hfss.release_desktop(close_desktop=False, close_projects=False)
38 changes: 38 additions & 0 deletions doc/source/Scripts_resources/SI/create_siwave_excitation_ports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout
from pyaedt.generic.constants import SourceType

# Ansys release version
desktop_version = "2023.2"

#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

signal_nets = ["DDR4_DQ0", "DDR4_DQ1", "DDR4_DQ2", "DDR4_DQ3", "DDR4_DQ4", "DDR4_DQ5", "DDR4_DQ6", "DDR4_DQ7"]
reference_nets = ["GND"]

# processing cutout
edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=0.01)

if not edbapp.components.create_port_on_component(component="U1", net_list=signal_nets,
reference_net="GND",
port_type=SourceType.CircPort,
):
edbapp.logger.error("Failed to create ports on component U1")
if not edbapp.components.create_port_on_component(component="U15",
net_list=signal_nets,
reference_net="GND",
port_type=SourceType.CircPort,
):
edbapp.logger.error("Failed to create port on component U15")


# save and close project
edbapp.save_edb()
edbapp.close_edb()
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
hfss.release_desktop(close_desktop=False, close_projects=False)
40 changes: 40 additions & 0 deletions doc/source/Scripts_resources/SI/editing_layer_stackup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout

# Ansys release version
desktop_version = "2023.2"

#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

# ploting layer stackup in matplotlib
edbapp.stackup.plot()

# retrieving signal layers name
signal_layers = list(edbapp.stackup.signal_layers.keys())

# selecting top layer
top_layer = edbapp.stackup.signal_layers[signal_layers[0]]

# Stackup total thickness
layout_stats = edbapp.get_statistics()
layout_stats.stackup_thickness

# setting all signal layers thickness to 20um
for layer_name, layer in edbapp.stackup.signal_layers.items():
layer.thickness = "20um"

edbapp.materials.add_material(name="MyMaterial", permittivity=4.35, dielectric_loss_tangent=2e-4)
edbapp.materials.add_material(name="MyMetal", conductivity=1e7)
for layer in list(edbapp.stackup.dielectric_layers.values()):
layer.material = "MyMaterial"
for layer in list(edbapp.stackup.signal_layers.values()):
layer.material = "MyMetal"
edbapp.materials.add_material(name="SolderMask", permittivity=3.8, dielectric_loss_tangent=1e-3)
edbapp.stackup.add_layer(layer_name="Solder_mask", base_layer="1_Top", thickness="200um", material="SolderMask")


Empty file.
39 changes: 39 additions & 0 deletions doc/source/Scripts_resources/SI/layout_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pyaedt
from pyaedt import Edb, Hfss3dLayout

# Ansys release version
desktop_version = "2023.2"

#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)

# Some layout statistics
stats = edbapp.get_statistics()

# When edb is loaded, we can access all layout information
nets = edbapp.nets

# net list
nets.netlist

# power nets
nets.power

# Getting components from specific net
nets.power["GND"].components

# Getting pins from components
edbapp.components["U9"].pins

# Getting pins from components connected to given net
u9_gnd_pins = [pin for pin in list(edbapp.components["U9"].pins.values()) if pin.net_name == "GND"]

# Plotting layout in matplotlib
edbapp.nets.plot(None)

# plotting specific net
edbapp.nets.plot("GND")
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions doc/source/Signal Integrity/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
==================================================
High frequency channel extraction workflow example
==================================================

This section describes an automated workflow using PyANSYS-EDB for high frequency channel extraction:

.. toctree::
:maxdepth: 2


40 changes: 40 additions & 0 deletions doc/source/User_guide/cutout.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Clipping layout
===============
Because most of the time only a specific part of a layout must be simulated, clipping the design
needs to be performed to reduce computer resources and speed up simulation. This section describes
how to clip a design based on nets selection.

.. code:: python
import pyaedt
from pyedb import Edb, Hfss3dLayout
# Ansys release version
desktop_version = "2023.2"
#download and copy the layout file from examples
temp_folder = pyaedt.generate_unique_folder_name()
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)
# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)
# selecting signal nets to evaluate the extent for clipping the layout
signal_nets = ["DDR4_DQ0", "DDR4_DQ1", "DDR4_DQ2", "DDR4_DQ3", "DDR4_DQ4", "DDR4_DQ5", "DDR4_DQ6", "DDR4_DQ7"]
# at least one reference net must be inclulded. Reference nets are included in the design but clipped.
reference_nets = ["GND"]
# defining the expansion factor. The value gives the distance for evaluating the cutout extent. Here we define a cutout
expansion = 0.01 # 1cm in this case
# processing cutout
edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=expansion)
# save and close project
edbapp.save_edb()
edbapp.close_edb()
# opening resulting in AEDT to visualize the resulting project.
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
# After opening AEDT with PyAEDT, if you want to be able to close manually the project you have to release
# AEDT from PyAEDT.
hfss.release_desktop(close_desktop=False, close_projects=False)
. image:: ../Resources/clipped_layout.png
:width: 800
:alt: Layout clipping
20 changes: 18 additions & 2 deletions doc/source/User_guide/edb_queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@ EDB Queries
===========
PyEBD allows layout information queries, this section describe some basic examples:

- stackup layers
- Load EDB
.. code:: python
# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)
- changing layer thickness
- Getting layout statistics
.. code:: python
stats = edbapp.get_statistics()
- Nets
.. code:: python
# net list
nets.netlist
# power nets
nets.power
# Plotting layout in matplotlib
edbapp.nets.plot(None)
. image:: ../Resources/layout_plot_all_nets.png
:width: 800
:alt: Plot all nets

- Components
.. code:: python
# Getting all components
nets = edbapp.components.instances
# Getting pins from components connected to given net
u9_gnd_pins = [pin for pin in list(edbapp.components["U9"].pins.values()) if pin.net_name == "GND"]
. image:: ../Resources/aedt_box.png
:width: 800
Expand Down
5 changes: 5 additions & 0 deletions doc/source/User_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ You can obtain the same result with:

loading_layout
edb_queries
cutout
layer_stackup
ports
simulation_setup

Loading

0 comments on commit 16b4142

Please sign in to comment.