gds2palace 0.1.5__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.
@@ -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,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: gds2palace
3
+ Version: 0.1.5
4
+ Summary: Create AWS Palace 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: gmsh
12
+ Requires-Dist: PySide6
13
+ Dynamic: license-file
14
+
15
+ # Create AWS Palace FEM Models from GDSII layout files
16
+
17
+ gds2palace provides utility functions for an RFIC FEM simulation workflow based on the Palace FEM solver by AWS.
18
+
19
+ The full repository with examples is available at
20
+ https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2
21
+
22
+
23
+ # Documentation
24
+ Extensive documentation on creating models using gds2palace is available in PDF format here:
25
+ [gds2palace FEM workflow for IHP](./doc/gds2palace_workflow_October_2025.pdf)
26
+
27
+ # Installation
28
+ To install the gds2palace module, activate the venv where you want to install.
29
+
30
+ Documentation for the gds2palace workflow assumes that you have created a Python venv
31
+ named "palace" in ~/venv/palace and installed the modules there.
32
+
33
+ If you follow this, you would first activate the venv:
34
+ ```
35
+ source ~\venv\palace\bin\activate
36
+ ```
37
+ and then install gds2palace module and dependencies via PyPI:
38
+ ```
39
+ pip install gds2palace
40
+ ```
41
+
42
+ To upgrade to the latest version, do
43
+ ```
44
+ pip install gds2palace --upgrade
45
+ ```
46
+
47
+
48
+
49
+ # Dependencies
50
+ This module also installs these dependencies:
51
+ gdspy > 1.6.0
52
+ gmsh
53
+ PySide6
54
+
55
+ PySide6 is not required by gds2palace module itself, but required by the GUI application that uses gds2palace.
56
+
57
+ # Example script using gds2palace
58
+ Below is an example script that create *.json and *msh input files for simulation with Palace.
59
+ Input is a layout in GDSII file format and an XML file with stackup information
60
+
61
+ ```python
62
+ import os
63
+ import sys
64
+ import subprocess
65
+
66
+ from gds2palace import *
67
+
68
+ # ===================== input files and path settings =======================
69
+
70
+ gds_filename = "line_simple_viaport.gds" # geometries
71
+ XML_filename = "SG13G2_nosub.xml" # stackup
72
+
73
+ # preprocess GDSII for safe handling of cutouts/holes?
74
+ preprocess_gds = False
75
+
76
+ # merge via polygons with distance less than .. microns, set to 0 to disable via merging.
77
+ merge_polygon_size = 0
78
+
79
+ # get path for this simulation file
80
+ script_path = utilities.get_script_path(__file__)
81
+
82
+ # use script filename as model basename
83
+ model_basename = utilities.get_basename(__file__)
84
+
85
+ # set and create directory for simulation output
86
+ sim_path = utilities.create_sim_path (script_path,model_basename)
87
+ print('Simulation data directory: ', sim_path)
88
+
89
+ # change path to models script path
90
+ modelDir = os.path.dirname(os.path.abspath(__file__))
91
+ os.chdir(modelDir)
92
+
93
+ # ======================== simulation settings ================================
94
+
95
+ settings = {}
96
+
97
+ settings['unit'] = 1e-6 # geometry is in microns
98
+ settings['margin'] = 50 # distance in microns from GDSII geometry boundary to simulation boundary
99
+
100
+ settings['fstart'] = 0e9
101
+ settings['fstop'] = 100e9
102
+ settings['fstep'] = 2.5e9
103
+
104
+ settings['refined_cellsize'] = 2 # mesh cell size in conductor region
105
+ settings['cells_per_wavelength'] = 10 # how many mesh cells per wavelength, must be 10 or more
106
+
107
+ settings['meshsize_max'] = 70 # microns, override cells_per_wavelength
108
+ settings['adaptive_mesh_iterations'] = 0
109
+
110
+ # settings['nogui'] = True # create files without showing 3D model
111
+ # settings['nogui'] = ('nogui' in sys.argv) # check if nogui specified on command line, then create files without showing 3D model
112
+
113
+ # Ports from GDSII Data, polygon geometry from specified special layer
114
+ # Excitations can be switched off by voltage=0, those S-parameter will be incomplete then
115
+
116
+ simulation_ports = simulation_setup.all_simulation_ports()
117
+ # instead of in-plane port specified with target_layername, we here use via port specified with from_layername and to_layername
118
+ simulation_ports.add_port(simulation_setup.simulation_port(portnumber=1, voltage=1, port_Z0=50, source_layernum=201, from_layername='Metal1', to_layername='TopMetal2', direction='z'))
119
+ simulation_ports.add_port(simulation_setup.simulation_port(portnumber=2, voltage=1, port_Z0=50, source_layernum=202, from_layername='Metal1', to_layername='TopMetal2', direction='z'))
120
+
121
+
122
+ # ======================== simulation ================================
123
+
124
+ # get technology stackup data
125
+ materials_list, dielectrics_list, metals_list = stackup_reader.read_substrate (XML_filename)
126
+ # get list of layers from technology
127
+ layernumbers = metals_list.getlayernumbers()
128
+ layernumbers.extend(simulation_ports.portlayers)
129
+
130
+ # read geometries from GDSII, only purpose 0
131
+ allpolygons = gds_reader.read_gds(gds_filename, layernumbers, purposelist=[0], metals_list=metals_list, preprocess=preprocess_gds, merge_polygon_size=merge_polygon_size)
132
+
133
+
134
+ ########### create model ###########
135
+
136
+ settings['simulation_ports'] = simulation_ports
137
+ settings['materials_list'] = materials_list
138
+ settings['dielectrics_list'] = dielectrics_list
139
+ settings['metals_list'] = metals_list
140
+ settings['layernumbers'] = layernumbers
141
+ settings['allpolygons'] = allpolygons
142
+ settings['sim_path'] = sim_path
143
+ settings['model_basename'] = model_basename
144
+
145
+
146
+ # list of ports that are excited (set voltage to zero in port excitation to skip an excitation!)
147
+ excite_ports = simulation_ports.all_active_excitations()
148
+ config_name, data_dir = simulation_setup.create_palace (excite_ports, settings)
149
+
150
+ ```
151
+
152
+ XML file for this example:
153
+
154
+ ```xml
155
+ <Stackup schemaVersion="2.0">
156
+ <Materials>
157
+ <Material Name="Activ" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="357141.0" Color="00ff00"/>
158
+ <Material Name="Metal1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="21640000.0" Color="39bfff"/>
159
+ <Material Name="Metal2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="ccccd9"/>
160
+ <Material Name="Metal3" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="d80000"/>
161
+ <Material Name="Metal4" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="93e837"/>
162
+ <Material Name="Metal5" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="dcd146"/>
163
+ <Material Name="TopMetal1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="27800000.0" Color="ffe6bf"/>
164
+ <Material Name="TopMetal2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="30300000.0" Color="ff8000"/>
165
+ <Material Name="TopVia2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="3143000.0" Color="ff8000"/>
166
+ <Material Name="TopVia1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2191000.0" Color="ffe6bf"/>
167
+ <Material Name="Via4" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="deac5e"/>
168
+ <Material Name="Via3" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="9ba940"/>
169
+ <Material Name="Via2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="ff3736"/>
170
+ <Material Name="Via1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="ccccff"/>
171
+ <Material Name="Cont" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2390000.0" Color="00ffff"/>
172
+ <Material Name="Passive" Type="Dielectric" Permittivity="6.6" DielectricLossTangent="0.0" Conductivity="0" Color="a0a0f0"/>
173
+ <Material Name="SiO2" Type="Dielectric" Permittivity="4.1" DielectricLossTangent="0.0" Conductivity="0" Color="fffcad"/>
174
+ <Material Name="Substrate" Type="Semiconductor" Permittivity="11.9" DielectricLossTangent="0" Conductivity="2.0" Color="01e0ff"/>
175
+ <Material Name="EPI" Type="Semiconductor" Permittivity="11.9" DielectricLossTangent="0" Conductivity="5.0" Color="294fff"/>
176
+ <Material Name="AIR" Type="Dielectric" Permittivity="1.0" DielectricLossTangent="0.0" Conductivity="0" Color="d0d0d0"/>
177
+ <Material Name="LOWLOSS" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1E10" Color="ff0000"/>
178
+ <Material Name="Vmim" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2191000.0" Color="ffe6bf"/>
179
+ <Material Name="MIM" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="500000.0" Color="e6ffbf"/>
180
+ </Materials>
181
+ <ELayers LengthUnit="um">
182
+ <Dielectrics>
183
+ <Dielectric Name="AIR" Material="AIR" Thickness="300.0000"/>
184
+ <Dielectric Name="Passive" Material="Passive" Thickness="0.4000"/>
185
+ <Dielectric Name="SiO2" Material="SiO2" Thickness="15.7303"/>
186
+ <Dielectric Name="Spacing" Material="SiO2" Thickness="2.0"/>
187
+ </Dielectrics>
188
+ <Layers>
189
+ <Substrate Offset="2.0"/>
190
+ <Layer Name="Activ" Type="conductor" Zmin="0.0000" Zmax="0.4000" Material="Activ" Layer="1"/>
191
+ <Layer Name="Metal1" Type="conductor" Zmin="1.0400" Zmax="1.4600" Material="Metal1" Layer="8"/>
192
+ <Layer Name="Metal2" Type="conductor" Zmin="2.0000" Zmax="2.4900" Material="Metal2" Layer="10"/>
193
+ <Layer Name="Metal3" Type="conductor" Zmin="3.0300" Zmax="3.5200" Material="Metal3" Layer="30"/>
194
+ <Layer Name="Metal4" Type="conductor" Zmin="4.0600" Zmax="4.5500" Material="Metal4" Layer="50"/>
195
+ <Layer Name="Metal5" Type="conductor" Zmin="5.0900" Zmax="5.5800" Material="Metal5" Layer="67"/>
196
+ <Layer Name="TopMetal1" Type="conductor" Zmin="6.4303" Zmax="8.4303" Material="TopMetal1" Layer="126"/>
197
+ <Layer Name="TopMetal2" Type="conductor" Zmin="11.2303" Zmax="14.2303" Material="TopMetal2" Layer="134"/>
198
+ <Layer Name="TopVia2" Type="via" Zmin="8.4303" Zmax="11.2303" Material="TopVia2" Layer="133"/>
199
+ <Layer Name="TopVia1" Type="via" Zmin="5.5800" Zmax="6.4303" Material="TopVia1" Layer="125"/>
200
+ <Layer Name="Via4" Type="via" Zmin="4.5500" Zmax="5.0900" Material="Via4" Layer="66"/>
201
+ <Layer Name="Via3" Type="via" Zmin="3.5200" Zmax="4.0600" Material="Via3" Layer="49"/>
202
+ <Layer Name="Via2" Type="via" Zmin="2.4900" Zmax="3.0300" Material="Via2" Layer="29"/>
203
+ <Layer Name="Via1" Type="via" Zmin="1.4600" Zmax="2.0000" Material="Via1" Layer="19"/>
204
+ <Layer Name="Cont" Type="via" Zmin="0.4000" Zmax="1.0400" Material="Cont" Layer="6"/>
205
+ <Layer Name="MIM" Type="conductor" Zmin="5.6043" Zmax="5.7540" Material="MIM" Layer="36"/>
206
+ <Layer Name="Vmim" Type="via" Zmin="5.7540" Zmax="6.4303" Material="Vmim" Layer="129"/>
207
+ </Layers>
208
+ </ELayers>
209
+ </Stackup>
210
+ ```
@@ -0,0 +1,196 @@
1
+ # Create AWS Palace FEM Models from GDSII layout files
2
+
3
+ gds2palace provides utility functions for an RFIC FEM simulation workflow based on the Palace FEM solver by AWS.
4
+
5
+ The full repository with examples is available at
6
+ https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2
7
+
8
+
9
+ # Documentation
10
+ Extensive documentation on creating models using gds2palace is available in PDF format here:
11
+ [gds2palace FEM workflow for IHP](./doc/gds2palace_workflow_October_2025.pdf)
12
+
13
+ # Installation
14
+ To install the gds2palace module, activate the venv where you want to install.
15
+
16
+ Documentation for the gds2palace workflow assumes that you have created a Python venv
17
+ named "palace" in ~/venv/palace and installed the modules there.
18
+
19
+ If you follow this, you would first activate the venv:
20
+ ```
21
+ source ~\venv\palace\bin\activate
22
+ ```
23
+ and then install gds2palace module and dependencies via PyPI:
24
+ ```
25
+ pip install gds2palace
26
+ ```
27
+
28
+ To upgrade to the latest version, do
29
+ ```
30
+ pip install gds2palace --upgrade
31
+ ```
32
+
33
+
34
+
35
+ # Dependencies
36
+ This module also installs these dependencies:
37
+ gdspy > 1.6.0
38
+ gmsh
39
+ PySide6
40
+
41
+ PySide6 is not required by gds2palace module itself, but required by the GUI application that uses gds2palace.
42
+
43
+ # Example script using gds2palace
44
+ Below is an example script that create *.json and *msh input files for simulation with Palace.
45
+ Input is a layout in GDSII file format and an XML file with stackup information
46
+
47
+ ```python
48
+ import os
49
+ import sys
50
+ import subprocess
51
+
52
+ from gds2palace import *
53
+
54
+ # ===================== input files and path settings =======================
55
+
56
+ gds_filename = "line_simple_viaport.gds" # geometries
57
+ XML_filename = "SG13G2_nosub.xml" # stackup
58
+
59
+ # preprocess GDSII for safe handling of cutouts/holes?
60
+ preprocess_gds = False
61
+
62
+ # merge via polygons with distance less than .. microns, set to 0 to disable via merging.
63
+ merge_polygon_size = 0
64
+
65
+ # get path for this simulation file
66
+ script_path = utilities.get_script_path(__file__)
67
+
68
+ # use script filename as model basename
69
+ model_basename = utilities.get_basename(__file__)
70
+
71
+ # set and create directory for simulation output
72
+ sim_path = utilities.create_sim_path (script_path,model_basename)
73
+ print('Simulation data directory: ', sim_path)
74
+
75
+ # change path to models script path
76
+ modelDir = os.path.dirname(os.path.abspath(__file__))
77
+ os.chdir(modelDir)
78
+
79
+ # ======================== simulation settings ================================
80
+
81
+ settings = {}
82
+
83
+ settings['unit'] = 1e-6 # geometry is in microns
84
+ settings['margin'] = 50 # distance in microns from GDSII geometry boundary to simulation boundary
85
+
86
+ settings['fstart'] = 0e9
87
+ settings['fstop'] = 100e9
88
+ settings['fstep'] = 2.5e9
89
+
90
+ settings['refined_cellsize'] = 2 # mesh cell size in conductor region
91
+ settings['cells_per_wavelength'] = 10 # how many mesh cells per wavelength, must be 10 or more
92
+
93
+ settings['meshsize_max'] = 70 # microns, override cells_per_wavelength
94
+ settings['adaptive_mesh_iterations'] = 0
95
+
96
+ # settings['nogui'] = True # create files without showing 3D model
97
+ # settings['nogui'] = ('nogui' in sys.argv) # check if nogui specified on command line, then create files without showing 3D model
98
+
99
+ # Ports from GDSII Data, polygon geometry from specified special layer
100
+ # Excitations can be switched off by voltage=0, those S-parameter will be incomplete then
101
+
102
+ simulation_ports = simulation_setup.all_simulation_ports()
103
+ # instead of in-plane port specified with target_layername, we here use via port specified with from_layername and to_layername
104
+ simulation_ports.add_port(simulation_setup.simulation_port(portnumber=1, voltage=1, port_Z0=50, source_layernum=201, from_layername='Metal1', to_layername='TopMetal2', direction='z'))
105
+ simulation_ports.add_port(simulation_setup.simulation_port(portnumber=2, voltage=1, port_Z0=50, source_layernum=202, from_layername='Metal1', to_layername='TopMetal2', direction='z'))
106
+
107
+
108
+ # ======================== simulation ================================
109
+
110
+ # get technology stackup data
111
+ materials_list, dielectrics_list, metals_list = stackup_reader.read_substrate (XML_filename)
112
+ # get list of layers from technology
113
+ layernumbers = metals_list.getlayernumbers()
114
+ layernumbers.extend(simulation_ports.portlayers)
115
+
116
+ # read geometries from GDSII, only purpose 0
117
+ allpolygons = gds_reader.read_gds(gds_filename, layernumbers, purposelist=[0], metals_list=metals_list, preprocess=preprocess_gds, merge_polygon_size=merge_polygon_size)
118
+
119
+
120
+ ########### create model ###########
121
+
122
+ settings['simulation_ports'] = simulation_ports
123
+ settings['materials_list'] = materials_list
124
+ settings['dielectrics_list'] = dielectrics_list
125
+ settings['metals_list'] = metals_list
126
+ settings['layernumbers'] = layernumbers
127
+ settings['allpolygons'] = allpolygons
128
+ settings['sim_path'] = sim_path
129
+ settings['model_basename'] = model_basename
130
+
131
+
132
+ # list of ports that are excited (set voltage to zero in port excitation to skip an excitation!)
133
+ excite_ports = simulation_ports.all_active_excitations()
134
+ config_name, data_dir = simulation_setup.create_palace (excite_ports, settings)
135
+
136
+ ```
137
+
138
+ XML file for this example:
139
+
140
+ ```xml
141
+ <Stackup schemaVersion="2.0">
142
+ <Materials>
143
+ <Material Name="Activ" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="357141.0" Color="00ff00"/>
144
+ <Material Name="Metal1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="21640000.0" Color="39bfff"/>
145
+ <Material Name="Metal2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="ccccd9"/>
146
+ <Material Name="Metal3" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="d80000"/>
147
+ <Material Name="Metal4" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="93e837"/>
148
+ <Material Name="Metal5" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="23190000.0" Color="dcd146"/>
149
+ <Material Name="TopMetal1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="27800000.0" Color="ffe6bf"/>
150
+ <Material Name="TopMetal2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="30300000.0" Color="ff8000"/>
151
+ <Material Name="TopVia2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="3143000.0" Color="ff8000"/>
152
+ <Material Name="TopVia1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2191000.0" Color="ffe6bf"/>
153
+ <Material Name="Via4" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="deac5e"/>
154
+ <Material Name="Via3" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="9ba940"/>
155
+ <Material Name="Via2" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="ff3736"/>
156
+ <Material Name="Via1" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1660000.0" Color="ccccff"/>
157
+ <Material Name="Cont" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2390000.0" Color="00ffff"/>
158
+ <Material Name="Passive" Type="Dielectric" Permittivity="6.6" DielectricLossTangent="0.0" Conductivity="0" Color="a0a0f0"/>
159
+ <Material Name="SiO2" Type="Dielectric" Permittivity="4.1" DielectricLossTangent="0.0" Conductivity="0" Color="fffcad"/>
160
+ <Material Name="Substrate" Type="Semiconductor" Permittivity="11.9" DielectricLossTangent="0" Conductivity="2.0" Color="01e0ff"/>
161
+ <Material Name="EPI" Type="Semiconductor" Permittivity="11.9" DielectricLossTangent="0" Conductivity="5.0" Color="294fff"/>
162
+ <Material Name="AIR" Type="Dielectric" Permittivity="1.0" DielectricLossTangent="0.0" Conductivity="0" Color="d0d0d0"/>
163
+ <Material Name="LOWLOSS" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="1E10" Color="ff0000"/>
164
+ <Material Name="Vmim" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="2191000.0" Color="ffe6bf"/>
165
+ <Material Name="MIM" Type="Conductor" Permittivity="1" DielectricLossTangent="0" Conductivity="500000.0" Color="e6ffbf"/>
166
+ </Materials>
167
+ <ELayers LengthUnit="um">
168
+ <Dielectrics>
169
+ <Dielectric Name="AIR" Material="AIR" Thickness="300.0000"/>
170
+ <Dielectric Name="Passive" Material="Passive" Thickness="0.4000"/>
171
+ <Dielectric Name="SiO2" Material="SiO2" Thickness="15.7303"/>
172
+ <Dielectric Name="Spacing" Material="SiO2" Thickness="2.0"/>
173
+ </Dielectrics>
174
+ <Layers>
175
+ <Substrate Offset="2.0"/>
176
+ <Layer Name="Activ" Type="conductor" Zmin="0.0000" Zmax="0.4000" Material="Activ" Layer="1"/>
177
+ <Layer Name="Metal1" Type="conductor" Zmin="1.0400" Zmax="1.4600" Material="Metal1" Layer="8"/>
178
+ <Layer Name="Metal2" Type="conductor" Zmin="2.0000" Zmax="2.4900" Material="Metal2" Layer="10"/>
179
+ <Layer Name="Metal3" Type="conductor" Zmin="3.0300" Zmax="3.5200" Material="Metal3" Layer="30"/>
180
+ <Layer Name="Metal4" Type="conductor" Zmin="4.0600" Zmax="4.5500" Material="Metal4" Layer="50"/>
181
+ <Layer Name="Metal5" Type="conductor" Zmin="5.0900" Zmax="5.5800" Material="Metal5" Layer="67"/>
182
+ <Layer Name="TopMetal1" Type="conductor" Zmin="6.4303" Zmax="8.4303" Material="TopMetal1" Layer="126"/>
183
+ <Layer Name="TopMetal2" Type="conductor" Zmin="11.2303" Zmax="14.2303" Material="TopMetal2" Layer="134"/>
184
+ <Layer Name="TopVia2" Type="via" Zmin="8.4303" Zmax="11.2303" Material="TopVia2" Layer="133"/>
185
+ <Layer Name="TopVia1" Type="via" Zmin="5.5800" Zmax="6.4303" Material="TopVia1" Layer="125"/>
186
+ <Layer Name="Via4" Type="via" Zmin="4.5500" Zmax="5.0900" Material="Via4" Layer="66"/>
187
+ <Layer Name="Via3" Type="via" Zmin="3.5200" Zmax="4.0600" Material="Via3" Layer="49"/>
188
+ <Layer Name="Via2" Type="via" Zmin="2.4900" Zmax="3.0300" Material="Via2" Layer="29"/>
189
+ <Layer Name="Via1" Type="via" Zmin="1.4600" Zmax="2.0000" Material="Via1" Layer="19"/>
190
+ <Layer Name="Cont" Type="via" Zmin="0.4000" Zmax="1.0400" Material="Cont" Layer="6"/>
191
+ <Layer Name="MIM" Type="conductor" Zmin="5.6043" Zmax="5.7540" Material="MIM" Layer="36"/>
192
+ <Layer Name="Vmim" Type="via" Zmin="5.7540" Zmax="6.4303" Material="Vmim" Layer="129"/>
193
+ </Layers>
194
+ </ELayers>
195
+ </Stackup>
196
+ ```
@@ -0,0 +1,26 @@
1
+ # Utilities for gds2palace
2
+ ########################################################################
3
+ #
4
+ # Copyright 2025 Volker Muehlhaus and IHP PDK Authors
5
+ #
6
+ # Licensed under the GNU General Public License, Version 3.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # https://www.gnu.org/licenses/gpl-3.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ ########################################################################
19
+
20
+ from . import util_stackup_reader as stackup_reader
21
+ from . import util_gds_reader as gds_reader
22
+ from . import util_utilities as utilities
23
+ from . import util_simulation_setup as simulation_setup
24
+
25
+ __version__ = "0.1.3" # version of gds2palace
26
+