Metadata-Version: 2.4
Name: gds2palace
Version: 0.13.1
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

## Highlights

The main new features of the last months, with the version that brought them:

- **Ready-made Palace 0.20.0 container image**, the default of the install scripts (26 November)
- **Overlapping materials with Priority**, e.g. mold compound drawn over a die (0.13.0)
- **Thermal conductivity lateral and vertical**, and **limits for stackup variables** (0.13.0)
- **Datatype per stackup layer**, for technologies with a metal and a keepout on one GDS layer number (0.13.0)
- **Thermal simulation: heat flux, temperature gradient and heat flow per boundary** (0.13.0)
- **Tube ports**, for ports that stand for a conductor such as a copper pillar between two chips (0.12.0)
- **Port walls**: calibrated de-embedding of ports at the layout edge (0.10.0)
- **Multielement ports**: several shapes as one port, e.g. the fingers of a transistor (0.9.3)
- **`settings['conductor_model']`**: one setting for the conductor model, for accurate conductor loss (0.9.0)

Each dated section below lists the new features first, then changed behaviour, then fixes.

## 30 November-2026

gds2palace 0.13.1, released on 30 November.

### New

**The agent guide ships with the package**  
`AGENTS.md`, the guide for AI coding agents that write model scripts, is now part of the pip package, so it matches the installed version and can be read offline. `utilities.get_agents_guide_path()` returns its path. The gds2palace MCP server reads it from there.

## 22 to 29 November-2026

gds2palace 0.12.1 and 0.13.0, released together on 29 November.

### New

**Ready-made container image for Palace 0.20.0**  
`apptainer pull palace_0200.sif oras://ghcr.io/volkermuehlhaus/palace_0200:latest` downloads Palace 0.20.0, for all Intel processors since 2013 and all AMD processors since 2017. The install scripts for Linux and Windows (WSL) now install this image. The Palace 0.18.1 image is still available (`--palace-version 0181`). See `doc/building-palace-apptainer.md`.

**Overlapping materials with Priority**  
Dielectric blocks in the stackup may now overlap, e.g. mold compound drawn over a die. `Priority` sets which material is used where they overlap: the higher number wins. Existing stackups give the same models as before. See "Priority: overlapping volumes" in `doc/XML_stackup_format/XML_stackup_format.md`, with examples.

**Thermal simulation: different thermal conductivity lateral and vertical**  
A material can have one thermal conductivity in the lateral directions (x, y) and another one vertically (z), e.g. a laminate. See "Direction-dependent thermal conductivity" in `doc/XML_stackup_format/XML_stackup_format.md`.

**Datatype per stackup layer**  
A `<Layer>` in the stackup can name the GDS datatype it is read from, e.g. `Layer="68" Datatype="20"`. A metal and a keepout can then share one GDS layer number, and a script with `purposelist=[0]` still reads the right shapes. Layers without a `Datatype` are read as before. See "Datatype" in `doc/XML_stackup_format/XML_stackup_format.md`.

**Limits for stackup variables**  
A stackup variable such as the chip thickness can have a minimum and maximum, or a list of allowed values. A value outside them stops the model setup with a clear message. See "Allowed values" in `doc/XML_stackup_format/XML_stackup_format.md`.

Stackup files that use these new features are marked `schemaVersion="3.2"`. Older gds2palace versions print a warning and ignore the new features.

**Thermal simulation: heat flux and temperature gradient**  
`settings['heat_flux_output'] = True` also writes the heat flux (W/m²) and the temperature gradient (K/m) to the result file, e.g. to show the heat flow as arrows. The result file gets about 50 % larger.

**Thermal simulation: heat flow per constant-temperature boundary**  
Every thermal model now writes `thermal_heatflow.dat`: the heat flow through each constant-temperature boundary, in W. It shows where the heat goes when a model has several heat sinks. The heat flows always add up to the input power, so they don't tell whether the mesh is fine enough. `python -m gds2palace.scripts.thermal_summary <path>` prints the min/max temperature and the heat flow per boundary.

### Changed behaviour

- Thermal models: two heat sources or constant-temperature boundaries on the same GDS layer now stop the model setup with a message. Before, only the first one was built and the other was left out without notice. Each heat source and each boundary needs its own GDS layer.
- A misspelled attribute in a stackup file, e.g. `DataType="20"` instead of `Datatype="20"`, now gives a warning that names the attribute and the closest known one. Before, it was ignored without a message, and the layer was read from the wrong datatype.
- The SG13G2 stackups `SG13G2_FEM_200um.xml` and `SG13G2_FEM_200um_passi3D.xml` have a minimum of 25 µm for `total_thickness`. A smaller value stops the model setup with a message. The models are the same as before.
- The Palace log is shorter: `config.json` now has `"Verbose": 2` instead of 3. With Palace 0.20, level 3 printed a long report of the direct solver for every solve. The log still shows the progress, the iterations of every solve and all warnings. For the old output, set `"Verbose": 3` in `config.json`.
- A mesh with zero-volume elements now stops the model build for Palace models too, with the location of these elements, and no mesh file is written. Before, this was only a warning for Palace models, and Palace then failed with a message that did not point to the mesh ("STRUMPACK factorization failed" or "requires a finite, nonzero real operator diagonal"). The message now also names layers with a larger mesh size from `refined_cellsize_override`. Typical cause: a mesh size of several µm at shapes with much smaller steps or gaps. Use a finer mesh there.
- `read_gds()` prints a note when the layout has shapes on the layer number of a stackup layer that are not read, e.g. fill shapes on another datatype. `purposelist` can be left out for datatype 0.
- Thermal simulation: two metal or via bodies may now touch, e.g. a contact passing through resistor poly; heat flows across the shared face. A resistor's unheated poly heads can be drawn on `HEAT_RESISTOR` (see "Heat source targets" in `XML_stackup/latest/IHP/README.md`). EM models still stop with "touches another conductor layer".
- When gmsh has to use its second 3D meshing method (HXT), the message now says that this can take several minutes for models with thin layers of large area. It is not a hang.
- Thermal models solve more reliably: the default solver setting was changed, and models that stopped because the solver did not converge now run. If one still fails, set `settings['iterative'] = False` (0.12.1).
- Elmer EM: `settings['order'] = 3` runs as order 2, with a warning; before, it ran as order 1 without a message. The new `doc/EM_model_limitations_Elmer.md` lists the differences between Elmer and Palace models (0.12.1).
- Stackup reader, stricter checks: a layer with equal `Zmin` and `Zmax` is a sheet, also when the numbers are written differently (`"0.4"` and `"0.40"`); a negative `<Substrate Offset>` shifts the layers down instead of being ignored; two layers with the same name, or two table points at the same temperature, stop with an error (0.12.1).

### Fixes

- Where shapes are merged when the layout is read (via arrays with `merge_polygon_size`, derived layers), a hole of the merged shape could come out filled: the geometry library (gdstk 1.0.2) returned it as a separate polygon in some unions of many shapes, and that polygon became metal. Found on a Metal1 plane with a cut-out around transistors. The same fix is in gds2openEMS and gds_prepare_for_EM 1.9.1.
- Thermal models with the iterative solver (the default): the solver now stops at a tolerance of 1e-10 instead of 1e-7. With 1e-7, the heat flow through the constant-temperature boundaries could add up to a few percent less than the input power (0.4 % on an interposer model), and the temperatures were slightly low. The run time is the same.
- Thermal simulation: a constant-temperature boundary drawn as several polygons used only the last polygon.
- Thermal simulation with MPI (`ELMER_MPI_THREADS` above 1): there was one result file per process and no `thermal_results.dat`. There is one file again.
- Creating an Elmer model crashed when `ElmerGrid` was not found. Now the model files are written, and a note gives the command for the mesh conversion (0.12.1).
- Thermal example: `BACKSIDEGND` in `SG13_interposer_thermal_typicalvalues.xml` had its Zmax below its Zmin. The temperatures don't change (0.12.1).

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.)
