• 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. Output expression has evaluation errors for corner sims

Stats

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

Output expression has evaluation errors for corner sims

BillH314
BillH314 over 3 years ago

Using ADE Explorer the following output expression plots fine the first time I run a single run.   

psd(vt_v1 tstart tstop round(VAR("NUM_PTS")) ?windowName "Hamming" ?smooth 5 ?windowSize round((VAR("NUM_PTS") / VAR("NUM_AVGS"))) ?detrending "None" ?cohGain 1)

vt_v1, tstart, tstop are other output expressions defining voltage waveform and start and stop time respectively (they evaluate OK).    NUM_PTS and NUM_AVGS are Design Variables

When trying to replot using Results->Plot Outputs->Expressions or when running a corner sim I get an evaluation error:

Expression:'psd(vt_v1 tstart tstop round(VAR("NUM_PTS")) ?windowName "Hamming" ?smooth 5 ?windowSize round((VAR("NUM_PTS") / VAR("NUM_AVGS"))) ?detrending "None" ?cohGain 1)'
because of the following error(s)
("round" 0 t nil ("*Error* round: argument #1 should be a number (type template = \"n\")" srrWave:0x67b3b700))
Ensure that the definition of the expression is correct.
*Error* ("eval" 0 t nil ("*Error* eval: unbound variable" arg))

The following expression DOES work, whether for single run, replot, or corner sim 

psd(VT("/v1") 1e-08 1.6394e-05 16384 ?windowName "Hamming" ?smooth 5 ?windowSize 8192 ?detrending "None" ?cohGain 1)

Am I allowed to use variables and other output expressions in another output expression?    It seems those things are causing problems.

Thank you, Bill Huff

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Hi Bill,

    See How to apply round() or any other unary function to a waveform. You'd need to change the round((VAR("NUM_PTS") / VAR("NUM_AVGS"))) part to abApplyToWave('round VAR("NUM_PTS") / VAR("NUM_AVGS")) - having accessed the code through the article.

    Regards,

    Andrew

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

    Hi Andrew, 

    Thank you for the function - that does help.  But the expression only works in certain situations.   When I do a single run and look at the automatic plot at the end of the run things look OK, but then for a corner run I'm still get errors.   Maybe I don't understand

    1.   How does the output processing work in ADE for expression dependencies (e.g. if I have expressions dependent on other expressions or variables then does it matter what order I put them in or will the output processing iterate to figure out all the dependencies?)   

    2.   I think if I run a single case then the expression evaluates to a number and the function is happy with the number but if I run a corner run maybe the expression evaluates to some kind of list or array object that the function chokes on?   Is there some kind of typecasting I should be doing in general to get all the expressions into the correct type(s) of objects whether I've done a single run or a corner run?

    Thank you again for all your help you give to the Cadence community!

    Bill Huff

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

    Hi Bill,

    I was going to move the other post across to this thread, but I see you re-posted (so I just deleted the post in the wrong thread; no harm done!)

    What errors are you getting? First of all, are you ensuring that the abApplyToWave function is registered with the calculator or did you just load it in the CIW?

    To answer your two questions:

    1. The order dependency is taken care of anyway - you don't have to worry about it
    2. The function I wrote should take care of running with different flavours of data - direct numbers, vectors, waveforms and families - there's a cond() statement within that handles that. So that's why it should work without needing to do anything special.

    Regards,

    Andrew

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

    Hi Andrew,

    Thanks again for all your help.   Sorry for the delay; I ran a few more experiments.

    1.   I'm not sure how to use the abApplyToWave function for an expression with a numerical value (such as my tstart and tstop expressions).   I just want to use the abApplyToWave to take care of different flavors of data as you say but not apply a function.   I tried using abApplyToWave(nil tstart) but that gave an error.

    2.  I'll try to describe a few different versions of the expression and the results.   All of these plot fine if I run a single case (no corners)

    psd(VT("/v1") 1e-08 1.6394e-05 32768 ?windowName "Hamming" ?smooth 5 ?windowSize 16384 ?detrending "None" ?cohGain 1)

    => Automatically plots at end of corner run; plots OK from calculator after corner run

    psd(VT("/v1") 1e-08 1.6394e-05 abApplyToWave('round VAR("NUM_PTS")) ?windowName "Hamming" ?smooth 5 ?windowSize abApplyToWave('round (VAR("NUM_PTS") / VAR("NUM_AVGS"))) ?detrending "None" ?cohGain 1)

    => Does NOT automatically plot at end of corner run; but does plot OK from calculator.    I didn't see anything in CIW or CDS.log about why it didn't plot.

    psd(VT("/v1") tstart tstop abApplyToWave('round VAR("NUM_PTS")) ?windowName "Hamming" ?smooth 5 ?windowSize abApplyToWave('round (VAR("NUM_PTS") / VAR("NUM_AVGS"))) ?detrending "None" ?cohGain 1)

    => Does not plot at end of corner run or from calculator

    Error message when attempting to plot from calculator: ("round" 0 t nil ("*Error* round: argument #1 should be a number (type template = \"n\")" srrWave:0x67b3ace0))("times" 0 t nil ("*Error* times: can't handle (nil * srrWave:0x67b3ad00)"))("drPSD" 0 t nil ("*Error* drPSD: argument #2 should be a number (type template = \"gnnxSnnxSl\")" nil))

    output .csv file follows for reference:

    Name,Type,Output,EvalType,Plot,Save,Spec
    ,net,/v1,point,,t,
    vt_v1,expr,VT("/v1"),point,t,,
    clip_v1,expr,clip(vt_v1 tstart tstop),point,,,
    NUM_PTS,expr,round(VAR("NUM_PTS")),point,t,,
    NUM_AVGS,expr,round(VAR("NUM_AVGS")),point,,,
    WIN_LENGTH,expr,round((NUM_PTS / NUM_AVGS)),point,,,
    fsamp,expr,VAR("fsamp"),point,,,
    tsamp,expr,VAR("tsamp"),point,t,,
    tstart,expr,(tstop - (NUM_PTS * tsamp)),point,t,,
    tstop,expr,0.00016394,point,t,,
    clip2,expr,clip(vt_v1 tstart tstop),point,t,,
    psd16,expr,psd(VT("/v1") 1e-08 1.6394e-05 32768 ?windowName "Hamming" ?smooth 5 ?windowSize 16384 ?detrending "None" ?cohGain 1),point,t,,
    psd17,expr,psd(VT("/v1") 1e-08 1.6394e-05 abApplyToWave('round VAR("NUM_PTS")) ?windowName "Hamming" ?smooth 5 ?windowSize abApplyToWave('round (VAR("NUM_PTS") / VAR("NUM_AVGS"))) ?detrending "None" ?cohGain 1),point,t,,
    psd18,expr,psd(VT("/v1") tstart tstop abApplyToWave('round VAR("NUM_PTS")) ?windowName "Hamming" ?smooth 5 ?windowSize abApplyToWave('round (VAR("NUM_PTS") / VAR("NUM_AVGS"))) ?detrending "None" ?cohGain 1),point,t,,

    • 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