Layers

Layers in a GDSII or OASIS files are a pair of non-negative integers the specify the purpose of a geometrical shape (or textual object). In short, they are used to specify whether a shape is a waveguide, a metal interconnect, a cut-out region, etc. according to the fabrication processes. Layers are composed to create process masks during fabrication and extrusion masks in PhotonForge, so that we can build 3D devices from the 2D layout and use them in FDTD simulations, for example.

image.png

Layers definitions are provided by each foundry. In PhotonForge, they are available as part of the technology.

As an example, let’s look at the layers specified by the SiEPIC OpenEBL PDK, available through the siepic_forge module:

[1]:
import photonforge as pf
import siepic_forge as siepic

tech = siepic.ebeam()
pf.config.default_technology = tech

tech.layers
[1]:
{'BlackBox': LayerSpec(layer=(998, 0), description="SiEPIC", color="#00408018", pattern="solid"),
 'FDTD': LayerSpec(layer=(733, 0), description="SiEPIC", color="#80005718", pattern="hollow"),
 'FbrTgt': LayerSpec(layer=(81, 0), description="SiEPIC", color="#00408018", pattern="/"),
 'Errors': LayerSpec(layer=(999, 0), description="SiEPIC", color="#00008018", pattern="/"),
 'PinRecM': LayerSpec(layer=(1, 11), description="SiEPIC", color="#00408018", pattern="/"),
 'DevRec': LayerSpec(layer=(68, 0), description="SiEPIC", color="#00408018", pattern="hollow"),
 'Chip design area': LayerSpec(layer=(290, 0), description="Misc", color="#80005718", pattern="hollow"),
 'Dicing': LayerSpec(layer=(210, 0), description="Misc", color="#a0a0c018", pattern="solid"),
 'Deep Trench': LayerSpec(layer=(201, 0), description="Misc", color="#c0c0c018", pattern="solid"),
 'FloorPlan': LayerSpec(layer=(99, 0), description="Misc", color="#8000ff18", pattern="hollow"),
 'PinRec': LayerSpec(layer=(1, 10), description="SiEPIC", color="#00408018", pattern="/"),
 'Waveguide': LayerSpec(layer=(1, 99), description="Waveguides", color="#ff80a818", pattern="\"),
 'SiN': LayerSpec(layer=(1, 5), description="Waveguides", color="#a6cee318", pattern="\\"),
 'M_Open': LayerSpec(layer=(13, 0), description="Metal", color="#00000018", pattern="xx"),
 'Si': LayerSpec(layer=(1, 0), description="Waveguides", color="#ff80a818", pattern="\\"),
 'M2_router': LayerSpec(layer=(12, 0), description="Metal", color="#3471eb18", pattern="xx"),
 'SEM': LayerSpec(layer=(200, 0), description="Misc", color="#ff00ff18", pattern="\"),
 'VC': LayerSpec(layer=(40, 0), description="Metal", color="#3a027f18", pattern="xx"),
 'Keep out': LayerSpec(layer=(202, 0), description="Misc", color="#a0a0c018", pattern="//"),
 'Si slab': LayerSpec(layer=(2, 0), description="Waveguides", color="#80a8ff18", pattern="/"),
 'Si_Litho193nm': LayerSpec(layer=(1, 69), description="Waveguides", color="#cc80a818", pattern="\"),
 'Text': LayerSpec(layer=(10, 0), description="", color="#0000ff18", pattern="\"),
 'Si N': LayerSpec(layer=(20, 0), description="Doping", color="#7000ff18", pattern="\\"),
 'Si N++': LayerSpec(layer=(24, 0), description="Doping", color="#0000ff18", pattern=":"),
 'Oxide open (to BOX)': LayerSpec(layer=(6, 0), description="Waveguides", color="#ffae0018", pattern="\"),
 'M1_heater': LayerSpec(layer=(11, 0), description="Metal", color="#ebc63418", pattern="xx")}

We see the many layers available for use with this PDK. Each layer will have a particular use, such as the “Si” layer, number (1, 0), which is used to specify core device regions.

Other specifications found in each layer are used for information and visualization only. They have no impact in the exported layout.

Using Layers

Whenever a layer is required, we can chose to use the layer number directly or the layer name. As long as the layer name exists within the technology being used, the layer number will be correctly found.

[2]:
component = pf.Component("MAIN")

circle = pf.Circle(1, (0, 0))
rectangle = pf.Rectangle((2, -1), (3, 1))

# Use the layer number directly
component.add((1, 0), circle)

# Use the layer name (the number will be retrieved from the component's technology)
component.add("Si", rectangle)

print(component.structures)
{(1, 0): [Circle(radius=(1, 1), inner_radius=(0, 0), center=(0, 0), sector=(0, 0), rotation=0), Rectangle(center=(2.5, 0), size=(1, 2), rotation=0)]}

Customizing Layers

It is possible to fully modify layer specifications, but changing the name or the number of a layer specified in a PDK might lead to invalid layouts, so do it only when absolutely sure that it is necessary.

Layer descriptions and drawing specifications don’t have the same impact and can be freely customized.

[3]:
component = pf.Component("TEST")
component.add("M1_heater", pf.Rectangle((0, -0.5), (2.5, 0.5)))
[3]:
../_images/guides_Layers_6_0.svg
[4]:
tech.layers["M1_heater"].color = "#C0C0CE60"
component
[4]:
../_images/guides_Layers_7_0.svg

Adding or removing a layer specification is also easy, when necessary:

[5]:
new_layer = pf.LayerSpec((4, 0), "Waveguide clad etch", color=(204, 255, 204, 1), pattern=".")
tech.add_layer("WG_CLAD_ETCH", new_layer)

tech.layers
[5]:
{'WG_CLAD_ETCH': LayerSpec(layer=(4, 0), description="Waveguide clad etch", color="#ccffcc01", pattern="."),
 'BlackBox': LayerSpec(layer=(998, 0), description="SiEPIC", color="#00408018", pattern="solid"),
 'FDTD': LayerSpec(layer=(733, 0), description="SiEPIC", color="#80005718", pattern="hollow"),
 'FbrTgt': LayerSpec(layer=(81, 0), description="SiEPIC", color="#00408018", pattern="/"),
 'Errors': LayerSpec(layer=(999, 0), description="SiEPIC", color="#00008018", pattern="/"),
 'PinRecM': LayerSpec(layer=(1, 11), description="SiEPIC", color="#00408018", pattern="/"),
 'DevRec': LayerSpec(layer=(68, 0), description="SiEPIC", color="#00408018", pattern="hollow"),
 'Chip design area': LayerSpec(layer=(290, 0), description="Misc", color="#80005718", pattern="hollow"),
 'Dicing': LayerSpec(layer=(210, 0), description="Misc", color="#a0a0c018", pattern="solid"),
 'Deep Trench': LayerSpec(layer=(201, 0), description="Misc", color="#c0c0c018", pattern="solid"),
 'FloorPlan': LayerSpec(layer=(99, 0), description="Misc", color="#8000ff18", pattern="hollow"),
 'PinRec': LayerSpec(layer=(1, 10), description="SiEPIC", color="#00408018", pattern="/"),
 'Waveguide': LayerSpec(layer=(1, 99), description="Waveguides", color="#ff80a818", pattern="\"),
 'SiN': LayerSpec(layer=(1, 5), description="Waveguides", color="#a6cee318", pattern="\\"),
 'M_Open': LayerSpec(layer=(13, 0), description="Metal", color="#00000018", pattern="xx"),
 'Si': LayerSpec(layer=(1, 0), description="Waveguides", color="#ff80a818", pattern="\\"),
 'M2_router': LayerSpec(layer=(12, 0), description="Metal", color="#3471eb18", pattern="xx"),
 'SEM': LayerSpec(layer=(200, 0), description="Misc", color="#ff00ff18", pattern="\"),
 'VC': LayerSpec(layer=(40, 0), description="Metal", color="#3a027f18", pattern="xx"),
 'Keep out': LayerSpec(layer=(202, 0), description="Misc", color="#a0a0c018", pattern="//"),
 'Si slab': LayerSpec(layer=(2, 0), description="Waveguides", color="#80a8ff18", pattern="/"),
 'Si_Litho193nm': LayerSpec(layer=(1, 69), description="Waveguides", color="#cc80a818", pattern="\"),
 'Text': LayerSpec(layer=(10, 0), description="", color="#0000ff18", pattern="\"),
 'Si N': LayerSpec(layer=(20, 0), description="Doping", color="#7000ff18", pattern="\\"),
 'Si N++': LayerSpec(layer=(24, 0), description="Doping", color="#0000ff18", pattern=":"),
 'Oxide open (to BOX)': LayerSpec(layer=(6, 0), description="Waveguides", color="#ffae0018", pattern="\"),
 'M1_heater': LayerSpec(layer=(11, 0), description="Metal", color="#c0c0ce60", pattern="xx")}
[6]:
component.add("WG_CLAD_ETCH", pf.Rectangle((0, 0), (1, 1)))
component.structures
[6]:
{(4, 0): [Rectangle(center=(0.5, 0.5), size=(1, 1), rotation=0)],
 (11, 0): [Rectangle(center=(1.25, 0), size=(2.5, 1), rotation=0)]}
[7]:
tech.remove_layer("WG_CLAD_ETCH")
tech.layers
[7]:
{'BlackBox': LayerSpec(layer=(998, 0), description="SiEPIC", color="#00408018", pattern="solid"),
 'FDTD': LayerSpec(layer=(733, 0), description="SiEPIC", color="#80005718", pattern="hollow"),
 'FbrTgt': LayerSpec(layer=(81, 0), description="SiEPIC", color="#00408018", pattern="/"),
 'Errors': LayerSpec(layer=(999, 0), description="SiEPIC", color="#00008018", pattern="/"),
 'PinRecM': LayerSpec(layer=(1, 11), description="SiEPIC", color="#00408018", pattern="/"),
 'DevRec': LayerSpec(layer=(68, 0), description="SiEPIC", color="#00408018", pattern="hollow"),
 'Chip design area': LayerSpec(layer=(290, 0), description="Misc", color="#80005718", pattern="hollow"),
 'Dicing': LayerSpec(layer=(210, 0), description="Misc", color="#a0a0c018", pattern="solid"),
 'Deep Trench': LayerSpec(layer=(201, 0), description="Misc", color="#c0c0c018", pattern="solid"),
 'FloorPlan': LayerSpec(layer=(99, 0), description="Misc", color="#8000ff18", pattern="hollow"),
 'PinRec': LayerSpec(layer=(1, 10), description="SiEPIC", color="#00408018", pattern="/"),
 'Waveguide': LayerSpec(layer=(1, 99), description="Waveguides", color="#ff80a818", pattern="\"),
 'SiN': LayerSpec(layer=(1, 5), description="Waveguides", color="#a6cee318", pattern="\\"),
 'M_Open': LayerSpec(layer=(13, 0), description="Metal", color="#00000018", pattern="xx"),
 'Si': LayerSpec(layer=(1, 0), description="Waveguides", color="#ff80a818", pattern="\\"),
 'M2_router': LayerSpec(layer=(12, 0), description="Metal", color="#3471eb18", pattern="xx"),
 'SEM': LayerSpec(layer=(200, 0), description="Misc", color="#ff00ff18", pattern="\"),
 'VC': LayerSpec(layer=(40, 0), description="Metal", color="#3a027f18", pattern="xx"),
 'Keep out': LayerSpec(layer=(202, 0), description="Misc", color="#a0a0c018", pattern="//"),
 'Si slab': LayerSpec(layer=(2, 0), description="Waveguides", color="#80a8ff18", pattern="/"),
 'Si_Litho193nm': LayerSpec(layer=(1, 69), description="Waveguides", color="#cc80a818", pattern="\"),
 'Text': LayerSpec(layer=(10, 0), description="", color="#0000ff18", pattern="\"),
 'Si N': LayerSpec(layer=(20, 0), description="Doping", color="#7000ff18", pattern="\\"),
 'Si N++': LayerSpec(layer=(24, 0), description="Doping", color="#0000ff18", pattern=":"),
 'Oxide open (to BOX)': LayerSpec(layer=(6, 0), description="Waveguides", color="#ffae0018", pattern="\"),
 'M1_heater': LayerSpec(layer=(11, 0), description="Metal", color="#c0c0ce60", pattern="xx")}