Create shapes and boundaries
First, a PCell can be simple (only contains one element e.g., Straight waveguide) to complicate(contains several elements and layers e.g., Mach-Zehnder modulator (MZM)). Defining the shape and boundary of each layers in the PCell is the prior thing to do when writing scripts to generate a PCell.
There are several methods to define the shape or geometry in a PCell.
Create with polygons from element
This method uses simple polygons in
fp.elfunction such asfp.el.Line,fp.el.Circle,fp.el.Polygonto define the shape and a given layer which belongs to the specific PDK. Users can find somefp.el.examples in the below section .The elements generated by
fp.elfunction should be added to the element container, mostly referred toelems.Create with existing lower-level PCells
However, sometimes we wish to create a higher-level PCell which is based on some lower-level PCells. For example, in a
MZMcell, aSplitter, aCombinerand aPhaseShifterwill be routed. This time we can call the existing PCells as a instance and add to the instance container.The existing PCells called by the higher-level PCell should be added to the instance container, mostly referred to
insts.Create curves from geometry for waveguides and metal lines
To generate some basic components such as straight waveguide, bends,
raw_curvemethod is necessary for *PhotoCAD to trace the length and the angle of the port of the curve(straight or bend). Geometries fromfp.g.are used to return the curves in theraw_curvemethod. After that, in thebuildmethod, users can set the curve of the waveguide to theraw_curve, which will create the waveguide that follows the curve. For more implementation offp.g.geometries, please seeBend_Bezier,Bend_Circular,Straight,pn_phase_shifter, andRing_Filter.