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+ 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.common.stack import get_stack
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
stack = get_stack(air_above=300.0) # auto-detects active PDK
sim.set_stack(stack)
# 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())
Validation: PASSED
/tmp/ipykernel_5740/940379228.py:14: UserWarning: get_stack(air_above/air_below) is deprecated and ignored. Use simulation.set_airbox(margin_x=..., margin_y=..., z_above=..., z_below=...).
stack = get_stack(air_above=300.0) # auto-detects active PDK
Mesh Summary
========================================
Dimensions: 1040.0 x 54.0 x 17.9 µm
Nodes: 5,784
Elements: 40,950
Tetrahedra: 25,986
Edge length: 0.42 - 23.84 µm
Quality: 0.450 (min: 0.001)
SICN: 0.491 (all valid)
----------------------------------------
Volumes (2):
- sio2 [1]
- sin [2]
Surfaces (9):
- metal1_xy [3]
- metal1_z [4]
- topmetal2_xy [5]
- topmetal2_z [6]
- P1 [7]
- P2 [8]
- sio2__None [9]
- sin__sio2 [10]
- sin__None [11]
----------------------------------------
Mesh: palace-sim-microstrip/palace.msh

Run simulation on GDSFactory+ Cloud¶
palace-577c4ddf completed 1m 13s
Extracting results.tar.gz...
Downloaded 10 files to /home/runner/work/simulation-templates/simulation-templates/docs/notebooks/sim-data-palace-577c4ddf
Port mapping: Port 1: e1, Port 2: e2
Port mapping: Port 1: e1, Port 2: e2