Skip to content

Commit d135ca8

Browse files
Merge branch 'update/01-HFSS3DLayout' into update/01-Modeling-Setup
2 parents 3e7cc16 + 4ba904d commit d135ca8

File tree

3 files changed

+67
-36
lines changed

3 files changed

+67
-36
lines changed

examples/01-HFSS3DLayout/01_power_integrity.py

+59-36
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,76 @@
11
# # HFSS 3D Layout: Power Integrity Analysis
2+
23
# This example shows how to use the electronics database (EDB) for power integrity analysis. The
34
# EDB will be loaded into HFSS 3D Layout for analysis and post-processing.
5+
#
46
# - Set up EDB
7+
#
58
# - Assign S-parameter model to components
69
# - Create pin groups
710
# - Create ports
811
# - Create SIwave SYZ anaylsis
912
# - Create cutout
13+
#
1014
# - Import EDB into HFSS 3D Layout
15+
#
1116
# - Analyze
1217
# - Plot $Z_{11}$
1318

14-
# ## Preparation
15-
# Import the required packages
19+
# ## Perform required imports
20+
#
21+
# Perform required imports.
1622

17-
# +
1823
import os
1924
import json
2025
import tempfile
2126
import time
2227
from pyaedt import Edb
2328
from pyaedt import Hfss3dLayout
2429
from pyaedt.downloads import download_file
25-
# -
2630

27-
# Set constant values
31+
# ## Define constants
32+
#
33+
# Define constant values used in this example
2834

2935
AEDT_VERSION = "2024.1"
3036
NG_MODE = True
3137

38+
# ## Create temporary directory and download files
39+
#
40+
# Create a temporary directory where we store downloaded data or
41+
# dumped data.
42+
43+
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
3244

3345
# Download the example PCB data.
3446

35-
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
3647
aedb = download_file(
3748
source="edb/ANSYS-HSD_V1.aedb", destination=temp_folder.name
3849
)
3950
download_file(
4051
source="touchstone", name="GRM32_DC0V_25degC_series.s2p", destination=temp_folder.name
4152
)
4253

43-
# ## Create a configuration file
44-
# In this example, we are going to use a configuration file to set up the layout for analysis.
45-
# ### Initialize a dictionary
54+
# ## Create a configuration file to set up the layout for analysis
55+
#
4656
# Create an empty dictionary to host all configurations.
4757

4858
cfg = dict()
4959

50-
# In this example, we are going to assign S-parameter models to capacitors.
51-
# The first step is to use the "general" key to specify where the S-parameter files can be found.
60+
# > **Note:** In the following, we are going to assign S-parameter
61+
# > models to capacitors.
62+
63+
# ### Define the S-parameter files
64+
#
65+
# Specify the location of the S-parameter files.
5266

5367
cfg["general"] = {
5468
"s_parameter_library": os.path.join(temp_folder.name, "touchstone")
5569
}
5670

57-
# ## Assign model to capactitors.
58-
# In this example, the model "GRM32_DC0V_25degC_series.s2p" is assigned to capacitors C3 and C4, which share the same component part number.
71+
# ### Assign model to capactitors
72+
#
73+
# Assign the model "GRM32_DC0V_25degC_series.s2p" to capacitors C3 and C4, which share the same component part number.
5974
# When "apply_to_all" is ``True``, all components having the part number "CAPC3216X180X20ML20" will be assigned the S-parameter model.
6075

6176
cfg["s_parameters"] = [
@@ -72,9 +87,11 @@
7287
}
7388
]
7489

75-
# ## Create pin groups.
76-
# In this example, the listed pins on component U2 are combined into two pin groups.
77-
# Pins can be grouped explicitly by the pin name or pin groups can be assigned by net name using the "net" key as shown here:
90+
# ### Define pin groups
91+
#
92+
# Combine the listed pins on component U1 into pin groups:
93+
# - the first group is defined explicitly by the pins name;
94+
# - the second group is assigned by net name using the "net" key.
7895

7996
cfg["pin_groups"] = [
8097
{
@@ -89,8 +106,9 @@
89106
}
90107
]
91108

92-
# ## Create ports
93-
# Create a circuit port between the two pin groups just created.
109+
# ### Create ports
110+
#
111+
# Create a circuit port between the two pin groups previously created.
94112

95113
cfg["ports"] = [
96114
{
@@ -106,8 +124,12 @@
106124
}
107125
]
108126

109-
# ## Create SIwave SYZ analysis setup
110-
# Both SIwave and HFSS can be used to run an analysis in the 3D Layout user interface.
127+
# ### Create SIwave SYZ analysis setup
128+
#
129+
# Create SIwave SYZ analysis setup.
130+
#
131+
# > **Note:** Both SIwave and HFSS can be used to run an analysis in the
132+
# > 3D Layout user interface.
111133

112134
cfg["setups"] = [
113135
{
@@ -131,8 +153,9 @@
131153
}
132154
]
133155

134-
# ## Cutout
135-
# The following assignments will define the region of the PCB to be cut out for analysis.
156+
# ### Cutout
157+
#
158+
# Define the the region of the PCB to cutout for analysis.
136159

137160
cfg["operations"] = {
138161
"cutout": {
@@ -162,17 +185,17 @@
162185
}
163186
}
164187

165-
# ## Save the configuration
188+
# ### Save the configuration
166189
#
167-
# The configuration file can be saved in JSON format and applied to layout data using the EDB.
190+
# Save the configuration file in JSON format.
168191

169192
pi_json = os.path.join(temp_folder.name, "pi.json")
170193
with open(pi_json, "w") as f:
171194
json.dump(cfg, f, indent=4, ensure_ascii=False)
172195

173196
# ## Load configuration into EDB
174-
175-
# Load configuration from JSON
197+
#
198+
# Load configuration from the JSON file.
176199

177200
edbapp = Edb(aedb, edbversion=AEDT_VERSION)
178201
edbapp.configuration.load(config_file=pi_json)
@@ -186,7 +209,7 @@
186209

187210
# ## Analyze in HFSS 3D Layout
188211

189-
# ### Load edb into HFSS 3D Layout.
212+
# ### Load EDB into HFSS 3D Layout
190213

191214
h3d = Hfss3dLayout(
192215
aedb,
@@ -204,17 +227,17 @@
204227
solutions = h3d.post.get_solution_data(expressions='Z(port1,port1)')
205228
solutions.plot()
206229

207-
# ## Shut Down Electronics Desktop
208-
209-
h3d.close_desktop()
230+
# ## Save project and close AEDT
231+
#
232+
# Save the project, release AEDT and remove both the project and temporary directory.
210233

211-
# All project files are saved in the folder ``temp_file.dir``. If you've run this example as a Jupyter notbook you
212-
# can retrieve those project files. The following cell removes all temporary files, including the project folder.
234+
# > **Note:** All project files are saved in the folder ``temp_file.dir``.
235+
# > If you've run this example as a Jupyter notebook you can retrieve those project files.
236+
# > The following cell removes all temporary files, including the project folder.
213237

214-
# ## Cleanup
215-
#
216-
# All project files are saved in the folder ``temp_file.dir``. If you've run this example as a Jupyter notbook you
217-
# can retrieve those project files. The following cell removes all temporary files, including the project folder.
238+
# +
239+
h3d.save_project()
240+
h3d.release_desktop()
218241

219242
time.sleep(3)
220243
temp_folder.cleanup()

examples/01-HFSS3DLayout/02_dc_ir_analysis.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# # HFSS 3D Layout: DC IR Analysis
22
# This example shows how to configure EDB for DC IR analysis, and load EDB into the 3D Layout UI for analysis and
33
# post-processing.
4+
#
45
# - Set up EDB
6+
#
57
# - Edit via padstack
68
# - Assign SPICE model to components
79
# - Create pin groups
810
# - Create voltage and current sources
911
# - Create SIwave DC anaylsis
1012
# - Create cutout
13+
#
1114
# - Import EDB into HFSS 3D Layout
15+
#
1216
# - Analyze
1317
# - Get DC IR analysis results
1418

examples/01-HFSS3DLayout/04_pre_layout_sma_connector_on_pcb.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# # HFSS 3D Layout: Pre-layout Signal Integrity
22
# This example shows how to create a parameterized layout design, and load the layout into HFSS 3D Layout for analysis and
33
# post-processing.
4+
#
45
# - Create EDB
6+
#
57
# - Add material
68
# - Create stackup
79
# - Create a parameterized via padstack definition
@@ -10,7 +12,9 @@
1012
# - Create signal vias and traces
1113
# - Create ground stitching vias
1214
# - Create HFSS analysis setup and frequency sweep
15+
#
1316
# - Import EDB into HFSS 3D Layout
17+
#
1418
# - Place SMA connector
1519
# - Analysis
1620
# - Plot return loss

0 commit comments

Comments
 (0)