LVS: compare the extracted circuit
Build the right physical reference and explain which layout mistakes a connectivity comparison can reveal.
- Lesson
- L7.3
- Time
- 24 min
- Runs on
- OpenROAD
- Check
- 5 questions
The final MAC has 591 instances in both its DEF and ordinary Verilog export. Matching those counts looks reassuring, but the ordinary export omits supply connections. A physical comparison needs more than matching totals.
| Export | Instance count | Explicit cell supply connections |
|---|---|---|
| DEF inventory | 591 | Database power connectivity audited separately |
| Ordinary Verilog | 591 | Supply pins omitted from cell port lists |
| Verilog with power and ground | 591 | 2092 audited supply pins |
Measured exports of one routed design. This inventory is preparation for LVS, not an LVS result.
Compare two separately obtained circuits
Layout versus schematic, or LVS, compares a circuit extracted from physical shapes with a reference circuit. Extraction identifies devices and electrical connections from the layout’s layers. Comparison then checks the resulting devices, parameters and connections against the intended design.
Read the diagram as text
- Merged layout
- Device extraction
- Reference netlist
- Cell and device definitions
- Compare circuits
- Merged layout → Device extraction: shapes
- Device extraction → Compare circuits: extracted circuit
- Reference netlist → Cell and device definitions: instances
- Cell and device definitions → Compare circuits: reference circuit
Exporting two netlists from the same logical database does not supply physical measurements about the manufactured connections.
An open connection separates nodes that should join. A short joins nodes that should remain separate. A device mismatch can instead concern transistor type, dimensions, multiplicity or another compared parameter. A useful report points to the affected nets or devices, rather than only announcing unequal totals.
Net names alone are not reliable results: extracted internal names can differ from reference names while the topology still matches. Conversely, identical top-level port names can hide an internal short. The comparison rules define which equivalences and device reductions are legitimate.
Magic can extract a layout netlist, and Netgen can compare it with a reference using process-specific setup rules. KLayout also provides extraction and comparison in an LVS flow. None of those tools is installed here; the exercise stops at measured OpenROAD exports and inventories.
Make power and physical cells explicit
| Class in this DEF | Instances | Reference concern |
|---|---|---|
| Sequential cells | 52 | Clock, data and reset connections |
| Other logic | 389 | Device definitions and signal ports |
| Buffers | 14 | Include CTS and repair additions |
| Taps | 136 | Supply and substrate connectivity |
The ordinary export omits 0 entire instances in this build. Physical cells are not automatically absent merely because their timing model is absent.
Filler cells, taps, decaps and antenna diodes have physical purposes that differ from ordinary logic. Some flows retain them in the physical reference; others apply documented comparison rules to selected devices. Arbitrarily deleting an unfamiliar cell can hide the very power or substrate connection being checked.
| Power pin | Connections in power-aware export |
|---|---|
| VPWR | 591 |
| VPB | 455 |
| VGND | 591 |
| VNB | 455 |
The database audit reports 0 missing and 0 wrong-supply connections among 2092 supply pins.
The power-aware export adds cell supply ports. Its VDD and VSS names must agree with the intended power domains and extraction conventions. This MAC uses one supply pair; multiple domains would require domain-specific checks rather than a blanket global connection.
A database connection audit can catch an omitted CTS-buffer supply connection before extraction. It cannot prove that the corresponding metal shapes actually reach the pin. Retain both forms of results: intended database connectivity and layout-extracted physical connectivity.
Choose the comparison that answers the question
| Check | Question | A limitation |
|---|---|---|
| DRC | Do the checked shapes meet geometric rules? | Legal shapes can connect the wrong circuit |
| LVS | Does the extracted circuit match its reference? | Matching connectivity can still be too slow |
| Logic equivalence | Do implementations implement the specified behavior? | Boolean models do not prove wire continuity |
| Static timing | Do modeled paths meet their constraints? | It assumes the supplied connectivity is correct |
Each report answers a distinct question; replacing one with another leaves a gap.
Logic equivalence can allow a different gate structure that computes the same behavior. LVS generally compares physical devices and connectivity under declared reduction rules. A transistor implementation and a Boolean implementation therefore need different models and different comparison assumptions.
The live exercise runs timing on a small mapped circuit. Its positive slack is useful timing evidence, but no layout is extracted by that run. Changing the period changes a timing requirement without changing whether a physical short exists.
A useful debugging sequence begins with the first localized mismatch and traces the nearby connections in both the layout and reference circuits. One open supply connection can produce many downstream device mismatches, so treating every printed line as a separate layout defect wastes effort. Confirm the extraction layer mapping before changing devices, since a missing contact layer can make many correct connections appear electrically disconnected. Then inspect reference pin ordering and cell definitions, because a comparison built from incompatible models cannot fairly assess the physical implementation. Keep the original extracted circuit alongside the report so another engineer can reproduce the mismatch with the same models and comparison settings. After repairing the root cause, repeat extraction and comparison over the complete design to check that the local edit caused no new mismatch.
Asked in interviews
What commonly causes LVS failures?
Opens, shorts, incorrect device parameters, missing device definitions and mismatched power conventions. Inspect the first localized mismatch before treating every later mismatch as independent.
Why include physical-only cells?
Their devices or supply connections may appear in the extracted layout. Any exclusions need documented, justified comparison rules.
Is equal instance count sufficient?
No. Two circuits can have identical counts and different connections or parameters. An inventory is an early consistency check.
Try it
This ideal-wire circuit reports 1.5462 ns worst maximum slack. The run checks modeled timing; it has no extracted-layout input.
Raise the period and observe the slack change. That change supplies no new information about physical connectivity.
Run to draw the timing paths here.
WNS 1.5462 nsRead the netlist: path2.v (the bundled design path2)
// path2: the two-flop reference path of docs/pd-lessons (L2.1-L2.5), written by hand.
// ff1/Q -> u1 (inv_1) -> u2/A (nand2_1) -> ff2/D, both flops on clk.
module path2 (clk, a, b, y);
input clk;
input a;
input b;
output y;
wire q1;
wire n1;
wire n2;
sky130_fd_sc_hd__dfxtp_1 ff1 (.CLK(clk), .D(a), .Q(q1));
sky130_fd_sc_hd__inv_1 u1 (.A(q1), .Y(n1));
sky130_fd_sc_hd__nand2_1 u2 (.A(n1), .B(b), .Y(n2));
sky130_fd_sc_hd__dfxtp_1 ff2 (.CLK(clk), .D(n2), .Q(y));
endmodule
Check yourself
Remember
- LVS compares a layout-extracted circuit with a defined reference.
- Check devices, parameters and connections, beyond names and counts.
- Power pins and physical cells require documented comparison conventions.
- LVS, geometry, logic equivalence and timing answer different questions.