Palace driven simulation for spiral inductor with guard ring#132
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a Jupyter notebook demonstrating 3D electromagnetic simulations of a spiral inductor with a guard ring using the Palace backend. The review identifies several technical issues: the port configuration likely lacks the necessary ground reference layer at the terminal coordinates, the guard ring dimensions result in an unintended overlap with the inductor spiral, and the mesh resolution is insufficient for the inductor's feature size, potentially compromising simulation accuracy.
| "sim.add_port(\n", | ||
| " \"P1\", from_layer=\"metal1\", to_layer=\"topmetal2\", geometry=\"via\", excited=True\n", | ||
| ")\n", | ||
| "sim.add_port(\n", | ||
| " \"P2\", from_layer=\"metal1\", to_layer=\"topmetal2\", geometry=\"via\", excited=True\n", | ||
| ")\n", |
There was a problem hiding this comment.
The geometry="via" port configuration requires the from_layer (metal1) to be present directly beneath the to_layer (topmetal2) at the port's (x, y) coordinates to define the terminals. However, the guard ring is constructed as a peripheral frame (margin_inner = -15.0), meaning metal1 is likely missing under the inductor's ports (which are typically located towards the center of the spiral). This will prevent the port terminals from being correctly defined, likely leading to incorrect simulation results (e.g., an open circuit or missing ground reference). Consider using a solid metal1 ground plane or extending the guard ring to cover the port areas.
| "margin_outer = 0.0\n", | ||
| "margin_inner = -15.0\n", |
There was a problem hiding this comment.
Setting margin_inner = -15.0 while margin_outer = 0.0 creates a guard ring that extends 15µm inside the inductor's bounding box. This causes the Metal1 ring to overlap with the TopMetal2 inductor spiral. Typically, a guard ring should be placed outside the component by using a positive margin_outer and a margin_inner that maintains a safe clearance from the inductor's edge.
| ], | ||
| "source": [ | ||
| "# Generate mesh (presets: \"coarse\", \"default\", \"fine\")\n", | ||
| "sim.mesh(preset=\"default\", margin=50, refined_mesh_size=1.5)" |
There was a problem hiding this comment.
The inductor has a width of 2µm and spacing of 2.1µm. A refined_mesh_size of 1.5µm is too coarse for these features (less than 2 elements across the width), which can lead to inaccurate EM results. As noted in the simulation output warning in the notebook, a smaller mesh size is recommended. Aim for at least 4-5 elements across the conductor width to ensure convergence.
| "sim.mesh(preset=\"default\", margin=50, refined_mesh_size=1.5)" | |
| sim.mesh(preset="default", margin=50, refined_mesh_size=0.4) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 46.74% 54.22% +7.47%
==========================================
Files 57 58 +1
Lines 6197 6547 +350
Branches 1079 1184 +105
==========================================
+ Hits 2897 3550 +653
+ Misses 3003 2643 -360
- Partials 297 354 +57 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
joamatab
left a comment
There was a problem hiding this comment.
LGTM - Palace simulation for spiral inductor with guard ring
Overview
This notebook demonstrates a driven EM simulation of a spiral inductor
using
gsim.palacewith the IHP PDK. The inductor includesa Metal1 guard ring. It follows the same conventions as the existing
example notebooks in the repository.
What this adds
Work in progress
This is an initial contribution. Planned next steps:
Notes
Feedback welcome, especially on simulation setup and port configuration.