Lab 8
Layout and Verification
Generate the layout of the course OTA, check it with DRC and LVS, find errors from the reports, extract it and compare the post-layout simulation with the schematic.
Contents
| Lab 8 at a glance | |
|---|---|
| Goal | Generate the layout of the course OTA, check it with DRC and LVS, find errors from the reports, extract it and compare the post-layout simulation with the schematic. |
| Reproduces | Chapter 15 (Figure 15.4, Table 15.4) and Chapter 16 (Tables 16.1 and 16.2, Figure 16.2) |
| Time | 3–4 hours |
| Files | labs/lab8: ota2s.gds, ota2s_lvs.spice, ota2s_pex.spice, ota2s.sch and ota2s.sym, ota2s_pex.sym, postlayout_tb.sch per PDK; tools/layout |
Hand calculation
Size the two passives of the OTA from the PDK values of Chapter 15. The Miller capacitor is 1 pF: how large is a square MIM capacitor at 1.5 fF/µm² (SG13G2) or 2.0 fF/µm² (SKY130)? The nulling resistor is 2.1 kΩ (SG13G2, rppd, 260 Ω/sq, 1 µm wide) or 2.6 kΩ (SKY130, res_high_po_0p69, 319.8 Ω/sq, 0.69 µm wide): how long is it without its contact heads? Compare with the drawn sizes in Table 15.4 and explain the difference.
Steps
- Generate the layout (or use the copy in
labs/lab8/<pdk>). From the top of the course files (art_of_aicd/), run the three commands of Section 15.8: the PDK generators draw the unit cells, thenpython3 tools/layout/ota_layout.py sg13g2 sky130places and routes them. Open the result withklayout tools/layout/sg13g2/ota2s.gds &and find the three groups, the guard rings, the Metal3 spines and \(R_z\) and \(C_c\) of Figure 15.4. In SKY130, open it in Magic as well (gds read,load ota2s) and select a few nets. - DRC. Run the commands of Section 16.2 for your PDK, or all checks at once with
python3 tools/layout/verify.py(it writestools/layout/<pdk>/verify.json). Load the report into KLayout with-mand look at the categories, even if they are empty. - LVS. Run the LVS of Section 16.3 against
ota2s_lvs.spice. Read the reference netlist first: find the PDK resistor and capacitor and the three dummy lines. - Break it, twice. Copy
ota2s_lvs.spice, delete the three dummy lines (MD1–MD3) and run LVS against the copy. Then restore them and swapinpandinnon the gates of M1 and M2. Note what each tool reports. - Extract. Run the Magic extraction of Section 16.4 (or take
ota2s_pex.spicefrom step 2). Find the five largest capacitors and the nets they sit on. - Post-layout simulation. In
labs/lab8/<pdk>, run../../sim.sh postlayout_tb.sch. Copiesaandtare the schematic OTA, copiesbanduthe extracted layout throughota2s_pex.sym, whosespice_sym_defattribute includesota2s_pex.spiceinstead of a schematic. The testbench prints the loop gain, phase margin, slew rates and overshoot of both.
Checkpoint
Table 18.9. Lab 8 results (IIC-OSIC-TOOLS 2026.10; post-layout values for the unity-gain buffer with 2 pF, tt, 27 °C).
| Quantity | SG13G2 | SKY130 |
|---|---|---|
| Layout size | 118.8 × 56.6 µm = 6725 µm² | 58.9 × 66.4 µm = 3911 µm² |
| DRC | 0 violations (KLayout, all rules except density); antenna: 0 | 0 violations (KLayout); Magic drc(full): 1 (rpm.1, Section 16.2) |
| LVS | netlists match | circuits match uniquely |
| Without the dummies in the reference | FAIL: no match | Netlists do not match: 12 devices against 10 |
With inp and inn swapped |
FAIL (strict port mode) | top level cell failed pin matching |
| Extracted: devices (fingers), wiring capacitors, total | 92, 36, 169 fF | 50, 33, 144 fF |
| Largest extracted capacitor | tail to vss, 70 fF | between the Miller-capacitor nets, 43 fF |
| Unity-gain frequency, schematic → layout | 21.5 → 21.0 MHz | 21.7 → 20.6 MHz |
| Phase margin, schematic → layout | 67.0 → 65.3° | 72.8 → 72.4° |
| Falling slew rate, schematic → layout | 15.6 → 14.7 V/µs | 14.6 → 13.7 V/µs |
Questions
- The swapped inputs still give a circuit that is topologically the same as the layout. Why does LVS catch it anyway, and what would happen without pin labels on the layout?
- The SKY130 extraction puts 43 fF in parallel with \(C_c\). Where in Figure 15.4 does it come from, and how would you reduce it?
- Neither extraction contains the trench stress of Section 15.5. Which device pairs of the OTA would suffer most if their units had different surroundings, and how does the floorplan prevent it?
Extension
Generate the input pair as AABB instead of ABBA with python3 tools/layout/ota_layout.py <pdk> --pair=AABB --out=/tmp/aabb (the default layout stays untouched), run DRC and LVS on /tmp/aabb/<pdk>/ota2s.gds, and confirm that both still pass: LVS checks the circuit, not its sensitivity to gradients. Then use Section 15.4 to estimate the systematic offset the new arrangement would have under a threshold gradient of your choice, and compare it with the random offset of Lab 7. If you have time, place the OTA in a Tiny Tapeout analog tile for your PDK and run the full DRC with density checks, as Chapter 17 suggests.