Home › Forums › Nazca › Questions and Answers › Iterate over a cell and return polygons from child cell › Reply To: Iterate over a cell and return polygons from child cell
Generally, I am trying to use Boolean operations to define shapes with interior geometry that are otherwise difficult to build from primitives.
In this specific case, I have a die-level GDS that consists of an array of different PICs. Each PIC cell (by this I mean a nazca cell) consists of:
1. a “tile” cell, which has probe pads, test structures, and fabrication process monitors
2. a “device” cell, which is a photonic waveguide device like a laser, SOA, or MZM
3. some interconnect objects to connect the pads in the tile to the vias in the device
The tile cell is complicated but relatively uniform across all the PICs, with a few exceptions, mainly the waveguide in the device cell has a few layers that need to be Boolean subtracted (NOT operation) from a big square in the tile cell. It would be highly desirable to have a uniform p-cell for the tile that was reusable across the entire die and in later masks, and just use some Boolean operations to adapt the geometry inside the tile cell for the specific device that is with it inside the PIC cell.
Another reason would be to invert the polarity of pattern to adapt it for the specific photoresist tone.
Previously I have done these Boolean operations in klayout using a DRC script, but, at least for the way that I know how to do it in klayout, the Boolean operations affect the entire mask. This presents some difficulty, as there were eventually a lot of these operations. It became difficult to mentally imagine what the final outcome would be. Some PIC cells needed a different set of Boolean operations, and this required the creation of a bunch of virtual layers which were Booleaned and then added back into the physical layer. It was a big headache, and during the fabrication, there were many errors in the mask that resulted from this extra complexity.
Ideally, I envision a “p-cell”, which is basically a Python function with some design information as an input, which produces a Nazca cell and then a GDS cell, that is fully complete, so that either the python function or the resulting GDS cell can be transported from one mask layout to another without someone (me) having to chase it around and apply the correct klayout DRC script to it.
So to accomplish this, I have learned that the klayout Boolean algorithms are accessible as a Python library. They are very robust at resolving the specific issue of polygons with interior geometry and making them compatible with GDS. I can post a simple example of how to do this if you are interested in seeing it. This way a Python function that creates a Nazca cell can do Boolean operations and edit the polygons either before putting them into the cell, which works really nicely already, or after the polygon has been put into the cell but before the cell has been instanced, which is what I’m trying to do here and is more difficult.
The only issue left is that the Nazca polygon class has to be converted somehow into a klayout polygon class, which is where I run into a problem. In Nazca it is simple and often very helpful to make a many layers deep cell hierarchy, but for the Boolean operation to be successful, the piece of geometry in the “tile” cell (in my example it is just a square) and the geometry of the waveguide trench (which is hopefully arbitrary and maybe very complicated, like an MZM with all adiabatic bends) need to be simple polygons in the coordinate system of the PIC cell.
Open to any suggestions, even if the suggestion is that the idea is impractical.