Download this example

Download this example as a Jupyter Notebook or as a Python script.


DCIR Setup Leveraging EDB Configuration Format#

Perform imports and define constants#

Perform required imports.

[1]:
import json
import os
import tempfile
import time

from ansys.aedt.core import Hfss3dLayout
from ansys.aedt.core.examples.downloads import download_file
from pyedb import Edb

Define constants.

[2]:
AEDT_VERSION = "2026.1"
NG_MODE = False

Download the example BGA Package design.

[3]:
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
file_edb = download_file(source=r"pyaedt/edb/BGA_Package.aedb", local_path=temp_folder.name)

Load example layout#

[4]:
edbapp = Edb(edbpath=file_edb, version=AEDT_VERSION)
C:\actions-runner\_work\pyaedt-examples\pyaedt-examples\.venv\lib\site-packages\pyedb\generic\design_types.py:375: UserWarning: You are using PyEDB with grpc, which is currently in beta. Some feature might be missing or not working as expected. Please report any issue you find to the PyEDB team.
  warnings.warn(GRPC_BETA_WARNING, UserWarning)
PyEDB INFO: Logger is initialized in EDB.
PyEDB INFO: legacy v0.75.0
PyEDB INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyEDB INFO: Using PyEDB with gRPC as Beta until ANSYS 2027R1 official release.
PyEDB INFO: Logger is initialized in EDB.
PyEDB INFO: legacy v0.75.0
PyEDB INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyEDB INFO: Grpc session started
PyEDB INFO: Grpc session started: pid=9028
PyEDB INFO: RPC session acquired (open databases: 1)
PyEDB INFO: Database BGA_Package.aedb Opened in 2026.1
PyEDB INFO: Cell BGA_Package Opened
PyEDB INFO: Refreshing the Components dictionary.
PyEDB INFO: Builder was initialized.
PyEDB INFO: EDB initialized.

Create config file#

Define Component with solder balls.

[5]:
cfg_components = [
    {
        "reference_designator": "FCHIP",
        "part_type": "other",
        "solder_ball_properties": {
            "shape": "cylinder",
            "diameter": "0.1mm",
            "height": "0.085mm",
            "chip_orientation": "chip_up",
        },
        "port_properties": {
            "reference_offset": 0,
            "reference_size_auto": False,
            "reference_size_x": 0,
            "reference_size_y": 0,
        },
    },
    {
        "reference_designator": "BGA",
        "part_type": "io",
        "solder_ball_properties": {
            "shape": "cylinder",
            "diameter": "0.45mm",
            "height": "0.45mm",
            "chip_orientation": "chip_down",
        },
        "port_properties": {
            "reference_offset": 0,
            "reference_size_auto": False,
            "reference_size_x": 0,
            "reference_size_y": 0,
        },
    },
]

Define Pin Groups on Components.

[6]:
cfg_pin_groups = [
    {"name": "BGA_VSS", "reference_designator": "BGA", "net": "VSS"},
    {"name": "BGA_VDD", "reference_designator": "BGA", "net": "VDD"},
]

Define sources.

[7]:
cfg_sources = [
    {
        "name": "FCHIP_Current",
        "reference_designator": "FCHIP",
        "type": "current",
        "magnitude": 2,
        "distributed": True,
        "positive_terminal": {"net": "VDD"},
        "negative_terminal": {"nearest_pin": {"reference_net": "VSS", "search_radius": 5e-3}},
    },
    {
        "name": "BGA_Voltage",
        "reference_designator": "BGA",
        "type": "voltage",
        "magnitude": 1,
        "positive_terminal": {"pin_group": "BGA_VDD"},
        "negative_terminal": {"pin_group": "BGA_VSS"},
    },
]

Define DCIR setup.

[8]:
cfg_setups = [
    {
        "name": "siwave_dc",
        "type": "siwave_dc",
        "dc_slider_position": 1,
        "dc_ir_settings": {"export_dc_thermal_data": True},
    }
]

Create final configuration.

[9]:
cfg = {
    "components": cfg_components,
    "sources": cfg_sources,
    "pin_groups": cfg_pin_groups,
    "setups": cfg_setups,
}

Create the config file.

[10]:
file_json = os.path.join(temp_folder.name, "edb_configuration.json")
with open(file_json, "w") as f:
    json.dump(cfg, f, indent=4, ensure_ascii=False)

Apply Config file#

Apply configuration to the example layout

[11]:
edbapp.configuration.load(config_file=file_json)
edbapp.configuration.run()
PyEDB INFO: Updating nets finished. Time lapse 0:00:00
PyEDB INFO: Updating components finished. Time lapse 0:00:00.176971
C:\actions-runner\_work\pyaedt-examples\pyaedt-examples\.venv\lib\site-packages\pyedb\configuration\cfg_pin_groups.py:76: FutureWarning: Call to deprecated function create_pin_group. use edb.components.create_pin_group method instead
  if not self._pedb.siwave.create_pin_group(self.reference_designator, pins, self.name):
PyEDB INFO: Creating pin groups finished. Time lapse 0:00:00.553156
PyEDB INFO: Placing sources finished. Time lapse 0:00:13.335143
PyEDB INFO: Applying materials finished. Time lapse 0:00:00
PyEDB INFO: Applying padstack definitions and instances completed in 0.0159 seconds.
PyEDB INFO: Applying S-parameters finished. Time lapse 0:00:00
PyEDB INFO: Applying package definitions finished. Time lapse 0:00:00.015917
PyEDB INFO: Applying modeler finished. Time lapse 0:00:00
PyEDB INFO: Placing ports finished. Time lapse 0:00:00
PyEDB INFO: Placing terminals completed in 0.0000 seconds.
PyEDB INFO: Placing probes finished. Time lapse 0:00:00
PyEDB INFO: Applying operations completed in 0.0000 seconds.
PyEDB INFO: SIWave DCIR setup siwave_dc created.
PyEDB INFO: Applying setups completed in 0.0160 seconds.
C:\actions-runner\_work\pyaedt-examples\pyaedt-examples\.venv\lib\site-packages\pyedb\configuration\configuration.py:202: FutureWarning: Call to deprecated function create_siwave_dc_setup. Use simulation_setups.create_siwave_dcir_setup() instead.
  edb_setup = self._pedb.create_siwave_dc_setup(
C:\actions-runner\_work\pyaedt-examples\pyaedt-examples\.venv\lib\site-packages\pyedb\configuration\configuration.py:207: FutureWarning: Accessing deprecated property dc_ir_settings. use settings property instead.
  edb_setup.dc_ir_settings.export_dc_thermal_data = dc_ir_settings.export_dc_thermal_data
[11]:
True

Save and close EDB.

[12]:
edbapp.save()
edbapp.close()
PyEDB INFO: RPC session released (open databases: 0)
[12]:
True

The configured EDB file is saved in a temp folder.

[13]:
print(temp_folder.name)
C:\Users\ansys\AppData\Local\Temp\tmp0mj_1fur.ansys

Load edb into HFSS 3D Layout.#

[14]:
h3d = Hfss3dLayout(edbapp.edbpath, version=AEDT_VERSION, non_graphical=NG_MODE, new_desktop=True)
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)].
PyAEDT INFO: PyAEDT version 1.0.dev0.
PyAEDT INFO: Initializing new Desktop session.
PyAEDT INFO: AEDT version 2026.1.
PyAEDT INFO: New AEDT session is starting on gRPC port 62086.
PyAEDT INFO: Starting new AEDT gRPC session on port 62086.
PyAEDT INFO: Launching AEDT server with gRPC transport mode: wnua
PyAEDT INFO: Electronics Desktop started on gRPC port 62086 after 9.8 seconds.
PyAEDT INFO: AEDT installation Path C:\Program Files\ANSYS Inc\v261\AnsysEM
PyAEDT INFO: Connected to AEDT gRPC session on port 62086.
PyAEDT INFO: Non-graphical mode detected. Disabling Desktop logs.
PyAEDT INFO: EDB folder C:\Users\ansys\AppData\Local\Temp\tmp0mj_1fur.ansys\pyaedt\edb\BGA_Package.aedb has been imported to project BGA_Package
PyAEDT INFO: Active Design set to 0;BGA_Package
PyAEDT INFO: AEDT objects correctly read

Solve.

[15]:
h3d.analyze(setup="siwave_dc")
PyAEDT INFO: Project BGA_Package Saved correctly
PyAEDT INFO: Solving design setup siwave_dc
PyAEDT INFO: Design setup siwave_dc solved correctly in 0.0h 0.0m 52.0s
[15]:
True

Plot insertion loss.

[16]:
h3d.post.create_fieldplot_layers_nets(layers_nets=[["VDD_C1", "VDD"]], quantity="Voltage", setup="siwave_dc")
PyAEDT INFO: Parsing C:\Users\ansys\AppData\Local\Temp\tmp0mj_1fur.ansys\pyaedt\edb\BGA_Package.aedt.
PyAEDT INFO: File C:\Users\ansys\AppData\Local\Temp\tmp0mj_1fur.ansys\pyaedt\edb\BGA_Package.aedt correctly loaded. Elapsed time: 0m 0sec
PyAEDT INFO: aedt file load time 0.047876596450805664
PyAEDT INFO: PostProcessor class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Post class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Loading Modeler.
PyAEDT INFO: Modeler loaded.
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: No EDB gRPC setting provided. Enabling gRPC for EDB.
PyAEDT INFO: Loading EDB with Grpc enabled.
PyEDB INFO: Logger is initialized in EDB.
PyEDB INFO: legacy v0.75.0
PyEDB INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyEDB INFO: Using PyEDB with gRPC as Beta until ANSYS 2027R1 official release.
PyEDB WARNING: AEDT project-related file C:\Users\ansys\AppData\Local\Temp\tmp0mj_1fur.ansys\pyaedt\edb\BGA_Package.aedt exists and may need to be deleted before opening the EDB in HFSS 3D Layout.
PyEDB WARNING: AEDT project-related file C:\Users\ansys\AppData\Local\Temp\tmp0mj_1fur.ansys\pyaedt\edb\BGA_Package.aedt.lock exists and may need to be deleted before opening the EDB in HFSS 3D Layout.
PyEDB INFO: Logger is initialized in EDB.
PyEDB INFO: legacy v0.75.0
PyEDB INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyEDB INFO: Grpc session started
PyEDB INFO: Grpc session started: pid=2664
PyEDB INFO: RPC session acquired (open databases: 1)
PyEDB INFO: Database BGA_Package.aedb Opened in 2026.1
PyEDB INFO: Cell BGA_Package Opened
PyEDB INFO: Refreshing the Components dictionary.
PyEDB INFO: Builder was initialized.
PyEDB INFO: EDB initialized.
PyAEDT INFO: Active Design set to 0;BGA_Package
[16]:
Class: ansys.aedt.core.visualization.post.field_data.FieldPlot

Release AEDT#

[17]:
h3d.close_desktop()
PyAEDT INFO: Desktop has been released and closed.
[17]:
True
[18]:
# Wait 3 seconds to allow AEDT to shut down before cleaning the temporary directory.
time.sleep(3)

Clean up#

All project files are saved in the folder temp_folder.name. If you’ve run this example as a Jupyter notebook, you can retrieve those project files. The following cell removes all temporary files, including the project folder.

[19]:
temp_folder.cleanup()

Download this example

Download this example as a Jupyter Notebook or as a Python script.