You can do this in two lines:
1. Save the cell A as OASIS file from the old layout
2. Read the OASIS file into the new layout
Note that this copies not only cell A but also all sub-cells of A. So if you do this into an empty layout there are no issu…
I don't think it makes sense to do this operation box by box. You could do it but then first you have to transform all the shapes up to a common top cell which is more work. Instead do a Boolean "not" operation on the shapes of two layers.…
First look at the GDSII file in KLayout in GUI mode. Go to a hierarchy of "1" (e.g. hit the "1" key). Now you should see all instances in the top cell, plus you'll see any other shapes also included in the top cell (in the "…
This depends on the use of GDSII layers in the design which is determined by the PDK. Sometimes people use a dedicated GDSII datatype for the pins, and if that's being done it's easy to find them, just write out the boxes for this layer, and look fo…
I think the major foundries accept GDSII or OASIS. Conversion from one to the other has never been a problem for me (either with KLayout or a commercial tool) and so to save time I always save the data i need in OASIS format. The issue with industry…
We only use the MEBES format for post-fracture data to check the masks before they are written (our foundries send us MEBES data for inspection, but I usually convert it to OASIS anyway). I would stay away of it as it is really just for the mask wri…
For a user deep copy means that the entire tree is copied and converted to new cells (with different names in the database, because this is what you need when you want to change the sub-tree later without affecting the original tree). What I see rig…
I suggest using OASIS instead of GDSII. OASIS results in much smaller file sizes. GDSII is outdated. I only convert my OASIS to GDSII at the final step when my counterpart needs GDSII. Cleaning up the GDSII after the fact is technically possible but…
Hi John, if your time is valuable the fastest way to get results is to buy a $200-400 lease return workstation on ebay, install Ubuntu 18.04, and run KLayout there. This is what I have been doing for my home computing for years. You can search for &…
Just to close this, I followed Matthias's instructions and now I have the Python module working with Python 3.6.7 on Windows (the canonical install from python.org). This is good, mainly because it makes it easy to share the module with others.
Als…
Hi Matthias, thanks, I'll have a look at how setuptools work. Actually, my solution (WSL with Pycharm on Windows) has been working really well (because I can use the Python either on the Windows Subsystem for Linux side, or also the Python in our Li…
The rotation is expressed in units of 90 degrees (see doc), so in Python this works:
trans = klayout.db.Trans(270, False, 0, 0)
which means that in Ruby this should work:
trans = Trans::new(270, false, 0, 0)
Cheers, Erwin
E.g. like this (using the klayout module from PyPI.org.
To install it into your Python: Python bin directory/pip3 install klayout
import osimport sysimport klayout.db as kllay = kl.Layout()layer_map = lay.read(sys.argv[1])print(layer_map.to_string(…
Hi Matthias, thanks for the explanation, this is what I thought. I of course have a workaround, by creating an instance of the KLayout cell and call that one rather than using inheritance.
Best regards, Erwin
Hi simg: You need to be a bit careful with this. The layers are later used for mask making (in general, using Boolean operations) and so certain GDSII or OASIS layer numbers are combined to make masks. So you really can't merge GDS files which have …
Hi Mikhail, typical IC layout databases have a pre-defined grid, typically 1nm. The data is stored as integer number of grid points, not real numbers. So at some point from a sine to GDSII or Oasis, the layout will be grid-snapped. I am not sure whe…
I think there are 3 different cases depending on what the user needs:
* Overwrite ==> Replace existing cell in layout with new cell which potentially has different subcells & shapes & texts, and if they already exist, they get overwritte…
For what it's worth, I generated the Python module "klayout" using the setup.py file on RHEL6, generated a 40MB test vehicle (compressed gds), and did XOR against the same Python script run within KLayout. The XOR was clean. So this is pre…
Hi Mikhails, you can run the new version with the Python scripting on Windows today, if you have Windows 10. (I admit this is cheating, but ...) Following:
https://seanthegeek.net/234/graphical-linux-applications-bash-ubuntu-windows/
I have downl…
I built on Ubuntu. The build finishes. The install fails with:
/usr/bin/ld: cannot find -lklayout_ext
This is when I do "make install" in the build-debug directory (which may be the wrong thing to do).
If I manually copy the init.py file …
Hi Matthias, how do you want to handle the discussion, on this forum or using your klayout email? I am one step further, I got the repo from github, compiled again, and now find the pykl module (but not in the installed build directory, only in the …
Hi All, I downloaded the pymod branch and built it on Linux but I didn't get a pykl module or directory in the build directory. Is there a build option needed to get the pykl module? Thanks.
Hi All, I actually don't see a need to wrap the Qt GUI classes into a Python module. The point of the GUI is to run the app, so I don't see why I would start the app from Python. On the other hand, the Python module is a way to modify the content in…
Hi Matthias, I am very interested in that. Let me know if I can help testing. I did read through your code (very beautiful, by the way) but I can't claim I understand the wrapping for Python completely. Let me have a look.
Hi Muheng, I very much look forward to Matthias's work of having a database module which can be used from a normal Python, but until then, you can still use PyCharm but you have to set the interpreter (in PyCharm) to be a windows batch file with the…