There can be multiple 'top' cells. Top just means that a cell has no parent cell. Which is usually the case when you write/export a gds file.
Some documentation: (ctrl-f top and you'll find it)
https://www.klayout.de/doc-qt5/programming/database_ap…
You'll need to add this to the end of your script:
... idx = ly.layer(a) cell.shapes(idx).insert(r) #new code # select the top cell in the view, set up the view's layer list and # fit the viewport to the extensions of our layout mv.current_…
In DRC you can do something like this to get all points per polygon in a string output:
deep #usually faster but you can remove to perform a flat operation#Go through each layer in current viewlayers.each {|lay| input(lay).data.each {|shape| …
Those two lines are just creating a new gds in the same folder as your current gds (that way you don't overwrite data). You can write them however you see fit, but make sure they don't match any existing gds files.
Here is the target drc method docu…
I recommend the clipping tool, as well, the hierarchy aspect is great!
As for going through each layer - here's a DRC example:
cv = RBA::CellView::activeinputDir = File.dirname(cv.filename)target("#{inputDir}\\out_clip.gds", "OUT_C…
The 'smooth' function might be good to use. It removes a specified 'roughness' of shapes.
You can do this with the DRC engine here:
https://www.klayout.de/doc-qt5/about/drc_ref_layer.html#smoothed
Example
#input layersmetal = input(11, 0)#derived …
Adding on to Tomas - here is a link to a ruby pCell circle sample if you want to see the implementation and methods used:
https://klayout.de/doc/programming/ruby_pcells.html
You’re best bet would be using the drc engine and the function “fill”:
https://www.klayout.de/doc/about/drc_ref_layer.html#fill
You’ll also need to NOT your metal layer with the fill in order to get the holes you’re looking for. If you require m…
The default properties shown are based on the cell the shape originates from, in your case INV2. By checking off Absolute (accumulated) transformations you're just applying the transformations accumulated in the cell hierarchy from that shape's cell…
Hi Kim,
I'm not familiar with all the inner workings of drc functions, but it looks like the output drc function will spit out kLayout's internal database type and not the drc's database type: #<RBA::EdgaPairs:> vs #<DRC::DRCLayer:>
To…
Like Matthias mentioned antenna_check computes the areas of the specified layers , which are connected, so if you set the ratio value to 0 then it should grab all shapes of the layer connected to those nets. Here's an example using antenna_check to…
Instead of looking for where the two regions differ you want to know where they exactly match? If that's the case then it sounds like the opposite of an XOR operation...
This is what I came up with:
a_AND_b = region_A.and(region_B) #common overlap…
The main benefit I would get is having the association between the device type (diode_dev), device name (Dev_A), its coordinates, and its net in one extraction for parsing out. But it would be a 'nice to have' feature, unless there is a more useful …
Oops I didn't include everything - I still can: (I'll include output file for reference)
* cell TOP.SUBCKT TOP* net 1 dev,pad_Chip_A* net 2 dev,pad_Chip_B* net 3 dev,pad_Chip_C* net 4 dev,pad_Chip_C...* cell instance $1 r0 *1 0,0X$1 1 Pad* cell ins…
Thanks @Matthias!
There are multiple nets per chip so I added a bit of code to map the chip text to the appropriate pad text:
...chip_mask = input(11, 0)#Derived Layerschip_mask = chip_mask.merged#Flatten text to top level - makes parsing the …
Thank you for the response @Matthias,
Here is an example and I'll also include my GDS/LVS deck:
(Image)
In the example I have arrays for both the pads and devices with each being labeled respectively.
When I run the LVS deck flat the output spic…