|
1 | 1 | # # HFSS 3D Layout: Power Integrity Analysis
|
2 |
| -# This example shows how to use the electronics database (EDB) for power integrity analysis. The |
| 2 | +# This example shows how to use the electronics database (EDB) for power integrity analysis. The |
3 | 3 | # EDB will be loaded into HFSS 3D Layout for analysis and post-processing.
|
4 | 4 | # - Set up EDB
|
5 | 5 | # - Assign S-parameter model to components
|
6 | 6 | # - Create pin groups
|
7 | 7 | # - Create ports
|
8 |
| -# - Create SIwave SYZ anaylsis |
| 8 | +# - Create SIwave SYZ analysis |
9 | 9 | # - Create cutout
|
10 | 10 | # - Import EDB into HFSS 3D Layout
|
11 | 11 | # - Analyze
|
|
14 | 14 | # ## Preparation
|
15 | 15 | # Import the required packages
|
16 | 16 |
|
| 17 | +import json |
| 18 | + |
17 | 19 | # +
|
18 | 20 | import os
|
19 |
| -import json |
20 | 21 | import tempfile
|
21 | 22 | import time
|
22 |
| -from pyaedt import Edb |
23 |
| -from pyaedt import Hfss3dLayout |
| 23 | + |
| 24 | +from pyaedt import Edb, Hfss3dLayout |
24 | 25 | from pyaedt.downloads import download_file
|
| 26 | + |
25 | 27 | try:
|
26 | 28 | from ansys.pyaedt.examples.constants import AEDT_VERSION
|
27 | 29 | except:
|
|
34 | 36 | # Download the example PCB data.
|
35 | 37 |
|
36 | 38 | temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
|
37 |
| -aedb = download_file( |
38 |
| - source="edb/ANSYS-HSD_V1.aedb", destination=temp_folder.name |
39 |
| -) |
| 39 | +aedb = download_file(source="edb/ANSYS-HSD_V1.aedb", destination=temp_folder.name) |
40 | 40 | download_file(
|
41 | 41 | source="touchstone", name="GRM32_DC0V_25degC_series.s2p", destination=temp_folder.name
|
42 | 42 | )
|
|
48 | 48 |
|
49 | 49 | cfg = dict()
|
50 | 50 |
|
51 |
| -# In this example, we are going to assign S-parameter models to capacitors. |
| 51 | +# In this example, we are going to assign S-parameter models to capacitors. |
52 | 52 | # The first step is to use the "general" key to specify where the S-parameter files can be found.
|
53 | 53 |
|
54 |
| -cfg["general"] = { |
55 |
| - "s_parameter_library": os.path.join(temp_folder.name, "touchstone") |
56 |
| -} |
| 54 | +cfg["general"] = {"s_parameter_library": os.path.join(temp_folder.name, "touchstone")} |
57 | 55 |
|
58 |
| -# ## Assign model to capactitors. |
| 56 | +# ## Assign model to capactitors. |
59 | 57 | # In this example, the model "GRM32_DC0V_25degC_series.s2p" is assigned to capacitors C3 and C4, which share the same component part number.
|
60 |
| -# When "apply_to_all" is ``True``, all components having the part number "CAPC3216X180X20ML20" will be assigned the S-parameter model. |
| 58 | +# When "apply_to_all" is ``True``, all components having the part number "CAPC3216X180X20ML20" will be assigned the S-parameter model. |
61 | 59 |
|
62 | 60 | cfg["s_parameters"] = [
|
63 | 61 | {
|
|
67 | 65 | "apply_to_all": False,
|
68 | 66 | "components": ["C110", "C206"],
|
69 | 67 | "reference_net": "GND",
|
70 |
| - "reference_net_per_component": { |
71 |
| - "C110": "GND" |
72 |
| - } |
| 68 | + "reference_net_per_component": {"C110": "GND"}, |
73 | 69 | }
|
74 | 70 | ]
|
75 | 71 |
|
76 | 72 | # ## Create pin groups.
|
77 |
| -# In this example, the listed pins on component U2 are combined into two pin groups. |
| 73 | +# In this example, the listed pins on component U2 are combined into two pin groups. |
78 | 74 | # 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:
|
79 | 75 |
|
80 | 76 | cfg["pin_groups"] = [
|
81 |
| - { |
82 |
| - "name": "PIN_GROUP_1", |
83 |
| - "reference_designator": "U1", |
84 |
| - "pins": ["AD14", "AD15", "AD16", "AD17"] |
85 |
| - }, |
86 |
| - { |
87 |
| - "name": "PIN_GROUP_2", |
88 |
| - "reference_designator": "U1", |
89 |
| - "net": "GND" |
90 |
| - } |
| 77 | + {"name": "PIN_GROUP_1", "reference_designator": "U1", "pins": ["AD14", "AD15", "AD16", "AD17"]}, |
| 78 | + {"name": "PIN_GROUP_2", "reference_designator": "U1", "net": "GND"}, |
91 | 79 | ]
|
92 | 80 |
|
93 | 81 | # ## Create ports
|
|
98 | 86 | "name": "port1",
|
99 | 87 | "reference_designator": "U1",
|
100 | 88 | "type": "circuit",
|
101 |
| - "positive_terminal": { |
102 |
| - "pin_group": "PIN_GROUP_1" |
103 |
| - }, |
104 |
| - "negative_terminal": { |
105 |
| - "pin_group": "PIN_GROUP_2" |
106 |
| - } |
| 89 | + "positive_terminal": {"pin_group": "PIN_GROUP_1"}, |
| 90 | + "negative_terminal": {"pin_group": "PIN_GROUP_2"}, |
107 | 91 | }
|
108 | 92 | ]
|
109 | 93 |
|
|
120 | 104 | "name": "Sweep1",
|
121 | 105 | "type": "Interpolation",
|
122 | 106 | "frequencies": [
|
123 |
| - { |
124 |
| - "distribution": "log scale", |
125 |
| - "start": 1e6, |
126 |
| - "stop": 1e9, |
127 |
| - "samples": 20 |
128 |
| - } |
129 |
| - ] |
| 107 | + {"distribution": "log scale", "start": 1e6, "stop": 1e9, "samples": 20} |
| 108 | + ], |
130 | 109 | }
|
131 |
| - ] |
| 110 | + ], |
132 | 111 | }
|
133 | 112 | ]
|
134 | 113 |
|
|
159 | 138 | "maximum_iterations": 10,
|
160 | 139 | "preserve_components_with_model": False,
|
161 | 140 | "simple_pad_check": True,
|
162 |
| - "keep_lines_as_path": False |
| 141 | + "keep_lines_as_path": False, |
163 | 142 | }
|
164 | 143 | }
|
165 | 144 |
|
|
190 | 169 | # ### Load edb into HFSS 3D Layout.
|
191 | 170 |
|
192 | 171 | h3d = Hfss3dLayout(
|
193 |
| - aedb, |
194 |
| - specified_version=AEDT_VERSION, |
195 |
| - non_graphical=NG_MODE, |
196 |
| - new_desktop_session=True |
| 172 | + aedb, specified_version=AEDT_VERSION, non_graphical=NG_MODE, new_desktop_session=True |
197 | 173 | )
|
198 | 174 |
|
199 | 175 | # ### Analyze
|
|
202 | 178 |
|
203 | 179 | # ### Plot impedance
|
204 | 180 |
|
205 |
| -solutions = h3d.post.get_solution_data(expressions='Z(port1,port1)') |
| 181 | +solutions = h3d.post.get_solution_data(expressions="Z(port1,port1)") |
206 | 182 | solutions.plot()
|
207 | 183 |
|
208 | 184 | # ## Shut Down Electronics Desktop
|
209 | 185 |
|
210 | 186 | h3d.release_desktop()
|
211 | 187 |
|
212 |
| -# All project files are saved in the folder ``temp_file.dir``. If you've run this example as a Jupyter notbook you |
| 188 | +# All project files are saved in the folder ``temp_file.dir``. If you've run this example as a Jupyter notbook you |
213 | 189 | # can retrieve those project files. The following cell removes all temporary files, including the project folder.
|
214 | 190 |
|
215 | 191 | # ## Cleanup
|
216 | 192 | #
|
217 |
| -# All project files are saved in the folder ``temp_file.dir``. If you've run this example as a Jupyter notbook you |
| 193 | +# All project files are saved in the folder ``temp_file.dir``. If you've run this example as a Jupyter notbook you |
218 | 194 | # can retrieve those project files. The following cell removes all temporary files, including the project folder.
|
219 | 195 |
|
220 | 196 | time.sleep(3)
|
|
0 commit comments