problem opening cif

edited April 2014 in File Formats
Hello All,

I tried opening a cif file on KLayout but all I got on the window was a square with the name "MainSymbol" inside. The file opens normally either on LayoutEditor or Clewin 5. Does anyone have an idea about what could be happening? I use KLayout on Linux Mint Debian.

Thank you!

Comments

  • edited November -1

    If the CIF is not too long of a file, then open it in a notepad and paste the characters in here. Then may be able to help debug.

    If it is too long to paste here, try opening a subset of that CIF. Or try making a simple CIF that is only a few commands long (like, just a box or something) and see if it opens in KLayout. I haven't had trouble in the past.

    David

  • edited November -1
    The CIF file I was using was made on Clewin 5 by a friend. I opened it in LayoutEditor, saved it as a new CIF file without any modification and then opened it successfully in KLayout. Maybe there is a problem with the way Clewin writes the CIF file and/or on the way KLayout is interpreting it (some incompatibility).

    David, like I said above, I got the original file from a friend, that's why I didn't post it here. I would like to talk to him before posting. In anyway, thank you for the help and attention!
  • edited November -1

    Hm, weird. OK yes there must be some slight differences in the file format. But glad it worked!

    If you have the time or desire you could do a quick text-based "diff" on the file and you could see the differences before and after it became compatible.

  • edited November -1
    Yes, good idea. The difference between the files that open and don't open lies in the very end of the file:
    - File that does not open:
    "...
    -9632000 -3916000 -9632000 -3850000;
    DF;
    C 1;
    E"

    - File that does open:
    "...
    -9632000 -3916000 -9632000 -3850000;
    DF;
    E"

    Observe that the difference is the line "C 1;". Just to make sure, I deleted this line from the original CIF file, saved it and then it opened normally. I don't know if this is an issue on Clewin 5 or KLayout, but this solves the problem.

    Thank you!
  • edited April 2014

    Well, I guess you have a hierarchy here ...

    What you see is the top cell - KLayout will not show the hierarchy in full detail initially by default. What you see is the top cell's bounding box. To get the full details, choose "Display/Full Hierarchy" or simply press "*".

    Does that fix your problem?

    If yes, you can configure KLayout to show the full details in "File/Setup", on the "Navigation/New Cell" page: check "Select all hierarchy levels" to make KLayout show the cell in all details.

    But I wonder why saving a file should solve that issue - maybe there is something wrong additionally. Saving should not modify the hierarchy. "C 1" is an instance of a cell with number 1. Is there a cell with that number in your CIF file (look for "DS 1 ...")?

    Matthias

  • edited April 2014
    Hi Matthias,

    You are right in your suppositions. Considering the original Clewin 5 file:
    - Pressing "*" or "Display/Full Hierarchy" in KLayout shows all the designed layouts.
    - Yes, there is a DS1 in the beginning of the file, it is pasted bellow
    "(Top level);
    DS1 1 10;
    9 MainSymbol;
    L L3;
    P -9638000 -525000 -9638000 -200000 -9200000 -200000 -9200000 -1700000 -17800000 -1700000"
    - There is also the "C 1;" line at the end.

    In the saved as file after LayoutEditor (the one that KLayout opens out of the box), there is the DS1 line ("DS 1 1 10")
    but not the "C 1;" line.

    I hope this helps!
    Thank you.
  • edited November -1

    OK so seems like the original file was opening correctly. (Pressing "*" is the usual way to view the entire hierarchy.)

    Looks actually like the second version (the one saved by LayoutEditor) is the "broken" one - as this appears to have messed up the original cell hierarchy (since you can see it in KLayout WITHOUT pressing "*").

  • edited November -1

    Hi all,

    I had a look into my sample CIF files and here is my explanation:

    Although CIF is among the well documented formats, there is no strict specification how to represent the GDS top cells in CIF. CIF features one anonymous top level and an optional number of sub cells. GDS has one to many named top cells. To represent a GDS hierarchy, usually the anonymous top level is used to establish the cells and optionally instantiate them. I found two possible ways to representing a single cell called TOP in CIF:

    DS 1;
    9 TOP;
    ... content of the top cell
    DF;
    E
    

    or

    DS 1;
    9 TOP;
    ... content of the top cell
    DF;
    C 1;
    E
    

    So both ways are possible, either with or without the call of the cell. The anonymous top level does not contribute information, whether it contains the C 1 line or not, so KLayout strips it.

    For writing it will chose the first format, so that explains why the C 1 line is gone. If other tools behave the same way, they should not show a difference between the two versions.

    That does not explain why both files are shown differently in KLayout. I was not able to reproduce the observations with some test cases I have. To me both files look identical whether they contain the C 1 line or not. I need to test that on other platforms yet.

    However, in general I assume the difference is rather cosmetic and not related to a loss of information.

    Matthias

Sign In or Register to comment.