Precise positioning, snap to center of array?

edited August 2014 in Layout
I just start to use Klayout. I used AutoCAD a lot. But recently I have needs of creating large arrays of objects. It is almost impossible for autoCAD, but it seems the Klayout can handle them smoothly. So I guess I am going to use Klayout a lot from now on. It is a powerful tool.

However, as an autoCAD user, I feel confused by the entire philosophy of this tool. I hope someone can give me a education about this. The online doc is rather a walk through of the menu items which is not enough for me.

1. What is the purpose and concept of Layout, panel, layer, cell, item? What is the hierarchical relationship between them? which object contains what?

It seems like the cell is more like a block in autoCAD. It can contain other cell hierarchically. when new cell is created it will be on level 1. the level 0 is actually the layout? It seems like if I create an array instance in current cell, the instantiated cell will be nested under current cell. But how can I manually move one cell into another cell? Or It is completely determined by the program itself so I should not bother to control the level at all?

The screen will ONLY show the current selected `top` cell (can be controlled by the display level range). But how can I display all content of all level 1 cells? Or I misunderstand the purpose of the cell. There really should be just 1 top cell?

What is actually the layout, panel do?

2. how to edit the array after placed it? Some time I might need to modify the number of rows or cols. Or the separations.

3. Can I do a periodical separations? for example, nth row with y=-1 n+1th row with y=1, n+2th y=-1 ...

4. how can I precisely position the array based on the array centre?

5. in autoCAD we can snap to lots of points: centre, corner, tangent ... What the object snap do in klayout? I guess there will be completely different design flow for klayout. How can I precisely position objects, arrays? At least I want the relative position to be controllable. Can I reset the origin of the objects like what we do in Blender?

6. is there anyway I can automatically reset the cell origin to the centre of the selections? Like the function `fit the page to drawing` in inkscape.

Thanks

Comments

  • edited November -1

    Hi,

    well, KLayout and AutoCAD are probably very different tools. The world of IC layout comes with a couple of concepts, specifically hierarchy and strict layering. The basis of KLayout is the GDS format and there are some substantial differences to AutoCAD files:

    • GDS is far more simple that typical CAD formats. Just polygons, rectangles, simple texts and paths. No bulges, hatches, ellipses, splines etc.
    • GDS does not store the layer representation (colors, stipples etc.).
    • GDS files are therefore usually accompanied by a technology description - which layers has what meaning and maybe colors and styles to use.
    • GDS layers typically have a specific meaning, often they represent material on the wafer surface. Sometimes these layers have a logical function, i.e. to mark certain regions.
    • GDS texts may not be plain labels, they can act as markers for carry net information.
    • GDS properties allow to attach custom information to objects.
    • GDS file can be very big (several ten GB are not uncommon). OASIS is a format which is similar to GDS, but better optimized to carry much more data even.
    • Even though GDS is not an official standard, portability of GDS files is usually very good (compared to DXF for example).
    • Hierarchy is very common in GDS - you have small cells which represent low-level devices (transistors, contacts) from which you build bigger cells (gates, latches etc.), from those you build macros and finally your top-level assembly. In GDS cells are always placed using their coordinate origin (0, 0) as the reference point. Transformations include rotation and mirroring, (uniform) magnification is possible but deprecated in some applications. Rotation is sometimes constrained to multiples of 90 degree.

    KLayout is not primarily a drawing tool to replace real CAD tools. It's an editor for simple applications. It's main capabilities are to handle big data volumes and the scripting capabilities. I'd never try to compare the editing capabilities with AutoCAD.

    Regarding the Arrays - what you see is what GDS offers. You can specify a corner instance and two step vectors plus two dimensions. That's basically all. Everything beyond that would exceed the capabilities of GDS and require incompatible enhancements.

    Regarding 5.) - maybe Edit/Selection/Align is what you are looking for. But I'm aware it's not a convenient snapping feature.

    Regarding 6.) - Edit/Cell/Adjust Origin is your friend I guess.

    Regards,

    Matthias

  • edited November 2014
    Hi,

    I'm kind of having the same problem here while trying to create a simple layout from scratch (just one layer for starters).

    Basic idea:
    - create pattern, select, make cell from selection
    - instantiate several arrays of that pattern/cell in the layout
    - create some useful hierarchy of cells, that contain one/some/all of the arrays

    Problems I did not solve so far:
    1. If the initial (single) pattern is part of the top-level cell, you'll always have the single pattern as a leftover next to your arrays, deleting it deletes everything (actually makes sense). --> workaround: create one or more additional top-level cells and put the single patterns there - I've no idea whether this is good practice or not.

    2. Arrays cannot be moved separately after they are placed in the layout. Moving will actually shift the origin of the initial single pattern and therefore shifts all arrays at the same time. In case you have several rotated arrays this will completely mess things up.

    3. Creating cells from one or more selected arrays somehow transformes the initial single pattern into your new array cell --> instances that were not selected will disappear (initial cell is now empty) plus the unity of the array(s) gets destroyed --> individual patterns loose their connection.

    4. Creating the whole layout via Ruby-script does not work for me since I'm not familiar with Ruby. (Lookin' forward to a stable release with Python-support)

    Since I seem to fail in so many ways, I guess I'm not getting the concept either. Can someone please give me a short overview of the typical workflow with KLayout? I already got lost in the documentation...
  • edited November 2014

    Hi rellachs,

    There is a tiny switch which makes a big difference for you: if you check "Select Top Level Objects" in the "View" menu, you'll notice that the tool behaves rather differently.

    Let me explain: if you have cells and a hierarchy there are basically two ways to manipulate a layout.

    The first way is to manipulate the shapes. If the shapes are inside a cell and since cell instances are basically "live copies" of each other, manipulating shapes inside one instance will also affect the other instances of the cell. So if you delete a shape or all shapes, the other instances of that cell will loose those shapes too. If "Select Top Level Objects" is OFF, you'll happen to select shapes down in the hierarchy.

    The second way is to edit the cell instances (or placements). This is what happens if "Select Top Level Objects" is ON. If you click on a shape that is in some child cell, not the shape but the cell instance will be selected. This is what "top level object" means - the shapes are not on the top level (this is: in the current cell). Instead the cell instance is the object inside the current cell. If you delete a cell instance, the instantiated cell will not be modified. It's just the placement which is gone. If you move a cell instance, only that placement will change and the other instances of the cell will not be affected. The "arrayness" of a placement is a property of the instance too. Double click on an instance and the properties dialog will open. In that dialog you can edit the array properties of the instance too.

    The "Select Top Level Objects" settings will survive a restart of the program. Just pick the desired mode and leave it like that if you prefer the instance editing mode.

    Matthias

Sign In or Register to comment.