• 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. Plotting Expression Output Vs. Swept Design Variable

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 126
  • Views 7614
  • 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

Plotting Expression Output Vs. Swept Design Variable

KTBuckON
KTBuckON over 1 year ago

I'm running a corner simulation in Explorer/Assembler where a scalar output is calculated in an expression. I'd like to plot this scalar value against the swept design variable for the corresponding corner. For example I have a variable called Vin defined as 1:1m:2 and I'd like to use this as the x-axis to be plotted with the scalar value as the y-axis. The problem is that the tool wants to use temperature as the x axis when plotting anything. I'm aware of the waveVsWave function but I'm probably missing a step on how to get that to work. I can generate the correct x values from the input variable using waveVsWave but that output also doesn't work to plot the scalar expression. I'm guessing that this has something to do with resolving the correct corner value to plot with but I'm not having any success in figuring it out with the documentation.

  • Cancel
  • KTBuckON
    KTBuckON over 1 year ago

    One detail I missed: the plot works as desired when I run a single corner but not when running multiple corners.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 1 year ago in reply to KTBuckON

    Dear KTBuckON,

    KTBuckON said:
    I have a variable called Vin defined as 1:1m:2 and I'd like to use this as the x-axis to be plotted with the scalar value as the y-axis. The problem is that the tool wants to use temperature as the x axis when plotting anything. I'm aware of the waveVsWave function but I'm probably missing a step on how to get that to work.

    I'm not sure of the exact expressions you are using with the WavevsWave() ViVA function. However, its syntax requires that its two inputs be waveforms (wave_x, wave_y) and that the x components of the waveforms wave_x and wave_y have the same units. So for example, if you are sweeping your design variable "Vin", then for the function to work as expected, both of its waveforms must have an x-component corresponding to Vin. This means, in your specific case where you want the plot abscissa to be the design variable "Vin", the wave_x must have an x_component of Vin AND a y_component of Vin.

    I am sure there are other ways to accomplish this, but an easy way to create this waveform is to define an output node as the voltage on the voltage source whose value is design variable Vin. Let's say that output net is called "in" Let's also say your scalar output expression has a name "my_scalar_output". Hence, to create the plot, I think you can then use something like the following if you are using a transient simulation:

    waveVsWave(?x v("in" ?result "tran-tran") ?y v("my_scalar_output"" ?result "tran-tran"))

    Did you happen to try this?  If you did and it did not work, I apologize for the suggestion!

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • KTBuckON
    KTBuckON over 1 year ago in reply to ShawnLogan

    Hi Shawn,

    The scalar output is not referenced to time. It is a sampled digital waveform converted to a digital word. When it is plotted during a corner run the x axis is temperature, for a single corner the x axis is the swept input.

    When I plot the digital output word using calcVal from the calculator during a corner run it looks like this (for some reason simply entering the name of the expression in the calculator returns an error):

    When running a single point the same expression from the calculator looks like this (what I want):

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 1 year ago in reply to KTBuckON

    Dear KTBuckON,

    Thank you for the added information concerning the scalar expression and the two screenshots display your desired result and what you are observing! They helped me better understand the nature of your issue.

    I think your observed behavior makes sense now that I understand a bit better. When you are doing a sweep of a single variable, in this case your variable "Vin", each value of design variable "Vin" in your set of swept values will return a single scalar expression. In other words, your scalar expression, lets call it bin2dec_value, is:

    bin2dec_value(Vin).

    Therefore, when you instantiate a plot of the set of values for bin2dec_value(), the only choice for the x-axis is the dependent variable "Vin" and you observe the behavior shown in your second screenshot (your desired result).

    However, now you add a second sweep variable, temperature, to your set of corners. Therefore, your scalar output expression is now:

    bin2dec_value(Vin,Temperature).

    The resulting plot will attempt to plot all values of the scalar expression bin2dec_value() for both swept variables. In the case you have shown in your first screenshot, the x-axis was chosen as temperature and it appears you chose three temperature values for your sweep. Note that the legend entry has a "+" to the left of the text and this "+" does not exist in your single variable sweep plot.

    The "+" indicates that there are multiple values plotted at each x-axis value. If you were to click on it, the legend will expand and show that there are waveforms for each value of the sweep you defined for design variable "Vin".

    Hence, I might suggest that in order to change the abscissa to reflect your design variable "Vin" in lieu of "Temperature", you consider the ViVA swapSweep() function accessible from the Calculator. This function allows you to specify which design variable to use as the abscissa for your plot. It is documented in the ViVA User Guide and a brief synopsis of its GUI is attached below with an example of its use.

    Hence, if you export your scalar expression function bin2dec_value to the Calculator, you may use it as the first argument to the swapSweep() function and set its second argument to your design variable "Vin". In your case, I think the optional third argument to the function should remain blank as you want to view all values your design variable "Vin'. In the example, a specific abscissa value is selected for the plot - which really has three independent variables (time, temp, and vdd). You only have two.

    I hope this helps KTBuckON and does not waste any more of your time on my behalf!

    Shawn

    swapsweep_example_sml_101723.pdf

    • 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