with_text

I was trying to follow up on some comments about how
this function could be used to make "asserted" objects
by "text tagging" a shape. But I can't find any mention of
this function in the DRC manual sections of the online
documentation.

Now most of my interest has been in the context of
connectivity (replace complex "recognition logic" by
simple text-assertion logic) but I would employ it for
device-specific rules (and checking for un-asserted
devices) in DRC if I were able.

1) Is this function available to DRC scripts?
2) Where would I find documentation or examples?

Comments

  • Hi Jim,

    sorry, I went into the future already. I'm upgrading the DRC engine currently. "with_text" is a new enhancement as the DRC engine is going to support text layers as native objects.

    So far, texts are kind of "hidden" objects inside "normal" input layers. They can be extracted from original layers and turned into small, dot-like shapes which can be used in "interacting", like this:

    l1 = input(1, 0)
    l2 = input(2, 0)
    
    l2_a_labels = l2.texts("A")
    
    l1_with_a_labels = l1.interacting(l2_a_labels)
    
    l1_with_a_labels.output(100, 0)
    

    which gives (layer 100 is the bold-edged shape):

    It's worth noting that "texts" can only operate on original, unmodified layers. The documentation for "texts" is here: https://www.klayout.de/doc-qt5/about/drc_ref_layer.html#k_108

    Best regards,

    Matthias

  • Matthias,
    What would be the "modern" :) way to write it ?
    Laurent

  • Hi Laurent,

    The "modern" way is to use "text layers". To input a text layer, you use "labels" in the same way you would use "input". But "labels" generates a text layer instead of a polygon layer.

    A text layer can participate in a variety of operations with polygon and edge layers:

    • Boolean NOT and AND: "texts - polygons" or "texts & polygons" (will filter texts outside or inside the polygons)
    • "polygons.interacting(texts)" and "polygons.not_interacting(texts)": filters polygons interacting or not interacting with texts on the text layer
    • "texts" and "texts_not" which can be used select texts by their strings (see here for details: https://www.klayout.de/doc-qt5/about/drc_ref_layer.html#h2-2988)

    So the modern way simply is:

    l1 = input(1, 0)
    l2 = labels(2, 0)   # no longer "input"
    
    l2_a_labels = l2.texts("A")
    
    l1_with_a_labels = l1.interacting(l2_a_labels)
    
    l1_with_a_labels.output(100, 0) 
    

    :)

    Matthias

  • Hi Matthias,

    Has there been any documentation of this function, with
    emphasis on DRC scripting (examples?)? Connectivity
    by tagged polygons too? Parametrics like LF, WF, NF, M
    (for MOSFETs) by text or by "measure bars" on special
    (non-mask) layers?

    Coming up on a need to embellish a runt DRC deck
    (add a raft of special geom devices) and I would much
    prefer to tag, than try to develop bulletproof recognition
    and derivation by layer logic.

  • Hi @dick_freebird,

    There is not really a particular documentation I'm afraid. The "texts" function is described here: https://www.klayout.de/doc-qt5/about/drc_ref_layer.html#h2-3353

    The (somewhat) new thing is that texts form a special kind of layer with "point-like" objects. This layer can be filtered and participates in some polygon operations - for example boolean "AND" and "interact", as in the example above.

    It is also a hierarchical layer, so you can use it in "deep" context.

    "Tagging" - as I understand it - basically just means select + interact like in the above code:

    # select labels
    l2_a_labels = l2.texts("A")
    
    # "tag" l1 polygons - i.e. select those with an "A" label on them
    l1_with_a_labels = l1.interacting(l2_a_labels)
    

    Matthias

Sign In or Register to comment.