Difference between NetElement information on GUI & Python script

edited January 2 in Python scripting

We are always doing useful work using Klayout, Thank you.

While using NetTracer, I have qusetion about the process of extracting net info.
It is about the difference between net info on gui and script.

First, I set NetTracerConnectivity as follows.

TECH = pya.NetTracerConnectivity()
TECH.symbol('PC', '1/0')
TECH.symbol('CT', '2/'0) 
TECH.symbol('M1', '3/0')
TECH.symbol('PC_real' 'PC-CT')
TECH.connectivity('M1','PC_real')

After that, when I select [Tools-Net Tracer - Export to Text] of gui and extract the information, the following layer information appears.

<element>
<layer>PC_real</layer>
<cell>TEST_CELL</cell>
<trans>r0 *1 0,0</trans>
<shape>polygon (762,36;762,1308;774,1308;774,36)</shape>
</element>

However, the above layer information cannot be obtained through the NetTracer.each_elements() of the python script.
If I get the NetElement object through NetTracer.each_elements() and apply NetElement.layer() to it, only the integer information of layer index NetTracer.each_elements() will come out.
And this information cannot get which real layer infomation through Layout.get_info(). (Maybe in Klayout, it seems that int is arbitrarily given to previously undefined layers. )

so I would like to bring the information of the layer name as obtained from [Tools-Net Tracer - Export to Text] in python script too. How can I do?
If the above description alone is ambiguous or difficult to understand, I will rewrite the entire code.
Help me, thank you.

Comments

  • Hi @thor,

    thank you for your feedback.

    By coincidence (?) a similar problem got reported by "shipfire" (https://www.klayout.de/forum/discussion/comment/10562#Comment_10562).

    The problem with your case is that "PC_real" is a computed layer and there is no corresponding layout database entry. Such computed layers are generated on the fly and do not feed back into the layout database.

    Right now, there is no direct way to obtain the symbol information. I think it is possible to derive the symbol name using the following algorithm (disclaimer: not tested):

    • All layers with indexes >= 1,000,000,000 are symbolic layers
    • Layer index 1,000,000,000 corresponds to the first symbol you defined, 1,000,000,001 to the second and so on

    But beware that there is no warranty it will stay like this forever. You can raise a ticket on GitHub to request a method for returning the symbol name for a given symbolic layer index.

    Regards,

    Matthias

Sign In or Register to comment.