Error reading GDSII file


Can anyone tell me what this error message is, and if there's any way to resolve it? I'm trying to read in a gds file created on another application. It must be messing up a field that klayout needs, but I can't tell what it is.

Comments

  • edited December 2023

    It looks like the exception was thrown from:

    The function signature implies that when creating a new cell (from your GDS2 file),
    a cell name might be missing (empty).

    A buddy command line tool, strm2txt, would help.

    $ strm2txt  [options]  <input>  <output>
    
    $ strm2txt -h (for detailed help)
    

    An example run of strm2txt

    Since you are using a Mac version, see the instructions shown below.

  • I'll give it a shot, sekigawa-san. Thank you

  • @BillG and @sekigawa "strm2txt" may not work as it reads the file before writing it as text and the reader will fail already.

    For the purpose of debugging file issues I created a direct conversion tool (https://github.com/klayoutmatthias/dump_oas_gds2). However, there are only sources, no binaries. There is a Makefile which should be good enough for most cases, but building it is in particular easy on Linux.

    Matthias

  • Hello @Matthias,

    I understand it. I'll try to make the debugging tools in different environments.

    Kazzz-S

  • edited December 2023

    Hello @BillG,

    I could build the above dump tools on macOS Monterey using Apple clang version 14.0.0.
    ===> https://github.com/klayoutmatthias/dump_oas_gds2/issues/2#issuecomment-1863817572
    If you need the executables (for Intel Mac), I can provide you with them.

    I also found another simple GDS2-->ASCII dump tool in Python suggested by ChatGPT.
    I have modified the original code a bit.
    ===> https://github.com/Kazzz-S/gds2ascii-tool-project


    1. dump_gds2 testdata/gds/t10.gds

    000000000   00 06 00 02              HEADER
    000000004   02 58                      600
    000000006   00 1c 01 02              BGNLIB
    000000010   07 e0 00 0a 00 1c 00 17    2016-10-28 23:42:45
    000000018 + 00 2a 00 2d
    000000022   07 e0 00 0a 00 1c 00 17    2016-10-28 23:42:45
    000000030 + 00 2a 00 2d
    000000034   00 08 02 06              LIBNAME
    000000038   4c 49 42 00                "LIB"
    000000042   00 14 03 05              UNITS
    000000046   3e 41 89 37 4b c6 a7 f0    0.001 <=== "Correct!"
    000000054   39 44 b8 2f a0 9b 5a 54    1e-09 <=== "Correct!"
    000000062   00 1c 05 02              BGNSTR
    000000066   07 e0 00 0a 00 1c 00 17    2016-10-28 23:42:45
    000000074 + 00 2a 00 2d
    000000078   07 e0 00 0a 00 1c 00 17    2016-10-28 23:42:45
    000000086 + 00 2a 00 2d
    000000090   00 0a 06 06              STRNAME
    000000094   54 52 41 4e 53 00          "TRANS" <=== "Cell Name"
    000000100   00 04 08 00              BOUNDARY
    000000104   00 06 0d 02              LAYER
    000000108   00 02                      2
    000000110   00 06 0e 02              DATATYPE
    000000114   00 00                      0
    000000116   00 2c 10 03              XY
    000000120   ff ff fd 76 ff ff fe 25    -650,-475
    000000128   ff ff fd 76 00 00 01 db    -650,475
    000000136   00 00 02 8a 00 00 01 db    650,475
    000000144   00 00 02 8a ff ff fe 25    650,-475
    000000152   ff ff fd 76 ff ff fe 25    -650,-475
    000000160   00 04 11 00              ENDEL
    :
    :
    :
    

    2. gds2ascii.py testdata/gds/t10.gds

    ['HEADER', [600]]
    ['BGNLIB', [2016, 10, 28, 23, 42, 45, 2016, 10, 28, 23, 42, 45]]
    ['LIBNAME', ['L', 'I', 'B', '\x00']]
    ['UNITS', [8.165836334228516e-09, 7.980852135579423e-33]]         <=== Incorrect! They are in the IBM 370 floating point format!
    ['BGNSTR', [2016, 10, 28, 23, 42, 45, 2016, 10, 28, 23, 42, 45]]
    ['STRNAME', ['T', 'R', 'A', 'N', 'S', '\x00']]                    <=== "Cell Name"
    ['BONDARY', []]
    ['LAYER', [2]]
    ['DATATYPE', [0]]
    ['XY', [-650, -475, -650, 475, 650, 475, 650, -475, -650, -475]]
    ['ENDEL', []]
    ['BONDARY', []]
    ['LAYER', [4]]
    ['DATATYPE', [0]]
    ['XY', [-510, -310, -510, -90, -290, -90, -290, -310, -510, -310]]
    ['ENDEL', []]
    ['BONDARY', []]
    ['LAYER', [4]]
    ['DATATYPE', [0]]
    ['XY', [-510, 90, -510, 310, -290, 310, -290, 90, -510, 90]]
    ['ENDEL', []]
    ['BONDARY', []]
    ['LAYER', [4]]
    :
    :
    :
    

    Kazzz-S

  • I have fixed the bug of gds2ascii.py.

    2-retry. gds2ascii.py testdata/gds/t10.gds

    ['HEADER', [600]]
    ['BGNLIB', [2016, 10, 28, 23, 42, 45, 2016, 10, 28, 23, 42, 45]]
    ['LIBNAME', ['L', 'I', 'B', '\x00']]
    ['UNITS', [0.001, 1e-09]] <=== "Correct!"
    ['BGNSTR', [2016, 10, 28, 23, 42, 45, 2016, 10, 28, 23, 42, 45]]
    ['STRNAME', ['T', 'R', 'A', 'N', 'S', '\x00']] <=== "Cell Name"
    ['BONDARY', []]
    ['LAYER', [2]]
    ['DATATYPE', [0]]
    ['XY', [-650, -475, -650, 475, 650, 475, 650, -475, -650, -475]]
    ['ENDEL', []]
    ['BONDARY', []]
    ['LAYER', [4]]
    ['DATATYPE', [0]]
    ['XY', [-510, -310, -510, -90, -290, -90, -290, -310, -510, -310]]
    ['ENDEL', []]
    ['BONDARY', []]
    ['LAYER', [4]]
    ['DATATYPE', [0]]
    ['XY', [-510, 90, -510, 310, -290, 310, -290, 90, -510, 90]]
    ['ENDEL', []]
    ['BONDARY', []]
    ['LAYER', [4]]
    : 
    : 
    : 
    
Sign In or Register to comment.