It looks like you're new here. If you want to get involved, click one of these buttons!
Hello everyone,
I want to get the information of all the instance in the topcell, such as name, location, width, height and pin-information, etc.
(eg:
cell name : r493/FE_OFC16857_n623
position : 126.920 26.180 127.490 27.580
type: BUF_X1
fanin pins: A
fanout pins: Z )
How can I get them from the gds files using python script?
Thanks
Comments
@blues That's not a GDS instance information. GDS does not have
GDS is a pure layout format. It can give you the location of a cell, that's it. LEF/DEF can give you that information for example.
Matthias
@Matthias
Hi Matthias,
Thanks for your help.
I still want to know that may I get the location and size of the pin from the gds file?
Not like the pin information above(fanin pins: A fanout pins: Z ), just the physical information of pin-box.
thanks.
This depends on the use of GDSII layers in the design which is determined by the PDK. Sometimes people use a dedicated GDSII datatype for the pins, and if that's being done it's easy to find them, just write out the boxes for this layer, and look for the texts on that layer if they are being used.
@ejprinz
Thanks for your kind reply.
But I could still not find a way to achieve it.
It seems that the dedicated GDSII datatype is not used in my file.
Could you give me more details?
Thanks.
First look at the GDSII file in KLayout in GUI mode. Go to a hierarchy of "1" (e.g. hit the "1" key). Now you should see all instances in the top cell, plus you'll see any other shapes also included in the top cell (in the "Layers" window, hit "Show All"). You can then hit "+" and go down the hierarchy until you are at the bottom and see no instances anymore, only shapes.
If you need more info you need to know more about your GDSII file. You need a map file from the PDK which tells you what each GDSII layer/datatype (both integer numbers) means. Typically this is a correspondence of (Layer Name, Layer Purpose, GDSII Layer #, GDSII Datatype). If you find such a map file in the PDK, convert it to a KLayout .lyp file. Then you see the info in the "Layers" window.
Which layers are pins and ports is a convention in the PDK. A pin or port is typically a box on a specific layer with a GDSII text either on the same or a different layer. The LVS tool then can use the text labels and annotate circuits with it.
Once you understand what you see in the GUI, scripting it is straightforward. Something like:
At this point if you want to add something you need to read the docs. Also use a good Python IDE like VS Code or Neovim.