• 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. Change instance name prefixes automatically

Stats

  • Replies 1
  • Subscribers 148
  • Views 167
  • Members are here 0

Change instance name prefixes automatically

MF202512032436
MF202512032436 5 days ago

Hi all,

I would like to change all instance name prefixes for a group of cells placed in a schematic:

Example:

All cells with the cell-name starting with "nch" (so n-MOS devices) should have the instance name prefix "N". The old prefix M or MN should be removed.

Thanks for your help

Martin

  • Cancel
  • Sign in to reply
Parents
  • Andrew Beckett
    Andrew Beckett 5 days ago

    Martin,

    This code (that I threw together, so not especially polished) can do this easily enough:

    procedure(CCFrenameInsts(@key (cv geGetEditCellView()) cellPattern fromPattern replacement "gttt")
      let((
        (cellPat pcreCompile(cellPattern))
        (fromPat pcreCompile(fromPattern))
        instName changed
        )
        foreach(inst cv~>instances
          when(pcreExecute(cellPat inst~>cellName)
            instName=pcreReplace(fromPat inst~>name replacement 1)
            unless(inst~>name==instName
              inst~>name=instName
              changed=t
            )
          )
        )
        changed
      )
    )

    You'd use it like this:

    CCFrenameInsts(?cellPattern "^nch" ?fromPattern "^MN?" ?replacement "N")

    The ?cellPattern is a regular expression for the matching cell names (i.e. begins with nch); the ?fromPattern is a regular expression for matching instance names (begins with M, followed by 0 or 1 N) and the replacement is what you want that part of the instance name to be replaced with.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 5 days ago

    Martin,

    This code (that I threw together, so not especially polished) can do this easily enough:

    procedure(CCFrenameInsts(@key (cv geGetEditCellView()) cellPattern fromPattern replacement "gttt")
      let((
        (cellPat pcreCompile(cellPattern))
        (fromPat pcreCompile(fromPattern))
        instName changed
        )
        foreach(inst cv~>instances
          when(pcreExecute(cellPat inst~>cellName)
            instName=pcreReplace(fromPat inst~>name replacement 1)
            unless(inst~>name==instName
              inst~>name=instName
              changed=t
            )
          )
        )
        changed
      )
    )

    You'd use it like this:

    CCFrenameInsts(?cellPattern "^nch" ?fromPattern "^MN?" ?replacement "N")

    The ?cellPattern is a regular expression for the matching cell names (i.e. begins with nch); the ?fromPattern is a regular expression for matching instance names (begins with M, followed by 0 or 1 N) and the replacement is what you want that part of the instance name to be replaced with.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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.

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

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