• 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. use of calcVal() to access expressions from other tests

Stats

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

use of calcVal() to access expressions from other tests

AncisMichele
AncisMichele over 3 years ago

Hello :-)

I have two tests A and B. In test A I have an expression as output, X.

Within the outputs declaration for test B, I create an expression like this:

Y = calcVal("X" "A")*3

(Here I write Y = ... to signify that the calcVal expression as a name Y, I do everything from the GUI so there's no actual assigment anywhere)

After running the simulations in Assembler, in the results pane I see both X and Y appearing as valid waveforms, so no "eval err" or anything:

Here

test A --> RVT

test B --> RVT_Rout

X --> AC_gm

Y --> calcVal("AC_gm" "RVT" ?getFirstSweepPoint t)*3

Now, when I was inputting this calcVal expression the first time, it worked fine. After running a new simulation, however, despite the "waveform symbol" and no warning,

when trying to plot I get an empty window and the CIW complains that expression X returns nil. Expression X is however readily plottable w/o further complaints.

(The reason why I added this ?getFirstSweepPoint parameter is that I read afterwards that when doing sweeps, the calcVal can get confused. I have tried both single point and sweeps, both with and without the ?getFirstSweepPoint parameter and none of them works. It worked ony once, in the beginning, when I was testing).

So I'm a little puzzled. Before I spend too much time trying to make it work, I have a basic question: is the calcVal function in principle thought for such use?

In the manual I seem to see this is mostly used to pass variable values between tests, for calibration purposes.

So before I get too deep into this, please tell me if I'm just misusing the function Slight smile

Thanks,

Michele

  • Cancel
  • ShawnLogan
    ShawnLogan over 3 years ago

    Dear Michele,

    AncisMichele said:
    So I'm a little puzzled. Before I spend too much time trying to make it work, I have a basic question: is the calcVal function in principle thought for such use?

    Yes.

    AncisMichele said:
    So before I get too deep into this, please tell me if I'm just misusing the function

    I am not an expert on the calcVal function, but if you are passing a signal (i.e. waveform) from test A to test B, then from my read of the calcVal() function and its arguments, it suggests you need to include a value for its ?result parameter. 

    From the definition of its input parameters:

    ?result t_resultName

    Name of an analysis from which the signal type output is to be to retrieved. When specified, returns a waveform for the corresponding output of that analysis. Use this argument only for the outputs of type signal.

    The specified analysis must exist in the test along with the simulation waveform results in order for calcVal to return the expected result.

    Looking at your ADE outputs, it appears AC_gm is a signal. However, in the calcVal() expression does not include the ?result parameter. Hence, from the error you reported, calcVal() cannot be evaluated. 

    The parameters for the calcVal() function are detailed in the manual at URL:

    https://support.cadence.com/apex/techpubDocViewerPage?path=maeSKILLref/maeSKILLrefICADVM20.1/measures.html#calcVal

    and specifically Example 5 (shown below) that shows the use of the ?result parameter in calcVal() with a waveform.

    Example 5:

    You can use the waveform from the result, as shown below.

    calcVal("/OUT" "AC" ?result "ac")
    => srrWave:0x40421090

    Once again, I am not an expert on this function, but this came to mind and wanted to at least mention it Michele.

    Shawn

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

    A few comments, but realistically you'll need to contact support as there's not enough information here - you didn't show what the expressions are here (if any). I've no idea (for example) how AC_gm was produced. 

    Shawn's suggestion about adding ?result is only needed if the output being referenced by the calcVal is of type signal (not expr). If it was a calculator expression that produced a waveform, then you don't need ?result - it's just for the case where you're plotting a signal (note that signals normally plot transient, dc and ac results automatically - which is why it needs to know which result you're referring to). 

    You are also not that likely to need the ?getFirstSweepPoint if both tests are running over the same sweeps and corners - it should do a 1-1 map of the results from each - which most of the time is what you'd want. 

    However, giving a more precise answer is going to be impossible without understanding the goal here - so please try to contact support for this.

    Andrew

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

    Hi Shawn,

    thanks for your detailed answer.

    "AC_gm" is an expression, as I wrote initially. It's definition is - as I'm just simulating AC (for both tests) - like this:

    IF("/N0/d")/VF("/vgs")

    Sorry, I did not think that was too important.

    From what you and Adrew wrote - though - I do not see I'm doing anything terribly wrong.

    Unfortunately the output of the error is just that the expression evaluates to *nil*, without further information and, in absence of possibility of proper Support, I'm just stuck as it is now becoming my new normal.

    Thanks,

    Michele

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AncisMichele
    AncisMichele over 3 years ago in reply to AncisMichele

    Leaving this in the thread, in case anybody stumbles on a similar roadblock.

    The end goal can be reached as well - after simulation - with a small OCEAN script which stores the results from different simulations, following this template:

    OpenResults("/path/to/first/test/A")

    X = your_expression_based_on_test_A

    OpenResults("/path/to/second/test/B")

    Y = your_expression_based_on_test_B

    plot(f(X,Y))

    Provided you swept some top-level variable (like I did), this works fine with sweeps too.

    Regards,

    Michele

    • 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