Layout vs schematic (LVS)
WHY does LVS exist?
The three sign-off checks in physical verification:
- DRC (Design Rule Check): Is the layout manufacturable? (spacing/width rules)
- LVS (Layout vs Schematic): Does the layout match the intended circuit?
- ERC (Electrical Rule Check): Are there electrical bugs? (floating gates, etc.)
LVS answers the functional-equivalence question, not the manufacturability one.
WHAT is LVS, precisely?
Two netlists are equivalent when they are the same labeled graph:
- Nodes = electrical nets (wires)
- Edges/vertices = devices (transistors, R, C) with their terminals and parameters
HOW does LVS work? (derivation from first principles)
Think of the LVS engine as building and comparing two graphs. We derive each stage.
Stage 1 — Layout extraction (build the layout graph)
Net formation (union-find on polygons). Start with every polygon as its own net. Merge nets when:
- two shapes on the same layer overlap/abut, or
- shapes on two layers are joined by a contact/via where those layers are allowed to connect.
This is exactly a union-find (disjoint-set) problem. If there are polygons and overlap/via relations, labeling all nets costs
Why this formula? Union-find with path compression + union by rank does each of the merges and finds in near-constant amortized time (inverse Ackermann ≈ 4 for any real chip). So it's essentially linear in geometry.
Device recognition. A device is a pattern of overlapping layers. An MOS transistor = poly crossing diffusion:
- the poly-over-diffusion overlap region is the gate/channel,
- the diffusion on each side = source and drain,
- the underlying well ⇒ NMOS vs PMOS.
The gate width = length of the poly–diffusion crossing edge; the length = the poly dimension along current flow. So parameters come straight from geometry:
The output of Stage 1 is the layout netlist: devices + extracted nets + .
Stage 2 — Reference netlist
The schematic is compiled (or a SPICE netlist is given) into the same graph form. No extraction needed — connectivity is already named.
Stage 3 — Graph matching (the comparison)
The trick: coloring / partition refinement (Weisfeiler–Leman idea).
- Give every node an initial color from local invariants it cannot fake: for a net, e.g. (#transistor gates on it, #sources, #drains, #passives). For a device, its type and parameters.
- Refine: recolor each node using the multiset of neighbor colors. Repeat.
- After refinement, colors partition nodes into classes. Match classes across the two graphs.
- If both graphs converge to identical color histograms and each class has a unique pairing ⇒ LVS clean. Any leftover ambiguity/mismatch ⇒ report a discrepancy.
Refinement runs a small number of rounds (until stable), each round , so practically
near-linear on well-structured chips (hierarchy helps hugely — you match a cell once and reuse it).

Typical LVS error classes (and how they show up)
| Error | Physical cause | Graph symptom |
|---|---|---|
| Short | two nets touch that shouldn't | two schematic nets map to one layout net |
| Open | wire broken / via missing | one schematic net splits into two layout nets |
| Missing device | forgot to place a transistor | device count mismatch |
| Parameter mismatch | wrong | isomorphic graph but differ |
| Property/label error | wrong port/pin label | matching fails at boundary |
Worked examples
Common mistakes (steel-manned)
80/20 — the 20% that gives 80%
- LVS = extract-layout-netlist → graph-compare with schematic.
- It checks devices + connectivity + parameters, by isomorphism, not by name.
- Main errors: short, open, missing/extra device, param mismatch.
- DRC≠LVS≠ERC; LVS clean ≠ correct schematic.
Recall Feynman: explain to a 12-year-old
Imagine you have LEGO instructions (the schematic) and the model your friend actually built (the layout). LVS is a robot that looks at the built model, figures out which bricks connect to which, and checks it exactly matches the instructions. If your friend accidentally stuck two towers together (a short) or forgot to click two bricks (an open), the robot shouts which piece is wrong — before you glue everything and can't undo it.
What does LVS verify?
What are the two main stages of LVS?
Why can't LVS match nets by name?
Algorithm used to build layout connectivity from polygons?
How is a MOS transistor recognized in extraction?
How are W and L obtained in extraction?
Difference between DRC and LVS?
A short shows up in LVS as...?
An open shows up in LVS as...?
Can LVS be clean but the topology still 'pass' with wrong sizes?
Does LVS clean guarantee correct chip function?
What technique underlies graph matching in LVS?
Connections
- Design Rule Check (DRC) — sibling physical-verification check (manufacturability).
- Electrical Rule Check (ERC) — floating gates, over-driven nets.
- Parasitic Extraction (PEX) — extends extraction to R/C for timing.
- Netlist and SPICE — the reference-netlist format.
- CMOS Inverter Layout — the canonical LVS example.
- Union-Find (Disjoint Set) — the connectivity engine.
- Graph Isomorphism — the theoretical core of matching.
- Physical Design Flow / Tape-out — where LVS sits in sign-off.
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, LVS ka matlab simple hai: aapne chip ka layout banaya (metal, poly, diffusion ke rectangles) aur aapke paas ek schematic hai jo batata hai circuit kaisa hona chahiye. LVS ek tool hai jo layout se ek netlist extract karta hai — yani geometry dekh ke figure out karta hai ki kaun se shapes ek transistor banate hain aur kaun se wires electrically ek hi net hain. Phir wo is layout netlist ko schematic netlist ke saath compare karta hai. Agar dono graph bilkul same (isomorphic) hain — same devices, same connections, same W/L — to "LVS clean". Warna error.
Yeh important kyun hai? Kyunki fabrication bahut mehenga hai aur ek baar mask ban gaya to undo nahi hota. Agar galti se do wire touch ho gaye (SHORT) ya ek via miss ho gaya (OPEN), to chip dead. LVS yeh sab tape-out se pehle pakad leta hai. Ek key baat: LVS naam se match nahi karta, kyunki layout ke net naam auto-generated (jaise N$27) hote hain — wo structure (connectivity + device fingerprint) se match karta hai, coloring/refinement algorithm use karke.
Do cheezein yaad rakho jo students confuse karte hain. Pehla: DRC aur LVS alag hain — DRC bolta hai "yeh banaya ja sakta hai kya?" (spacing rules), LVS bolta hai "sahi circuit banaya kya?". Dono chahiye. Doosra: LVS clean ka matlab chip sahi kaam karega, aisa nahi — LVS sirf yeh prove karta hai ki layout aapke diye schematic ke barabar hai; agar schematic khud galat hai to LVS phir bhi pass ho jayega. Isliye functional simulation bhi zaroori hai.
Mnemonic ek dum simple: "Extract, then Match — watch SOMP" (Short, Open, Missing, Parameter). Bas itna yaad rahe to LVS ka core clear hai.