It looks like you're new here. If you want to get involved, click one of these buttons!
Hi everyone,
I am using Python to create a complicated layout.
In it, I created a cell which contains a whole Die. This cell is inserted into the top cell which contains the entire wafer.
I can manually select the cell, go edit->selection->make array and duplicate it to cover the wafer. Can this be done in the Python script?
For simplifying, let's assume there's a cell named "Cell_Die" which has a single 2000x3000um box in it. I want it to be duplicated with dx=3000 and dy=4000 over the entire wafer (a cell named "Cell_Wafer"), and also be able to move it slightly (for example in the above scenario, I want the wafer end to be at x=1500 of the die that touches it).
Thanks for the help!
Shoval.
Comments
Hi Shoval,
I think I don't understand precisely what's the issue. If you're able to place one cell in Python, just use this code in a loop and place the cell multiple times.
Or am I missing something?
Matthias
Hi Matthias,
I managed to solve the problem by using the CellInstArray to insert it multiple times using a transformation with dx, dy. Previously I inserted the die into the wafer without it, and it would place the (0,0) of the die on the (0,0) of the wafer.
Shoval
Hi Matthias,
I am currently using the following code, but I currently only see one instance (n = 8)
Am I missing something? I guess the other alternative is inserting an array instead of single cells, but any help is appreciated.
Thanks!
So actually, I found that it is stepping and placing instances. However, for whatever reason, the scale seems to be off.
pitch = self.pitch+2*self.length
Where self.pitch and self.length are TypeDouble
When using the debug points, these numbers look normal and equal 36.5. When I zoom in, I see that it did indeed place the number of instances I had asked for except that the step size is only 0.0365.
When I "correct" the pitch by multiplying by 1000, it looks to be correct, but I would like to get to the bottom of why the scale is off by 1000 here, but not elsewhere in my code?
pitch = (self.pitch+2self.length)1000
If anyone can clarify why this is happening that would be much appreciated.
Thanks in advance!
Hi @CreatedByCreator,
You're using "DTrans" for the transformation, but put it into a "CellInstArray" object, which is by definition using integer DBU units. That is not consistent and the effect is that "CellInstArray" will convert the "DTrans" into integer units, but not applying the DBU.
You have to use "DCellInstArray" instead of "CellInstArray" to consistently work with micrometer units.
In short, KLayout can work with database units - that is integer multiples of the DBU value, which in your case seems to be the default of 1nm. Or it can work with micrometer units with some limitations. In that case you have to use different object types and some limitations apply - like boolean operations, which are only available in integer space. You mixed up these spaces, hence your micrometer values will be seens as integers and taken as DBU multiples. Hence instead of 36 micrometer, you get 36 nanometer.
There is an explanation of that concept here: https://www.klayout.org/klayout-pypi/overview/layout/.
Matthias
Thanks Matthias! I didn't realize there was the DCellInstArray, but that makes sense now.
I also didn't realize there was a whole other python documentation here: https://www.klayout.org/klayout-pypi/
Thanks for putting together all the documentation!