• 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. passing variable by reference

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 142
  • Views 15719
  • 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

passing variable by reference

archive
archive over 17 years ago

Hello,

I'm wondering how can a variable be passed by reference instead of value in skill functions ?

Regards,
David


Originally posted in cdnusers.org by david.denis
  • Cancel
  • archive
    archive over 17 years ago

    Hi David,

    In fact all variables [u]are [/u] passed by reference in SKILL. This is fairly obvious when passing lists, structures, tables, arrays and so on - but less obvious when passing "atomic" values such as integers, floats and strings - primarly because of the fact that there aren't functions to change a value of an atomic value in place.

    The purpose of you asking is probably to allow the function you're calling to change the value of a variable passed in. There are several ways this can be done:

    1. If the data passed is a list, structure, table, array, class instance, database object etc, then you can change it already. With lists you'd need to use a destructive operation (e.g. rplaca, rplacd and so on).
    2. You could write a macro instead of a function (see sourcelink solution 11025352 for an overview of macros)
    3. You could pass the name of the variable to the function. This is sort of equivalent to pointers in other languages. For example:

    procedure(MYupdateVar(varName "s")
    set(varName symeval(varName)+1)
    )

    a=1
    MYupdateVar('a)
    a => 2

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Thanks for the details.
    David


    Originally posted in cdnusers.org by david.denis
    • 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