• 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. Inconsistent evaluation/plotting of phase-correction expressions...

Stats

  • Replies 0
  • Subscribers 129
  • Views 26
  • Members are here 0

Inconsistent evaluation/plotting of phase-correction expressions in ADE Assembler vs. Calculator (IC23.1-64b.43)

baltaci
baltaci 1 hour ago

Hello,

I am observing inconsistent behavior between the Virtuoso Calculator and ADE Assembler result evaluation when trying to unwrap the phase from an STB analysis so that it starts at +180° and can be used conveniently for phase-margin and gain-margin calculations.


Goal

From an STB analysis I obtain loop gain phase:

phase0 = phase(getData("loopGain" ?result "stb"))

Because the phase may start at −180° (or 180° ± n·360°), I compute a correction term so the low-frequency phase starts at +180° and downstream calculations (e.g., cross() for phase margin) are straightforward.


Solution 0 (works numerically, but cannot be plotted from Results)

phase0 = phase(getData("loopGain" ?result "stb"))
phase_correction = (360 * round(((180 - value(phase0 firstVal(phase0))) / 360)))
phase = (phase0 + phase_correction)

Observed behavior

  • ADE Assembler recognizes phase as a waveform (wave icon shown in Outputs/Results).

  • Downstream expressions using this phase (e.g., cross() for phase margin) evaluate correctly.

  • However, double-clicking the waveform to plot fails with:

*Error* ("round" 0 t nil ("*Error* round: argument #1 should be a number (type template = "n")" srrWave:0x49863400))

ERROR (ADE-1057): Could not evaluate expression
        Name:'phase_correction'
        Expression:'(360 * round(((180 - value(phase0 firstVal(phase0))) / 360)))'
     because of the following error(s)
        ("round" 0 t nil ("*Error* round: argument #1 should be a number (type template = "n")" srrWave:0x49863400))
     Ensure that the definition of the expression is correct.

*Error* ("round" 0 t nil ("*Error* round: argument #1 should be a number (type template = "n")" srrWave:0x498634c0))

ERROR (ADE-1057): Could not evaluate expression
        Name:'phase_correction'
        Expression:'(360 * round(((180 - value(phase0 firstVal(phase0))) / 360)))'
     because of the following error(s)
        ("round" 0 t nil ("*Error* round: argument #1 should be a number (type template = "n")" srrWave:0x498634c0))
     Ensure that the definition of the expression is correct.

*Error* ("plus" 0 t nil ("*Error* plus: can't handle (srrWave:0x49863420 + unbound)"))

ERROR (ADE-1057): Could not evaluate expression
        Name:'phase'
        Expression:'(phase0 + phase_correction)'
     because of the following error(s)
        ("plus" 0 t nil ("*Error* plus: can't handle (srrWave:0x49863420 + unbound)"))
     Ensure that the definition of the expression is correct.

So the expression behaves as:

  • Valid for numerical post-processing

  • Invalid for plotting


Solution 1 (Calculator plots OK, but ADE output gives eval error)

As a workaround I modified the correction:

phase_correction1 = (360 * round(((180 - ymax(value(phase0 firstVal(phase0)))) / 360)))
phase1 = (phase0 + phase_correction1)

Observed behavior

  • In the Virtuoso Calculator, plotting phase1 works correctly.

  • When defined as an ADE Assembler output, it results in eval err after simulation.

So this case behaves as:

  • Valid in Calculator

  • Invalid in ADE output evaluation


Confusion / Question

These two cases appear inconsistent:

Expression Calculator ADE numerical eval ADE plotting
Solution 0 OK OK Fails
Solution 1 OK Fails N/A

This makes it difficult to determine:

  • what data types (number vs. wave) are actually expected by round(), value(), ymax(), etc.

  • why ADE can use a waveform expression for further calculations but cannot plot it

  • what the recommended method is to unwrap STB phase to start at +180° in a way that is:

    • numerically robust

    • plottable

    • ADE-compatible


Questions

  1. Is this inconsistent behavior between Calculator, ADE evaluation, and ADE plotting expected?

  2. Is there a Cadence-recommended method to unwrap STB phase to +180°?

  3. Could this indicate a bug in ADE expression evaluation or plotting?


Environment

Cadence IC version: IC23.1-64b.43
Analysis: STB in ADE Assembler


Any clarification or recommended best practice would be greatly appreciated.

Thank you.
Can

  • Cancel
  • Sign in to reply

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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information