How export cell with fixed name in hierarchy to csv file in fixed format?

Hi,

I try to export cells information with fixed names to csv file using search and replace function.
I have several questions?
1): it shows cells information, but only in hierarchy, how to get them in flat?
2):the csv file have some information, but I only need xy points, how to get them without reprocessing data?

Best regards!
Weiling

Comments

  • edited June 23

    Hi @Weiling_Zheng,

    I don't fully understand what you are looking for, but here is a query that gives you the "flat" bounding box centers of all shapes on layer 1/0 from the top cell of the layout and all cells below:

    select path_dtrans*shape.dbbox.center from shapes on layer 1/0 from instances of $(CellView.active.cell.name)..
    

    Explanation:

    select <expressions> from <query> computes expression(s) on the query results.
    $(CellView.active.cell.name).. selects the cell tree below the current cell. . instances of ... will expand to all instances in the cell tree.

    path_dtrans is the accumulated transformation from the cell the shape is in to the current cell. shape.dbbox.center gives the bounding box center of the current shape. t*x transforms the object "x" by the transformation "t", hence path_dtrans*shape.dbbox.center will give you the position of the shape's bounding box center in coordinates of the top (current) cell.

    Maybe that helps.

    Matthias

  • @Matthias
    Hi, thank you for your respond.
    The skill you give can select shapes on certain layer of the top. But how to change this to get instances position with fixed name prefix, for example, the top has sub-instances, with names of abc1/abc2/abc3/abcetf. How to get those instances' center position in flat?
    Best regards!
    Weiling

  • So you want center positions of instances, not shapes?

    Please try:

    select path_dtrans*instance.dbbox.center from instances of $(CellView.active.cell.name)..abc*
    

    Matthias

  • @Matthias
    Thank you for your respond. I use this code, but get this information.
    Are there other terms not modified in this code?

    Best regards!
    Weiling

  • edited August 1

    Sorry, there was a typo.

    It's supposed to be "inst", not "instance" (see https://www.klayout.de/doc-qt5/about/custom_queries.html#k_4 for a full description):

    select path_dtrans*inst.dbbox.center from instances of $(CellView.active.cell.name)..abc*
    

    Matthias

Sign In or Register to comment.