• 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 Design
  3. Control flow when a return from an expression is nil

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 125
  • Views 11269
  • 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

Control flow when a return from an expression is nil

delgsy
delgsy over 3 years ago

When my cross command fails to cross the threshold, it gives eval err in the result.
I want the test to give default value, i.e., uncalibrated value, so the next test have something to compare with.
Otherwise, all the tests after the one that have fail cross command will gives eval err as well.

This code does not work:
if((cross(v("/VOUT_INV" ?result "dc") 0.6 1 "rising" nil nil nil) - pv("/vref" "value" ?result "variables") == nil) "nil" "not_nil")

I found this. Changing the function with my expression does not work.

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 3 years ago

    Dear delgsy,

    delgsy said:
    When my cross command fails to cross the threshold, it gives eval err in the result.
    I want the test to give default value, i.e., uncalibrated value, so the next test have something to compare with.
    Otherwise, all the tests after the one that have fail cross command will gives eval err as well.

    This code does not work:
    if((cross(v("/VOUT_INV" ?result "dc") 0.6 1 "rising" nil nil nil) - pv("/vref" "value" ?result "variables") == nil) "nil" "not_nil")

    I believe the reason your ocean/SKILL code does not work is that you are requesting an expression be evaluated using the cross() function as part of your conditional expression. Note that your code is also not consistent with the recommendation Andrew made in the post for which you included the URL.

    Luckily, the correction I believe, is quite straightforward if you have the time and wish to try it. You need to include only the cross() function in your conditional expression as in the following example. Since I do not know what desired "default, uncalibrated value" is, I will use the artificial variable name of "default_value" for it and the resulting value as variable "measured_cross_value" in my example. I hope this makes sense to you delgsy!

    measured_cross_value  = if(cross(v("/VOUT_INV" ?result "dc") 0.6 1 "rising" nil nil nil) default_value cross(v("/VOUT_INV" ?result "dc") 0.6 1 "rising" nil nil nil))

    I hope I understood your question correctly delgsy and this is somewhat useful to you!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • delgsy
    delgsy over 3 years ago in reply to ShawnLogan

    Thanks! it works if I do not include the arithmatic operation.

    Andrew Beckett
    Thanks! I will try it later.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • delgsy
    delgsy over 3 years ago in reply to ShawnLogan

    Thanks! it works if I do not include the arithmatic operation.

    Andrew Beckett
    Thanks! I will try it later.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • ShawnLogan
    ShawnLogan over 3 years ago in reply to delgsy

    Dear Delgsy,

    Great!! I was happy to read you have it working! Thank you for letting us know and good luck with your simulations!

    Shawn

    • 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