• 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
  • ShawnLogan
    ShawnLogan over 10 years ago

    Hi Mark,

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

    I have used the cross() function but with the "cycle" argument in lieu of "time". I then determine the length of the vector. I've attached a sample of the code below.

    zcross_hsclki = cross(hsclki_clipped 0 0 "rising" t "cycle")

    xvector = drGetWaveformXVec(zcross_hsclki)

    xvector_length = drVectorLength(xvector)

    printf("Vector phase length = %d.\n" xvector_length)

    This might do what you want - assuming I understand your intent Mark!

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • ShawnLogan
    ShawnLogan over 10 years ago

    Hi Mark,

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

    I have used the cross() function but with the "cycle" argument in lieu of "time". I then determine the length of the vector. I've attached a sample of the code below.

    zcross_hsclki = cross(hsclki_clipped 0 0 "rising" t "cycle")

    xvector = drGetWaveformXVec(zcross_hsclki)

    xvector_length = drVectorLength(xvector)

    printf("Vector phase length = %d.\n" xvector_length)

    This might do what you want - assuming I understand your intent Mark!

    Shawn

    • 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