DRC Clean and Raw modes

edited January 2014 in KLayout Support
Hi,

I'm working on a DRC script it looks like the behaviour of raw and clean modes doesn't work as documented in the help file.

To test this, I am using a layout with three overlapping polygons. Two on 1 layer, and the third on a seperate layer.

and the following drc script:

layer1 = input(1)
layer1c = input(1).clean
layer1r = input(1).raw
layer2c = input(2).clean
layer2r = input(2).raw

layer1.output("Default")
layer1c.output("Clean")
layer1r.output("raw")

layer1c.not(layer2c).output("combined_clean")
layer1r.not(layer2r).output("combined_raw")

All three inputs of layer 1 output the same, in what I understand to be raw mode (Seperate polygons), while the output of both not operations is merged into a single polygon, where I would have expected the not of two raw layers to also be raw.

Have I misunderstood the purpose of clean and raw or is this a bug?

Cheers,

Graeme

P.S. Thanks Matthias for your efforts with KLayout so far.

Comments

  • edited November -1

    Hi Graeme,

    thanks for asking that. Your observation is correct, but the intention of raw/clean is actually a different one. The difference is not in the output of an operation but in the interpretation of the input.

    In "clean" mode, polygons are conceptually merged into bigger shapes when they touch before the operation is applied, while in raw mode they are not. "conceptually" means, that the output will differ if the operation is sensitive to that difference. Specifically, "rawness" does not propagate to the output of an operation, but rather influences the interpretation of the input. Raw mode is useful mainly for original input layers.

    "not" is not a good example, since the "not" operation is not sensitive to the size or extension of a polygon - if I subtract "B" from another set of polygons ("A"), the result will look the same, regardless if I subtract B from every polygon part of A or first merge touching/overlapping polygons of A and then subtract B from that. Hence, the "not" operation does not differentiate between raw and clean input. Currently, it will implicitly merge since that is the way the scanline boolean implementation works. A future and more efficient implementation might choose not to produce merged output in any case.

    An example for an operation sensitive to the "rawness" of input is the area selection (with_area) - for a raw layer, this operation might select different polygons since smaller parts have a different area. Another operation is the overlap detection ("merge" with an overlap count > 1). That is only possible for raw mode layers since the definition of "clean" layers is that overlaps are removed.

    Hope that makes things somewhat clearer.

    Regards,

    Matthias

  • edited November -1
    Hi Matthias,

    Thanks for the response - that certainly clears up my confusion about what I was seeing in my test cases.

    The reason I was looking into this is that in my full layout, I generate a layer using:

    M4 = M4I.not(M4S)
    and then check:

    M4.enclosing(ETCH)

    Running this check takes about 12 hours as is - I suspect because the result of the not operation merges the resulting M4 layer into a single giant polygon. Running the enclosing check on the original M4I layer only takes about an hour - in practice the two layers should be (almost) the same, since M4S is only a small area containing some rectangles. My hope was to force the derived layer to maintain it's raw state to try and speed up the DRC check.

    Since "not" is doing the implicit merge, I'll try and break this down another way. Thanks again for the quick response.

    Cheers,

    Graeme
  • edited November -1

    Hi Graeme,

    You may be right about the merging, but in the case of "not" it won't be effective. It's rather the output which is already a giant polygon. In general, performance is not the primary scope of KLayout's DRC engine, so there are some limitations. You might try to employ tiling (see http://www.klayout.de/doc/manual/drc_runsets.html#h2-639) to break your layout into smaller parts which reduces memory consumption and may be faster. This option also allows to utilize multiple CPU's.

    Matthias

Sign In or Register to comment.