Getting started with Klayout
Last updated
Last updated
Download Klayout from their websites and follow the instructions to install the software
After it is successfully installed, open the Klayout editor
To create a new layout File>>New Layout
Set the initial layer(s) that you need. The current hacker fab process would require 5 layers which are substrate, poly, active, contact, and aluminum. This is just for getting started, you can always add new layers later if you need to do so.
The layers will be shown in the upper right corner.
Go to View>>Layer Toolbox to open the layer toolbox so that you can adjust the order of the layers and the texture of the layers based on your preference.
Double-click the layer to hide it. If you are drawing on a hidden layer, the following tip will show up.
To create a new layer, go to Edit>>Layer>>New Layer
Scroll your mouse to adjust the size of the grid
The grid can also be hidden through View>>Show Grid. When you need to export the masks as screenshots, the mask needs to be hidden.
Klayout has the following tools to draw the shapes. Press “shift” to draw straight lines.
Draw the rough shape of an object then adjust it to be the exact size by pressing “Q” to edit its property.
Mask Exporting (method 1):
Go to Display>>Zoom Fit to maximize the size of the mask on the screenshot
Rename and sort the order of the layers according to the order of the fabrication steps. In this case, the easiest way is to sort them by name (0:substrate, 1:poly gate, 2:active layer, 3:contact hole, 4:aluminum)
To make the masks compatible with the lithography stepper, adjust the size of the substrate layer (layer 0 in this case) to be proportional to its resolution (3840x2160). In this set of masks, the size of the substrate layer is set to be 384x216. Under this setting, the actual size of the pattern coming from the stepper is 2.5 times the designed size.
Adjust the color and texture of the mask to be blue/red/black accordingly to make them compatible with the red focusing and UV focusing.
Hide or show certain layers based on the property of the mask and take screenshots via File>>Screenshot and save the mask.
Corp the screenshots since the exported screenshot would normally have white sides.
Mask Exporting (method 2):
Set up steps are the same as Step 10 a. to c. steps.
Go to Macros>>Macro Development to write Maros in Klayout
Select “Python” and change the Macro Template to “Plain Python file”
Paste the following code into the Python file you just created. 1
Change the path to the folder where you want your images to be saved. Note that if the name of your folder or file starts with a number, it will give you the following error message.
The .png file of your mask will be saved in black and white. Be sure to adjust the color and texture of the mask to be blue/red/black accordingly to make them compatible with the red focusing and UV focusing.
Reference:
1 GDS to image https://www.klayout.de/doc-qt5/programming/python.html
Appendix 1. Klayout user guides
Klayout user manual from their websites:
https://www.klayout.de/doc/manual/basic.html
Shorter one for getting started with basic functions:
https://mycourses.aalto.fi/pluginfile.php/897248/mod_resource/content/2/KLayout%20Guide.pdf
Appendix 2. Masks for an NMOS enhancement load inverter
See step 11 for an alternative way of exporting the masks using Python scripts