Metadata-Version: 2.4
Name: gds2palace
Version: 0.11.0
Summary: Create AWS Palace model from RFIC GDSII layout file
Author-email: Volker Muehlhaus <volker@muehlhaus.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2
Project-URL: Repository, https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2
Project-URL: Changelog, https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/CHANGES.md
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gdstk
Requires-Dist: gmsh
Requires-Dist: numpy
Requires-Dist: shapely>=2.0
Dynamic: license-file

# Create AWS Palace FEM Models from GDSII layout files

![Intro](https://raw.githubusercontent.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/main/doc/png/gds2palace_banner.png)

The files provided here enable RFIC FEM simulation using AWS Palace from GDSII layouts created in [IHP SG13G2](https://github.com/IHP-GmbH/IHP-Open-PDK) RFIC technology. 

Palace, is an open-source, parallel finite element code for full-wave 3D electromagnetic simulations. It can be scaled from single computer to large high performance simulation clusters and cloud-based computing.  
https://awslabs.github.io/palace/stable/  

In addition to AWS Palace, gds2palace can also generate models for [Elmer FEM](https://www.elmerfem.org/), as an additional workflow option for EM (S-parameter) simulation as well as steady-state thermal simulation. See [CHANGES.md](https://raw.githubusercontent.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/main/doc/CHANGES.md) for this and other recent additions.

The gds2palace workflow in this repository is pre-configured for GDSII layout files in the [IHP SG13G2 Open PDK.](https://github.com/IHP-GmbH/IHP-Open-PDK)
Special thanks to IHP and the public funded German project FMD-QNC (16ME0831) https://www.elektronikforschung.de/projekte/fmd-qnc for financial support, which has contributed to this work.

## Install

    pip install gds2palace

**Full documentation, installation guide, and usage walkthrough:**
https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2

## Recent changes

## 19 November-2026

gds2palace 0.11.0

**Changed dependency: gdstk instead of gdspy**  
The GDSII reader uses [gdstk](https://github.com/heitzmann/gdstk) instead of gdspy, which is no longer maintained and whose polygon fracturing could hang. `pip install gds2palace` installs gdstk. The results are the same: every layer of the shipped examples reads with the same area as before, and their model files are unchanged. The examples that build layouts with gdspy (`inductor_synthesis_no_external_library`, the pcLab examples) need `pip install gdspy`. The mirror/offset options of `read_gds()` now also move paths; before, only polygons moved.

**Changed behaviour: the cell read without a cell name**  
With `cellname=""` (or a name not in the file), `read_gds()` reads the design cell: the top-level cell with the largest bounding box, never KLayout's `$$$CONTEXT_INFO$$$`. Before, it read the first top-level cell, which depends on the order in the file and was `$$$CONTEXT_INFO$$$` in some KLayout files. gds_prepare_for_EM 1.8, gds2openEMS, setupEM and the MCP server use the same rule (`select_design_cell()`).

**Fix**  
Via array merging (`merge_polygon_size > 0`) no longer cuts strips out of merged vias. A via array around an opening, e.g. a guard ring of contacts, came out cut open: shrinking back after merging opened the slit that encodes the hole, and, for large arrays, the lines along which the merged shape was split into pieces. The same for derived layers with a negative `Oversize`. None of the shipped examples is affected.

## 15 November-2026

gds2palace 0.10.7

**Changed behaviour: the frequencies that replace DC**  
With `fstart = 0`, gds2palace simulates two low frequency points instead of 0 Hz, and `combine_snp` extrapolates the 0 Hz point of the `_dc` file from them. These points were always 10 MHz and 20 MHz. For a mesh finer than 0.5 um (`refined_cellsize` or any `refined_cellsize_override` value) they now move up: the first one is 5 MHz*um divided by the smallest cell size, rounded up to a full MHz, the second one twice that (25 and 50 MHz at 0.2 um, 100 and 200 MHz at 0.05 um). Models with cell sizes of 0.5 um and more keep 10 and 20 MHz. Reason: on such a fine mesh the solver breaks down at low frequency, in all Palace versions tested (0.17 to 0.19): Palace could stop with `SuperLUSolver: Found a singular matrix`, or the solver did not converge. When the point is raised, the console message `Start frequency changed from DC to ... GHz!` gets a second line that says why. A low `fstart` or `fpoint` that you set yourself is not changed. See the FAQ, "Why can't I simulate at 0 Hz, and how is DC handled?".

**Fix**  
The `_dc` Touchstone file written by `combine_snp` (`combine_extend_snp.py` 1.5) keeps all simulated frequency points now and only adds the 0 Hz point in front. Before, a result with the two low frequency points of `fstart = 0` was resampled to a uniform frequency grid: the simulated points, among them the two low ones, were replaced by interpolated values at slightly different frequencies (e.g. 0.4902 GHz steps instead of 0.5 GHz). The 0 Hz value itself is unchanged. For the smooth results checked, the interpolated S-parameters were within 0.004 of the simulated ones. The file is no longer uniformly spaced when the sweep starts at 0 Hz.

## 13 November-2026

gds2palace 0.10.6

**Fix**  
Port walls with a reference plane shift or a port wall extension: R and Q below fstop/20 were wrong. The standards were solved at fstop/20, fstop/5 and fstop only, and below fstop/20 the feed line's loss was extrapolated with sqrt(f), towards zero at DC. A thin line's resistance stays at its DC value there, so too little of it was removed. Example: an rfcmim capacitor with two 35 µm feed lines, series resistance at 0.01 GHz 0.74 Ω instead of 0.25 Ω (PDK model 0.25 Ω). The standards are now also solved at the model's lowest frequency, which gives the line's resistance there, and between the solved frequencies the loss is interpolated linearly in sqrt(f). Results without a shift or extension change very little, capacitance and inductance not at all. Models written by an earlier version keep their own `combine_extend_snp.py` and their results; write the model again to get the fix. `combine_extend_snp.py` is 1.4.

**New example**  
`more_examples/calibrated_boxwall_ports`: step-by-step guide to port walls on an rfcmim capacitor, compared with the PDK model.

Full history: [CHANGES.md](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/CHANGES.md)

---

**Note:** the `gds2palace` PyPI package itself only requires:

- gdstk
- gmsh
- numpy
- shapely>=2.0

(Other Python modules mentioned above are only needed to run the example/model scripts in this repository, not to use the installed package.)
