FOSSlab

Chapter 6 of 14 · about 90 min

Layout with IHP PCells

The layout is what the factory builds. We draw it in KLayout with IHP’s parameterised cells (PCells): give a transistor its W, L and number of fingers and the PCell draws every layer correctly. We then connect the transistors with metal.

1. Open the layout editor

Select the cell opamp and press Layout (or FOSSLab > Open layout of this cell from the schematic). The first time FOSSLab asks to create the view: an empty opamp.gds with the top cell opamp. KLayout opens in editing mode with the SG13G2 technology: layers, grid, IHP’s menu SG13G2 PDK and FOSSLab’s menu.

2. Place the devices

  1. Instance (i), library SG13_dev, cell nmos or pmos. In the PCell parameters set w (total width), l and ng exactly as in the schematic: LVS compares them.
  2. The Miller capacitor: cell cmim, Calculate = C, w = l = 24u.
  3. Substrate and well contacts: ptap1 strips near the NMOS (to VSS), ntap1 strips inside the N-well of the PMOS (to VDD). Rule LU.a/LU.b: no transistor may be more than 20 µm from a tap.

3. Connect

The PCells give the source/drain fingers in Metal1 but no gate contact: draw a GatPoly strap over the gate ends with contacts (Cont) and Metal1. Then route with Metal2 and Metal3, with vias (Via1, Via2). Finally put the pins: a Metal3 shape on the pin layer (Metal3.pin) and a text label with the net name (Metal3.text) for INP, INN, OUT, IBIAS, VDD and VSS. LVS uses the labels to match nets by name.

Op-amp layout in KLayout
The reference layout: one transistor per row (bias and sinks at the bottom, the input pair, the PMOS mirror and M6 on top), each with its source bar (Metal1), gate strap (poly) and drain bar (Metal2) running right to a channel of vertical Metal3 tracks, one per net. The MIM capacitor is on the right.
This placement is chosen to be easy to read and to check, not to be the best possible op-amp. Improving it is a good exercise: interdigitate M1/M2 and M3/M4 (or a common-centroid arrangement), add dummies, surround the input pair with a guard ring (guard_ring). Run DRC, LVS and post-layout simulation after each change and compare the offset in Monte Carlo.

The reference layout is generated by a script

The layout of the reference library was drawn by a Python script that uses the same PCells (app/fosslab/examples/opamp_layout.py in the FOSSLab folder). It is a good way to read how the layout is built: every rectangle has a comment. It reads the device sizes from examples/opamp.py (the MOS table and CC_SIDE), so after changing a size there, regenerate it with

$ fosslab example opamp --lib opamp_try

which writes the whole reference library (schematic, symbol, testbenches with their setups, model and layout) as a new library opamp_try of your workspace.