Skip to main content

KLayout Notes

Layer numbers: layer/datatype​

A layer shown as poly.drawing - 66/20 has two parts:

  • poly.drawing: a human-readable name.
  • 66/20: the GDS layer number (66) and the datatype (20).

GDS files don't store layer names, only these integer pairs. Every shape in a GDS file carries a layer number and a datatype, and the PDK defines what each pair means.

  • Layer number: which mask layer the shape belongs to (66 = poly, 67 = li1, 68 = met1, …).
  • Datatype: what kind of shape it is on that layer. This is the part after the dot in the name.

Datatypes (purposes)​

The same physical layer carries several kinds of shapes. For met1 (layer 68):

NamePairMeaning
met1.drawing68/20The metal geometry that is actually manufactured
met1.pin68/16Marks pin locations, for LVS and routing
met1.label68/5Text labels naming nets
met1.net68/23Net-highlighting shapes
met1.res68/13Marks a metal resistor
met1.blockage68/10"Don't route here" areas for place-and-route
met1.boundary68/4Cell boundary on this layer

So met1.drawing and met1.pin are both metal 1. The first becomes metal on the chip; the second is bookkeeping for the design tools.

Where the names come from​

The names come from a layer properties file (.lyp), an XML file that maps each pair to a name, color, and fill pattern:

<properties>
<fill-color>#ff0000</fill-color>
<name>poly.drawing - 66/20</name>
<source>66/20@1</source>
</properties>

<source> is the pair to match (@1 means the first loaded layout) and <name> is the label shown in the layer panel. Without a .lyp, KLayout shows only the raw pairs (66/20).

For sky130 the file ships with the PDK at $PDK_ROOT/sky130A/libs.tech/klayout/tech/sky130A.lyp; this site uses a copy in gds/. To rename layers or change colors, edit the XML or adjust the layer panel in KLayout and use File → Save Layer Properties.

sky130 drawing layers​

From sky130A.lyp, bottom of the stack to top:

LayerPairWhat it is
nwell64/20N-well (body of PMOS devices)
diff65/20Active area: transistor source/drain
tap65/44Active area for well/substrate ties
nsdm93/44N+ source/drain implant
psdm94/20P+ source/drain implant
poly66/20Polysilicon (gates)
npc95/20Nitride poly cut (under poly contacts)
licon166/44Contact: diff/tap/poly to li1
li167/20Local interconnect
mcon67/44Contact: li1 to met1
met168/20Metal 1
via68/44Via: met1 to met2
met269/20Metal 2
via269/44Via: met2 to met3
met370/20Metal 3
capm89/44MiM capacitor plate (over met3)
via370/44Via: met3 to met4
met471/20Metal 4
via471/44Via: met4 to met5
met572/20Metal 5
pad76/20Passivation opening over bond pads

sky130 conventions worth knowing​

  • Contacts and vias share the number of the layer they sit on, with datatype 44: licon1 is 66/44 (poly is 66/20), mcon is 67/44 (li1 is 67/20), via is 68/44 (met1 is 68/20). The datatype is what tells them apart.
  • "drawing" isn't always datatype 20. Contacts, vias, tap (65/44), and nsdm (93/44) use 44 for their drawn shapes.
  • Don't confuse layer numbers across PDKs. 66/20 is poly in sky130 but can mean something else entirely in another process; always go through the PDK's .lyp or layer map.