klayout icon indicating copy to clipboard operation
klayout copied to clipboard

DRC: Extent marks layout as dirty/modified

Open akrinke opened this issue 1 year ago • 2 comments

Calling extent marks the layout as modified, although nothing should have changed.

Steps to reproduce: Load layout and run the following DRC script.

Checked with version 0.29.7.

active_layout = RBA::CellView::active.layout
active_cellname = RBA::CellView::active.cell_name
source(active_layout, active_cellname)
a = extent()

akrinke avatar Nov 15 '24 08:11 akrinke

Ah, well ...

Actually, "extent" creates a temporary layer. That layer is deleted at the end of the script, but it will render the layout modified.

The reasoning is that with a cell filter, the generated layer will be made from the bounding boxes of the cells, where these are stored directly inside the cell. This enables interoperability with all the other features, like clipping, cell filtering etc.

For a plain top-level box (simple "extent") that would not be required. Still it is implemented in the same way - for example to properly support clipping.

If you need a plain bounding box and don't use clipping for example, you can use that substitute which does not set the modified flag:

def readonly_extent
  DRC::DRCLayer::new(self, RBA::Region::new(source.cell_obj.bbox))
end

Matthias

klayoutmatthias avatar Nov 17 '24 19:11 klayoutmatthias

Thanks for the explanation and the alternative! Since I'm only interested in the bounding box, it should work for me.

It was just unexpected that a DRC command apparently changes the layout.

Andreas

akrinke avatar Nov 18 '24 16:11 akrinke