• 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 replace only a pattern in a set of labels

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 14037
  • 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 replace only a pattern in a set of labels

ssram
ssram over 9 years ago

For example, if i've a bus label like bg_n<0>, bg_n<1>, bg_n<2>, what can i do to replace the n in those to p so that my new labels will be bg_p<0>, bg_p<1>, bg_p<2> ? It becomes really difficult sometimes changing these manually when there are over 200 pins in the custom layout. Anyone has a script to do this?

  • Cancel
  • ssram
    ssram over 9 years ago

    For example, if i've a bus label like bg_n<0>, bg_n<1>, bg_n<2>, what can i do to replace the n in those to p so that my new labels will be bg_p<0>, bg_p<1>, bg_p<2> ? It becomes really difficult sometimes changing these manually when there are over 200 pins in the custom layout.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    The forum guidelines tell you NOT to post duplicate posts, but you have done so: 

    ssram
    How to replace only a pattern in a set of labels
    For example, if i've a bus label like bg_n<0>, bg_n<1>, bg_n<2>, what can i do to replace the n in those to p so that my new labels will be bg_p<0>, bg_p<1>, bg_p<2> ? It becomes really difficult sometimes…
    By ssram over 9 years ago in Cadence Technology Forums > Custom IC SKILL
    3 replies
    Latest by Andrew Beckett over 9 years ago

    I will try to merge this post with the other thread.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    If it's just the labels you want to change, something like:

    origPattern=pcreCompile("bg_n")
    cv=geGetEditCellView()
    foreach(shape cv~>shapes
      when(shape~>objType=="label" && pcreExecute(origPattern shape~>theLabel)
        shape~>theLabel=pcreReplace(origPattern shape~>theLabel "bg_p" 0)
      )
    )

    Note that this doesn't try to be selective - so if you have labels which are "abg_ntest" then that would also get replaced to be "abg_ptest". You may want to change the pattern on the first line to "^bg_n<" and the replacement on the last (non-parenthesis) line to be "bg_p<" if you want it to be more anchored.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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