PCell to create Circular Array

I'm sure many people need to populate a circular wafer with an Array of devices, where the GDS Array function doesn't quite do the trick since it only creates rectangular arrays.

I would like to make a PCell that can automatically generate a Circular array - so it can be moved, edited etc. as needed.
This is unlike making a GDS rectangular array then running resolve arrays and then delete the off-wafer die - here you lose the ability to move the entire array, change pitch/spacing, alter instance properties (unless you individually select each Instance) etc.

Has anyone done this, or have any tips on how to accomplish this?
I haven't made a PCell before, but I assume it can be a .py or .rb file placed somewhere in my KLayout path.

-- Demis


  • Hi Demis,

    the topic has been discussed in this forum already a couple of times.

    Basically for reasons of the architecture, it is impossible to generate a PCell (in a library) that instantiates a cell from the current layout. A library is a self-contained entity and cannot access the client layout. I do not recommend a PCell therefore.

    Instead, you can create a generator script - one that generates a cell placing other components like dies. This is not dynamic like a PCell, but you can add a decent user interface to compensate for that.


  • @demis, We are working on a slightly different approach to this that might be interesting to you. This is a PDK that is under heavy development, so it is in no way production ready yet, but we have a way to generate very generic arrays. It can however only place PCells. But you could make a PCell from a regular cell via KLayout's Convert to PCell-feature which is very cool.

    In our PDK, all PCells can be placed in any array; coordinates for the instances are generated via any Python code. It looks like this:

    If you tick the Array PPCell-option, you can specify a list of points where you want your PCell. In addition, you can specify a list of dictionaries with parameters for the different instances. So, as seen in the picture above, you can change the parameters for the different instances. This is probably not very useful for production, but very useful for research applications where one often wants to test to sweep a particular feature.

    If you are interested, I'd be happy to show more details about this.

  • edited June 2022

    Thanks Matthias and @ravn ,

    Ravn, I would indeed be interested in seeing how you accomplished that - passing PCell params to a script sounds perfect. I do want something more "dynamic", as one often needs to adjust the array (x/y-shift, radius, include/exclude partial die etc) to see what fits on the wafer. Your type of PCells sound like they could accomplish that, and I'd be happy to contribute code to that effect.

  • @Matthias , How does the "BASIC.TEXT" PCell work? It appears to generate polygons based on input params - can't I use a similar approach to make a PCell that has input parameters of
    1) cell to instantiate
    2) x/y spacing
    3) diameter to fill
    (maybe other params, like Wafer Flat, partial-cells-included etc.)
    And it places Instances of Arg1, at spacing of Arg3, filling an area of Arg3

  • @demis A PCell can generate polygons, but I PCell can only instantiate cells from other libraries, not from the client layout (the one you uses the PCell in). So if "cell to instantiate" comes from some library that is fine. If it is supposed to come from the client layout, you cannot do so.


  • Can we perhaps have the PCell script generate a "Library" to store the Cell from the client layout?

  • @demis , I can share some more information if you are interested. The code is not released to the general public yet as it is not mature enough, but the feature we are talking about here works well. If you are interested, send me an email robert.rehammar_at_chalmers.se.

  • @demis Please don't try making a system doing things it was not designed for.

    I'd advise you to look in a different direction. Instead of a PCell you can provide a script which is executed in order to manipulate the layout you have loaded and which you are working on. Assume you have such a script, you bind it to a menu and on execution it will pop up a dialog, ask some parameters - for example the name of the cell you like to place - and then creates a sequence of instances inside your layout.

    Such a script can offer undo/redo and fancy UI's if you like, but it is not a PCell. Which means you cannot live-adjust the parameters, but you have to delete the existing placements and redo them. You could make the delete a feature of the script so it's more convenient.

    In the end, a PCell does not do much different things, but a script can access everything from your layout and even change details a PCell does not have access to.


Sign In or Register to comment.