data base units

edited March 2014 in General
Sorry if this is kind of a basic question but i didnt get it.
Do you recommend to work always with DBU of 0.001?how do i know the real size of shapes in microns?does the ruler shows the real size?
By some reason i drow a whole layout with a DBU of 1e-5,do i need to fix it,and again how can i be sure what is the real sizes in micron?


  • edited March 2014

    Hi Shirly,

    the database unit is an internal unit and represents the finest grid you can draw a layout on. Your layout may be much bigger or drawn on a coarser grid, but the database unit is the very limit imposed by the file format. 1nm is a good compromise unless you work with very fine technologies that require a smaller resolution. KLayout will always show the real dimensions, except if you choose "show in database units" in the shape properties dialog for example.

    To change the database unit, just enter the desired new database unit in the database unit field in the save options. KLayout will take care to rewrite the shapes and cell instances to the new database unit. However, when you save to a bigger DBU or one that is not compatible with your layout design grid, snapping may occur and you should carefully check your layout for small gaps after that.

    Note, that if you change the database unit in "File/Layout Properties", the shapes and instance will not be rewritten and the layout will appear scaled after that.


  • edited November -1
    Hello Matthias
    Thanks for the answer.
    I have layout block of 10000um X12000um drawn in 1e-5 DBU.
    I try to make 10X10 array of this block,but it doesnt work.
    i can make only 2X2 array of this layout block.
    Any way to solve this out?
  • edited November -1

    Hi Shirly,

    1e-5 is simply too small. GDS supports 32bit coordinates, that is roughly -2e9 to 2e9 database units. With 1e-5 micron, the layout area available is -20mm to 20mm. Change the database unit to 1e-4 for example (or even better, 1e-3) by saving your layout with that DBU and you will be able to create a 10x10 array.


  • edited November -1
    Hello Matthias
    thanks,that helped me solving the problem.
    one small question-if i am changing the dbu of existing i need to add scaling factor in order to keep poligons in the same size?
  • edited November -1

    Hi Shirly,

    you just need to save the layout with a new database unit. Scaling is done automatically when you do so and the layout will look identical when you load it again.

    However, if you change the database unit in "Layout Properties", the shapes are not adjusted and therefore the layout will look differently afterwards.


  • edited November -1
    Hi Matthias,
    sorry to resurrect this old thread, but I can't find a way to change the database unit any other way than with "Layout Properties". How do I "save the layout with a new DBU"?

    Also my default DBU is set to 0.01 µm and I don't know how to change it (and can't remember if I have done this myself a year ago or so).

    I can't find any insightful information on the forums.
  • edited July 2017

    Hi Johannes,

    Ok, it's a bit hidden ... to change it, go to the technology manager (Tools/Manage Technologies). Pick the "(Default)" technology and on the "General" page you'll find the default database unit value.

    The idea is to associate the database unit with a "technology" - because it's a physical design unit related to the feature size and needs to be aligned with libraries or upsteam tools you're using. In the broader sense, a KLayout "technology" is some setup you provide for layouting and the database unit is part of that.

    There is always one default technology, but you can have more than that. In this case, the default database unit will follow the technology definition when you create a new layout and chose a particular technology.


  • edited November -1
    Thank you Matthias. I did specify a custom technology, but both that and the default have a DBU of 0.001 µm set.
    Still there is a preset of DBU 0.01 µm when I do File -> New Layout.

    I did find where this is saved and it's in the file "C:\Users\xxx\KLayout\klayoutrc", as are key-bindings etc.
    Maybe this information will help someone else (even though it's probably documented somewhere else, too ;) ).

    Best regards :)
  • edited November -1


    Yes, the configuration file is one place. Only Linux the location is "~/.klayout/klayoutrc" ... but actually I can't confirm it does not change with the technology. When I edit the technology's DBU, the default will change ...

    What version are you using?


  • Hi Mattias! I have a question in this topic: When I change the default dbunits in a technology, the new units do appear as the 'recommended' units when I hit create a new layout (grayed like in the image below). However, if I leave it empty for default, the applied units are not the ones I defined as default in my technology, but directly 0.001. Any idea why this happens? Is there a way to write a macro that enforces this behaviour (to set the tech default and not the global default)?

  • There's no real use for a DBU that's smaller than the finest
    mask spot size, in my book. Look at the foundry's template
    mask fab order form and you should see guidance in the
    fracture / spot size columns, with some variation according
    to layer geometries expected.

    But I think there's a "soft standard" where people who don't
    have any better idea, just all settle on 0.001 (1nm, plenty far
    from a care-about aside from the most aggressive modern
    flows). And those, like the rest, would be ready to tell you
    the foundry-specific Right Answer if asked (by an engaged
    customer, at least).

  • Well thanks for that discussion... but I guess this is simply a bug :(

    I have created a ticket:

    In general I'd not recommend going higher than 1nm. A DBU implies a grid, but using a too coarse value will take away numerical reserve and weird snapping will happen - e.g. on converting non-manhattan paths to polygons. Usually the motivation for a technology-specific DBU is to go below 1nm - for example because in advanced nodes sub-nm resolution is reality.


  • Hey Matthias, Thanks for creating the ticket.
    I agree on the units, but I'm working with a PDK that has a higher dbu, so I'm tied to it :neutral:

Sign In or Register to comment.