Skip to content

Commit 8cd12a4

Browse files
DOCS: Update GDS Example to match template (#392)
Co-authored-by: svandenb-dev <[email protected]>
1 parent 9790a16 commit 8cd12a4

File tree

2 files changed

+74
-42
lines changed

2 files changed

+74
-42
lines changed
Lines changed: 74 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,110 @@
1-
# # EDB: Importing GDS file
1+
# # GDS Import
22
#
3-
# This example demonstrates how to import GDS files and translate their information to an EDB file.
3+
# Integrated circuit layout data is defined in GDS data which specifies the layout
4+
# geometry. Additionally, layer mapping and layer material information is defined in a
5+
# technology file.
6+
#
7+
# This example demonstrates how to import GDS files and translate GDS data
8+
# into an EDB file along with some simplified technology data
9+
# for subsequent use in HFSS 3D Layout.
10+
#
11+
# Keywords: **GDS**, **RFIC**
412

5-
# Perform imports.
13+
# ## Prerequisites
14+
#
15+
# ### Perform imports
616

7-
# +
817
import os
918
import tempfile
1019
from pyedb.dotnet.edb import Edb
1120
from pyedb.misc.downloads import download_file
1221
from ansys.aedt.core.hfss3dlayout import Hfss3dLayout
13-
# -
1422

15-
# ## Case 1: Import a GDS file.
23+
# ### Define constants
24+
# Constants help ensure consistency and avoid repetition throughout the example.
25+
26+
AEDT_VERSION = "2025.1"
27+
NG_MODE = False # Open AEDT UI when it is launched.
28+
29+
# ### Create temporary directory
30+
#
31+
# Create a temporary working directory.
32+
# The name of the working folder is stored in ``temp_folder.name``.
33+
#
34+
# > **Note:** The final cell in the notebook cleans up the temporary folder. If you want to
35+
# > retrieve the AEDT project and data, do so before executing the final cell in the notebook.
36+
37+
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
38+
39+
# ### Import a GDS file.
40+
#
41+
# Download the test case folder and copy it to the working directory. The
42+
# method ``download_file()`` retrieves example data from the
43+
# [Ansys GitHub "example_data" repository](https://github.com/ansys/example-data/tree/main/pyaedt).
1644
#
17-
# Download the test case folder and copy it to a temporary folder.
1845
# The following files are used in this example:
1946
#
20-
# - XML_Automation.xml
21-
# defines physical information such
22-
# as material properties, stackup layers, and boundary conditions.
23-
# - Model.map
24-
# maps properties to stackup layers.
47+
# - ``Model.xml`` defines physical information such
48+
# as material properties, stackup layer names, and boundary conditions.
49+
# - ``Model.gds`` contains the GDS data for the layout.
50+
# - ``Model.map`` maps properties to stackup layers.
2551

2652
# +
27-
temp_dir = tempfile.TemporaryDirectory(suffix=".ansys")
2853
control_fn = "Model.xml"
2954
gds_fn = "Model.gds"
3055
layer_map = "Model.map"
3156

32-
local_path = download_file("gds", destination=temp_dir.name)
33-
my_control_file = os.path.join(local_path, control_fn)
34-
my_map_file = os.path.join(local_path, layer_map)
57+
local_path = download_file("gds", destination=temp_folder.name)
58+
control_file = os.path.join(local_path, control_fn)
59+
map_file = os.path.join(local_path, layer_map)
3560
gds_in = os.path.join(local_path, gds_fn)
3661
# -
3762

38-
# ## Open EDB
63+
# ### Open the EDB
3964
#
40-
# Import the gds and open the edb. Each gds is followed either by a control file (XML) or a technology file (IRCX, VLC.TECH, or ITF).
41-
# Then a MAP file is also regularly used to map the stackup layers, and finally in some cases a layer filter (XML) is deployed, when
65+
# Each GDS file requires a control file (XML) or a technology file (IRCX, VLC.TECH, or ITF)
66+
# that maps the GDS geometry to a physical layer in the stackup.
67+
# The MAP file is also regularly used to map the stackup layers, and finally in some cases a layer filter (XML) is deployed, when
4268
# only a part of the stackup is needed.
69+
#
70+
# Open the EDB by creating an instance of the ``Edb`` class.
4371

44-
# +
45-
# Select EDB version (change it manually if needed, e.g. "2025.1")
46-
version = "2025.1"
47-
print(f"EDB version: {version}")
48-
49-
edb = Edb(gds_in, edbversion=version, control_file=my_control_file, map_file=my_map_file)
50-
51-
# ## Plot stackup
72+
edb = Edb(gds_in, edbversion=AEDT_VERSION, control_file=control_file, map_file=map_file)
5273

74+
# ### View the layer stackup
5375

5476
edb.stackup.plot()
5577

56-
# ## Save and close EDB
78+
# ### Save and close the EDB
5779
#
58-
# Save the project.
59-
60-
edb1_path = os.path.join(temp_dir.name, "gds_design.aedb")
80+
# The GDS file has been converted to an EDB and is ready for subsequent processing either in the
81+
# 3D Layout UI of Electronics Desktop or using
82+
# PyEDB.
83+
# The following commands save and close the EDB.
6184

62-
edb.save_as(edb1_path)
85+
edb_path = os.path.join(temp_folder.name, "gds_design.aedb")
86+
edb.save_as(edb_path)
87+
edb.close()
6388

64-
# Close the project.
65-
66-
edb.close_edb()
67-
68-
# ## Open both EDB files with HFSS 3D Layout, and observe the design / confirm the robustness from GDS to EDB.
89+
# ## View the layout
90+
# ### Open the EDB in Electronics Desktop
91+
#
92+
# The following command opens the EDB in Electronics Desktop. If you're running this example locally, you should see something like this:
93+
#
94+
# <img src="_static/layout.png" width="800">
6995

70-
h3d_gds = Hfss3dLayout(project=edb1_path, version=version, new_desktop=True)
96+
h3d = Hfss3dLayout(project=edb_path, version=AEDT_VERSION, new_desktop=NG_MODE)
7197

72-
# ## Close the HFSS 3D Layout design and release the dekstop.
98+
# ### Close the HFSS 3D Layout
99+
# The following command releases Ansys Electronics Desktop and closes the project.
73100

74-
h3d_gds.release_desktop()
101+
h3d.release_desktop()
75102

76-
# Clean up the temporary folder.
103+
# ### Clean up
104+
#
105+
# All project files are saved in the folder ``temp_folder.name``.
106+
# If you've run this example as a Jupyter notebook, you
107+
# can retrieve those project files. The following cell
108+
# removes all temporary files, including the project folder.
77109

78-
temp_dir.cleanup()
110+
temp_folder.cleanup()
13.7 KB
Loading

0 commit comments

Comments
 (0)