Home > Community > Forums > Custom IC SKILL > Library of all instances

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Library of all instances 

Last post Tue, Oct 20 2009 6:58 AM by marbs. 8 replies.
Started by marbs 15 Oct 2009 05:10 AM. Topic has 8 replies and 2411 views
Page 1 of 1 (9 items)
Sort Posts:
  • Thu, Oct 15 2009 5:10 AM

    • marbs
    • Top 100 Contributor
    • Joined on Mon, Jun 15 2009
    • Posts 63
    • Points 810
    Library of all instances Reply

     Hello sir ,

    I would like to ask, how can I display the library 

    of all the instances in my libray by using SKILL ?

     

    I've got a skill code below from one of my officemate, 

    but I think it is not running very well.  It can not display the library 

    of all the instances . 

     

    Please help. 

     

    Thanks in advance . 

     

    Marbs

     

     

     

    ;;;============================================================================================
    ;;; procedure name        : vxl_GetlibName
    ;;;    argument(inputs)
    ;;;    retern
    ;;;    function
    ;;;    history
    ;;;        06/4/05
    ;;;============================================================================================
    procedure(test()
    let((
        libName_Field
        uncomparisonLibName_Fild
        getLibName_Form
        )

        libName_Field = hiCreateStringField(
            ?name        'libName_Field
            ?prompt        "Library Name"
            ?value        ""
        )

        uncomparisonLibName_Fild = hiCreateStringField(
            ?name        'uncomparisonLibName_Fild
            ?prompt        "Uncomparison Library"
            ?value        ""
        )


        getLibName_Form = hiCreateAppForm(
            ?name            'getLibName_Form
            ?buttonLayout    'OKCancelApply
            ?fields            list(
                                list(libName_Field                0:10    350:25    150)
                                list(uncomparisonLibName_Fild    0:40    350:25    150)
                            )    
            ?callback        "GetlibName()"
            ?formTitle        "Get Cell Library Name"
        )

        hiDisplayForm(getLibName_Form)

    );let
    );procedure




    procedure(GetlibName()
    prog((
        libName
        uncomparisonLibName
        l_uncomparisonLibName
        lib_id
        cv_open
        outPort)

    ;;; get parameter value
        libName = getLibName_Form->libName_Field->value
        uncomparisonLibName = getLibName_Form->uncomparisonLibName_Fild->value

    ;;; change ""--->list()
        l_uncomparisonLibName = parseString(uncomparisonLibName)

    ;;; check libName
        unless(parseString(libName)
            println("********* Error : Input Library Name *********")
            return(nil)
        )
        
    ;;; get lib_id
        lib_id    = ddGetObj(libName)
        outPort = outfile("./libName.txt" "w")

    foreach(cell lib_id~>cells
        ;;; open cv
        cv_open = dbOpenCellViewByType(lib_id cell~>name "layout" "" "r")

    /*
        println("-----------------------------------------------------------------------------")
        println(cell~>name)
        fprintf(outPort "-----------------------------------------------------------------------------\n")
        fprintf(outPort "%s \n" cell~>name)
    */

        if(cv_open == nil then
            println("-----------------------------------------------------------------------------")
            println(cell~>name)
            fprintf(outPort "-----------------------------------------------------------------------------\n")
            fprintf(outPort "%s \n" cell~>name)
            println("********* Error *********")
            fprintf(outPort "********* Error *********\n")
        else
    /*
            println("-----------------------------------------------------------------------------")
            println(cell~>name)
            fprintf(outPort "-----------------------------------------------------------------------------\n")
            fprintf(outPort "%s \n" cell~>name)
    */
            foreach(int cv_open~>instances
                unless(member(int~>libName l_uncomparisonLibName) ;int~>libName == pdk_name
                    println("-----------------------------------------------------------------------------")
                    println(cell~>name)
                    fprintf(outPort "-----------------------------------------------------------------------------\n")
                    fprintf(outPort "%s \n" cell~>name)
                    printf("%s %s \n" int~>libName int~>cellName)
                    fprintf(outPort "%s %-20s \n" int~>libName int~>cellName)
                
                
        
                
                
                );unless

        
        
        
        
                
                
                
            );foreach
            
            
            
            
        ;;sprintf( reportFile "./countFile.tmp")
        ;cqsh("touch ./countFile.tmp")
        outPort = outfile("./countFile.tmp")
        ;;outPort = outfile(reportFile)
        fprintf(outPort "  \n  ELEMENTS LIBRARY:\n")
        fprintf(outPort "\n ============================================================\n" )
        fprintf(outPort "  Cell Name       Library Name      Master Name")
        
        fprintf(outPort "\n ============================================================\n" )
        
        
        
        foreach(int cv_open~>instances
                unless(member(int~>libName l_uncomparisonLibName) ;int~>libName == pdk_name
                    println("-----------------------------------------------------------------------------")
                    println("  ")
                    
                    println(cell~>name)
                    
                    fprintf(outPort "  ")
                    fprintf(outPort "%s   |" cell~>name)
                    printf("%s %s \n" int~>libName int~>cellName)
                    ;fprintf(outPort "%s %-20s \n" int~>libName int~>cellName)
                       
                       
                       
                        fprintf(outPort "  %s  " int~>libName )
                        fprintf(outPort "         ")
                        
                        fprintf(outPort "|  %s    \n" int~>cellName )
                
                                fprintf(outPort " --------------+-----------------+---------------------------\n")
                    
                
                
                );unless

        
        
        
        
                
                
                
            );foreach
        
        
        
        
        
        fprintf(outPort " ============================================================\n" )
        fprintf(outPort "            List of Elements Library ends here .  " )
        fprintf(outPort "\n ============================================================\n" )
        close( outPort)
        view("./countFile.tmp" list(0:0 500:683) "ELEMENTS LIBRARY")
        ;csh("/bin/rm ./countFile.tmp")
        t
            
            
            
            
            
        
            
            
            
            
            
        );if
        
    );foreach

    println(";;;;;;;;;;;;;;; End ;;;;;;;;;;;;;;;")
    ;fprintf(outPort "%s\n" ";;;;;;;;;;;;;;; End ;;;;;;;;;;;;;;;")

    ;close(outPort)



    );let
    );procedure

     

     

     

     

     

     

     

     

     

    • Post Points: 20
  • Thu, Oct 15 2009 3:48 PM

    Re: Library of all instances Reply

    I think (maybe, if I've understood your requirements properly) one of the functions in the code attached could help.

    Best Regards,

    Andrew.

    • Post Points: 5
  • Thu, Oct 15 2009 3:57 PM

    Re: Library of all instances Reply

    The attachment didn't appear to work, so I'll paste it here instead:

    /* abNewLibraryRefs.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jan 12, 1999 
    Modified   Feb 19, 2003 
    By         A.D.Beckett
    
    Uses the new ccpExpand facilities to expand library data,
    either using the pc.db files (parent child databases),
    or using config files to find all the cellViews or libraries
    used. This is quicker than opening databases, and also supports
    configurations.
    
    Each of the four functions can be used externally.
    
    ***************************************************
    
    SCCS Info: @(#) abNewLibraryRefs.il 02/19/03.09:56:33 1.2
    
    */
    
    /****************************************************************
    *                                                               *
    *    (abNewCellViewRefs libName cellName viewName @optional     *
    *              (expandMode 'CCP_EXPAND_COMANAGED))              *
    *                                                               *
    *  Expand the specified cellView, returning a list of lists of  *
    *  cellView information. The expandMode is the keyword to pass  *
    *  to ccpExpand.* functions to say what files to include. The   *
    * default should be adequate for most cases. The expansion will *
    *   follow through the complete design hierarchy, into other    *
    *  libraries, since it uses the pc.db and config information.   *
    *                                                               *
    ****************************************************************/
    
    (procedure (abNewCellViewRefs libName cellName viewName @optional
    			      (expandMode 'CCP_EXPAND_COMANAGED))
      (let (spec expanded cellViews cellViewInfo obj)
           (setq obj (ddGetObj libName cellName viewName))
           (setq spec (gdmCreateSpecFromDDID obj))
           (setq expanded
    	     (cond 
    	      ((ddGetObj libName cellName viewName "pc.db")
    	       (ccpExpandDesign spec expandMode))
    	      ((ddGetObj libName cellName viewName "expand.cfg")
    	       (ccpExpandConfig spec expandMode))
    	      (t
    	       (setq specList (gdmCreateSpecList))
    	       (gdmAddSpecToSpecList spec specList)
    	       (ccpExpand specList expandMode))
    	      ))
           (gdmResetSpecList expanded)
           (while (setq spec (gdmNextFromSpecList expanded))
    	      (when (and
    		     (setq cellViewInfo (gdmInspectSpec spec "LibraryUnix"))
    		     (equal (cadddr cellViewInfo) "master.tag"))
    		    (rplacd (cddr cellViewInfo) nil)
    		    (setq cellViews (cons cellViewInfo cellViews))
    		    )
    	      )
           cellViews
           ))
    
    /**********************************************************************
    *                                                                     *
    *             (abNewLibraryRefs libName @optional sorted)             *
    *                                                                     *
    *  Get all cellViews in a library, invoke abNewCellViewRefs on them,  *
    *     and then collate the information into a list of lists. The      *
    * optional argument is a flag to indicate that the information should *
    *                             be sorted.                              *
    *                                                                     *
    **********************************************************************/
    
    (procedure (abNewLibraryRefs libName @optional sorted)
      (let (libObj cellViews cellViewTable)
           (unless
    	(setq libObj (ddGetObj libName))
    	(error "Could not open library %s\n" libName)
    	)
           /* create a table - easy way of removing duplicates */
           (setq cellViewTable (makeTable 'cellViewTable))
           /* visit all cells */
           (foreach cell (getq libObj cells)
    		/* visit all cellViews */
    		(foreach view (getq cell views)
    			 /* get all the references, even through other libs */
    			 (setq cellViews 
    			       (abNewCellViewRefs
    				libName (getq cell name) (getq view name)))
    			 /* record any cellViews used in the table */
    			 (foreach cellView cellViews
    				  (setarray cellViewTable cellView t))
    			 ))
           /* pull out everything from the table */
           (setq cellViews nil)
           (foreach cellView cellViewTable
    		(setq cellViews (cons cellView cellViews)))
           /* if sorted has been supplied and set to non-nil, sort the
    	  list before returning it */
           (when sorted
    	     (setq cellViews
    		   (sort cellViews 
    			 /* comparison function - sorts strings in lists */
    			 (lambda (a b)
    				 (while (and
    					 (car a) (car b)
    					 (equal (car a) (car b)))
    					(setq a (cdr a))
    					(setq b (cdr b)))
    				 (and (car a) (car b) 
    				      (alphalessp (car a) (car b)))
    				 ))
    		   ))
           cellViews
           ))
    
    /*************************************************************************
    *                                                                        *
    *                      (abNewLibrariesUsed libName)                      *
    *                                                                        *
    * Process the library, expand the design hierarchies and configurations, *
    *   and find out all the libraries referenced, directly or indirectly.   *
    *                                                                        *
    *************************************************************************/
    
    (procedure (abNewLibrariesUsed libName)
      (let (libs)
           (foreach cellView (abNewLibraryRefs libName)
    		(unless (member (car cellView) libs)
    			(setq libs (cons (car cellView) libs))))
           libs
           ))
    
    /****************************************************************************
    *                                                                           *
    *         (abNewLibrariesUsedByCellView libName cellName viewName)          *
    *                                                                           *
    * Process the cellView, expanding the hierarchy, and find out all libraries *
    *                    referenced, directly or indirectly.                    *
    *                                                                           *
    ****************************************************************************/
    
    (procedure (abNewLibrariesUsedByCellView libName cellName viewName)
      (let (libs)
           (foreach cellView (abNewCellViewRefs libName cellName viewName)
    		(unless (member (car cellView) libs)
    			(setq libs (cons (car cellView) libs))))
           libs
           ))
    

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Oct 19 2009 7:12 AM

    • marbs
    • Top 100 Contributor
    • Joined on Mon, Jun 15 2009
    • Posts 63
    • Points 810
    Re: Library of all instances Reply

    Thank you for the code sir,

    But I don't know how to run it. 

    Kindly complete the skill code . 

     

    Thanks in advance, 

    Marbs 

    • Post Points: 20
  • Mon, Oct 19 2009 7:33 AM

    Re: Library of all instances Reply

    Well, reading the comments should help.

    For example, calling:

    abNewLibrariesUsedByCellView("myLib" "myCell" "schematic")

    would tell you all the libraries down through the hierarchy which were used.

    I wasn't intending to write the entire code for you - quite frankly your requirements are not that clear, and I don't really have time to do this. I was just trying to provide you with some functions that you could potentially use in whatever solution you came up with. 

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Oct 19 2009 7:51 AM

    • marbs
    • Top 100 Contributor
    • Joined on Mon, Jun 15 2009
    • Posts 63
    • Points 810
    Re: Library of all instances Reply

     What I mean sir is, to display all the instances library used 

    in the layout not in the schematic. 

    Is that possible sir ? 

    • Post Points: 20
  • Mon, Oct 19 2009 7:53 AM

    Re: Library of all instances Reply

    Can you use Design->Hierarchy->Tree ?

    I'm not entirely sure what "display all the instances library used" means - it's not a meaningful phrase in English.

    Andrew.

    • Post Points: 35
  • Mon, Oct 19 2009 7:59 AM

    • marbs
    • Top 100 Contributor
    • Joined on Mon, Jun 15 2009
    • Posts 63
    • Points 810
    Re: Library of all instances Reply

     I will try it tomorrow sir, because its getting late 

    in here.   Thank you very much for the reply . I will

    go home now. 

     

     

    Regards, 

    Marbs 

    • Post Points: 5
  • Tue, Oct 20 2009 6:58 AM

    • marbs
    • Top 100 Contributor
    • Joined on Mon, Jun 15 2009
    • Posts 63
    • Points 810
    Re: Library of all instances Reply

    Hello sir,

    I tried the script this morning, 

    success, it is working according to my 

    request. 

     

    Thank you very much . 

    Regards , 

    Marbs

     

     

     

     

     

     

     

     

     

    • Post Points: 5
Page 1 of 1 (9 items)
Sort Posts:
Started by marbs at 15 Oct 2009 05:10 AM. Topic has 8 replies.