• 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 SKILL
  3. how to convert a "waveform object" into an "array" or "list...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 4130
  • 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

how to convert a "waveform object" into an "array" or "list" to iterate over each point?

SC6789
SC6789 over 3 years ago

The details below are specific to my design but the question is more broad, as in subject.

Using Cadence 6.1.8 I'm simulating noise of a clocked comparator. I'm running a 100-set of short transient simulations with noise (using transient sim options), while parameterizing a variable (x) that scales the size of some FETs in the circuit. My goal is to measure the final value of the transient sim (either High - close to vdd, or Low - close to gnd) for each transient curve in the 100-set. I am counting the  # of Highs in the 100-set, which is the figure of merit. Then I will list this number against each value of the swept parameter "x".

The brute-force approach I use (after simulations) is to loop over transient-noise "Iterations", as well as over the parameter "x" and use the data as I need. I access each end point of transient using:

leafValue( value( VT("/q1") 82e-12 ) "x" x "Iteration" iter )

The downside is that it's slow to access one final transient point at a time, => the loop takes several seconds per each "x" value. This is very slow, especially for many "x"s.

But I noticed that instead to access final pts for all 100 transients at once is quick (< 1s for all 100 transients):

leafValue( value( VT("/q1") 82e-12 ) "x" x )

^ This returns a waveform object which shows the final points of each transient for one "x". I can plot this waveform, but I can't access each point in this waveform using "foreach( )" (error: ... can't handle srrWave...). So:

Q1: Is it possible to convert this waveform object to an iterable array/list which I can access as a for/foreach loop? Alternatively how else can I process each point in this waveform.

Q2: Is it possible to access the list of parameter "x" to be iterable using "foreach( )", such that I don't have to edit the script when I change the sweep range of x in the simulator?

Please let me know if I need to clarify the above. Thank you!

  • Cancel
  • SC6789
    SC6789 over 3 years ago

    Found a solution to my Qs.

    Q1:

    After polishing my search keywords I've found Andrew Beckett's function: abWaveToList() archived here:

    https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/25049/how-to-calculate-hysteresis-using-ocean-skill-script

    To access the list of Y-axis points in the waveform an iterate over them I used:

    include("./abWaveToList.il")

    ...

    foreach( y_value nthelement( 2 abWaveToList ( leafValue( value( VT("/q1") 82e-12 ) "x" x ) ?transpose t ) )

    ... <perform my processing>

    )

    This greatly sped up the calculations. Thank you, Andrew! If anyone can comment why simply iterating over leafValue( signal param param) is so much slower, I'd appreciate it (access time to reopen the waveform each time?).

    Q2:

    In the same search I stumbled upon:

    famGetSweepValues( VT("/q1") )

    which can be used in foreach statement to iterate over each value of the swept parameter implicitly. Don't know where this function is documented, what kinds of sweeps it works for and how it works for sweeps with multiple parameters.

    Don't know if this post will be removed (for self answering) or moved, but perhaps it can help someone who searches for keywords in the subject line.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to SC6789
    SC6789 said:
    If anyone can comment why simply iterating over leafValue( signal param param) is so much slower, I'd appreciate it (access time to reopen the waveform each time?)

    The reason it would be slower is because (assuming I've understood you're usage) it will have to search along the waveform to find the x-value you're retrieving (possibly interpolating). The waveform is not indexed by the x-values, but by position.

    SC6789 said:
    Don't know where this function is documented,

    It is documented. Simply search for it in cdnshelp.

    Andrew

    • 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