Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorlukasc
    • CommentTimeJul 28th 2017

    Hi Matthias,

    When the user clicks on a technology, it triggers a reload of the specified layer properties file. Is there a way to add more actions to this? Specifically, I would like to have an init script called when someone changes the technology in which I define some global variables. These variables are then used by my PCells. I would like PCells to be general and applicable to multiple technologies, but with technology-specific parameters (e.g., different default layers, different feature sizes, etc).

    Thank you


    • CommentAuthorMatthias
    • CommentTimeJul 31st 2017 edited

    Hi Lukas,

    you can associate macros with a technology, but that just means that macro is shown in the menu only if the specific technology is selected. So that does not solve your problem.

    I'd in general discourage from making PCell code depending on global variables. PCell code may be executed on occasions beyond your control. Basically multiple layout objects can live in the KLayout object space and there is not necessarily one "active" layout. There may be occasions when the other layouts want to evaluate their PCell code as well - and in their technology context.

    With 0.25 it's possible to associate a library with a technology. That does not mean the library is tied strictly to that technology, but a user that has a layout with a certain technology will only see the libraries associated with this (or no specific) technology.

    Using this feature, my approach to solve your problem with 0.25 was to derive a bunch of libraries from a basic implementation. So no code duplication.

    Like this (just a sketch - not tested):

    class GenericPCell < PCellDeclarationHelper
      def initialize(tech_specific_par)
        @tech_specific_par = tech_specific_par
        # Important: initialize the super class
        # declare the parameters
        param(:l, TypeLayer, "Layer", :default => LayerInfo::new(1, 0))
      def produce_impl
        ... produce the layout using @tech_specific_par and the user parameters ...
    class MyGenericLib < Library
      def initialize(tech, tech_specific_par)
        layout.register_pcell("MyPcell", GenericPCell::new(tech_specific_par)) = tech   # Requires 0.25 !!!
        register("MyLib_" + tech)
    # Registers a library "MyLib_TECH1" for technology "TECH1" with technology specific parameter "1"
    MyGenericLib::new("TECH1", 1)
    # Registers a library "MyLib_TECH2" for technology "TECH2" with technology specific parameter "2"
    MyGenericLib::new("TECH2", 2)

    In other words, the approach is to install the same library multiple times with different variations. Because each library is tied to a specific technology, it will become visible in the library browser only for this technology.

    How about this?


    • CommentAuthorlukasc
    • CommentTimeAug 1st 2017

    Hi Matthias,

    This makes sense. I don't have 0.25 so can't test this yet.

    One question is what types of parameters can be stored in the technology. Hopefully it will be generic enough (i.e., not just the layer table) that I can put any number of variables that I want for my application (e.g., thickness values, wavelength, radius, layer assignments, etc); these variables can be simple strings that I parse to get my information.

    Thank you