• 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. Get value points from a wave for every x in a vector

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 125
  • Views 15925
  • 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

Get value points from a wave for every x in a vector

milind0y
milind0y over 10 years ago

Hi,

        I have 2 waveforms. First I find the intersection of the 1st wave to some threshold to get a list of time points where it crosses like:

drGetWaveformXVec(cross(clip(VT("/IN") 199u 220u ) VAR("vdd")/2 1 "rising" t "time" ))

now from these time points vector I want to get a vector of all the y points of the 2nd waveform at the corresponding time points. Something like:

value(VT("/wave2") drGetWaveformXVec(cross(clip(VT("/IN") 199u 220u ) VAR("vdd")/2 1 "rising" t "time" )))

and then find the max and min of all the values. Value function as I wrote above does not work. How can I accomplish this?

Thanks,

Milind

  • Cancel
  • ShawnLogan
    ShawnLogan over 10 years ago

    Dear milind0y,

    I do not think the value() function argument "g_value" works with a waveform. From the ocean reference manual:

    "Value (X value) at which to provide the Y value. If a string has
    been defined for a value or set of values, the string may be used
    instead of the value."

    How about the following? I am sure others can provide a more efficient solution, but I have used code similar to this.

    zcross_wave1 = cross(wave1 0 0 "rising" t "cycle")

    xvector = drGetWaveformXVec(zcross_wave1)

    xvector_length = drVectorLength(xvector)

    declare(y_values[xvector_length])

    ERR_VAL = 9e99

    min_y_value = 0.0 + ERR_VAL

    max_y_value = 0.0 - ERR_VAL

    for( i 1 xvector_length

    y_values[i] = value(wave1 zcross_wave1[i])

    min_y_value = if(y_value[i] < min_y_value y_value[i] min_y_value)
    max_y_value = if(y_value[i] > max_y_value y_value[i] max_y_value)

    )

    Shawn

    • 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