Extracting device coordinates and obtaining unreduced netlists for Matching/LDE Analysis

Hi Matthias and everyone,

I am working on a project involving Layout Dependent Effect (LDE) and Matching Analysis. To do this, I need to extract the exact physical location of every single device instance and map these coordinates to the extracted SPICE netlist.

I have performed an LVS run on a Sky130 design (see the attached image of the PMOS layout).

1. Observations regarding Coordinates:
In the results/lvs/pmos_sky130_lvs.lvsdb, I see structure definitions with coordinates (likely in DBU):

 D(D$sky130_fd_pr__pfet_01v8 sky130_fd_pr__pfet_01v8
  T(S R(l7 (-110 -300) (95 600)))
  ...
 )

And in the extracted netlist .cir, I see comments with coordinates in microns:

* device instance $1 r0 *1 2.065,7.57 sky130_fd_pr__pfet_01v8
M$1 VCC VCC VCC VCC ...

2. The Problem: Device Merging / Reduction
I noticed that the LVS process seems to merge/combine extracted devices.
As shown in the attached layout image, I have a multi-finger structure (or multiple separate devices). However, the generated LVS database and the extracted netlist seem to aggregate these into fewer device entries (e.g., M$1, M$2) with combined parameters (total W, combined Areas/Perimeters).

For my analysis, I need a 1-to-1 mapping. I need the extracted netlist to represent every single physical transistor finger (or at least every contiguous active area) as a separate subcircuit instance, without merging parallel devices.

My Questions:

  1. Disabling Reduction: Is there a switch or a specific command in the Sky130 LVS runset (or generally in KLayout LVS scripts) to disable device combination/parallel merging? I want the "raw" extracted netlist where one layout geometry equals one netlist instance.
  2. API for Coordinates: Instead of parsing the raw .lvsdb text file, is there a recommended Python/Ruby API to access the extracted device list and their specific coordinates (DTrans/Point)?

I want to write a script that iterates through the LVS results and prints something like:
Device M$1 (Finger 1): x=..., y=..., W=..., L=...
Device M$2 (Finger 2): x=..., y=..., W=..., L=...

Any guidance on how to configure the LVS to stop merging devices and how to query their locations via API would be extremely helpful.

Thank you!

Comments

  • Hi Matthias and everyone,

    Following up on my previous LVS issues, I have found the root cause regarding the mapping problem.

    The Context:
    I am working on Layout Dependent Effect (LDE) analysis.

    • Schematic: A netlist using multipliers (e.g., m=2), which expands to two distinct parallel instances: M$1 (W=3u) and M$2 (W=3u).
    • Layout: A physical layout containing two corresponding parallel devices.

    The Observation:
    When I run the Sky130 LVS, the Layout Extractor automatically merges these separate parallel devices into a single device with W=6u. It essentially performs "Parallel Reduction" during extraction.

    • Scenario A (Default):

      • Layout extracted: 1 merged device (W=6u).
      • Schematic: 2 separate devices (W=3u).
      • Result: ERROR: Netlists don't match (unless I enable schematic simplification).
    • Scenario B (With --set_schematic_simplify):

      • Layout extracted: 1 merged device.
      • Schematic reduced: 1 merged device.
      • Result: LVS Match.

    The Problem:
    While Scenario B passes LVS, it defeats my purpose for LDE analysis. I need to extract the exact coordinates of M$1 and M$2 individually. When they are merged into a single device entry in the .lvsdb (even if it internally holds the shapes of both), I lose the explicit link between the specific netlist instance (e.g., the 1st multiplier) and its specific physical location.

    My Questions:

    1. Disable Parallel Merging: Is there a way to configure the Sky130 extraction script to prevent the merging of parallel layout devices? I want the layout extractor to report two separate W=3u devices so they match the split schematic 1-to-1.
    2. Accessing Shapes of Multipliers: If disabling merging is impossible, how can I use the API to distinguish the shapes?
      • In the .lvsdb, the merged device has multiple Region R(...) entries.
      • Is there a deterministic way to map these regions back to the individual multipliers (e.g., M$1 vs M$2) based on their order or properties?

    I essentially need to achieve: Netlist Instance M$1 (Multiplier 1) -> Physical Coordinates (x1, y1)

    Thanks for your help!

  • KLayout can skip the device merge script, but the PDKs come with their own wrappers and some allow disabling the merge step and some don't.

    I lost track for the sky130 development ... there used to be a lot of forks. I don't know how the consolidated after e-Fabless shutdown.

    This repo seems fairly up to date: https://github.com/efabless/sky130_klayout_pdk/tree/main/tech/sky130/lvs (last commit 10 months ago by Leo), but that's the single-chunk thing I though they had abandoned.

    If I read that correctly, LVS does not combine extracted devices if you skip "--set_combine" in the LVS driver script. But I may be wrong.

    For parsing the .lvsdb file there is the LayoutVsSchematic class (https://www.klayout.de/doc-qt5/code/class_LayoutVsSchematic.html#k_1). You may be interested in the base class LayoutToNetlist. I hope the documentation is good enough as a starting point. As AI has absorbed all of my work, I am happy to delegate first level support to ChatGPT or Copilot.

    It's actually possible to run the extraction directly from your Python script as LVS commands are only wrappers around the KLayout API. This way you can seamlessly integrate extraction with analysis, but the price is that you need to reimplement the device and network extraction functionality of the LVS script.

    Matthias

Sign In or Register to comment.