• 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. Traversing the sweeps of a family of waveforms to calculate...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 16026
  • 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

Traversing the sweeps of a family of waveforms to calculate the max turn-on time

Curtisma
Curtisma over 7 years ago

Hello:

I am trying to make a turn-on time measurement on a transient voltage.  This measures how long it takes for a certain voltage to reach a certain Y-value threshold, Yth.  However I would like to create a function that can take a family of waveforms (set of corners) and give me the maximum of the turn-on times over the family of waveforms.  Here is what I have so far with comments explaining how I would like the function to work:

;apGetMaxTurnOn(famIn tmin tmax Yth)
; INPUTS
; famIn - wave or family of waves to measure the turn-on time.
; tmin - minimum time
; tmax - maximim time
; Yth - Y value threshold to get the period.
; Returns a list with the following elements
; '(maxWaveform maxT cornerInfo)
; maxWaveform: Waveform object with the max turn-on period
; maxT - Max turn-on period
; cornerInfo - A list with the corner information. One entry for each sweep name in the family of curves.
; EXAMPLE
; ; Calculate the max turn-on time to 1.5v for famIn which is between 0us and 20us
; turnOnList = apGetMaxTurnOn(nthelem(6 out) 0 20u -2.5)
procedure(apGetMaxTurnOn(famIn tmin tmax Yth)
let(()
xVal=cross(clip(famIn tmin tmax) Yth 1 "either" nil nil nil )
;xVal=cross(nthelem(6 out) -2.5 1 "either" nil nil nil )
when(drIsWaveform(xVal)
1 ; TO DO: Return the turn-on list for the turn-on time of the single waveform
)
when(famIsFamily(xVal)
1 ; TO DO: Return the turn-on list list as described above for the trace with the max turn-on time
))
)

I have figured out how to get to the data by  repeatedly using drGetWaveformYVec and drGetElem:

Note: xVal is a family of waveforms with the lowest waveform in the sweep hierarchy having the turn-on period for one of the traces.

drGetElem(drGetWaveformYVec(drGetElem(drGetWaveformYVec(drGetElem(drGetWaveformYVec(xVall) 0)) 0)) 0)

However I would like the function to work with any number of sweep parameters but I'm not sure how to traverse an unknown number of sweep parameters.  If I knew the number of sweep parameters I could use a nested loop, however the family of waveforms that is input to the function could have an arbitrary number of sweeps. 

What's the best way to traverse a family of waveforms to calculate the max turn-on period?  Could you please provide some example code?

I am using IC6.1.7.

-Curtis

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Curtis,

    What I'd suggest is that you write a function which computes the turn on time (not necessarily the maximum):

    procedure(apGetTurnOn(wave tmin tmax Yth)
      cond(
        (drIsWaveform(wave)
           ; the code you have above which computes the turn on for a single waveform
             xVal=cross(clip(famIn tmin tmax) Yth 1 "either" nil nil nil )
        )
        (famIsFamily(wave)
           famMap('apGetTurnOn wave tmin tmax Yth)
        )
        (t
          error("apGetTurnOn: I'm really confused - don't know how to handle %L\n" wave)
        )
      )
    )

    Then you can simply do:

    ymax(apGetTurnOn(yourWave tmin tmax Yth) ?overall t)

    What will happen is that apGetTurnOn will return either a single value or a waveform (or a family of waveforms) - with one fewer dimension than the original waveform. The ymax with ?overall will find the maximum value over the whole set of families (or the individual waveform). The one case this won't work is where the input was a single waveform. So you could write:

    procedure(apGetMaxTurnOn(wave tmin tmax Yth)
      let((result)
        result=apGetTurnOn(wave tmin tmax Yth)
        if(drIsWaveform(result) || famIsFamily(result) then
          ymax(result ?overall t)
        else
          result
        )
      )
    )

    Something like that. None of this is tested BTW...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Curtisma
    Curtisma over 7 years ago
    Hey Andrew,

    Thanks for the suggestion, it certainly looks much simpler. How would I also get the waveform object and wave index which has this max turn-on?

    I need the waveform so I can add a marker to a plot of the waveform that marks the location of the worst case turn-on time. Actually I suppose in the end I need the wave index to supply to awvPlaceWaveformLabel. I assume that I would need to get the sweep (corner) information from the waveform and then find the wave index based on that sweep (corner) information.

    -Curtis
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago
    Curtis,

    That's starting to get rather more complicated - and realistically I won't have time to answer it without doing a bunch of experimentation. Since I know I won't have time to do that for at least 2 weeks, I would strongly suggest you contact customer support (although I have a funny feeling the question might end up coming my way internally if you do that!).

    Regards,

    Andrew.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Curtisma
    Curtisma over 7 years ago
    Hey Andrew:
    I have submitted a request to technical support already asking someone to answer this post.

    My first thought is to start by taking the family of waveforms and flatten it into a list of waveforms with a single trace each. Then run my apGetTurnOn to get each of their turn-on times. Then find the first index of the turn-on time which matches the max turn-on time calculated using apGetMaxTurnOn . This should then be the index of the waveform with the max turn-on time, which can be used to select the correct waveform in the waveforms list.

    Sound like a reasonable first try?

    -Curtis
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Curtis,

    That may be a reasonable approach. You might find this function useful to unwrap the family. You probably don't need the container around each waveform, so you may just be able to replace the call to make_abFamilySignal in that code to just be fam (i.e. the last branch of the cond would then be (t (list fam)) . 

    If this does work, please make sure you call off the troops (I don't want to have another AE thinking about it in the meantime!)

    Regards,

    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