LVS - nets names in extraction


I’m struggling with nets names in LVS. Ideally I would like to have extracted in this form:
*net 1 2 3 in
R$1 1 2 5.3 RES
R$2 2 3 1.65 RES

I’m using this LVS script (which doesn't work in that way):

m1 = input(9,0)
m1lbl = labels(9,1)
con = input(8,0)
connect(m1lbl, m1)
res = m1 - con
extract_devices(resistor("RES", 1), {"R"=> res , "C" => con })
target_netlist("extraction.cir", write_spice, "Extracted by KLayout")

I don't want to connect m1 to con, because this will connect all the resistors to one net. I would like to have only information in the first line (* net 1 2 3 in) which nets are connected to "in".

Is there any other way to include label name from the layout to netlist, without "connect" command, as I have a feeling that this will not work for me.
I think that the easiest way to do this (in theory) is casting label name from M1 on “con” without a physical connection. Does anyone can help with this, because I'm stuck?



  • Hi Lidia,

    the problem isn't the the connect statements but that you're using the entire M1.

    I understand that "con" separates the M1 parts, but I do not fully understand your layout.

    Typically you have a resistor marker which indicates the area where the metal (or poly etc.) is supposed to form a resistor. For poly resistors for example this typically is identical with a mask suppressing salicidation.

    Like here:

    In this case, layer 5 is "poly" and layer 7 is the "resistor marker" (polyres).

    The corresponding LVS script is:

    poly        = input(5, 0)
    polyres     = input(7, 0)
    contact     = input(8, 0)
    # Computed layers
    poly_not_res  = poly - polyres
    poly_in_res   = poly & polyres
    # connect "poly not in resistor" to contact
    connect(poly_not_res,   contact)
    ... more connect statements for contact to M1 etc. ...
    # Resistor Definition
    extract_devices(resistor("RES", 1.0), { "C" => poly_not_res, "R" => poly_in_res })

    Please note that the conductive layer isn't "poly" anymore - it's the part of poly which is outside the resistor. So contact connects to this part, not to the original poly.

    Coming to your question: supposed we had labels we wanted to attach to poly, it's important we do so by connecting the labels to "poly_not_res", not to "poly":

    poly_labels = input(5, 1)
    connect(poly_not_res, poly_labels)

    Otherwise you'd imply a connection across the whole orginal poly which would short the resistor.


  • Hi Matthias,
    Thank you for your response.
    "con" is placed on M1 and divide M1 on parts. I calculate resistance of those parts (parasitic resistance of M1). The problem is that I'll be not able to identify net names in the extraction file for number of resistors. I can place label on "con" and then use connect statement between label and con, but I will need to add label for each "con" (if I want to identify all of them)

    Then I will get:

    *net 1 net2
    *net 2 net2
    *net 3 net2
    *net 4 net2
    R$1 1 3 3.125 RES
    R$2 4 3 3.4 RES
    R$3 3 2 3.325 RES

    This is some solution for me, but ideally I would like to connect one label to m1 (or duplication of m1) and then attach this label to "con" which interact this layer, without shorting resistors.


  • Hi Lidia,

    so you actually want to do parasitic extraction.

    The problem is that you are creating internal nodes which need to be named in some way. What you want to have in some way is a twofold extraction: once without the internal nodes and once with. This is not straightforward to do with the net extraction framework as there is only one extraction step.

    Another problem is that in the original example above the "in" label sits on the device, not on the metal outside the device. That's why you cannot connect.

    You can basically proceed the way you have and in a second step collect all the nodes connected to a given original net (here: "in") through extracted metal resistors. But you still have to make sure the "in" label sits on a "con" part.


  • Hi Matthias,

    First problem - I was hopping that this will be possible...
    Second problem - I can create pin where the label is and identify this place as a "con".
    In this case I will have only one net defined (where is label) and other nets will have internal names (It is not ideal, but I can work with this).
    "Collect all the nodes connected to a given original net (here: "in") through extracted metal resistors" - Will this connect all the nodes to one net or do you have something else in mind?
    *net 1 in
    R$1 1 1 3.125 RES
    R$2 1 1 3.4 RES
    R$3 1 1 3.325 RES


  • edited October 2021

    Hi Lidia,

    Well, you're operating outside the scope of the tool so there is limited warranty.

    My comment about "Collecting all the nodes connected to a given original net" is pretty general. You can basically do this on two netlist objects you get from two extractions: one with the net separators ("con") and one without.

    The algorithm then will need to load both netlists and identity the connected nets from the detailed netlist (this is a graph walk) with the corresponding nets from the joined netlist. This will give you the information you proposed.

    I can't give you code for this now, but I think it is possible to do that.


  • Hi Matthias,

    This is a very interesting idea, definitely worth a try.
    Thank you for your help!


Sign In or Register to comment.