HFSS 3D Layout: SIwave DCIR analysis in HFSS 3D Layout#

This example shows how you can use configure HFSS 3D Layout for SIwave DCIR analysis.

import os
import tempfile
import pyaedt

Set AEDT version#

Set AEDT version.

aedt_version = "2024.1"

Configure EDB for DCIR analysis#

Copy example into temporary folder

temp_dir = tempfile.gettempdir()
dst_dir = os.path.join(temp_dir, pyaedt.generate_unique_name("pyaedt_dcir"))
os.mkdir(dst_dir)
local_path = pyaedt.downloads.download_aedb(dst_dir)

Load example board into EDB

appedb = pyaedt.Edb(local_path, edbversion=aedt_version)
PyEDB INFO: StdOut is enabled
PyEDB INFO: Logger is initialized in EDB.
PyEDB INFO: legacy v0.7.1
PyEDB INFO: Python version 3.10.9 (remotes/origin/4e018266dafe29ec2836492d71d245fcfd366d07-dirty:4e018266, Jan  3 2) [MSC v.1920 64 bit (AMD64)]
PyEDB INFO: Database Galileo.aedb Opened in 2024.1
PyEDB INFO: Cell Galileo_um Opened
PyEDB INFO: Builder was initialized.
PyEDB INFO: EDB initialized.

Create pin group on VRM positive pins

gnd_name = "GND"
appedb.siwave.create_pin_group_on_net(
    reference_designator="U3A1",
    net_name="BST_V3P3_S5",
    group_name="U3A1-BST_V3P3_S5")
('U3A1-BST_V3P3_S5', <pyedb.dotnet.edb_core.edb_data.sources.PinGroup object at 0x000002713EAD0340>)

Create pin group on VRM negative pins

appedb.siwave.create_pin_group_on_net(
    reference_designator="U3A1",
    net_name="GND",
    group_name="U3A1-GND")
('U3A1-GND', <pyedb.dotnet.edb_core.edb_data.sources.PinGroup object at 0x0000027157A980A0>)

Create voltage source between VRM positive and negative pin groups

appedb.siwave.create_voltage_source_on_pin_group(
    pos_pin_group_name="U3A1-BST_V3P3_S5",
    neg_pin_group_name="U3A1-GND",
    magnitude=3.3,
    name="U3A1-BST_V3P3_S5"
)
True

Create pin group on sink component positive pins

appedb.siwave.create_pin_group_on_net(
    reference_designator="U2A5",
    net_name="V3P3_S5",
    group_name="U2A5-V3P3_S5")
('U2A5-V3P3_S5', <pyedb.dotnet.edb_core.edb_data.sources.PinGroup object at 0x0000027157A77F40>)

Create pin group on sink component negative pins

appedb.siwave.create_pin_group_on_net(
    reference_designator="U2A5",
    net_name="GND",
    group_name="U2A5-GND")

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Create place current source between sink component positive and negative pin groups
appedb.siwave.create_current_source_on_pin_group(
    pos_pin_group_name="U2A5-V3P3_S5",
    neg_pin_group_name="U2A5-GND",
    magnitude=1,
    name="U2A5-V3P3_S5"
)
True

Add SIwave DCIR analysis

appedb.siwave.add_siwave_dc_analysis(name="my_setup")
<pyedb.dotnet.edb_core.edb_data.siwave_simulation_setup_data.SiwaveDCSimulationSetup object at 0x0000027157A77310>

Save and close EDB#

Save and close EDB.

appedb.save_edb()
appedb.close_edb()
PyEDB INFO: EDB file save time: 0.00ms
PyEDB INFO: EDB file release time: 0.00ms

True

Analysis DCIR in AEDT#

Launch AEDT and import the configured EDB and analysis DCIR

desktop = pyaedt.Desktop(aedt_version, non_graphical=False, new_desktop_session=True)
hfss3dl = pyaedt.Hfss3dLayout(local_path)
hfss3dl.analyze()
hfss3dl.save_project()
PyEDB INFO: Initializing new Desktop session.
PyEDB INFO: StdOut is enabled
PyEDB INFO: Log on file is enabled
PyEDB INFO: Log on Desktop Message Manager is enabled
PyEDB INFO: Debug logger is disabled. PyAEDT methods will not be logged.
PyEDB INFO: Launching PyAEDT outside AEDT with gRPC plugin.
PyEDB INFO: New AEDT session is starting on gRPC port 54670
PyEDB INFO: AEDT installation Path C:\Program Files\AnsysEM\v241\Win64
PyEDB INFO: Ansoft.ElectronicsDesktop.2024.1 version started with process ID 1076.
PyEDB INFO: pyaedt v0.8.8
PyEDB INFO: Python version 3.10.9 (remotes/origin/4e018266dafe29ec2836492d71d245fcfd366d07-dirty:4e018266, Jan  3 2) [MSC v.1920 64 bit (AMD64)]
PyEDB INFO: AEDT 2024.1.0 Build Date 2023-11-27 22:16:18
PyEDB INFO: Returning found Desktop session with PID 1076!
PyEDB INFO: EDB folder D:\Temp\pyaedt_dcir_17J90A\edb/Galileo.aedb\edb.def has been imported to project Galileo
PyEDB INFO: Active Design set to Galileo_um
PyEDB INFO: Aedt Objects correctly read
PyEDB INFO: Key Desktop/ActiveDSOConfigurations/HFSS 3D Layout Design correctly changed.
PyEDB INFO: Solving all design setups
PyEDB INFO: Key Desktop/ActiveDSOConfigurations/HFSS 3D Layout Design correctly changed.
PyEDB INFO: Design setup None solved correctly in 0.0h 0.0m 53.0s
PyEDB INFO: Project Galileo Saved correctly

True

Get element data#

Get current source

current_source = hfss3dl.get_dcir_element_data_current_source(setup="my_setup")
print(current_source)

# ~~~~~~~~~~~~~~~~~~~
# Get via information

via = hfss3dl.get_dcir_element_data_via(setup="my_setup")
print(via)
PyEDB INFO: Parsing D:/Temp/pyaedt_dcir_17J90A/edb/Galileo.aedt.
PyEDB INFO: File D:/Temp/pyaedt_dcir_17J90A/edb/Galileo.aedt correctly loaded. Elapsed time: 0m 0sec
PyEDB INFO: aedt file load time 0.10938048362731934
PyEDB INFO: Loading Modeler.
PyEDB INFO: Modeler loaded.
PyEDB INFO: EDB loaded.
PyEDB INFO: Layers loaded.
PyEDB INFO: Primitives loaded.
PyEDB INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyEDB INFO: PostProcessor class has been initialized! Elapsed time: 0m 0sec
PyEDB INFO: Post class has been initialized! Elapsed time: 0m 0sec
PyEDB INFO: Solution Data Correctly Loaded.
               Voltage
U2A5-V3P3_S5  3.294553
PyEDB INFO: Solution Data Correctly Loaded.
PyEDB INFO: Solution Data Correctly Loaded.
PyEDB INFO: Solution Data Correctly Loaded.
PyEDB INFO: Solution Data Correctly Loaded.
PyEDB INFO: Solution Data Correctly Loaded.
PyEDB INFO: Solution Data Correctly Loaded.
                             X
J1-6<BOTTOM,TOP>      0.003632
J1A6-3<BOTTOM,TOP>    0.034595
J1B2-2<BOTTOM,GND>    0.007493
J1B2-2<GND,TOP>       0.007493
J2A1-4<BOTTOM,TOP>    0.026975
...                        ...
via_4873<GND,TOP>     0.056947
via_4874<BOTTOM,GND>  0.086106
via_4874<GND,TOP>     0.086106
via_4875<BOTTOM,GND>  0.082550
via_4875<GND,TOP>     0.082550

[883 rows x 1 columns]

Get voltage#

Get voltage from dcir solution data

voltage = hfss3dl.get_dcir_solution_data(setup="my_setup", show="Sources", category="Voltage")
print({expression: voltage.data_magnitude(expression) for expression in voltage.expressions})
PyEDB INFO: Solution Data Correctly Loaded.
{'SeriesRV(U3A1-BST_V3P3_S5)': [1.000632290113], 'V(U2A5-V3P3_S5)': [3294.553400696]}

Close AEDT#

desktop.release_desktop()
PyEDB INFO: Desktop has been released and closed.

True

Total running time of the script: (2 minutes 40.130 seconds)

Gallery generated by Sphinx-Gallery