• 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. Working with local variables

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 11000
  • 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

Working with local variables

RVERP
RVERP over 3 years ago

I have a few questions about working with local variables.

  1. I have a bunch of variables that are generated in my procedure. I want these variables to be local, is it able to do this after let has already been called?
  2. If I have a list pairs of symbols and values. Is it possible to use this list with let these symbols can be used as local variables?

    for example:
    procedure(makeSum(pairs) let(???????????? a+b))

    pairs=list(list('a 1) list('b 2))
    makeSum(pairs) => 3

    What should I put i place of ???????????? to make this work (if possible)?
  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago
    1. No, you can't do this.
    2. This seems a rather strange requirement. What exactly are you trying to do, because it doesn't make sense to me?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RVERP
    RVERP over 3 years ago in reply to Andrew Beckett

    My problem is that I have pcell that uses an amount of variables that is generated from a pcell parameter. The number of these variables is dependant of the parameter and their symbol name is generated based on the content of the symbol. I want to use these generated symbols in the rest of my pcell code, but since they are not in the let (I don't know what variables will exist) they will be global.

    I don't know how a programmer would tackle this, since I'm only a layouter :) but I see now that auto generating symbols in pcell code is't really a good idea. I think I can better contain them in something like autoValues->value1, .... In this case autoValues is the only variable is "autoValues", that I can make a local variable at the start of my code.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • RVERP
    RVERP over 3 years ago in reply to Andrew Beckett

    My problem is that I have pcell that uses an amount of variables that is generated from a pcell parameter. The number of these variables is dependant of the parameter and their symbol name is generated based on the content of the symbol. I want to use these generated symbols in the rest of my pcell code, but since they are not in the let (I don't know what variables will exist) they will be global.

    I don't know how a programmer would tackle this, since I'm only a layouter :) but I see now that auto generating symbols in pcell code is't really a good idea. I think I can better contain them in something like autoValues->value1, .... In this case autoValues is the only variable is "autoValues", that I can make a local variable at the start of my code.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to RVERP

    OK, seems a little unusual, but maybe having the "variables" in some structure (such as either a disembodied property list or maybe a table would make sense). You can always do:

    autoValues=makeTable('myValues nil)

    and then you can do:

    autoValues->value1=5.0

    which is identical to:

    autoValues['value1]=5.0

    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