Download this example

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


GDS Import#

Integrated circuit layout data is defined in GDS data which specifies the layout geometry. Additionally, layer mapping and layer material information is defined in a technology file.

This example demonstrates how to import GDS files and translate GDS data into an EDB file along with some simplified technology data for subsequent use in HFSS 3D Layout.

Keywords: GDS, RFIC

Prerequisites#

Perform imports#

[1]:
import os
import tempfile
import time
[2]:
from ansys.aedt.core.hfss3dlayout import Hfss3dLayout
from pyedb import Edb
from pyedb.misc.downloads import download_file

Define constant#

Constants help ensure consistency and avoid repetition throughout the example.

[3]:
AEDT_VERSION = "2026.1"
NG_MODE = False  # Open AEDT UI when it is launched.

Create temporary directory#

Create a temporary working directory. The name of the working folder is stored in temp_folder.name.

Note: The final cell in the notebook cleans up the temporary folder. If you want to retrieve the AEDT project and data, do so before executing the final cell in the notebook.

[4]:
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")

Import a GDS file.#

Download the test case folder and copy it to the working directory. The method download_file() retrieves example data from the Ansys GitHub “example_data” repository.

The following files are used in this example:

  • Model.xml defines physical information such as material properties, stackup layer names, and boundary conditions.

  • Model.gds contains the GDS data for the layout.

  • Model.map maps properties to stackup layers.

[5]:
control_fn = "Model.xml"
gds_fn = "Model.gds"
layer_map = "Model.map"

local_path = download_file("pyaedt/gds", destination=temp_folder.name)
control_file = os.path.join(local_path, control_fn)
map_file = os.path.join(local_path, layer_map)
gds_in = os.path.join(local_path, gds_fn)

Open the EDB#

Each GDS file requires a control file (XML) or a technology file (IRCX, VLC.TECH, or ITF) that maps the GDS geometry to a physical layer in the stackup. The MAP file is also regularly used to map the stackup layers, and finally in some cases a layer filter (XML) is deployed, when only a part of the stackup is needed.

Open the EDB by creating an instance of the Edb class.

[6]:
edb = Edb(edbpath=gds_in, control_file=control_file, map_file=map_file, 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: Translation successfully completed
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=3064
PyEDB INFO: RPC session acquired (open databases: 1)
PyEDB INFO: Database Model.aedb Opened in 2026.1
PyEDB INFO: Cell IC_Wo_Component1 Opened
PyEDB INFO: Refreshing the Components dictionary.
PyEDB WARNING: Unknown component type ViaGroup_1 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_2 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_3 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_4 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_5 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_6 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_13 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_14 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_15 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_16 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_17 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_18 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_19 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_20 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_21 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_22 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_23 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_24 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_25 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_26 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_27 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_28 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_29 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_30 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_31 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_32 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_33 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_34 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_35 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_36 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_37 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_38 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_39 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_40 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_41 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_42 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_43 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_44 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_45 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_46 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_47 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_48 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_49 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_50 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_51 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_52 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_53 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_54 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_55 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_56 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_57 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_58 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_59 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_60 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_61 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_62 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_63 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_64 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_65 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_66 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_67 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_68 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_69 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_70 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_71 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_72 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_73 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_74 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_75 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_76 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_77 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_78 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_79 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_80 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_81 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_82 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_83 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_84 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_85 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_86 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_87 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_88 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_89 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_90 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_91 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_92 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_93 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_94 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_95 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_96 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_97 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_98 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_99 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_100 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_101 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_102 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_103 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_104 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_105 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_106 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_107 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_108 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_109 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_110 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_111 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_112 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_113 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_114 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_115 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_116 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_117 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_118 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_119 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_120 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_121 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_122 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_123 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_124 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_125 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_126 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_127 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_128 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_129 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_130 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_131 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_132 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_133 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_134 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_135 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_136 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_137 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_138 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_139 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_140 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_141 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_142 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_143 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_144 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_145 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_146 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_147 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_148 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_149 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_150 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_151 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_152 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_153 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_154 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_155 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_156 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_157 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_158 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_159 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_160 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_161 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_162 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_163 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_164 found while refreshing components, will ignore
PyEDB WARNING: Unknown component type ViaGroup_165 found while refreshing components, will ignore
PyEDB INFO: Builder was initialized.
PyEDB INFO: EDB initialized.

View the layer stackup#

[7]:
edb.stackup.plot()
../../../_images/examples_edb_legacy_standalone_gds_workflow_13_0.png
[7]:
<module 'matplotlib.pyplot' from 'C:\\actions-runner\\_work\\pyaedt-examples\\pyaedt-examples\\.venv\\lib\\site-packages\\matplotlib\\pyplot.py'>

Save and close the EDB#

The GDS file has been converted to an EDB and is ready for subsequent processing either in the 3D Layout UI of Electronics Desktop or using PyEDB. The following commands save and close the EDB.

[8]:
edb_path = os.path.join(temp_folder.name, "gds_design.aedb")
edb.save_as(edb_path)
edb.close()
PyEDB INFO: RPC session released (open databases: 0)
[8]:
True

View the layout#

Open the EDB in Electronics Desktop#

The following command opens the EDB in Electronics Desktop. If you’re running this example locally, you should see something like this:

7238b6a12e9841fbb04a5ff2964658b1

[9]:
h3d = Hfss3dLayout(project=edb_path, version=AEDT_VERSION, new_desktop=NG_MODE)
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 Desktop session.
PyAEDT INFO: AEDT version 2026.1.
PyAEDT INFO: New AEDT session is starting on gRPC port 61890.
PyAEDT INFO: Starting new AEDT gRPC session on port 61890.
PyAEDT INFO: Launching AEDT server with gRPC transport mode: wnua
PyAEDT INFO: Electronics Desktop started on gRPC port 61890 after 11.0 seconds.
PyAEDT INFO: AEDT installation Path C:\Program Files\ANSYS Inc\v261\AnsysEM
PyAEDT INFO: Connected to AEDT gRPC session on port 61890.
PyAEDT INFO: Non-graphical mode detected. Disabling Desktop logs.
PyAEDT INFO: EDB folder C:\Users\ansys\AppData\Local\Temp\tmpkbgpesp9.ansys\gds_design.aedb has been imported to project gds_design
PyAEDT INFO: Active Design set to 0;IC_Wo_Component1
PyAEDT INFO: AEDT objects correctly read

Release AEDT#

The following command releases Ansys Electronics Desktop and closes the project.

[10]:
h3d.close_desktop()
PyAEDT INFO: Desktop has been released and closed.
[10]:
True
[11]:
# 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.

[12]:
temp_folder.cleanup()

Download this example

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