pCell flatten/Convert to static causing "XY record expected error"

edited July 2023 in KLayout Support

Hi

Recently I've occasionally run into a file error after I convert some of
my pCells into static cells and save it.


https://i.imgur.com/HDDNorY.mp4

The file opened and saved without issue while the pCell is not connected.

After flattening the pCells, saving the file, and re-open it, it sometimes
triggers "XY record expected error" image above (a)

It won't cause an error right after flattening and the file can still be edited if it's not closed.
For testing, I've tried to remove everything after flattening but the "empty"
file still causes the same error

The workaround is to copy the flattened shape to a new file and save the new file,
which no longer triggers the issue. image above (b)

This suggests the error might be bound to the cell instead of the shapes inside,
I assume this is why an "emptyCell" file can also cause the same issue.

Saving the file into OAS also solves the issue, but once you convert it back to gds, the same
error disappears. image above (c)


Here are three gds sampls in the zip file:

1 emptyCell with error.GDS

A gds with an "empty" top cell, but still causing "XY record expected error".

2 pCell - Cause error after convert to static.GDS

A gds with a pCell that will trigger an error after conversion

3 pCell - No error after convert to static.GDS

A gds with the same pCell, but different cell parameters, no error triggered
file #2 #3 have the same pCell. same location all parameters same except for one
that defines the path slant part lenght.


i've also tried and successfully load the gds files that generate error into other software,
the shape still holds, and the file is not corrupted.

I wonder if there's any way to avoid this, thanks in advanced.

Comments

  • Maybe a closer look at the differences in parameter value / style,
    between the failing and succeeding PCell instantiations? The
    error seems to complain about missing args / values?

  • edited July 2023

    @RawrRanger Many thanks for this nicely prepared report. For me the files crash without "convert to static".

    I assume something is broken with your PCell code (which I do not have). Analysis shows that the Pcell produces path objects with zero points which make the reader fail. Those objects are generated on layer 0/0 - in case this helps.

    You should now try to debug your PCell code and find how these paths are created. Paths with zero points do now make sense. Maybe they are created under some boundary conditions. but in that case, you should skip them.

    Matthias

  • Hi Matthias

    Thanks for look into the files and error, this makes alot of sense to me now.

    Indeed I use empty arrays in some cases to suppress paths that I would like to drop, which should be the cause of this error.

    And thats why when I move all the selectable shapes into a new file, the new file will not trigger the same issue, because the zero point path is not selectable, and will be leave in the "empty" cells.

    The zero points lines seems being dropped during the gds --> oas --> gds conversion, which happens to make the file "normal" again.

  • @RawrRanger Yes, I think your analysis makes sense.

    If you do not generate such invalid paths, everything should work as expected.

    Matthias

Sign In or Register to comment.