Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

A simple layer processing scripting environment

edited June 2011 in General

Recently I have received a request regarding automation capabilities for the layer processing functions (boolean operations, sizing and others). To provide a preliminary solution I have supplied a ruby script for download here: http://www.klayout.de/resources/layer_proc.rbm.

The script installs a new menu entry which allows to load and execute a processing script. The script can be used for implement layer generation and manipulation rules. Right now, the implementation is pretty simple and uses a flat approach, i.e. creates shapes in the top cell only.

You will find usage instructions in the script itself. Here is a short example which extracts the gate regions:

active = input("2/0")
poly = input("3/0")
gates = active.and(poly)
gates.output("10/0")

Since, the "and" method is available as the "*" operator, this example can be simplified to

(input("2/0") * input("3/0")).output("10/0")

To use these generation rules, save the script above as a text file and run the script using "Tools/Processing Scripts/Processing Script" to execute the script. To easily execute the script again, a list of most recently used scripts is maintained.

Matthias

Comments

  • Hi Matthias,

    I got an issue with shifting the layers in Klayout using the processing script. In the document I found the following command can be used to shift the layer by a given displacement.

    l.shift(dx, dy) - Shift the layer by the given displacement.

    But when I operate the following line in my code, it gave an error saying that "Ambiguous overload variants - multiple method declarations match arguments."

    The command line I was using is as below:
    input("210/0").shift(1,0).output("210/1")

    Do you know what was the error ?

    Regards,
    Oscar

Sign In or Register to comment.