Cif visualisation glitch and writing bug with a cell rotated by 5 degrees

Hi,

I've written a simple cif generation library.
It gives out the following file:

(CIF generated by the cifwrite library);
DS2 1 10;
9 test_cell2;
L L1D0;
B 1000 1000 500,500;
DF;
DS3 1 10;
9 test_encore;
L L1D0;
DF;
DS1 1 10;
9 test_top_cell;
L L1D0;
C3 R100000,0 T0,0;
C2 R99500,9983 T0,0;
DF;
E

When opening the file with klayout (0.26.5), the square appears to have the upper left corner truncated.
When I try to save this file under another name, incorrect numbers are used for the rotation and the file can't be opened anymore.

Is there anything I should optimize differently, or is this a klayout bug?

Comments

  • I noticed as well, that the coordinates of the square get wrongly evaluated in klayout to:
    center = (0.4995, 0.4995)
    size = (0.999, 0.999)
    when I open the file with a resolution of 0.001 um

  • edited May 2020

    I can confirm the writer bug, but the reader bug I can't.

    Here is my result for reading:

    My reader options are these:

    What's your OS?

    Matthias

  • I have created a ticket for the writer issue: https://github.com/KLayout/klayout/issues/568

    Matthias

  • Hi,

    Thank you for your quick reaction! :)
    I'm using windows 10, the x64 build.
    I can can only reproduce the rendering bug with my surface pro and windows 2004.
    On a more regular PC, the display is correct, but the coordinates aren't:

  • edited May 2020

    Hi again,

    The rendering bug doesn't happen anymore, I can't explain why, I have no idea what changed between yesterday and today.
    I also generated a bigger design and the square is still appearing with the wrong coordinates. All the other polygons seem to be correct.

    (CIF generated by the cifwrite library);
    DS1 1 10;
    9 test_cell2;
    L L1D0;
    B 1000 1000 500,500;
    P 0,0 4000,0 4000,3000;
    W 250 -1000,-1000 -1000,-2000 -2000,-1000;
    R 3000 500,-3000;
    DF;
    DS2 1 10;
    9 test_encore;
    L L2D0;
    C1 R99500,9983 T1000,1000;
    C1 R99500,-9983 T3000,3000;
    P -118,-39 -228,-31 -324,-7 -410,33 -484,90 -544,159 -587,241 -612,334 -620,437 -611,553 -579,656 -526,743 -453,817 -359,873 -245,914 -113,938 42,947 60,947 60,754 -42,749 -130,734 -205,710 -265,678 -313,635 -347,584 -367,522 -374,453 -370,388 -354,332 -328,283 -292,242 -248,209 -196,186 -135,171 -66,167 29,175 115,202 190,246 255,308 305,386 342,477 364,581 372,699 372,754 60,754 60,947 372,947 372,986 366,1069 348,1140 320,1199 281,1246 229,1281 165,1306 86,1322 -5,1328 -70,1325 -133,1318 -197,1306 -260,1291 -324,1270 -387,1246 -450,1218 -510,1186 -510,1432 -443,1456 -378,1478 -313,1495 -249,1510 -188,1520 -126,1530 -66,1534 -5,1537 83,1532 166,1522 242,1504 312,1482 375,1449 431,1412 482,1368 526,1317 549,1281 569,1242 585,1198 599,1151 608,1094 615,1027 619,947 620,856 620,0 372,0 372,222 330,159 283,106 230,60 173,24 110,-4 40,-24 -36,-36;
    P 9090,0 9846,2000 10003,2000 10003,1787 9985,1729 9883,1414 9659,787 10345,787 10089,1529 10003,1787 10003,2000 10168,2000 10910,0 10623,0 10418,566 9583,566 9380,0;
    DF;
    DS3 1 10;
    9 test_top_cell;
    L L1D0;
    C2 R98007,19867 T0,0;
    DF;
    E
    

  • Ok, thanks. Looks like the problem is reproducible on Windows 64bit.

    I'll take a look.

    Best regards,

    Matthias

  • Hi,

    I think I have fixed both bugs.

    You can try the regular master build from here: https://www.klayout.org/downloads/master/windows/klayout-0.27-win64-install.exe

    This preliminary installer isn't signed and it represents the unstable development head. If the bugfix is good it will go into the next 0.26 maintenance release.

    Regards,

    Matthias

  • Yes, it seems to work

    Regards,

    Théophane

  • Very good, I'll include it in 0.26.6.

    Thanks for reporting this issue. CIF isn't used quite often anymore. I think that's the reason this issue escaped so far.

    Best regards,

    Matthias

  • I've noticed a related bug with cell rotation angles when writing CIF files. In the example below the original GDSII version of this file has eight cells drawn at 45 degree rotation intervals but the CIF file has the angle vector for the 135 degree cell as -1,-1 when it should be -1,1. Two cells are drawn with the rotation angle -135 degrees rather the one at 135 degrees and the other at -135 degrees. I use klayout-0.26.5-win64-install.exe.

    (CIF file written by KLayout);
    DS 1 1 10;
    9 arrow;
    L L1D0;
    P 50000,-14000 50000,-10000 0,-10000 0,0 0,10000 50000,10000 50000,14000 60000,0;
    DF;
    DS 2 1 10;
    9 TOP;
    C1 R1,0 T0,0;
    C1 R1,1 T0,0;
    C1 R0,1 T0,0;
    C1 R-1,-1 T0,0;
    C1 R-1,0 T0,0;
    C1 R-1,1 T0,0;
    C1 R0,-1 T0,0;
    C1 R-1,-1 T0,0;
    DF;
    DS 3 1 10;
    9 LAYOUT;
    DF;
    E

  • Hi john,

    thanks for mentioning this. I did not encounter arbitrary angle rotations so far. And I start loathing CIF ...

    Here is ticket for this: https://github.com/KLayout/klayout/issues/578

    Matthias

Sign In or Register to comment.