general questions on Pcells

edited December 2013 in General
Matthias -

Let me ask you a few basic questions about Pcells:

if I want to create a parameterized layout/model - what's the best way with klayout - directly through Ruby scripting, or via Pcells?

Is Pcell mechanism good only for simple elements (like circle, rounded polygon, etc.), or would it work well for more complex (multi-layer, hierarchical, parameterized,...) structures?

Pcell is not a standard feature of GDS format - should Pcells be flattened (converted to regular layout) before GDS file can be used by downstream tools?

Thanks!

Max
---

Comments

  • edited December 2013

    Hi Max,

    the difference between a scripted layout generator and PCells is basically the ability to interact with the results of the generator algorithm. PCells can be adjusted quickly as used as components inside some other, manually created, layout. If you have a good idea how your final layout or macro should like look like, than a generator script is probably easier to create and more efficient. PCell code should execute quickly to maintain responsiveness of the tool, so they are not suited for complex generators.

    I'd use PCells for devices and small components but I would not use them for memory generators or similar.

    And you're right, PCells are not part of the GDS specification. However, KLayout produces valid GDS even with PCells embedded. KLayout will write the current layout of the PCell into the GDS file plus add some meta information which allows to recover the PCell identities and parameters. The layout file will therefore be a valid file containing the geometry of the PCells as produced with the current parameters. You won't need to flatten them.

    In GDS, the meta information is stored in a special cell at top level. In OASIS, special properties are used to store that information. When you read a GDS file containing PCells into other tools, you will notice an additional top cell. You can disable this cell with a writer option if necessary, but then you'll loose the ability to recover PCells then.

    Kind regards,

    Matthias

  • edited November -1
    Hi Matthias -

    thanks for the explanation.

    I understand that PCells (as opposed to layout generation script using static cells) are useful when there should be an immediate visual feedback, and a need to change parameters interactively, in GUI/klayout...

    It's a nice idea - to package PCell instances into GDS file so that GDS file is viewable and usable by other tools, yet parameterized PCell instances can be understood by Klayout (obviously - only Ruby lym script for those PCells is retained/provided).

    One follow-up question - can generation of layouts with PCells be programmed in klayout, or can it only be done interactively?

    Thanks,

    Max
  • edited November -1

    Hi Max,

    you're basically right - except that the PCell code itself is not stored in the GDS files. Instead, KLayout stores the parameter values of the PCells in the GDS file. If you read a GDS file and a PCell library is installed, KLayout will try to find a PCell with the corresponding library and cell name and connects the cell to that PCell. If not, it will convert the cell to a static cell.

    That implies that if the library has changed between saving and reading of the layout, the layout will be updated. The storage format is independent of the actual PCell implementation - whether the PCell is coded in Ruby or C++ does not matter.

    And right now there is no interactive way to defining PCells. I've noticed some concerns regarding existing schemes of that kind and my feeling was that interactive PCell generation is practically limited to simple applications, so I did not pursue that approach yet.

    But keep asking :-)

    Matthias

  • edited November -1
    If I understand well, saving in OASIS format allows to save PCells : is that true with KLayout Pcells ?
    While GDS saves only paths, polygons and texts.

    Thanks, Regards,
    Laurent
  • edited January 2014

    Hi Laurent,

    OASIS does not offer particular support for PCells. There are custom extensions you could use to store PCells, but their interpretation is not standardised. OASIS has a somewhat more elaborate annotation scheme, so it's possible to add metadata to objects easier. KLayout makes use of cell properties for example to store PCell metadata information that way.

    Apart from that, OASIS offers only a slightly richer set of objects compared to GDS (circles, trapzoids, explicit rectangles). The true advantage of OASIS are shape repetitions and an optimized binary representation, which results in very compact layout files.

    Matthias

  • edited November -1
    Hi Matthias -

    yes, I do see that the PCell code is not stored in the GDS file - only the parameters (and flat PCell instances) are stored there...

    Actually, regarding "interactivity" and PCells - I was actually meaning if instantiation of PCells can be done in a programmatic way (through coding in Ruby), as opposed to interactive way (through mouse clicking in klayout)?

    Regards,

    Max
  • edited November -1

    Hi Max,

    yes, it's possible to programmatically place PCell's. There already was a forum entry about that http://klayout.de/forum/comments.php?DiscussionID=230&page=1#Item_4.

    Regards,

    Matthias

  • edited November -1
    Matthias -

    thanks, this is exactly what I was looking for...

    Max
  • I am trying to make a Macro for serpentine pattern. Could anyone help me Please?

Sign In or Register to comment.