• 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. measurements with transient sim with temp as a dynamic ...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 125
  • Views 13515
  • 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

measurements with transient sim with temp as a dynamic parameter

vamshiky
vamshiky over 10 years ago

Hi,

I have a simple opamp setup with a single sine input and wish to plot output pk-pk variation with temperature swept min to max with 1degC step. (in tran sim)

Instead of doing 100s of sims for every 1degC, I have planned to use dyn parameter for temp and use in single tran run,

but confused about how to measure the output pk-pk wrt temp after the run is done, as the peak-peak calculator function only gives over complete time window and need to clip for every temp step.?

Please help me in this regard.

Thank,

Vamshi

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

    Not sure this is quite what you want but you may be able to adapt it to your needs (it finds the local peaks and returns them as a waveform):

    /* abGetPeakList.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jan 19, 2005 
    Modified   Jun 06, 2011 
    By         A.D.Beckett
    
    Example:
    
    peaks=abGetPeakList(myWaveObj 'minimum)
    abWritePeakListToFile(peaks "peaks.out")
    
    Also has a function which returns a waveform of the peaks:
    
    plot(abPeakDetect(v("/out" ?result 'tran) "maximum"))
    
    ***************************************************
    
    SCCS Info: @(#) abGetPeakList.il 06/06/11.14:21:52 1.3
    
    */
    
    /**********************************************************************
    *                                                                     *
    *                   abGetPeakList(waveform maximum)                   *
    *                                                                     *
    *       Given a waveform object, and a second argument which is       *
    * t, "max", "maximum", 'max, 'maximum or nil, "min", "minimum", 'min, *
    *       or 'minimum, return a list of x-y pairs for the peaks.        *
    *                                                                     *
    **********************************************************************/
    
    procedure(abGetPeakList(waveform maximum)
        let((xVec yVec len previous delta previousDelta current output)
            xVec=drGetWaveformXVec(waveform)
            yVec=drGetWaveformYVec(waveform)
            len=drVectorLength(xVec)
            ;----------------------------------------------------------------
            ; Iterate over points in waveform
            ;----------------------------------------------------------------
            for(index 0 sub1(len)
                current=drGetElem(yVec index)
                when(previous
                    delta=current-previous
                    ;--------------------------------------------------------
                    ; Check to see if previous point was a peak, and if so
                    ; add it to the output list
                    ;--------------------------------------------------------
                    when(
                        case(maximum
                            ((nil min minimum "min" "minimum")
                                delta>=0 &&
                                (!previousDelta || previousDelta<=0)
                                )
                            (;(t max maximum "max" "maximum")
                             t
                                delta<=0 &&
                                (!previousDelta || previousDelta>=0)
                                )
                            ) ; case
                        output=tconc(output 
                            list(drGetElem(xVec sub1(index)) previous)
                            ) ; tconc
                        ) ; when
                    )
                previousDelta=delta
                previous=current
                ) ; for
            ;----------------------------------------------------------------
            ; Return list of x-y points
            ;----------------------------------------------------------------
            car(output)
            ) ; let
        ) ; procedure
                    
    /***********************************************************************
    *                                                                      *
    *               abWritePeakListToFile(peakList fileName)               *
    *                                                                      *
    * Given the result of abGetPeakList, write the data to a tab-separated *
    *                                file.                                 *
    *                                                                      *
    ***********************************************************************/
    
    procedure(abWritePeakListToFile(peakList fileName)
        let((prt)
            prt=outfile(fileName)
            if(prt then
                foreach(peak peakList
                    fprintf(prt "%13g\t%13g\n" car(peak) cadr(peak))
                    ) ; foreach
                close(prt)
            else
                error("Could not open file %L for writing\n" fileName)
                ) ; if
            ) ; let
        ) ; procedure
                
                
    /********************************************************************
    *                                                                   *
    *                  abPeakDetect(waveform maximum)                   *
    *                                                                   *
    *   Function to return a waveform of the peaks in a waveform. The   *
    * second argument must be min, minimum, max or maximum (as a string *
    *                           or a symbol).                           *
    *                                                                   *
    ********************************************************************/
    
    procedure(abPeakDetect(waveform maximum)
        cond(
            (drIsWaveform(waveform)
                let((peaks x y xVec yVec)
                    peaks=abGetPeakList(waveform maximum)
                    x=mapcar('car peaks)
                    y=mapcar('cadr peaks)
                    xVec=drCreateVec('double x)
                    yVec=drCreateVec('double y)
                    xVec~>units=drGetWaveformXVec(waveform)~>units
                    xVec~>name=drGetWaveformXVec(waveform)~>name
                    yVec~>units=drGetWaveformYVec(waveform)~>units
                    yVec~>name=drGetWaveformYVec(waveform)~>name
                    drCreateWaveform(xVec yVec)
                )
            )
            (famIsFamily(waveform)
                famMap('abPeakDetect waveform maximum)
            )
            (t
                error("abPeakDetect: Cannot handle %L\n" waveform)
            )
        )
    )

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

    Not sure this is quite what you want but you may be able to adapt it to your needs (it finds the local peaks and returns them as a waveform):

    /* abGetPeakList.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jan 19, 2005 
    Modified   Jun 06, 2011 
    By         A.D.Beckett
    
    Example:
    
    peaks=abGetPeakList(myWaveObj 'minimum)
    abWritePeakListToFile(peaks "peaks.out")
    
    Also has a function which returns a waveform of the peaks:
    
    plot(abPeakDetect(v("/out" ?result 'tran) "maximum"))
    
    ***************************************************
    
    SCCS Info: @(#) abGetPeakList.il 06/06/11.14:21:52 1.3
    
    */
    
    /**********************************************************************
    *                                                                     *
    *                   abGetPeakList(waveform maximum)                   *
    *                                                                     *
    *       Given a waveform object, and a second argument which is       *
    * t, "max", "maximum", 'max, 'maximum or nil, "min", "minimum", 'min, *
    *       or 'minimum, return a list of x-y pairs for the peaks.        *
    *                                                                     *
    **********************************************************************/
    
    procedure(abGetPeakList(waveform maximum)
        let((xVec yVec len previous delta previousDelta current output)
            xVec=drGetWaveformXVec(waveform)
            yVec=drGetWaveformYVec(waveform)
            len=drVectorLength(xVec)
            ;----------------------------------------------------------------
            ; Iterate over points in waveform
            ;----------------------------------------------------------------
            for(index 0 sub1(len)
                current=drGetElem(yVec index)
                when(previous
                    delta=current-previous
                    ;--------------------------------------------------------
                    ; Check to see if previous point was a peak, and if so
                    ; add it to the output list
                    ;--------------------------------------------------------
                    when(
                        case(maximum
                            ((nil min minimum "min" "minimum")
                                delta>=0 &&
                                (!previousDelta || previousDelta<=0)
                                )
                            (;(t max maximum "max" "maximum")
                             t
                                delta<=0 &&
                                (!previousDelta || previousDelta>=0)
                                )
                            ) ; case
                        output=tconc(output 
                            list(drGetElem(xVec sub1(index)) previous)
                            ) ; tconc
                        ) ; when
                    )
                previousDelta=delta
                previous=current
                ) ; for
            ;----------------------------------------------------------------
            ; Return list of x-y points
            ;----------------------------------------------------------------
            car(output)
            ) ; let
        ) ; procedure
                    
    /***********************************************************************
    *                                                                      *
    *               abWritePeakListToFile(peakList fileName)               *
    *                                                                      *
    * Given the result of abGetPeakList, write the data to a tab-separated *
    *                                file.                                 *
    *                                                                      *
    ***********************************************************************/
    
    procedure(abWritePeakListToFile(peakList fileName)
        let((prt)
            prt=outfile(fileName)
            if(prt then
                foreach(peak peakList
                    fprintf(prt "%13g\t%13g\n" car(peak) cadr(peak))
                    ) ; foreach
                close(prt)
            else
                error("Could not open file %L for writing\n" fileName)
                ) ; if
            ) ; let
        ) ; procedure
                
                
    /********************************************************************
    *                                                                   *
    *                  abPeakDetect(waveform maximum)                   *
    *                                                                   *
    *   Function to return a waveform of the peaks in a waveform. The   *
    * second argument must be min, minimum, max or maximum (as a string *
    *                           or a symbol).                           *
    *                                                                   *
    ********************************************************************/
    
    procedure(abPeakDetect(waveform maximum)
        cond(
            (drIsWaveform(waveform)
                let((peaks x y xVec yVec)
                    peaks=abGetPeakList(waveform maximum)
                    x=mapcar('car peaks)
                    y=mapcar('cadr peaks)
                    xVec=drCreateVec('double x)
                    yVec=drCreateVec('double y)
                    xVec~>units=drGetWaveformXVec(waveform)~>units
                    xVec~>name=drGetWaveformXVec(waveform)~>name
                    yVec~>units=drGetWaveformYVec(waveform)~>units
                    yVec~>name=drGetWaveformYVec(waveform)~>name
                    drCreateWaveform(xVec yVec)
                )
            )
            (famIsFamily(waveform)
                famMap('abPeakDetect waveform maximum)
            )
            (t
                error("abPeakDetect: Cannot handle %L\n" waveform)
            )
        )
    )

    • 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