• 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. getting the number of points in a waveform, or the number...

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 125
  • Views 20961
  • 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

getting the number of points in a waveform, or the number of events...

MarkGr15
MarkGr15 over 10 years ago

I want to count the number of times an analog waveform crosses a threshold. It will do so , lets say 3 times, in a period in time (I am going to clip the time period in the Spectre calculator).

This is what I am trying, it creates a waveform (N time points, with associated values).

overCurrentXingsInClip1=cross(clip(VT("/fb_top1/I_buck_nonlinear/I0/overcurrent_det")  20u 40u ) 1.8/2 1 "rising"  t "time"  )

I want the number of time points.  Is there a way to get this?

The goal is to count the number of crossings, mind you. If there is another way to skin the cat, I'm open to that.

Thanks

Mark

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Mark,

    Sorry, I didn't try your code, and so didn't notice that you had the "multiple occurrence" option set. Rather perversely, you need to have it set to "single occurrence" (which corresponds to having the last two arguments to the cross() function set to nil), and then it should work.

    The multiple occurrence feature was added at some point later, and will generate a waveform with all the crossing points - which would require you to use an approach similar to Shawn's suggestion, but if you use the older "single occurrence" capability, you can set the edge number to 0 and get a list of the crossings (which is normally not useful in the calculator because it can't deal with SKILL lists of stuff).

    So that should be:

    overCurrentXingsInClip1=length(cross(clip(VT("/fb_top1/I_buck_nonlinear/I0/overcurrent_det")  20u 40u ) 1.8/2 0 "rising" nil nil  ))

    Hopefully that will work for you!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Mark,

    Sorry, I didn't try your code, and so didn't notice that you had the "multiple occurrence" option set. Rather perversely, you need to have it set to "single occurrence" (which corresponds to having the last two arguments to the cross() function set to nil), and then it should work.

    The multiple occurrence feature was added at some point later, and will generate a waveform with all the crossing points - which would require you to use an approach similar to Shawn's suggestion, but if you use the older "single occurrence" capability, you can set the edge number to 0 and get a list of the crossings (which is normally not useful in the calculator because it can't deal with SKILL lists of stuff).

    So that should be:

    overCurrentXingsInClip1=length(cross(clip(VT("/fb_top1/I_buck_nonlinear/I0/overcurrent_det")  20u 40u ) 1.8/2 0 "rising" nil nil  ))

    Hopefully that will work for you!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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