• 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. String operations in skill

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 20189
  • 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

String operations in skill

shazzy
shazzy over 12 years ago

Okay so we have a list 'p' constituting of elements as pin names. 

 p = ("GIO<0>"  "G1E<1>"  "GAE2<2>"  "G3F1<3>")

 

And the task is to add the under-braces numeric value with 4 and convert this array into

  p = ("GIO<4>"  "G1E<5>"  "GAE2<6>"  "G3F1<7>")

 

I did these operations in perl and also bridged the gap between perl and skill. 

But since this script has to be linked to a bind key hence I want to do the string operations in skill only. 

Is there any skill code or so by which we can edit the numeric portion ( only under the braces) of the string and then return it back to the 'p' array?

  • Cancel
Parents
  • dmay
    dmay over 12 years ago

    Here is one way to do it:

    p = list("GIO<0>"  "G1E<1>"  "GAE2<2>"  "G3F1<3>")

    procedure(myAdjustBit(nameList delta)
      let((newNameList parsed prefix suffix newSuffix newName)
        foreach(name nameList
            parsed=parseString(name "<>")
            prefix=car(parsed)
            suffix=evalstring(cadr(parsed))
            newSuffix=suffix+delta
            newName=sprintf(nil "%s<%d>" prefix newSuffix)
            newNameList = cons(newName newNameList)
        )
        reverse(newNameList)
      ) ;let
    ) ;proc

    myAdjustBit(p 4)

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • dmay
    dmay over 12 years ago

    Here is one way to do it:

    p = list("GIO<0>"  "G1E<1>"  "GAE2<2>"  "G3F1<3>")

    procedure(myAdjustBit(nameList delta)
      let((newNameList parsed prefix suffix newSuffix newName)
        foreach(name nameList
            parsed=parseString(name "<>")
            prefix=car(parsed)
            suffix=evalstring(cadr(parsed))
            newSuffix=suffix+delta
            newName=sprintf(nil "%s<%d>" prefix newSuffix)
            newNameList = cons(newName newNameList)
        )
        reverse(newNameList)
      ) ;let
    ) ;proc

    myAdjustBit(p 4)

    Derek

    • 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