• 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. How to programtically rename a selected pin

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 145
  • Views 17088
  • 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

How to programtically rename a selected pin

polygon pusher
polygon pusher over 16 years ago

 What would the skill code look like to rename a selected pin in a layout(Virtuoso)?

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

    Not exactly what you want, but hopefully enough to get you started...

     

    /* abReplaceTermNames.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 26, 2007 
    Modified   
    By         
    
    Function to replace a substring in a terminal - uses regular
    expression functions. For more details, see the comments below,
    but:
    
    abReplaceTermNames(cvId "from" "to")
    
    is a typical usage.
    
    ***************************************************
    
    SCCS Info: @(#) abReplaceTermNames.il 06/26/07.13:26:16 1.1
    
    */
    
    /******************************************************************
    *                                                                 *
    *  abReplaceTermNames(cvId pattern replace @optional (index 1))   *
    *                                                                 *
    *    Look for any terminal names in the view with a name which    *
    *   matches the regular expression pattern. When found, replace   *
    *    the matching pattern with the string replace. Normally it    *
    * will replace the first occurrence, but that can be changed with *
    * the optional index argument. Returns t if anything was changed. *
    *                                                                 *
    ******************************************************************/
    
    procedure(abReplaceTermNames(cvId pattern replace @optional (index 1))
        let((existTerm newName newNet changed)
    	rexCompile(pattern)
    	foreach(term cvId~>terminals
    	    when(rexExecute(term~>name)
    		newName=rexReplace(term~>name replace index)
    		existTerm=dbFindTermByName(cvId newName)
    		if(existTerm then
    		    warn("Cannot rename %s to %s as terminal already exists with that name" term~>name newName)
    		else
    		    ;----------------------------------------------------
    		    ; Update the name, and update the net too
    		    ; (by creating a new one and merging it)
    		    ;----------------------------------------------------
    		    term~>name=newName
    		    newNet=dbMakeNet(cvId newName)
    		    dbMergeNet(newNet term~>net)
    		    ;----------------------------------------------------
    		    ; Then update any labels attached to pin figures;
    		    ; textDisplays will be updated automatically, so it's
    		    ; only conventional labels we need to worry about
    		    ;----------------------------------------------------
    		    foreach(pin term~>pins
    			foreach(child pin~>fig~>children
    			    when(child~>objType=="label"
    				child~>theLabel=
    				    rexReplace(
    					child~>theLabel
    					replace
    					index
    				    )
    			    ) ; when label
    			) ; foreach child
    		    ) ; foreach pin
    		    changed=t
    		) ; if
    	    ) ; when
    	) ; foreach
    	changed
        ) ; let
    ) ; procedure
    
    

    Regards,

    Andrew.

     

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

    Not exactly what you want, but hopefully enough to get you started...

     

    /* abReplaceTermNames.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 26, 2007 
    Modified   
    By         
    
    Function to replace a substring in a terminal - uses regular
    expression functions. For more details, see the comments below,
    but:
    
    abReplaceTermNames(cvId "from" "to")
    
    is a typical usage.
    
    ***************************************************
    
    SCCS Info: @(#) abReplaceTermNames.il 06/26/07.13:26:16 1.1
    
    */
    
    /******************************************************************
    *                                                                 *
    *  abReplaceTermNames(cvId pattern replace @optional (index 1))   *
    *                                                                 *
    *    Look for any terminal names in the view with a name which    *
    *   matches the regular expression pattern. When found, replace   *
    *    the matching pattern with the string replace. Normally it    *
    * will replace the first occurrence, but that can be changed with *
    * the optional index argument. Returns t if anything was changed. *
    *                                                                 *
    ******************************************************************/
    
    procedure(abReplaceTermNames(cvId pattern replace @optional (index 1))
        let((existTerm newName newNet changed)
    	rexCompile(pattern)
    	foreach(term cvId~>terminals
    	    when(rexExecute(term~>name)
    		newName=rexReplace(term~>name replace index)
    		existTerm=dbFindTermByName(cvId newName)
    		if(existTerm then
    		    warn("Cannot rename %s to %s as terminal already exists with that name" term~>name newName)
    		else
    		    ;----------------------------------------------------
    		    ; Update the name, and update the net too
    		    ; (by creating a new one and merging it)
    		    ;----------------------------------------------------
    		    term~>name=newName
    		    newNet=dbMakeNet(cvId newName)
    		    dbMergeNet(newNet term~>net)
    		    ;----------------------------------------------------
    		    ; Then update any labels attached to pin figures;
    		    ; textDisplays will be updated automatically, so it's
    		    ; only conventional labels we need to worry about
    		    ;----------------------------------------------------
    		    foreach(pin term~>pins
    			foreach(child pin~>fig~>children
    			    when(child~>objType=="label"
    				child~>theLabel=
    				    rexReplace(
    					child~>theLabel
    					replace
    					index
    				    )
    			    ) ; when label
    			) ; foreach child
    		    ) ; foreach pin
    		    changed=t
    		) ; if
    	    ) ; when
    	) ; foreach
    	changed
        ) ; let
    ) ; procedure
    
    

    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