• 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. Problem with execute skill procedure do convert "<>" to...

Stats

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

Problem with execute skill procedure do convert "<>" to "[]"

zgzg8312
zgzg8312 over 6 years ago

Hi,Guys!

    I write a skill procedure do convert "<>" to "[]" or "[]" to "<>",like below.

    When I execute convert("a[1]"),it work ok,result "a<1>",but I execute convert("a<1>"),it not work,result nil !!

    Where is the problem?

    procedure(convert(label)

                      if(label==car(parseString(label "[]"))

                                  then

                                         a_label=car(parseString(label "<>"))

                                         b_label=car(cdr(parseString(label "<>")))

                                         strcat(a_label "[" b_label "]")

                      else nil

                      )

                      if(label==car(parseString(label "<>"))

                                  then 

                                         a_label=car(parseString(label "[]"))

                                         b_label=car(cdr(parseString(label "[]")))

                                         strcat(a_label "<" b_label ">")

                        else nil

                        )

)

Best regards!!!!

  • Cancel
  • mschw
    mschw over 6 years ago

    Hi,

    a SKILL procedures return value is always the last SKILL expression in the procedure body. The last SKILL expression in your procedure is the second if statement. If you execute convert("a[1]"), the second if statement returns the last SKILL expression in the true branch, which is strcat(a_label "<" b_label ">"). If you execute convert("a<1>") the second if statement returns the last SKILL expression in the false branch, which is nil. To overcome the problem you can save the return value in a variable and add this return value as last SKILL expression in the procedures body. e.g.

    procedure(convert(label)

    (let (a_label b_label returnValue)

    if(label==car(parseString(label "[]")) then

    a_label=car(parseString(label "<>"))

    b_label=car(cdr(parseString(label "<>")))

    returnValue = strcat(a_label "[" b_label "]")

    else
             nil
    )

    if(label==car(parseString(label "<>")) then

    a_label=car(parseString(label "[]"))

    b_label=car(cdr(parseString(label "[]")))

    returnValue = strcat(a_label "<" b_label ">")

    else
              nil

    )

                       returnValue
           )
    )

    I also added a let statement for the local variables.

    Kind regards,
    Matthias

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • zgzg8312
    zgzg8312 over 6 years ago in reply to mschw

    Understand !!! Thanks a lot !!!

    • 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