• 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. Undefined variables when procedures used in optional ar...

Stats

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

Undefined variables when procedures used in optional arguments

theoaoki
theoaoki over 1 year ago

Hello,

I'm not sure if this is expected behavior or not.

Using the following code, if I set a breakpoint in fun1 on line 2 (right before calling fun2) and step through the program after calling fun1 from the CIW, "var1 does not exist" will print. 

If I set var1's default value to 1, "var1 does not exist" will NOT print.

If I don't set a breakpoint, "var1 does not exist" will NOT print.

Any direction would be appreciated!

The code:

procedure(fun1()
fun2()
)

procedure(fun2(@optional (var1 fun3()))
when(!boundp('var1) printf("var1 does not exist\n"))
)

procedure(fun3()
1
)

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    This seems to be an obscure bug with the debugger. If you also put a breakpoint on the when line in fun2, and use continue after the first breakpoint - it works. It seems that single-stepping does execute fun3 (but doesn't step through it) but doesn't bind the variable in the argument list - which is a bit strange.

    I'll raise this with R&D (I'll report the CCR number once I've done that).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to Andrew Beckett

    I filed Cadence Change Request #2977527 for this. It's definitely odd - the optional expression gets evaluated but doesn't get bound to the variable in the argument list.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theoaoki
    theoaoki over 1 year ago in reply to Andrew Beckett

    Thanks 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