• 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. Mixed-Signal Design
  3. measurements on eyediagram

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 64
  • Views 18115
  • 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 on eyediagram

vamshiky
vamshiky over 6 years ago

Hi,

I have an eyediagram for the reference voltage of my circuit. It is periodic and I am interested in the vertical (voltage)spread at a particular time instant.

adding delta markers does the job in VIVA, however I am looking for a calculator expression where I can check the voltage spread at multiple time instances and check over corners in ADEXL.

Tried with value() and clip() functions but had no luck here.

Thanks,

vamshiky

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

    You can't do that. You'd have to analyse the raw data. Some of the functions in the eye diagram assistant can be used to generate expressions which measure many of these things. You can probably achieve what you want by using the sample function to sample the waveform at a particular regular time interval (e.g. in the middle of each period), and then you could use the ymax/ymin to find the range of values. You'd do this on the input transient waveform to the eye diagram, rather than the eye diagram itself.

    There are a couple of my SKILL functions for capturing info similar to eye diagrams what might get you started too - in article 11395772 and article 11564054

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vamshiky
    vamshiky over 6 years ago in reply to Andrew Beckett

    Thanks for the reply Andrew, I ended up using sample function on transient waveform which works perfectly.

    It would be interesting to see a plot of voltage spread on y-axis  on the same scale of eyediagram (x-axis).

    Regards,

    vamshiky

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • vamshiky
    vamshiky over 6 years ago in reply to Andrew Beckett

    Thanks for the reply Andrew, I ended up using sample function on transient waveform which works perfectly.

    It would be interesting to see a plot of voltage spread on y-axis  on the same scale of eyediagram (x-axis).

    Regards,

    vamshiky

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to vamshiky

    Hi Vamshiky,

    If it's sampled once per period, not sure what benefit there would be to plotting on the same x-axis like with an eye diagram? You could however just plot a histogram of the resulting samples using  (say) Measurements->Histogram having plotted the sampled waveform? That would be a good way of visualising the spread of voltage at that instant in time in the period...

    Maybe I've misunderstood what you're saying though.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vamshiky
    vamshiky over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Sorry I meant to have it sampled more than once per period, and visualize the spread of voltage on the same scale as eyediagram.

    Thanks,

    vamshiky

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to vamshiky

    Hi Vamshiky,

    How about this code? It then produces a plot like this (the eye period is 80n, and sampled every 10n):

    /* abSampledEye.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Feb 18, 2019 
    Modified   
    By         
    
    Plot a waveform as a graph similar to an eye diagram, but
    only using the sampled points. The points are plotted rather than
    as a continuous line, to help see the spread at various instants
    during the eye period.
    
    To install, use the fx button in the calculator function panel or
    in the ADE Expression Builder.
    
    For example:
    
    abSampledEye(v("jitter" ?result "tran-tran") 160n 400u 10n 80n )
    
    ***************************************************
    
    SCCS Info: @(#) abSampledEye.il 02/18/19.07:56:43 1.1
    
    */
    
    /*******************************************************************
    *                                                                  *
    *     (abSampledEye waveform start stop sampleInterval period)     *
    *                                                                  *
    * Produce a plot like an eye diagram (i.e. with the x-axis shifted *
    *  to always be on the specified period) with the points sampled   *
    *   onto the specified sampleInterval. The plot is produced with   *
    *      a hint to plot using points rather than a joined line.      *
    *                                                                  *
    *******************************************************************/
    
    (procedure (abSampledEye waveform start stop sampleInterval period )
      (cond
        ;--------------------------------------------------------------------
        ; Handle ordinary waveform
        ;--------------------------------------------------------------------
        ((drIsWaveform waveform)
         (let (xVec yVec outXVec outYVec len startOfPeriod endOfPeriod time
                    sampled outWave)
           (setq xVec (drGetWaveformXVec waveform))
           (setq yVec (drGetWaveformYVec waveform))
           (setq len (drVectorLength xVec))
           ;---------------------------------------------------------------
           ; if no start given (start less or equal to 0), use first time point
           ;---------------------------------------------------------------
           (when (leqp start 0) 
             (setq start (drGetElem xVec 0)))
           ;---------------------------------------------------------------
           ; if no stop given (stop less or equal to 0), use last time point
           ;---------------------------------------------------------------
           (when (leqp stop 0)
             (setq stop (drGetElem xVec (sub1 len))))
           ;---------------------------------------------------------------
           ; cast everything to floats, just to make sure
           ;---------------------------------------------------------------
           (setq start (float start))
           (setq stop (float stop))
           (setq period (float period))
           (if (greaterp stop start)
             (progn
               (setq sampled (sample waveform start stop "linear" sampleInterval))
               (setq xVec (drGetWaveformXVec sampled))
               (setq yVec (drGetWaveformYVec sampled))
               (setq len (drVectorLength xVec))
               ;----------------------------------------------------------
               ; create the output vectors
               ;----------------------------------------------------------
               (setq outXVec (drCreateVec (drType xVec) len))
               (setq outYVec (drCreateVec (drType yVec) len))
               (setq startOfPeriod start)
               (setq endOfPeriod (plus start period))
               (for point 0 (sub1 len)
                    (setq time (drGetElem xVec point))
                    (when (greaterp time endOfPeriod)
                      (setq startOfPeriod endOfPeriod)
                      (setq endOfPeriod (plus endOfPeriod period))
                      )
                    (drAddElem outXVec (difference time startOfPeriod))
                    (drAddElem outYVec (drGetElem yVec point))
                    )
               (putpropq outXVec (getq xVec units) units)
               (putpropq outXVec (getq xVec name) name)
               (putpropq outYVec (getq yVec units) units)
               (putpropq outYVec (getq yVec name) name)
               (setq outWave (drCreateWaveform outXVec outYVec))
               (famSetExpr outWave 
                           `(abSampledEye ,famGetExpr(waveform) start
                                          stop sampleInterval period))
               (putpropq outWave "scatterPlot" plotStyle)
               outWave
               )
             (error "Start time must be before stop time\n")
             )
           )
         )
        ;--------------------------------------------------------------------
        ; Handle family
        ;--------------------------------------------------------------------
        ((famIsFamily waveform)
         (famMap 'abSampledEye waveform start stop sampleInterval period)
         ) ; family
        (t
          (error "eyePlot - can't handle %L\n" waveform)
          )
        ) ; cond
      )
    
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;; GUI builder information ;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ocnmRegGUIBuilder(
     '(nil
      function abSampledEye
      name abSampledEye
      description "Produce an eye diagram of sampled points"
      category ("Custom Functions")
      analysis (nil
          general (nil
            args (waveform start stop sampleInterval period )
              signals (nil
                    waveform (nil
                          prompt "Waveform"
                          tooltip "Waveform"
                          )
               )
              params(nil
                     start (nil
                           prompt "Start Time"
                           tooltip "Start Time"
                           guiRowHint 1
                           type float
                           default 0.0
                           required t
                     )
                     stop (nil
                           prompt "Stop Time"
                           tooltip "Stop Time"
                           guiRowHint 1
                           type float
                           default 0.0
                           required t
                     )
                     sampleInterval (nil
                           prompt "Sample Interval"
                           tooltip "Sample Interval"
                           guiRowHint 2
                           type float
                           required t
                     )
                     period (nil
                           prompt "Eye Period"
                           tooltip "Eye Period"
                           guiRowHint 2
                           type float
                           required t
                     )
              )
            inputrange t
          )
      )
      outputs(result)
     )
    )
    

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vamshiky
    vamshiky over 6 years ago in reply to Andrew Beckett

    Thanks a lot Andrew, its pretty close to what I was looking for.

    I just need that range of the spread (i.e, ymax() - ymin()  ) for the voltage spread at each sampleInterval i.e., 10n in you example.

    ex:  At 50ns time in your plot  I expect a single point at  ymin-ymax i.e, ~ 1.22-(-0.15) =1.37V

    Thanks,

    vamshiky

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to vamshiky

    Hi Vamshiky,

    Here's an updated piece of code with an additional function, abSampledEyeRange that I think does what you want (it can also output the min or max value at each sample point, since that was easy to do at the same time):

    /* abSampledEye.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Feb 18, 2019 
    Modified   Feb 20, 2019 
    By         A.D.Beckett
    
    Plot a waveform as a graph similar to an eye diagram, but
    only using the sampled points. The points are plotted rather than
    as a continuous line, to help see the spread at various instants
    during the eye period.
    
    A second function is provided to compute the range, min or max
    at each sample point within the period.
    
    To install, use the fx button in the calculator function panel or
    in the ADE Expression Builder.
    
    For example:
    
    abSampledEye(v("jitter" ?result "tran-tran") 160n 400u 10n 80n )
    abSampledEyeRange(v("jitter" ?result "tran-tran") 160n 400u 8 80n "range"
                                                      "points")
    
    ***************************************************
    
    SCCS Info: @(#) abSampledEye.il 02/20/19.22:07:22 1.2
    
    */
    
    /*******************************************************************
    *                                                                  *
    *     (abSampledEye waveform start stop sampleInterval period)     *
    *                                                                  *
    * Produce a plot like an eye diagram (i.e. with the x-axis shifted *
    *  to always be on the specified period) with the points sampled   *
    *   onto the specified sampleInterval. The plot is produced with   *
    *      a hint to plot using points rather than a joined line.      *
    *                                                                  *
    *******************************************************************/
    
    (procedure (abSampledEye waveform start stop sampleInterval period )
      (cond
        ;--------------------------------------------------------------------
        ; Handle ordinary waveform
        ;--------------------------------------------------------------------
        ((drIsWaveform waveform)
         (let (xVec yVec outXVec outYVec len startOfPeriod endOfPeriod time
                    sampled outWave)
           (setq xVec (drGetWaveformXVec waveform))
           (setq yVec (drGetWaveformYVec waveform))
           (setq len (drVectorLength xVec))
           ;---------------------------------------------------------------
           ; if no start given (start less or equal to 0), use first time point
           ;---------------------------------------------------------------
           (when (leqp start 0) 
             (setq start (drGetElem xVec 0)))
           ;---------------------------------------------------------------
           ; if no stop given (stop less or equal to 0), use last time point
           ;---------------------------------------------------------------
           (when (leqp stop 0)
             (setq stop (drGetElem xVec (sub1 len))))
           ;---------------------------------------------------------------
           ; cast everything to floats, just to make sure
           ;---------------------------------------------------------------
           (setq start (float start))
           (setq stop (float stop))
           (setq period (float period))
           (if (greaterp stop start)
             (progn
               (setq sampled (sample waveform start stop "linear" sampleInterval))
               (setq xVec (drGetWaveformXVec sampled))
               (setq yVec (drGetWaveformYVec sampled))
               (setq len (drVectorLength xVec))
               ;----------------------------------------------------------
               ; create the output vectors
               ;----------------------------------------------------------
               (setq outXVec (drCreateVec (drType xVec) len))
               (setq outYVec (drCreateVec (drType yVec) len))
               (setq startOfPeriod start)
               (setq endOfPeriod (plus start period))
               (for point 0 (sub1 len)
                    (setq time (drGetElem xVec point))
                    (when (greaterp time endOfPeriod)
                      (setq startOfPeriod endOfPeriod)
                      (setq endOfPeriod (plus endOfPeriod period))
                      )
                    (drAddElem outXVec (difference time startOfPeriod))
                    (drAddElem outYVec (drGetElem yVec point))
                    )
               (putpropq outXVec (getq xVec units) units)
               (putpropq outXVec (getq xVec name) name)
               (putpropq outYVec (getq yVec units) units)
               (putpropq outYVec (getq yVec name) name)
               (setq outWave (drCreateWaveform outXVec outYVec))
               (famSetExpr outWave 
                           `(abSampledEye ,famGetExpr(waveform) start
                                          stop sampleInterval period))
               (putpropq outWave "scatterPlot" plotStyle)
               outWave
               )
             (error "Start time must be before stop time\n")
             )
           )
         )
        ;--------------------------------------------------------------------
        ; Handle family
        ;--------------------------------------------------------------------
        ((famIsFamily waveform)
         (famMap 'abSampledEye waveform start stop sampleInterval period)
         ) ; family
        (t
          (error "eyePlot - can't handle %L\n" waveform)
          )
        ) ; cond
      )
    
    /****************************************************************************
    *                                                                           *
    *      (abSampledEyeRange waveform start stop samplesPerPeriod period       *
    *                 rangeType @optional (plotStyle "points")                  *
    *                                                                           *
    * Sample the waveform with samplesPerPeriod points in each period, and then *
    *    compute the min and max across all periods for that sample. Outputs    *
    *   either the min, max or range (dependent on the rangeType parameter),    *
    *           and plots as either discrete points or a joined line.           *
    *                                                                           *
    ****************************************************************************/
    
    (procedure (abSampledEyeRange waveform start stop samplesPerPeriod period 
                                  rangeType @optional (plotStyle "points"))
      (cond
        ;--------------------------------------------------------------------
        ; Handle ordinary waveform
        ;--------------------------------------------------------------------
        ((drIsWaveform waveform)
         (let (xVec yVec outXVec outYVec len startOfPeriod endOfPeriod time
                    sampled outWave minVector maxVector sampleInterval binNum
                    yVal)
           (setq xVec (drGetWaveformXVec waveform))
           (setq yVec (drGetWaveformYVec waveform))
           (setq len (drVectorLength xVec))
           (setq minVector (makeVector samplesPerPeriod nil))
           (setq maxVector (makeVector samplesPerPeriod nil))
           (setq sampleInterval (quotient period samplesPerPeriod))
           (when (equal plotStyle "points") 
             (setq plotStyle "scatterPlot"))
           ;---------------------------------------------------------------
           ; if no start given (start less or equal to 0), use first time point
           ;---------------------------------------------------------------
           (when (leqp start 0) 
             (setq start (drGetElem xVec 0)))
           ;---------------------------------------------------------------
           ; if no stop given (stop less or equal to 0), use last time point
           ;---------------------------------------------------------------
           (when (leqp stop 0)
             (setq stop (drGetElem xVec (sub1 len))))
           ;---------------------------------------------------------------
           ; cast everything to floats, just to make sure
           ;---------------------------------------------------------------
           (setq start (float start))
           (setq stop (float stop))
           (setq period (float period))
           (if (greaterp stop start)
             (progn
               (setq sampled (sample waveform start stop "linear" sampleInterval))
               (setq xVec (drGetWaveformXVec sampled))
               (setq yVec (drGetWaveformYVec sampled))
               (setq len (drVectorLength xVec))
               ;----------------------------------------------------------
               ; create the output vectors
               ;----------------------------------------------------------
               (setq outXVec (drCreateVec (drType xVec) samplesPerPeriod))
               (setq outYVec (drCreateVec (drType yVec) samplesPerPeriod))
               (setq startOfPeriod start)
               (setq endOfPeriod (plus start period))
               (for point 0 (sub1 len)
                    (setq time (drGetElem xVec point))
                    (when (greaterp time endOfPeriod)
                      (setq startOfPeriod endOfPeriod)
                      (setq endOfPeriod (plus endOfPeriod period))
                      )
                    (setq binNum
                          (mod
                            (round (quotient (difference time startOfPeriod)
                                             sampleInterval))
                            samplesPerPeriod))
                    (setq yVal (drGetElem yVec point))
                    (when (or
                            (null (arrayref minVector binNum))
                            (lessp yVal (arrayref minVector binNum)))
                      (setarray minVector binNum yVal))
                    (when (or
                            (null (arrayref maxVector binNum))
                            (greaterp yVal (arrayref maxVector binNum)))
                      (setarray maxVector binNum yVal))
                    )
               (for bin 0 (sub1 samplesPerPeriod)
                    (when (arrayref minVector bin)
                      (drAddElem outXVec (times sampleInterval bin))
                      (drAddElem outYVec
                                 (case rangeType
                                   ("min" 
                                    (arrayref minVector bin))
                                   ("max" 
                                    (arrayref maxVector bin))
                                   (t
                                     (difference
                                       (arrayref maxVector bin)
                                       (arrayref minVector bin)))
                                   ))
                      )
                    )
               (putpropq outXVec (getq xVec units) units)
               (putpropq outXVec (getq xVec name) name)
               (putpropq outYVec (getq yVec units) units)
               (putpropq outYVec (getq yVec name) name)
               (setq outWave (drCreateWaveform outXVec outYVec))
               (famSetExpr outWave 
                           `(abSampledEyeRange ,famGetExpr(waveform) start
                                          stop samplesPerPeriod period
                                          rangeType plotStyle))
               (putpropq outWave plotStyle plotStyle)
               outWave
               )
             (error "Start time must be before stop time\n")
             )
           )
         )
        ;--------------------------------------------------------------------
        ; Handle family
        ;--------------------------------------------------------------------
        ((famIsFamily waveform)
         (famMap 'abSampledEyeRange waveform start stop samplesPerPeriod period
                 rangeType plotStyle)
         ) ; family
        (t
          (error "eyePlot - can't handle %L\n" waveform)
          )
        ) ; cond
      )
    
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;; GUI builder information ;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ocnmRegGUIBuilder(
     '(nil
      function abSampledEye
      name abSampledEye
      description "Produce an eye diagram of sampled points"
      category ("Custom Functions")
      analysis (nil
          general (nil
            args (waveform start stop sampleInterval period )
              signals (nil
                    waveform (nil
                          prompt "Waveform"
                          tooltip "Waveform"
                          )
               )
              params(nil
                     start (nil
                           prompt "Start Time"
                           tooltip "Start Time"
                           guiRowHint 1
                           type float
                           default 0.0
                           required t
                     )
                     stop (nil
                           prompt "Stop Time"
                           tooltip "Stop Time"
                           guiRowHint 1
                           type float
                           default 0.0
                           required t
                     )
                     sampleInterval (nil
                           prompt "Sample Interval"
                           tooltip "Sample Interval"
                           guiRowHint 2
                           type float
                           required t
                     )
                     period (nil
                           prompt "Eye Period"
                           tooltip "Eye Period"
                           guiRowHint 2
                           type float
                           required t
                     )
              )
            inputrange t
          )
      )
      outputs(result)
     )
    )
    ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;; GUI builder information ;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ocnmRegGUIBuilder(
     '(nil
      function abSampledEyeRange
      name abSampledEyeRange
      description "Compute the range, min or max for each sample in eye period"
      category ("Custom Functions")
      analysis (nil
          general (nil
            args (waveform start stop samplesPerPeriod period rangeType plotStyle )
              signals (nil
                    waveform (nil
                          prompt "Waveform"
                          tooltip "Waveform"
                          )
               )
              params(nil
                     start (nil
                           prompt "Start Time"
                           tooltip "Start Time"
                           guiRowHint 1
                           type float
                           default 0
                           required t
                     )
                     stop (nil
                           prompt "Stop Time"
                           tooltip "Stop Time"
                           guiRowHint 1
                           type float
                           default 0
                           required t
                     )
                     samplesPerPeriod (nil
                           prompt "Samples Per Period"
                           tooltip "Samples Per Period"
                           guiRowHint 2
                           type int
                           required t
                     )
                     period (nil
                           prompt "Eye Period"
                           tooltip "Eye Period"
                           guiRowHint 2
                           type float
                           required t
                     )
                     rangeType (nil
                           prompt "Range Type"
                           tooltip "Range Type"
                           guiRowHint 3
                           default "range"
                           type ("range" "min" "max" )
                           required t
                     )
                     plotStyle (nil
                           prompt "Plot Style"
                           tooltip "Plot Style"
                           guiRowHint 3
                           default "points"
                           type ("points" "joined" )
                           required nil
                     )
              )
            inputrange t
          )
      )
      outputs(result)
     )
    )
    

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vamshiky
    vamshiky over 6 years ago in reply to Andrew Beckett

    Andrew,

    Thats pretty useful, I appreciate your effort on this.

    Thanks,

    vamshiky

    • 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