Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

cell.bbox in DRC

edited December 3 in KLayout Support

How to use the cell.bbox in a DRC file ?

nwell = input (1,0)
cellBulk = RBA::CellView::active.cell.bbox
pwell = cellBulk - nwell

But, the last command does not work, because I cannot mix a bbox with a polygon.
Here, I cannot use make_polygon : I need it for the extraction of NMOS in triple well.

Thank you,



  • Hi Laurent,

    the "extent" function will simply return the bounding box of the input layout:

    nwell = input(1,0)
    cellBulk = extent
    pwell = cellBulk - nwell

    (you just need to be careful not to define a layer with this name).

    Best regards,


  • Thank you Matthias.

    I tried it, but it is not compatible with deep (hierarchical) extraction. I works for a simple cell without hierarchy, but find different nets at higher level. The solution I use so far is a boundary layer for all cells including a device, and no boundary for the cells that only include cells.

    cellBulk = input(100,0)   # Boundary layer
    nwell = input(1,0)
    tpwell = input(2,0)   # Triple well layer
    #cellBulk = extent
    bulk    = cellBulk  - tpwell - nwell
    pwell  = (cellBulk - nwell) + (tpwell - nwell)

    I need to add (tpwell - nwell) because the tpwell is surrounded by nwell and then excluded from the cellBulk.


Sign In or Register to comment.