• 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. Converting Waveform data to list or vector using ocean ...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 17593
  • 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

Converting Waveform data to list or vector using ocean Script

Ishant Anand
Ishant Anand over 7 years ago

Hello,

I am using "cross function" on the output waveform in cadence which is giving me a 2D vector( Multiple rows and 2 columns).

wave=cross(v("/OUT" ?result "tran") 0.6 1 "either"  t "time"  )

I want to print the result in a file in two different vectors(each column in different vector) using script. SO, that i would be able to access the individual element of the vector.

There is already ocean script online but it is not working for my case.

I would be really grateful, if you would be able to help me with the solution.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Presumably this is happening because v("/OUT" ?result "tran") is a family waveform - i.e. you've done some kind of sweep around the transient analysis.

    You should just be able to use ocnPrint(wave) to print it out (there are arguments to print to a file too). Or you can use the value() function to slice out one of the columns - if the sweep variable was "vdc" then you would do:

    value(wave 'vdc 1.0) ; if 1.0 is the value of the swept variable you want

    That would then give you just the crossing points versus time for that value of the swept parameter.

    Not entirely sure what you want - but hopefully this gives you some pointers in the right direction?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Ishant Anand
    Ishant Anand over 7 years ago in reply to Andrew Beckett

    Thank you for your kind reply.

    The value function will tell be the value of the particular output at time given.

    I am actually writing a script based on the cross function, i would be able to get the time where the V("/OUT") is crossing the value 0.36.

    Then i will use the time to automatically do the other task too.

    I would be very grateful if you can help me with any ocean function that let me convert the waveform to two different vector so that i would be able to access the individual element of the array in single run of the script.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Ishant Anand

    In that case, why not just use:

    wave=cross(v("/OUT" ?result "tran") 0.6 1 "either")

    (i.e. don't ask it to produce a waveform with all crossing points in - which is what the t "time" part did).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Ishant Anand
    Ishant Anand over 7 years ago in reply to Andrew Beckett

    I tried this but it is giving me single value where my output is crossing 0.6 for the very first time, not for all time but for my work, i want the value for every time when it crosses the 0.6.

    I would be very grateful if you would be able to help me with the solution.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Ishant Anand

    One thing you could do is:

    foreach(crossPoint cross(v("/OUT" ?result "tran") 0.6 0 "either")
      printf("Crossing is %g\n" crossPoint)
      ; do you operation here
    )

    The cross function, if given 0 as the crossing number, returns a list of all the crossing points which can be processed with SKILL list functions - including foreach to iterate through.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Ishant Anand
    Ishant Anand over 7 years ago in reply to Andrew Beckett

    Thank you SIr. It works.

    • 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