KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

Layout vs. Schematic (LVS) Overview

Basic usage of LVS scripts

Starting with version 0.26, KLayout supports LVS as a built-in feature. LVS is an important step in the verification of a layout: it ensures the drawn circuit matches the desired schematic.

The basic functionality is simply to analyze the input layout and derive a netlist from this. Then compare this netlist against a reference netlist (schematic). If both netlist are equivalent, the circuit is likely to work in the intended fashion.

Beside the layout, a LVS script will also need a schematic netlist. Currently, KLayout can read SPICE-format netlists. The reader can be configured to some extent, so the hope is that a useful range of SPICE netlists can be digested.

While the basic idea is simple, the details become pretty complex. This documentation tries to cover the solutions KLayout offers to implement LVS as well as the constraints imposed by this process.

KLayout's LVS is integrated into the Macro Development IDE the same way as DRC scripts. In fact, LVS is an add-on to DRC scripts. All DRC functions are available within LVS scripts. Netlist extraction is performed in the DRC framework which was given the ability to recognize devices and connections and turn them into a netlist. Although DRC does not really benefit from these extensions, they are still useful for implementing Antenna checks for example. As it happens, the majority of features required for LVS is documented in the DRC Reference, while the few add-ons required specifically for LVS are documented in LVS Reference.

LVS scripts are created, edited and debugged in the Macro Editor IDE. They are managed in the "LVS" tab. For more details about the IDE, see About Macro Development. For an introduction about how to work with DRC scripts see Design Rule Checks (DRC) Basics.

LVS scripts carry the ".lylvs" extension for the XML form (in analogy to ".lydrc" for DRC) and ".lvs" for the plain text form (same as ".drc"). Like DRC scripts, LVS scripts can be executed standalone in batch mode like DRC scripts. See "Using KLayout as a standalone DRC engine" in Design Rule Checks (DRC) Basics.

KLayout's LVS implementation

The LVS implementation inside KLayout is designed to be highly flexible in terms of connectivity, device recognition and input/output channels. Here are some highlights:

Terminology

KLayout employs a specific terminology which is explained here: