gds2openEMS 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gds2openems-0.1.0/LICENSE +201 -0
- gds2openems-0.1.0/MANIFEST.in +1 -0
- gds2openems-0.1.0/PKG-INFO +283 -0
- gds2openems-0.1.0/README.md +269 -0
- gds2openems-0.1.0/gds2openEMS/__init__.py +27 -0
- gds2openems-0.1.0/gds2openEMS/util_gds_reader.py +486 -0
- gds2openems-0.1.0/gds2openEMS/util_meshlines.py +524 -0
- gds2openems-0.1.0/gds2openEMS/util_simulation_setup.py +765 -0
- gds2openems-0.1.0/gds2openEMS/util_stackup_reader.py +326 -0
- gds2openems-0.1.0/gds2openEMS/util_utilities.py +216 -0
- gds2openems-0.1.0/gds2openEMS.egg-info/PKG-INFO +283 -0
- gds2openems-0.1.0/gds2openEMS.egg-info/SOURCES.txt +15 -0
- gds2openems-0.1.0/gds2openEMS.egg-info/dependency_links.txt +1 -0
- gds2openems-0.1.0/gds2openEMS.egg-info/requires.txt +3 -0
- gds2openems-0.1.0/gds2openEMS.egg-info/top_level.txt +1 -0
- gds2openems-0.1.0/pyproject.toml +22 -0
- gds2openems-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include README.md
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gds2openEMS
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Create and run openEMS FDTD model from RFIC GDSII layout file
|
|
5
|
+
Author-email: Volker Muehlhaus <volker@muehlhaus.com>
|
|
6
|
+
License: Apache
|
|
7
|
+
Requires-Python: >=3.6
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: gdspy>1.6.0
|
|
11
|
+
Requires-Dist: CSXCAD
|
|
12
|
+
Requires-Dist: openEMS
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# Create openEMS simulation models from GDSII layout files
|
|
16
|
+
|
|
17
|
+
gds2openEMS provides utility functions for an RFIC FEM simulation workflow based on the openEMS FDTD field solver.
|
|
18
|
+
|
|
19
|
+
The full repository with examples is available at
|
|
20
|
+
https://github.com/VolkerMuehlhaus/openems_ihp_sg13g2
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Documentation
|
|
24
|
+
Extensive documentation on creating models using gds2openEMS available in PDF format here:
|
|
25
|
+
https://github.com/VolkerMuehlhaus/openems_ihp_sg13g2/tree/main/doc
|
|
26
|
+
|
|
27
|
+
# Installation
|
|
28
|
+
To install the gds2openEMS module, activate the venv where you want to install.
|
|
29
|
+
|
|
30
|
+
Documentation for the gds2openEMS workflow assumes that you have created a Python venv
|
|
31
|
+
named "openems" in ~/venv/openems and installed the modules there, including the Python modules that come with openEMS itself.
|
|
32
|
+
|
|
33
|
+
If you follow this, you would first activate the venv:
|
|
34
|
+
```
|
|
35
|
+
source ~\venv\openems\bin\activate
|
|
36
|
+
```
|
|
37
|
+
and then install gds2openEMS module and dependencies via PyPI:
|
|
38
|
+
```
|
|
39
|
+
pip install gds2openEMS
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
To upgrade to the latest version, do
|
|
43
|
+
```
|
|
44
|
+
pip install gds2openEMS --upgrade
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# Dependencies
|
|
50
|
+
This module also installs these dependencies:
|
|
51
|
+
gdspy > 1.6.0
|
|
52
|
+
|
|
53
|
+
In addition, you need to install the Python module that ship with openEMS as described there:
|
|
54
|
+
https://docs.openems.de/python/install.html#python-linux-install
|
|
55
|
+
|
|
56
|
+
# Example script using gds2palace
|
|
57
|
+
Below is an example script that create *.json and *msh input files for simulation with Palace.
|
|
58
|
+
Input is a layout in GDSII file format and an XML file with stackup information
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import os
|
|
62
|
+
import sys
|
|
63
|
+
|
|
64
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'modules')))
|
|
65
|
+
from modules import *
|
|
66
|
+
|
|
67
|
+
from openEMS import openEMS
|
|
68
|
+
import numpy as np
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# Model comments
|
|
72
|
+
#
|
|
73
|
+
# This is a generic model running port excitation for all ports defined below,
|
|
74
|
+
# to get full [S] matrix data.
|
|
75
|
+
# Output is stored to Touchstone S-parameter file.
|
|
76
|
+
# No data plots are created by this script.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# ======================== workflow settings ================================
|
|
80
|
+
|
|
81
|
+
# preview model/mesh only?
|
|
82
|
+
# postprocess existing data without re-running simulation?
|
|
83
|
+
preview_only = True
|
|
84
|
+
postprocess_only = False
|
|
85
|
+
|
|
86
|
+
# ===================== input files and path settings =======================
|
|
87
|
+
|
|
88
|
+
gds_filename = "line_simple_viaport.gds" # geometries
|
|
89
|
+
XML_filename = "SG13G2_nosub.xml" # stackup
|
|
90
|
+
|
|
91
|
+
# preprocess GDSII for safe handling of cutouts/holes?
|
|
92
|
+
preprocess_gds = False
|
|
93
|
+
|
|
94
|
+
# merge via polygons with distance less than .. microns, set to 0 to disable via merging.
|
|
95
|
+
merge_polygon_size = 0
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# get path for this simulation file
|
|
99
|
+
script_path = utilities.get_script_path(__file__)
|
|
100
|
+
# use script filename as model basename
|
|
101
|
+
model_basename = utilities.get_basename(__file__)
|
|
102
|
+
# set and create directory for simulation output
|
|
103
|
+
sim_path = utilities.create_sim_path (script_path,model_basename)
|
|
104
|
+
print('Simulation data directory: ', sim_path)
|
|
105
|
+
# change current path to model script path
|
|
106
|
+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
|
107
|
+
|
|
108
|
+
# ======================== simulation settings ================================
|
|
109
|
+
|
|
110
|
+
unit = 1e-6 # geometry is in microns
|
|
111
|
+
margin = 50 # distance in microns from GDSII geometry boundary to simulation boundary
|
|
112
|
+
|
|
113
|
+
fstart = 0e9
|
|
114
|
+
fstop = 110e9
|
|
115
|
+
numfreq = 401
|
|
116
|
+
|
|
117
|
+
refined_cellsize = 1 # mesh cell size in conductor region
|
|
118
|
+
|
|
119
|
+
# choices for boundary:
|
|
120
|
+
# 'PEC' : perfect electric conductor (default)
|
|
121
|
+
# 'PMC' : perfect magnetic conductor, useful for symmetries
|
|
122
|
+
# 'MUR' : simple MUR absorbing boundary conditions
|
|
123
|
+
# 'PML_8' : PML absorbing boundary conditions
|
|
124
|
+
Boundaries = ['PEC', 'PEC', 'PEC', 'PEC', 'PEC', 'PEC']
|
|
125
|
+
|
|
126
|
+
cells_per_wavelength = 20 # how many mesh cells per wavelength, must be 10 or more
|
|
127
|
+
energy_limit = -40 # end criteria for residual energy (dB)
|
|
128
|
+
|
|
129
|
+
# port configuration, port geometry is read from GDSII file on the specified layer
|
|
130
|
+
simulation_ports = simulation_setup.all_simulation_ports()
|
|
131
|
+
|
|
132
|
+
# in-plane port is specified with target_layername= and direction x or y
|
|
133
|
+
# via port is specified with from_layername= and to_layername= and direction z
|
|
134
|
+
simulation_ports.add_port(simulation_setup.simulation_port(portnumber=1,
|
|
135
|
+
voltage=1,
|
|
136
|
+
port_Z0=50,
|
|
137
|
+
source_layernum=201,
|
|
138
|
+
from_layername='Metal1',
|
|
139
|
+
to_layername='TopMetal2',
|
|
140
|
+
direction='z'))
|
|
141
|
+
|
|
142
|
+
simulation_ports.add_port(simulation_setup.simulation_port(portnumber=2,
|
|
143
|
+
voltage=1,
|
|
144
|
+
port_Z0=50,
|
|
145
|
+
source_layernum=202,
|
|
146
|
+
from_layername='Metal1',
|
|
147
|
+
to_layername='TopMetal2',
|
|
148
|
+
direction='z'))
|
|
149
|
+
|
|
150
|
+
# ======================== simulation ================================
|
|
151
|
+
|
|
152
|
+
# get technology stackup data
|
|
153
|
+
materials_list, dielectrics_list, metals_list = stackup_reader.read_substrate (XML_filename)
|
|
154
|
+
# get list of layers from technology
|
|
155
|
+
layernumbers = metals_list.getlayernumbers()
|
|
156
|
+
# we must also read the layers where we added ports, these are not included in technology layers
|
|
157
|
+
layernumbers.extend(simulation_ports.portlayers)
|
|
158
|
+
|
|
159
|
+
# read geometries from GDSII, only purpose 0
|
|
160
|
+
allpolygons = gds_reader.read_gds(gds_filename,
|
|
161
|
+
layernumbers,
|
|
162
|
+
purposelist=[0],
|
|
163
|
+
metals_list=metals_list,
|
|
164
|
+
preprocess=preprocess_gds,
|
|
165
|
+
merge_polygon_size=merge_polygon_size)
|
|
166
|
+
|
|
167
|
+
# calculate maximum cellsize from wavelength in dielectric
|
|
168
|
+
wavelength_air = 3e8/fstop / unit
|
|
169
|
+
max_cellsize = (wavelength_air)/(np.sqrt(materials_list.eps_max)*cells_per_wavelength)
|
|
170
|
+
|
|
171
|
+
# define excitation and stop criteria and boundaries
|
|
172
|
+
FDTD = openEMS(EndCriteria=np.exp(energy_limit/10 * np.log(10)))
|
|
173
|
+
FDTD.SetGaussExcite( (fstart+fstop)/2, (fstop-fstart)/2 )
|
|
174
|
+
FDTD.SetBoundaryCond( Boundaries )
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
########### create model, run and post-process ###########
|
|
178
|
+
|
|
179
|
+
# run all port excitations, one after another
|
|
180
|
+
|
|
181
|
+
for port in simulation_ports.ports:
|
|
182
|
+
simulation_setup.setupSimulation ([port.portnumber],
|
|
183
|
+
simulation_ports,
|
|
184
|
+
FDTD,
|
|
185
|
+
materials_list,
|
|
186
|
+
dielectrics_list,
|
|
187
|
+
metals_list,
|
|
188
|
+
allpolygons,
|
|
189
|
+
max_cellsize,
|
|
190
|
+
refined_cellsize,
|
|
191
|
+
margin,
|
|
192
|
+
unit,
|
|
193
|
+
xy_mesh_function=util_meshlines.create_xy_mesh_from_polygons)
|
|
194
|
+
|
|
195
|
+
simulation_setup.runSimulation ([port.portnumber],
|
|
196
|
+
FDTD,
|
|
197
|
+
sim_path,
|
|
198
|
+
model_basename,
|
|
199
|
+
preview_only,
|
|
200
|
+
postprocess_only)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
# Initialize an empty matrix for S-parameters
|
|
204
|
+
num_ports = simulation_ports.portcount
|
|
205
|
+
s_params = np.empty((num_ports, num_ports, numfreq), dtype=object)
|
|
206
|
+
|
|
207
|
+
# Define frequency resolution. Due to FFT from Empire time domain results,
|
|
208
|
+
# this is postprocessing and we can change it again at any time.
|
|
209
|
+
f = np.linspace(fstart,fstop,numfreq)
|
|
210
|
+
|
|
211
|
+
# Populate the S-parameter matrix with simulation results
|
|
212
|
+
for i in range(1, num_ports + 1):
|
|
213
|
+
for j in range(1, num_ports + 1):
|
|
214
|
+
s_params[i-1, j-1] = utilities.calculate_Sij(i, j, f, sim_path, simulation_ports)
|
|
215
|
+
|
|
216
|
+
# Write to Touchstone *.snp file
|
|
217
|
+
snp_name = os.path.join(sim_path, model_basename + '.s' + str(num_ports) + 'p')
|
|
218
|
+
utilities.write_snp(s_params, f, snp_name)
|
|
219
|
+
|
|
220
|
+
print('Created S-parameter output file at ', snp_name)
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
XML file for this example:
|
|
225
|
+
|
|
226
|
+
```xml
|
|
227
|
+
<Stackup schemaVersion="2.0">
|
|
228
|
+
<Materials>
|
|
229
|
+
<Material Name="Activ" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="357141.0" Color="00ff00"/>
|
|
230
|
+
<Material Name="Metal1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="21640000.0" Color="39bfff"/>
|
|
231
|
+
<Material Name="Metal2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="ccccd9"/>
|
|
232
|
+
<Material Name="Metal3" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="d80000"/>
|
|
233
|
+
<Material Name="Metal4" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="93e837"/>
|
|
234
|
+
<Material Name="Metal5" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="dcd146"/>
|
|
235
|
+
<Material Name="TopMetal1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="27800000.0" Color="ffe6bf"/>
|
|
236
|
+
<Material Name="TopMetal2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="30300000.0" Color="ff8000"/>
|
|
237
|
+
<Material Name="TopVia2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="3143000.0" Color="ff8000"/>
|
|
238
|
+
<Material Name="TopVia1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2191000.0" Color="ffe6bf"/>
|
|
239
|
+
<Material Name="Via4" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="deac5e"/>
|
|
240
|
+
<Material Name="Via3" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="9ba940"/>
|
|
241
|
+
<Material Name="Via2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="ff3736"/>
|
|
242
|
+
<Material Name="Via1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="ccccff"/>
|
|
243
|
+
<Material Name="Cont" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2390000.0" Color="00ffff"/>
|
|
244
|
+
<Material Name="Passive" Type="Dielectric" Permittivity="6.6" DielectricLossTangent="0.0" Conductivity="0" Color="a0a0f0"/>
|
|
245
|
+
<Material Name="SiO2" Type="Dielectric" Permittivity="4.1" DielectricLossTangent="0.0" Conductivity="0" Color="fffcad"/>
|
|
246
|
+
<Material Name="Substrate" Type="Semiconductor" Permittivity="11.9" DielectricLossTangent="0" Conductivity="2.0" Color="01e0ff"/>
|
|
247
|
+
<Material Name="EPI" Type="Semiconductor" Permittivity="11.9" DielectricLossTangent="0" Conductivity="5.0" Color="294fff"/>
|
|
248
|
+
<Material Name="AIR" Type="Dielectric" Permittivity="1.0" DielectricLossTangent="0.0" Conductivity="0" Color="d0d0d0"/>
|
|
249
|
+
<Material Name="LOWLOSS" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1E10" Color="ff0000"/>
|
|
250
|
+
<Material Name="MIM_equiv" Type="Dielectric" Permittivity="16.87" DielectricLossTangent="0.0" Conductivity="0" Color="ff0000"/>
|
|
251
|
+
<Material Name="SiO2" Type="Dielectric" Permittivity="4.1" DielectricLossTangent="0.0" Conductivity="0" Color="fffcad"/>
|
|
252
|
+
</Materials>
|
|
253
|
+
<ELayers LengthUnit="um">
|
|
254
|
+
<Dielectrics>
|
|
255
|
+
<Dielectric Name="AIR" Material="AIR" Thickness="300.0000"/>
|
|
256
|
+
<Dielectric Name="Passive" Material="Passive" Thickness="0.4000"/>
|
|
257
|
+
<Dielectric Name="SiO2" Material="SiO2" Thickness="15.7303"/>
|
|
258
|
+
<!-- Comment: Material name SiO2 is excluded from meshing, so we must use a different name to add some spacing at the bottom of the simulation box -->
|
|
259
|
+
<Dielectric Name="Spacing" Material="SiO2" Thickness="2.0"/>
|
|
260
|
+
</Dielectrics>
|
|
261
|
+
<Layers>
|
|
262
|
+
<Substrate Offset="2.0"/>
|
|
263
|
+
<Layer Name="Activ" Type="conductor" Zmin="0.0000" Zmax="0.4000" Material="Activ" Layer="1"/>
|
|
264
|
+
<Layer Name="Metal1" Type="conductor" Zmin="1.0400" Zmax="1.4600" Material="Metal1" Layer="8"/>
|
|
265
|
+
<Layer Name="Metal2" Type="conductor" Zmin="2.0000" Zmax="2.4900" Material="Metal2" Layer="10"/>
|
|
266
|
+
<Layer Name="Metal3" Type="conductor" Zmin="3.0300" Zmax="3.5200" Material="Metal3" Layer="30"/>
|
|
267
|
+
<Layer Name="Metal4" Type="conductor" Zmin="4.0600" Zmax="4.5500" Material="Metal4" Layer="50"/>
|
|
268
|
+
<Layer Name="Metal5" Type="conductor" Zmin="5.0900" Zmax="5.5800" Material="Metal5" Layer="67"/>
|
|
269
|
+
<Layer Name="TopMetal1" Type="conductor" Zmin="6.4303" Zmax="8.4303" Material="TopMetal1" Layer="126"/>
|
|
270
|
+
<Layer Name="TopMetal2" Type="conductor" Zmin="11.2303" Zmax="14.2303" Material="TopMetal2" Layer="134"/>
|
|
271
|
+
<Layer Name="TopVia2" Type="via" Zmin="8.4303" Zmax="11.2303" Material="TopVia2" Layer="133"/>
|
|
272
|
+
<Layer Name="TopVia1" Type="via" Zmin="5.5800" Zmax="6.4303" Material="TopVia1" Layer="125"/>
|
|
273
|
+
<Layer Name="Via4" Type="via" Zmin="4.5500" Zmax="5.0900" Material="Via4" Layer="66"/>
|
|
274
|
+
<Layer Name="Via3" Type="via" Zmin="3.5200" Zmax="4.0600" Material="Via3" Layer="49"/>
|
|
275
|
+
<Layer Name="Via2" Type="via" Zmin="2.4900" Zmax="3.0300" Material="Via2" Layer="29"/>
|
|
276
|
+
<Layer Name="Via1" Type="via" Zmin="1.4600" Zmax="2.0000" Material="Via1" Layer="19"/>
|
|
277
|
+
<Layer Name="Cont" Type="via" Zmin="0.4000" Zmax="1.0400" Material="Cont" Layer="6"/>
|
|
278
|
+
<Layer Name="MIM_DK" Type="conductor" Zmin="5.5800" Zmax="5.6800" Material="MIM_equiv" Layer="36"/>
|
|
279
|
+
<Layer Name="MIM" Type="conductor" Zmin="5.6800" Zmax="6.4303" Material="TopVia1" Layer="36"/>
|
|
280
|
+
</Layers>
|
|
281
|
+
</ELayers>
|
|
282
|
+
</Stackup>
|
|
283
|
+
```
|