Skip to content

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

png

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()  # auto-detects active PDK
sim.set_stack(stack)

# Surround the design with air. Without this the absorbing boundary sits
# directly on the passivation, microns above the trace, and adds large
# spurious loss and reflection.
sim.set_airbox(margin_x=50, margin_y=50, z_above=100, z_below=100)

# 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
# Generate mesh (presets: "coarse", "default", "fine")
sim.mesh(preset="default")
Mesh Summary
========================================
Dimensions: 1240.0 x 254.0 x 217.9 µm
Nodes:      9,729
Elements:   76,323
Tetrahedra: 56,061
Edge length: 0.42 - 162.07 µm
Quality:    0.518 (min: 0.001)
SICN:       0.552 (all valid)
----------------------------------------
Volumes (3):
  - sio2 [1]
  - sin [2]
  - air [3]
Surfaces (10):
  - metal1_xy [4]
  - metal1_z [5]
  - topmetal2_xy [6]
  - topmetal2_z [7]
  - P1 [8]
  - P2 [9]
  - air__sio2 [10]
  - sin__sio2 [11]
  - air__sin [12]
  - air__None [13]
----------------------------------------
Mesh:   palace-sim-microstrip/palace.msh
# Static PNG
sim.plot_mesh(show_groups=["metal", "P"])
pyvirtualdisplay not available; continuing without Xvfb





2026-08-20 04:53:46.098 (   5.244s) [    7FADCAE27080]vtkXOpenGLRenderWindow.:1460  WARN| bad X server connection. DISPLAY=

png

Run simulation on GDSFactory+ Cloud

# Run simulation on GDSFactory+ cloud
results = sim.run(check_cache=True)
  palace-4ca2576c  completed  0m 00s


Extracting results.tar.gz...
Downloaded 12 files to sim-data-palace-4ca2576c
results.plot_interactive()
Port mapping: Port 1: e1, Port 2: e2
results.plot_interactive(phase=True)
Port mapping: Port 1: e1, Port 2: e2