Running Palace Simulations: Microstrip¶
Palace is an open-source 3D electromagnetic simulator supporting eigenmode, driven (S-parameter), and electrostatic simulations. This notebook demonstrates using the gsim.palace API to run a driven simulation on a microstrip transmission line with via ports.
Requirements:
- IHP PDK:
uv pip install ihp-gdsfactory - GDSFactory Simulation SDK:
uv pip install gsim - GDSFactory+ account for cloud simulation
Load a pcell from IHP PDK¶
import gdsfactory as gf
from ihp import LAYER, PDK, cells
PDK.activate()
c = gf.Component()
r1 = c << cells.straight_metal(length=1000, width=14)
r = c.get_region(layer=LAYER.TopMetal2drawing)
r_sized = r.sized(+20000)
c.add_polygon(r_sized, layer=LAYER.Metal1drawing)
c.add_ports(r1.ports)
cc = c.copy()
cc.draw_ports()
cc

Configure and run simulation with DrivenSim¶
from gsim.palace import DrivenSim
# Create simulation object
sim = DrivenSim()
# Set output directory
sim.set_output_dir("./palace-sim-microstrip")
# Set the component geometry
sim.set_geometry(c)
# Configure layer stack from active PDK
sim.set_stack(substrate_thickness=2.0)
# Surround the stack with air to keep the absorbing side boundaries
# away from the trace and ground plane.
sim.set_airbox(margin_x=50.0, margin_y=50.0, z_above=300.0)
# Configure via ports (Metal1 ground plane to TopMetal2 signal)
for port in c.ports:
sim.add_port(port.name, from_layer="metal1", to_layer="topmetal2", geometry="via")
# Configure driven simulation (frequency sweep for S-parameters)
sim.set_driven(fmin=1e9, fmax=100e9, num_points=300)
# Validate configuration
print(sim.validate_config())
pyvirtualdisplay not available; continuing without Xvfb
Validation: PASSED
Mesh Summary
========================================
Dimensions: 1140.0 x 154.0 x 317.9 µm
Nodes: 9,221
Elements: 70,749
Tetrahedra: 49,229
Edge length: 0.42 - 285.00 µm
Quality: 0.502 (min: 0.002)
SICN: 0.536 (all valid)
Worst element distortion, κ: 315.774 (tet centers; 1 is ideal)
Estimated Field DOFs: 319,962 (order 2; before Palace preprocessing)
Mesh hash: sha256:0269758daf3d4169 (gmsh 4.15.2, gsim 0.7.0)
Mesher: 2D algorithm 5, 3D algorithm 1, threads 1 (1D/2D/3D limits 1/1/1)
----------------------------------------
Volumes (3):
- sio2 [1]
- sin [2]
- air [3]
Surfaces (11):
- metal1_xy [4]
- metal1_z [5]
- topmetal2_xy [6]
- topmetal2_z [7]
- P1 [8]
- P2 [9]
- air__sio2 [10]
- sio2__None [11]
- sin__sio2 [12]
- air__sin [13]
- air__None [14]
----------------------------------------
Mesh: palace-sim-microstrip/palace.msh
pyvirtualdisplay not available; continuing without Xvfb
[0m[33m2026-10-23 11:19:44.913 ( 5.100s) [ 7FB95A161B80]vtkXOpenGLRenderWindow.:1460 WARN| bad X server connection. DISPLAY=[0m

Run simulation on GDSFactory+ Cloud¶
palace-e7930970 [####################] 100% complete elapsed 2m 10s
Extracting results.tar.gz...
Downloaded 13 files to /home/runner/work/IHP/IHP/docs/sim-data-palace-e7930970
SParams(2 ports [e1, e2], 300 freq points, 4 S-parameters)
