heitzmann / gdstk

Gdstk (GDSII Tool Kit) is a C++/Python library for creation and manipulation of GDSII and OASIS files.
https://heitzmann.github.io/gdstk/
Boost Software License 1.0
324 stars 78 forks source link

Pin Identification and Extraction #229

Closed Rishabhgoyal07 closed 5 months ago

Rishabhgoyal07 commented 6 months ago

@heitzmann , How can we identify the pins that are present in the leaf cells (bottom hierarchy) of a layout, and export them to the top level of the layout?? Is this possible in gdstk?

heitzmann commented 6 months ago

How are the pins represented? There's no "pin" object in GDSII files. If they are paths or polygons, you can use get_polygons with the appropriate layer/datatype info. If they are nodes, gdstk doesn't have support for those, unfortunately.

Rishabhgoyal07 commented 6 months ago

Pins are text on metals(M1,M2..) which are used to clear the lvs, and also indicates on which metal the signal should come. I am creating pin on a metal(M2) but the text is getting created by polygon. Will this text give any DRC error.?? I am viewing my cell in virtuoso, in virtuoso we can directly create a pin on any metal, while the created pin using gdstk is not getting recognized in virtuoso. Also, i have one request, please add different font type while creating a text or label.

heitzmann commented 6 months ago

I see. In that case, text objects are called labels in GDSII, and they are created with the Label class, not the text function (that's for creating polygons from a string - after creation, the polygons behave like any other polygons and will interfere on DRC).

Regarding the font issue, I have no time to build another font, which is quite a lot of work, but fell free to create a PR if you wish do it.

Rishabhgoyal07 commented 6 months ago

Thank you for your help, also i want to know how can we flip a cell horizontally, i..e we the left side of the cell becomes the right side and the right side becomes the left side.

heitzmann commented 6 months ago

You can use a reference setting rotation=180 and x_reflection=True.

Rishabhgoyal07 commented 6 months ago

I did that, but the quadrant in which the cells is, got changed from 1 to 4 quadrant, i..e the x-axis is changed from x to-x. Is there any way so that the x-axis doesn't get changed, i..e, the cell is mirrored in its place only?

heitzmann commented 6 months ago

Yes, add a translation vector to the transform to take the cell to desired position after the transformation.

nmz787-intel commented 4 months ago

I am viewing my cell in virtuoso, in virtuoso we can directly create a pin on any metal, while the created pin using gdstk is not getting recognized in virtuoso.

You need to use the appropriate options during strmin or oasisin, such as -objectMap or -pinAttNum, or write SKILL or OaScript code to find your Labels on your metal:pin layer:type and then convert them into Pin objects