EDB: Edit Control File and import gds#

This example shows how you can use PyAEDT to import a gds from an IC file.

Perform required imports#

Perform required imports, which includes importing a section.

import os
import shutil
import tempfile

from pyedb import Edb
from pyedb.dotnet.edb_core.edb_data.control_file import ControlFile
from pyedb.misc.downloads import download_file

Download file#

Download the AEDB file and copy it in the temporary folder.

temppath = tempfile.gettempdir()
local_path = download_file("gds")
c_file_in = os.path.join(local_path, "sky130_fictitious_dtc_example_control_no_map.xml")
c_map = os.path.join(local_path, "dummy_layermap.map")
gds_in = os.path.join(local_path, "sky130_fictitious_dtc_example.gds")
gds_out = os.path.join(temppath, "example.gds")
shutil.copy2(gds_in, gds_out)
'C:\\Users\\ansys\\AppData\\Local\\Temp\\example.gds'

Control file#

A Control file is an xml file which purpose if to provide additional information during import phase. It can include, materials, stackup, setup, boundaries and settings. In this example we will import an existing xml, integrate it with a layer mapping file of gds and then adding setup and boundaries.

c = ControlFile(c_file_in, layer_map=c_map)

Simulation setup#

Here we setup simulation with HFSS and add a frequency sweep.

setup = c.setups.add_setup("Setup1", "1GHz")
setup.add_sweep("Sweep1", "0.01GHz", "5GHz", "0.1GHz")
<pyedb.dotnet.edb_core.edb_data.control_file.ControlFileSweep object at 0x000001AA56247BB0>

Additional stackup settings#

After import user can change stackup settings and add/remove layers or materials.

Boundaries settings#

Boundaries can include ports, components and boundary extent.

c.boundaries.units = "um"
c.boundaries.add_port("P1", x1=223.7, y1=222.6, layer1="Metal6", x2=223.7, y2=100, layer2="Metal6")
c.boundaries.add_extent()
comp = c.components.add_component("B1", "BGA", "IC", "Flip chip", "Cylinder")
comp.solder_diameter = "65um"
comp.add_pin("1", "81.28", "84.6", "met2")
comp.add_pin("2", "211.28", "84.6", "met2")
comp.add_pin("3", "211.28", "214.6", "met2")
comp.add_pin("4", "81.28", "214.6", "met2")
c.import_options.import_dummy_nets = True

Write xml#

After all settings are ready we can write xml.

c.write_xml(os.path.join(temppath, "output.xml"))
True

Open Edb#

Import the gds and open the edb.

edb = Edb(gds_out, edbversion="2024.1", technology_file=os.path.join(temppath, "output.xml"))

Plot Stackup#

Stackup plot.

edb.stackup.plot(first_layer="met1")
Stackup
<module 'matplotlib.pyplot' from 'C:\\actions-runner\\_work\\pyedb\\pyedb\\.venv\\lib\\site-packages\\matplotlib\\pyplot.py'>

Close Edb#

Close the project.

edb.close_edb()
True

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

Gallery generated by Sphinx-Gallery