Cross-sections
A cross-section cuts a GDS layout along a straight line and runs the process its layer stack implies: the etches that leave the rib and slab, the implants, the contacts etched through the oxide and filled, the metals and the passivation. The walls slope as the stack says. One cut gives each look of the same regions.
The device
Section titled “The device”The PN rib phase shifter of the GDSFactory generic PDK, straight_pn with its default via_stack_slab_m3,
as GDS records, on the bundled gdsfactory_generic stack. The contacts climb through M1 and M2 to M3,
the pad metal. The oxide is one body over M3, and PADOPEN (46/0) etches it down to the pads. The stack has
no NP and PP, so the cell leaves them out. For a file, pass its path: cross_section("chip.gds", ...).
Schematic
Section titled “Schematic”# The PN rib phase shifter of the gdsfactory generic PDK, cut across its ribfrom pathlib import Path
from optodraw.gds import GDSLayerRecord, GDSLayout, cross_section
def rect(x0, y0, x1, y1): return [(x0, y0), (x1, y0), (x1, y1), (x0, y1)]
def layer(spec, *shapes): return GDSLayerRecord(spec=spec, name="", description="", color="#000000", opacity=1.0, thickness=0.0, zmin=0.0, material_preset="", polygons=list(shapes), matched_pdk=False)
# straight_pn(length=20) with its default via_stack_slab_m3: a 500 nm rib on a 90 nm# slab, P and N either side, P++ and N++ from 1 um out, contacts up through M1 and M2# to M3, the pad metal; the oxide opens on PADOPEN, 1.5 um inside each pad, down to M3pads = [rect(0, 1, 20, 11), rect(0, -11, 20, -1)]openings = [rect(1.5, 2.5, 18.5, 9.5), rect(1.5, -9.5, 18.5, -2.5)]contacts = [rect(x - 0.35, y - 0.35, x + 0.35, y + 0.35) for x in range(2, 20, 2) for y in (-9, -7, -5, -3, 3, 5, 7, 9)]records = [ layer((1, 0), rect(0, -0.25, 20, 0.25)), # WG layer((3, 0), rect(0, -3.5, 20, 3.5), *pads), # SLAB90 layer((20, 0), rect(0, -8, 20, 0)), # N layer((21, 0), rect(0, 0, 20, 8)), # P layer((24, 0), rect(0, -8, 20, -1)), # N++ layer((25, 0), rect(0, 1, 20, 8)), # P++ layer((40, 0), *contacts), # VIAC layer((41, 0), *pads), # M1 layer((44, 0), *contacts), # VIA1 layer((45, 0), *pads), # M2 layer((43, 0), *contacts), # VIA2 layer((49, 0), *pads), # M3, the bond pads layer((46, 0), *openings), # PADOPEN: the etch down to the pads]layout = GDSLayout(source_path=Path("straight_pn.gds"), cell_name="straight_pn", bounds=(0, -11, 20, 11), layer_records=records)# the cut: across the rib at x = 2 um, through a row of contactsxs = cross_section(layout, "gdsfactory_generic", ((2, 12), (2, -12)))assert xs.check() == [], xs.check()xs.svg()Labels, dimensions and a scale bar. Heights are stretched only when the thinnest layer would be under 2 pt
tall; the figure then prints z × N and adds a height scale bar. xs.steps_svg() draws the process, one
panel per step.
SEM-like image
Section titled “SEM-like image”# The same cut as an SEM-like image, marked as a renderxs.png(width_px=1400)
A grey per material, edge rims, blur and noise. The image and its metadata say it is a render;
mark=False removes the marks.
Cut 3D slab
Section titled “Cut 3D slab”# The same cut as a 3D slab, 16 µm deep: drag to turn itslab = xs.slab(depth=16) # the scene that holds the slabslab.render_threejs(show_labels=False, camera_direction=(0.55, -1.0, 1.1))A block of the layout behind the cut. Its face is the cross-section above. Behind it the process runs again wherever the layout changes, so a contact shows only where it is drawn. Toward the back the oxide is cut away in steps, with the wiring above each step: first M1 on its oxide, then the bare rib and its implants.
xs.slab("pn_slab.glb") # for Blender or any glTF viewerxs.slab("pn_slab.png") # the viewer's image, headless: needs Chrome, Chromium or Edgexs.slab("pn_slab.html") # the interactive view as one pageTop view
Section titled “Top view”# The left end of the device from above, tilted 40 degrees, as a finished chipfrom optodraw.gds import top_view
chip = top_view(layout, "gdsfactory_generic", (-3, -5, 7, 5), stage="chip")assert chip.check() == [], chip.check()chip.png(tilt=40.0, width_px=1000)
The same process runs on a cut along each pixel row and column. stage="chip" is the finished chip: a
device under the oxide shows faintly (see_through, in µm), and metal hides what lies under it.
stage="device" stops before the first oxide. tilt and rotation set the view in degrees. Turned to the
layout’s edges, every cut is new: a minute at 1000 px.
In the editor
Section titled “In the editor”Select a GDS part. In the cross-section panel, cut along the Layout view’s ruler (M, two clicks, Cut along ruler) or scan a vertical cut, then pick a look. The cut uses the part’s own stack.
Check it
Section titled “Check it”xs.check() names a drawn layer the stack does not know, an implant on etched silicon and a contact that
lands on nothing. The first cell asserts it is empty.
References
Section titled “References”- GDSFactory generic PDK:
straight_pn,via_stack_slab_m3and its layer stack. gdsfactory.github.io