EDB Analysis

This example shows how to use EDB to interact with a layout.

# sphinx_gallery_thumbnail_path = 'Resources/edb.png'

import shutil

import os
import time
import tempfile
from pyaedt import generate_unique_name, examples

tmpfold = tempfile.gettempdir()
temp_folder = os.path.join(tmpfold, generate_unique_name("Example"))
if not os.path.exists(temp_folder):
    os.makedirs(temp_folder)
example_path = examples.download_aedb()
targetfolder = os.path.join(temp_folder, "Galileo.aedb")
if os.path.exists(targetfolder):
    shutil.rmtree(targetfolder)
shutil.copytree(example_path[:-8], targetfolder)
targetfile = os.path.join(targetfolder)
siwave_file = os.path.join(temp_folder, 'Galileo.siw')
print(targetfile)
aedt_file = targetfile[:-4] + "aedt"

Out:

C:\Users\ansys\AppData\Local\Temp\Example_OAGDMJ\Galileo.aedb
from pyaedt import Edb

Launch EDB

This example launches the pyaedt.Edb class. This example uses EDB 2021.1 and uses SI units.

if os.path.exists(aedt_file):
    os.remove(aedt_file)
edb = Edb(edbpath=targetfile, edbversion="2021.1")

Out:

pyaedt info: Logger Started on C:\Users\ansys\AppData\Local\Temp\Example_OAGDMJ\pyaedt20211026_140556.log
pyaedt info: Logger Initialized in EDB
pyaedt info: EDB Path C:\Users\ansys\AppData\Local\Temp\Example_OAGDMJ\Galileo.aedb
pyaedt info: EDB Version 2021.1
pyaedt info: EDB Standalone True
pyaedt info: Database Opened
pyaedt info: Cell Galileo_G87173_204 Opened
pyaedt info: C:\actions-runner\_work\PyAEDT\PyAEDT\pyaedt\dlls\EDBLib
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Objects Initialized
pyaedt info: Builder Initialized
pyaedt info: Edb Initialized

Compute Nets and Components

This example computes nets and components. There are queries for nets, stackups, layers, components, and geometries.

print("Nets {}".format(len(edb.core_nets.nets.keys())))
start = time.time()
print("Components {}".format(len(edb.core_components.components.keys())))
print("elapsed time = ", time.time() - start)

Out:

Nets 432
Components 531
elapsed time =  0.0

Get Pin Position

This example gets the position for a specific pin. The next example shows how to get all pins for a specific component and get the positions of each of them. Each pin is a list of [X, Y] coordinate postions.

pins = edb.core_components.get_pin_from_component("U2")
for pin in pins:
    print(edb.core_components.get_pin_position(pin))

Out:

[0.0824444122, 0.0313309]
[0.0819443878, 0.0324739]
[0.0824444122, 0.0324739]
[0.0814443888, 0.0324739]
[0.08298180000000001, 0.031902400000000004]
[0.0829444112, 0.0313309]
[0.0829444112, 0.0324739]
[0.0814443888, 0.0313309]
[0.0819443878, 0.0313309]
[0.08140700000000001, 0.031902400000000004]

Get All Nets Connected to a Component

This example get all nets connected to a specific component.

edb.core_components.get_component_net_connection_info("U2")

Out:

{'refdes': ['U2', 'U2', 'U2', 'U2', 'U2', 'U2', 'U2', 'U2', 'U2', 'U2'], 'pin_name': ['3', '8', '7', '9', '5', '4', '6', '1', '2', '10'], 'net_name': ['GND', 'VSHLD_S5', 'LVL_TXD', 'LVL_RXD', 'IO1_MUX', 'IO1_GPIO', 'IO1', 'IO0_MUX', 'IO0_GPIO', 'IO0']}

Compute Rats

This comman computes rats.

rats = edb.core_components.get_rats()

Get All DC-Connected Net Lists Through Inductance

This example gets all DC-connected net lists through inductance. The inputs needed are ground net lists. A list of all nets connected to a ground through an inductor is returned.

GROUND_NETS = ["GND", "PGND"]
dc_connected_net_list = edb.core_nets.get_dcconnected_net_list(GROUND_NETS)
print(dc_connected_net_list)

Out:

[{'V1P5_S5', 'BST_V1P5_S5'}, {'V3P3_S5', 'BST_V3P3_S5'}, {'V1P0_S0', 'BST_V1P0_S0'}]

Get the Power Tree Based on a Specific Net

This example gets the power tree based on a specific net.

VRM = "U3A1"
OUTPUT_NET = "BST_V1P0_S0"
powertree_df, component_list_columns, net_group = edb.core_nets.get_powertree(OUTPUT_NET, GROUND_NETS)
for el in powertree_df:
    print(el)

Out:

['U2A5', 'Y14', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'AB14', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'AD14', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'V14', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'Y20', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'Y18', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'Y16', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'AB20', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'AB18', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'V20', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'V18', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'V16', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['U2A5', 'T18', 'V1P0_S0', 'IC', 'IPD031-201', 'Y14-AB14-AD14-V14-Y20-Y18-Y16-AB20-AB18-V20-V18-V16-T18']
['C2L14', '1', 'V1P0_S0', 'Capacitor', 'A36096-066', '1']
['R2L19', '1', 'V1P0_S0', 'Resistor', 'E41735-001', '1']
['C3L22', '1', 'V1P0_S0', 'Capacitor', 'A36096-108', '1']
['C3B10', '1', 'V1P0_S0', 'Capacitor', '602433-081', '1']
['C2B2', '1', 'V1P0_S0', 'Capacitor', '602433-081', '1']
['C3L28', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L17', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L15', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L18', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L20', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L26', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L24', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3L29', '1', 'V1P0_S0', 'Capacitor', 'C83410-012', '1']
['C3B9', '1', 'V1P0_S0', 'Capacitor', 'C97875-001', '1']
['C3B11', '1', 'V1P0_S0', 'Capacitor', 'C97875-001', '1']
['FB3L1', '2', 'V1P0_S0', 'Other', 'G22224-001', '2']
['L4B1', '2', 'V1P0_S0', 'Inductor', 'A32422-019', '2']
['C2B12', '1', 'V1P0_S0', 'Capacitor', 'E16347-001', '1']
['C3B17', '1', 'V1P0_S0', 'Capacitor', 'E16347-001', '1']
['C4A2', '1', 'BST_V1P0_S0', 'Capacitor', '602433-057', '1']
['L4B1', '1', 'BST_V1P0_S0', 'Inductor', 'A32422-019', '1']
['U3A1', '37', 'BST_V1P0_S0', 'IC', 'G43225-001', '37-36']
['U3A1', '36', 'BST_V1P0_S0', 'IC', 'G43225-001', '37-36']

Delete all RLCs with Only One Pin

This command deletes all RLCs with only one pin, providing a useful way of removing components not needed in the simulation.

edb.core_components.delete_single_pin_rlc()

Out:

pyaedt info: Component R2B29 deleted
pyaedt info: Component R3M13 deleted

['R2B29', 'R3M13']

Delete a Component

This command can be used to manually delete one or more components.

edb.core_components.delete_component("C3B17")

Out:

True

Delete a Net

This command can be used to manually delete one or more nets.

edb.core_nets.delete_nets("A0_N")

Out:

pyaedt info: Net A0_N Deleted

['A0_N']

Get Stackup Limits

This command gets the stackup limits, top and bottom layers, and elevations.

print(edb.core_stackup.stackup_limits())

Out:

('UNNAMED_000', 0.00203454, 'UNNAMED_012', 0.0)

Create a Coaxial Port

This command creates a coaxial port for the HFSS simulation.

edb.core_hfss.create_coax_port_on_component("U2A5", "V1P0_S0")

Out:

['U2A5_V1P0_S0_Y14', 'U2A5_V1P0_S0_AB14', 'U2A5_V1P0_S0_AD14', 'U2A5_V1P0_S0_V14', 'U2A5_V1P0_S0_Y20', 'U2A5_V1P0_S0_Y18', 'U2A5_V1P0_S0_Y16', 'U2A5_V1P0_S0_AB20', 'U2A5_V1P0_S0_AB18', 'U2A5_V1P0_S0_V20', 'U2A5_V1P0_S0_V18', 'U2A5_V1P0_S0_V16', 'U2A5_V1P0_S0_T18']

Edit the Stackup and Material

THis example edits the stackup and the material. You can change stackup properties with assignment. Materials can be created and assigned to layers.

edb.core_stackup.stackup_layers.layers['TOP'].thickness = "75um"
edb.core_stackup.stackup_layers.layers['Diel1'].material_name = "Fr4_epoxy"
edb.core_stackup.create_debye_material("My_Debye", 5, 3, 0.02, 0.05, 1e5, 1e9)
# edb.core_stackup.stackup_layers.layers['BOTTOM'].material_name = "My_Debye"
edb.core_stackup.stackup_layers.remove_layer("Signal3")
edb.core_stackup.stackup_layers.remove_layer("Signal1")

Out:

True

Create a Voltage Source and Siwave DC IR Simulation

This example creates a Voltage Source and then setup a DCIR Analysis.

edb.core_siwave.create_voltage_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 3.3, 0, "V1")
edb.core_siwave.create_current_source_on_net("U1B5", "V1P5_S3", "U1B5", "GND", 1.0, 0, "I1")
settings = edb.core_siwave.get_siwave_dc_setup_template()
settings.accuracy_level = 0
settings.use_dc_custom_settings = True
settings.name = "myDCIR_4"
# settings.pos_term_to_ground = "I1"
settings.neg_term_to_ground = "V1"
edb.core_siwave.add_siwave_dc_analysis(settings)

Out:

True

Save Modifications

This command saves modifications.

edb.save_edb()
edb.solve_siwave()

Out:

True

Close EDB

This command closes EDB. After EDB is closed, it can be opened by AEDT.

edb.close_edb()

Out:

pyaedt info: EDB file release time: 0.00ms

True

Siwave PostProcessor

This command open Siwave and Generate Report. This works on Window Only.

# from pyaedt import Siwave
# siwave = Siwave("2021.1")
# siwave.open_project(siwave_file)
# report_file = os.path.join(temp_folder,'Galileo.htm')
#
# siwave.export_siwave_report("myDCIR_4", report_file)
# siwave.close_project()
# siwave.quit_application()

Total running time of the script: ( 0 minutes 34.432 seconds)

Gallery generated by Sphinx-Gallery