• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Library of all instances

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 143
  • Views 17278
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Library of all instances

marbs
marbs over 15 years ago

 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

 

 

 

 

 

 

 

 

 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information