How to get TOPCELLNAME from a GDS file without opening any GUI?

Discussion in 'Cadence' started by Manju Arasaiah, Jun 25, 2004.

  1. Is there any unix command or utility that gives out the topcellname
    given a GDS2 file? I do not want to open any GUI.

    Thanks, Manju
     
    Manju Arasaiah, Jun 25, 2004
    #1
  2. Manju Arasaiah

    gennari Guest

    I have a program that calculates the top cell of a GDSII file along with
    other information such as the number of cells, number of shapes, list of
    layers, etc. What operating system do you want it for? I have it compiled
    for MS Windows/PC and can probably compile it for other OSes.

    Frank
     
    gennari, Jun 26, 2004
    #2
  3. Manju Arasaiah

    torki Guest

    torki, Jun 27, 2004
    #3
  4. Frank,

    thanks! Pls send me a "Solaris" version.

    Manju
     
    Manju Arasaiah, Jun 28, 2004
    #4
  5. Manju Arasaiah

    fogh Guest

    Kholdoun,
    do you know also a program that is open source ?
    I found so far:
    - a perl module that is unreadable to mere mortals
    - a C program that is too restricted (expects stream data that is not compulsory and crashes when it s not there).

    I made a few tests to turn GDS2 to openGL code, compile and run, and that looks OK ; but I still rely on a proprietary GDS2 stream-to-text converter.
     
    fogh, Jul 19, 2004
    #5
  6. Manju Arasaiah

    gennari Guest

    I'm curious what you have that converts GDSII into openGL. Do you mean the
    OpenGL that is an open source graphics library? I didn't know it had it's
    own code format.

    I do have a program that prints the top cell that I sent to Manju and I can
    send to you, but it's part of a larger product and is not open source.

    Frank

    compulsory and crashes when it s not there).
    looks OK ; but I still rely on a proprietary GDS2 stream-to-text converter.
     
    gennari, Jul 20, 2004
    #6
  7. Manju Arasaiah

    fogh Guest

    Gen,

    This is a small set of makefile+shell+textutils that will convert gds2-text into C source that calls openGL functions. It then compile this code for X11+openGL and fly over using mouse and keyboard, but I eventually want to make a routine that takes care of flying over. I could use a "flock of boids" kind of algorithm for that flight. It would be trivial to make it compile for SDL+openGL thus also under windows and Mac.
    What I wrote is very crude, still. It handles only polygons and paths and does not make use of of techfile info to generate textures or more layout editor-alike colors. It could also use better guessing of the Z-axis dimensions (it is now only using gds2 number for color and Z). I tested it on a rather small structure of PADs+ESD+power nets+recognition patterns, so I can garanty how well this scales. But problems with big chips can probably be attacked by carefully/dynamically choosing the parameters of the openGL engine.
    In the end, of course I want something that does not require a compilation, and of course stg that can read gds2-binary. You simply drop your gds2 file in a directory, set some optional preferences for fly-over and rendering, and that's it.
    But now that I know it _can_ work, I am not so much insterested in going on. It would not be the first idea that I abandon this way...

    The GDS2 format is described in cadence docs by it's Bachus-Naur form. Ideally, the program would use this BNF as a config file for how to read streamfile. But I am not experienced enough with lex/yacc to turn that directly into stg I can use. I read somewhere that lisp is quite good at language transformation jobs, too. But all that rather new and murky to me. If there is a CS guru who can spend some time helping, that would be nice.

    Anyway that's but a toy. Though I could maybe defend the idea that this half-conscious repeated exposure to a layout could let someone catch mistakes of a different nature than those that can be caught during peer-review criticism of layouts.
     
    fogh, Jul 23, 2004
    #7
  8. Manju Arasaiah

    Ronald Guest

    Some of the gds reader tool defined before are good.

    In Cadence flow, you could use pipo to get the top cell name.
    This is a dummy way but as effective to get the data.

    Make a script which
    1. build a pipo streamin file, example file /tmp/tmp.pipo
    streamInKeys = '(nil
    runDir "/tmp"
    errFile "/tmp/PIPO.debug.100967565"
    inFile "/home/ronald/mycellname/all.gds"
    dataDump "/tmp/stout.ronald.100967565"
    scale 0.001
    units "micron"
    caseSensitivity "preserve")
    2. run "pipo strmin /tmp/tmp.pipo "
    3. Parse /tmp/PIPO.debug.100967565 until you find the first line
    with "1. scanning cellview"... This line indicates
    the top cell name and its cell view.
    Example:
    1. scanning cellview (libcell_ronald layout)
    You know that your top cell is libcell_ronald

    thanks,
    ronald
     
    Ronald, Jul 23, 2004
    #8
  9. Manju Arasaiah

    gennari Guest

    Your idea is very interesting. Is this code open source? This is exactly in
    my area of interest, so I would like to try working on this project if I
    have time. I have the GDSII binary parser and 2D/3D display code and a
    virtual reality game/simulator that I have been working on, so it shouldn't
    be that hard to do.

    Frank

    gds2-text into C source that calls openGL functions. It then compile this
    code for X11+openGL and fly over using mouse and keyboard, but I eventually
    want to make a routine that takes care of flying over. I could use a "flock
    of boids" kind of algorithm for that flight. It would be trivial to make it
    compile for SDL+openGL thus also under windows and Mac.
    and does not make use of of techfile info to generate textures or more
    layout editor-alike colors. It could also use better guessing of the Z-axis
    dimensions (it is now only using gds2 number for color and Z). I tested it
    on a rather small structure of PADs+ESD+power nets+recognition patterns, so
    I can garanty how well this scales. But problems with big chips can probably
    be attacked by carefully/dynamically choosing the parameters of the openGL
    engine.
    compilation, and of course stg that can read gds2-binary. You simply drop
    your gds2 file in a directory, set some optional preferences for fly-over
    and rendering, and that's it.
    on. It would not be the first idea that I abandon this way...
    Ideally, the program would use this BNF as a config file for how to read
    streamfile. But I am not experienced enough with lex/yacc to turn that
    directly into stg I can use. I read somewhere that lisp is quite good at
    language transformation jobs, too. But all that rather new and murky to me.
    If there is a CS guru who can spend some time helping, that would be nice.
    half-conscious repeated exposure to a layout could let someone catch
    mistakes of a different nature than those that can be caught during
    peer-review criticism of layouts.
     
    gennari, Jul 23, 2004
    #9
  10. Manju Arasaiah

    oghdayan Guest

    Gen,

    I ll post the "code" lower, but this is just scriptology. It is not
    GPL or licensed in anyway.
    What it does is simply generate C/C++ code from the ascii GDS as it is
    created by "cslist" gds. This cslist utility is from catena GmBh's layed
    package, and requires no license. ( The generated C file has the
    extension cpp but it doesn t make any use of cpp ). I tested this on the
    Abacus gds2 example file from some gds2viewer (from dolphin, if I
    remember well).

    I am a bit ashamed to post such dirty code here, but lets go. The shell
    script is this:
    ______________
    #!/bin/bash
    #

    #usage: cslist2cpp.sh Abacus.cslist > Abacus.cpp
    if [ -z "$1" ] ; then infile="Abacus.cslist" ; else infile="$1" ; shift ; fi
    if [ -z "$1" ] ; then outfile="Abacus.cpp" ; else outfile="$1" ; fi

    awk -f strbound.awk $infile >a
    cat a | sed -n '/^void/ { s/$/;/ ; p }' >b



    cat b a c >$outfile
    rm -f a b c
    echo $0 : done. Generated $outfile
    ______________
    and the strbound.awk called is this:
    ______________
    BEGIN{RS=")" ; firststream=1;
    printf("#define VX glVertex3f\n");
    printf("#define CL glColor4f\n");
    }

    function nlp() { gsub("[(]",""); }
    function nbra() { gsub("\\[.*\\]",""); }
    function tilangleorcoord() {
    while ( ($1 != "ANGLE") && ($1 != "XY") ) { getline; }
    ;}
    /BGNSTR/{
    getline;
    nlp(); streamfunc=$NF
    if(firststream != 1) {
    printf("\tglPopMatrix();\n");
    printf("} /* end streamfunc */\n");
    }
    firststream=0;
    printf("void streamfunc_%s(float x, float y, float
    angle)\n{\n",streamfunc);
    printf("\tglPushMatrix();\n");
    printf("\tglTranslatef(x,y,0);\tglRotatef( angle, 0, 0, 1 );\n");
    }
    ## how to extract prototypes: sed -n '/^void/ { s/$/;/ ; p }' . cf
    cslist2cpp.sh
    /SREF/{
    nlp(); streamref=$NF ; angle=0 ;
    tilangleorcoord()
    if($1 == "ANGLE") {nlp(); angle=$NF ; tilangleorcoord() ;}
    if($1 == "XY") {nlp(); coords=$NF ;}
    printf("streamfunc_%s( %s ,%f );\n",streamref,coords,angle);
    }
    #/^[:space:]BOUNDARY/,/^[:space:]{2}ENDEL/{
    /BOUNDARY/{
    # getline ; #print
    gsub("[(]",""); layer=$3 ;
    Zcoord=1000.0*layer ;
    red=100*(127.0-layer) ; green=100*(0.0+layer);
    blue=100*(63.5+sqrt((63.5-layer)**2));
    red=and(red,255)/255 ; green=and(green,255)/255 ;
    blue=and(blue,255)/255 ;
    alpha=0.5
    printf("CL(%f,%f,%f,%f);\n",red,green,blue,alpha);
    tilangleorcoord();
    nlp() ; nbra() ; gsub("XY","");
    printf("glBegin(GL_POLYGON);\n\t");
    for(i=1;i<=NF;i++){ printf("VX( %s, %s); ", $i, Zcoord ) ; }
    printf("\nglEnd();\n");
    }
    ## how to add a close function at the end: ( printf "\tglPopMatrix();\n"
    ;printf "} /* end streamfunc */\n" ; ) >>
    END{printf("\tglPopMatrix();\n") ; printf("} /* end streamfunc */\n") ; }

    ### about the code in the cpp file:
    # adding a glEnable(GL_BLEND); around the main sref.
    #

    ______________

    I included the resulting *.cpp file in a slightly modified version of
    this openGL intro:
    http://www.gametutorials.com/download/Ports/OpenGL/Camera5_SDL.zip
    I can remember that I modified the following in Init.cpp:
    void InitializeGL(int width, int height)
    {
    glEnable(GL_DEPTH_TEST); // Enables
    Depth Testing
    /////////////Fred addon; from NeHe's lesson08
    /* Ambient Light Values ( NEW ) */
    GLfloat LightAmbient[] = { 0.5f, 0.5f, 0.5f, 1.0f };
    /* Diffuse Light Values ( NEW ) */
    GLfloat LightDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
    /* Light Position ( NEW ) */
    GLfloat LightPosition[] = { 0.0f, 0.0f, 2000.0f, 1.0f };

    /* Enable smooth shading */
    glShadeModel( GL_SMOOTH );
    /* Set the background black */
    glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
    /* Depth buffer setup */
    glClearDepth( 1.0f );
    /* Enables Depth Testing */
    glEnable( GL_DEPTH_TEST );
    /* The Type Of Depth Test To Do */
    glDepthFunc( GL_LEQUAL );
    /* Really Nice Perspective Calculations */
    glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
    /* Setup The Ambient Light */
    glLightfv( GL_LIGHT1, GL_AMBIENT, LightAmbient );
    /* Setup The Diffuse Light */
    glLightfv( GL_LIGHT1, GL_DIFFUSE, LightDiffuse );
    /* Position The Light */
    glLightfv( GL_LIGHT1, GL_POSITION, LightPosition );
    /* Enable Light One */
    glEnable( GL_LIGHT1 );
    /* Full Brightness, 50% Alpha ( NEW ) */
    //glColor4f( 1.0f, 1.0f, 1.0f, 0.5f);
    /* Blending Function For Translucency Based On Source Alpha Value */
    glBlendFunc( GL_SRC_ALPHA, GL_ONE );
    /////////////////
    //enable blending
    glEnable( GL_BLEND ); glDisable( GL_DEPTH_TEST );
    //enable light
    glEnable( GL_LIGHTING ); /* this makes now all whiteish. need
    material ? */
    //material. taken from the OGL pdf.
    GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat mat_shininess[] = { 50.0 };
    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
    glEnable(GL_COLOR_MATERIAL);
    /////////////////////////////Fred done
    SizeOpenGLScreen(width, height); // resize
    the OpenGL Viewport to the given height and width
    }
    ________________

    I also customised the mouse/keyboard events and the numbers (this
    example deals with a normalised world whereas DBUs in GDS2 are making
    numbers >> 1 )

    In the end that gave me a 3D representation with transparancy and
    ambient light that was still nicely responsive (on a P4 machine with
    320MB and nvidia with 32MB, under linux mandrake. )
     
    oghdayan, Jul 26, 2004
    #10
  11. Manju Arasaiah

    torki Guest

    Fogh,

    I used long ago this link to translate a layout to VRML format :
    http://www.sfu.ca/~rjohnsto/ciftoansys.html
    It starts from CIF, and it is quite old now. I haven't found
    something similar starting from GDSII.

    We have our internal tools wrote in Pascal to manipulate directly
    GDSII files. But unfortunately they are not available for outside.

    Regards,
    =================
    Kholdoun TORKI
    http://cmp.imag.fr
    ==================
     
    torki, Jul 28, 2004
    #11
  12. Manju Arasaiah

    torki Guest

    torki, Jul 28, 2004
    #12
  13. Manju Arasaiah

    oghdayan Guest

    merci du tuyau, Torki.
    I will consider generating VRML rather than opengl commands.
    I am in the same situation. Our software branch has the program
    "cslist", and I could probably read the source if I ask, but I can t use
    it in anything I can release open/free.
     
    oghdayan, Jul 31, 2004
    #13
  14. Manju Arasaiah

    Spaller Guest

    This is true only in the case where the gdsII file is created as a streamOut
    of a given top cell, and that particular file was created in top-down order.

    The later versions of pipo stream out in bottom-up order, so the last cell
    would be the "top cell".

    The "top cell" is in quotes since an entire library could have been streamed
    out, and so there could be multiple top cells in the gdsII file.

    In that case, the top cells would be those which are not referenced by any
    other cell, but that is an entirely different thing that pipo will not tell
    you.

    spaller
     
    Spaller, Aug 24, 2004
    #14
  15. The "errFile" contains a section where are listed the topcells.
    This section comes just after the "scanning" and "translating" sections.

    .......
    Saving all cells ...


    Top Cells in File

    --------------------------------------------------------------------------
    top_cell layout


    List Hierarchy (#cellInst,#arrayInst)

    --------------------------------------------------------------------------
    top_cell layout
    ..top_core layout(1)
    ...block1 layout(1)
    ....my_block1 layout(2)
    ....my_block2 layout(1)
    ....my_block3 layout(16)
    etc ....


    Regards,
    =================
    Kholdoun TORKI
    http://cmp.imag.fr
    ==================
     
    Kholdoun TORKI, Aug 24, 2004
    #15
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.