Package: zeropdk
ZeroPDKThis is a pure-python PDK factory that enables klayout scripted layout. It assists in photonic integrated circuit layout, which relies on having specialized curved waveguides and non-square-corner shapes.InstallationThis package is heavily based on python'sklayout package, still in beta version as of this writing (Jul 2019).Installation with pip (virtual environment is highly recommended):pipinstallzeropdkInstallation from source:pythonsetup.pyinstallFeaturesKLayout extensionBy importing zeropdk, klayout is patched with a few useful functionalities. For example:importklayout.dbaskdbimportzeropdklayout=kdb.Layout()plogo=layout.read_cell(cell_name='princeton_logo',filepath='gdslibrary/princeton_logo_simple.gds')# plogo is a cell in the current layout. It can be inserted in the top cell.Easy technology layers definitionBased on a KLayout's layout properties file (.lyp) containing layer definitions, it is easy to import and use all layers. For example:fromzeropdkimportTechlyp_path="examples/EBeam.lyp"EBeam=Tech.load_from_xml(lyp_path)layerM1=EBeam.layers["M1"]print(layerM1,type(layerM1))# M1 (41/0) <class 'klayout.dbcore.LayerInfo'>The file above belongs to a project calledSiEPIC EBeam PDK, used in passive silicon photonic foundries.Advanced PCell definitionPCells can be hierarchical, as described inSec. IV.C of this article. One PCell can use another PCell in its definition, and the parent pcell should, in this case, inherit the child's parameters. an example taken fromzeropdk.default_library.iois:classDCPadArray(DCPad):params=ParamContainer(pad_array_count,pad_array_pitch)defdraw(self,cell):# ...foriinrange(cp.pad_array_count):dcpad=DCPad(name=f"pad_{i}",params=cp)returncell,portsIn this case,DCPadArraysimply places an array ofDCPadPcells, and contains parameterspad_array_countand alsopad_array_pitch, but also the parameters belonging toDCPad, such aslayer_metalandlayer_opening.In the EBeam PDK example, one can edit adapt a standard library of pcells to its own parameter sets. For example, EBeam PDK uses particular layers for its metal deposition and oxide etch steps. So the DCPadArray can be changed via the following:classDCPadArray(DCPadArray):params=ParamContainer(PCellParameter(name="layer_metal",type=TypeLayer,description="Metal Layer",default=EBeam.layers["M1"],),PCellParameter(name="layer_opening",type=TypeLayer,description="Open Layer",default=EBeam.layers["13_MLopen"],),)TODO: adapt example providedhereto zeropdk.Photonics-inspired layout functionsSeveral assistive tools for handling photonic shapes. For example, it is desired, sometimes, to draw a waveguide with progressive widths (a taper).fromzeropdk.layoutimportlayout_waveguidewav_polygon=layout_waveguide(cell,layer,points_list,width)Developer notesThis project is still under development phase. See thedevelopment notesfor more information.AcknowledgementsThis  material  is  based  in part upon  work  supported  by  the  National Science Foundation under Grant Number E2CDA-1740262. Any  opinions,  findings,  and  conclusions  or  recommendations expressed  in  this  material  are  those  of  the  author(s)  and  do  not necessarily reflect the views of the National Science Foundation.