• 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. How to combine two plots y1=f(v1) & y2=f(v2)

Stats

  • Locked Locked
  • Replies 11
  • Subscribers 125
  • Views 7826
  • 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

How to combine two plots y1=f(v1) & y2=f(v2)

SUEE
SUEE over 13 years ago

Hi all,

In ADE plot using AWD, how to combine two plots y1=f(V1) & y2=f(V2)

For y1=f(V1(t)), I could plot V1 along the x-axis and y1 along the y-axis

Similarly for y2=f(V2(t)), I could plot y2 (on the y-axis) versus V2 (along the x-axis)

Because V1(t) is not equal to V2(t) so that I can not plot both y1 & y2 respect to either V1 or V2.

However, I do need to overlap the y1=f(V1) and y2=f(V2) on the same plot.

What can I do?

 

Thank you very much !!

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    That's surprising, because normally if the X axes are similar, they will get plotted on the same graph in AWD. With wavescan, that's not the case, and you have to ensure that:

    drGetWaveformXVec(y1)->units 

    matches

    drGetWaveformXVec(y2)->units

    (You can assign the units attribute to whatever you want).

    Maybe you need to give a bit more detail...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

    Let me explain my problem in more detail.

    I have one circuit and I have to use two different waveforms to characterize it.

    (1) The length of first wafeform (called V1) is 5ms, so my first simulation result (called Y1) lasts 5ms.

          After this simulation I could then plot a 1st curve with Y1 on y-axis and X1 on x-axis.

         This curve characterizes the behavior of my circuit.

    (2) The length of second wafeform (called V2) is 5s, so my second simulation result (called Y2) lasts 5s.

          After this simulation I could then plot a 2nd curve with Y2 on y-axis and X2 on x-axis.

         This curve also characterizes the behavior of my circuit.

     

    My question is: how could I combine these two curves on the same plot? V1 is not equal to V2.

     

    Thank you !!!

     

     

     

     

     


     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    It's still not entirely clear what you want, because you can plot both of these on the same graph. I'm assuming you want to scale the x-values so that the axes match?

    If so, you could do something like this:

    v1=v("sig1" ?result 'tran ?resultsDir "run5ms.raw")
    v2=v("sig2" ?result 'tran ?resultsDir "run5.raw")
    scaledX=xval(v1)*1000
    v1scaled=abChangeXAxis(v1 scaledX)
    plot(v1scaled v2)

    This is using this code:

    /* abChangeXAxis.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       May 25, 1999 
    Modified   May 21, 2002 
    By         A.D.Beckett
    
    Function to change the X Axis of a waveform to the corresponding
    Y values of the second variable.
    
    Also function to transpose the X and Y axes of a waveform.
    
    Now handles families, and can be registered as a special function.
    Just call:
    
    abRegChangeXAxis()
    
    to add to the calculator.
    
    ***************************************************
    
    SCCS Info: @(#) abChangeXAxis.il 11/27/08.09:59:36 1.3
    
    */
    
    /*******************************************************************
    *                                                                  *
    *                    (abChangeXAxis yVar xVar)                     *
    *                                                                  *
    * Return a new waveform object with the x axis set to the y values *
    *                     of the second argument.                      *
    *                                                                  *
    *******************************************************************/
    
    (procedure (abChangeXAxis yVar xVar)
      (let (newWave)
        (cond
          ;------------------------------------------------------------------
          ; Handle normal waveform
          ;------------------------------------------------------------------
          ((drIsWaveform yVar)
           (setq newWave (drCreateEmptyWaveform))
           (drPutWaveformXVec newWave (drGetWaveformYVec xVar))
           (if (eq (drGetWaveformXVec yVar) (drGetWaveformXVec xVar))
             ;---------------------------------------------------------------
             ; if the x axes are the same for both, it's simple
             ;---------------------------------------------------------------
             (drPutWaveformYVec newWave (drGetWaveformYVec yVar))
             ;---------------------------------------------------------------
             ; otherwise need to use value() to interpolate
             ;---------------------------------------------------------------
             (let (xVec yVec len)
               (setq xVec (drGetWaveformXVec xVar))
               (setq len (drVectorLength xVec))
               (setq yVec (drCreateVec (drGetWaveformYType yVar) len))
               (for ind 0 (sub1 len)
                    (drAddElem yVec (value yVar (drGetElem xVec ind)))
                    )
               (drPutWaveformYVec newWave yVec)
               )
             )
           newWave
           )
          ;------------------------------------------------------------------
          ; Handle family
          ;------------------------------------------------------------------
          ((famIsFamily yVar)
           (famMap 'abChangeXAxis yVar xVar)
           ) ; is family
          (t
            (error "abChangeXAxis - can't handle %L\n" yVar)
            )
          ) ; cond
        ) ; let
      ) ; defun
    
    /**********************************************************************
    *                                                                     *
    *                         (abRegChangeXAxis)                          *
    *                                                                     *
    * Registers abChangeXAxis as a new special function in the calculator *
    *                                                                     *
    **********************************************************************/
    
    (procedure (abRegChangeXAxis)
      (calRegisterSpecialFunction
        (list "abChangeXAxis" 'abChangeXAxisCB)
        )
      t
      )
    
    /***************************************************************************
    *                                                                          *
    *                            (abChangeXAxisCB)                             *
    *                                                                          *
    * Callback function for the special function - which builds the expression *
    *                                                                          *
    ***************************************************************************/
    
    (procedure (abChangeXAxisCB)
      (calSpecialFunctionInput 'abChangeXAxis '(STACK))
      )
    
    /***************************************************************
    *                                                              *
    *                     (abTransposeXY var)                      *
    *                                                              *
    *             Swap the X and Y axes of a variable              *
    *                                                              *
    ***************************************************************/
    
    (procedure (abTransposeXY var)
      (let (newWave)
           (setq newWave (drCreateEmptyWaveform))
           (drPutWaveformXVec newWave (drGetWaveformYVec var))
           (drPutWaveformYVec newWave (drGetWaveformXVec var))
           newWave
           )
      )
    

     

    IC61X has a function (ocnYvsY) for doing this kind of plot directly.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

    Hi Andrew

    Thanks a lot for your great and kindly help.

    I redraw my question in the file:

    https://docs.google.com/open?id=0B21M2IdObdCiMWNmZDdjOWEtZjVlNy00ZmQ0LTg0MzktOTFjY2RmYWUzNGM4

    Please kindly show me the steps to combine the two plots together.

    I am a rookie in this matter. Your answer was too difficult for me to understand    :P

    Thank you so mych !!

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    OK, I understand now. You need to plot abChangeXAxis(y1 v1) and abChangeXAxis(y2 v2) using the SKILL code I posted previously.

    You can load this code with load("abChangeXAxis.il") from your .cdsinit file, and then call abRegChangeXAxis() to add a new special function in the calculator if you don't want to type the expressions.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

     Hi Andrew,

     

    Thank you so much.

    But I encountered an error message like this:

    https://docs.google.com/open?id=0B21M2IdObdCiODgxMjg4MzYtMDU3Ny00ZjFmLWFiYWMtZTcyNGE1ZDEyMzY4

    what should I do?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

    My icfb version is IC 5.1.41

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

    After I placed a ";" at the beginning of the lines that intended for comment and reload the il file, the above error messages disapper.

    But when I key in "abRegChangeXAxis" in the CIW, it shows "*Error* eval: undifined function - abRegChangeXAxis"

     

    Wher/how should I call "abRegChangeXAxis"? 

    Many thanks !!

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

    Interesting.... rather than load("abChangeAxis.il") but copy the whole file content into CIW, I could then call abRegChangeXAxis() and the calculator does show the new special function "abChangeXAxis" ....

    What thing did I do wrong by loading the "abChangeAxis.il" ?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SUEE
    SUEE over 13 years ago

    Andrew,

    Now I have the special function in the calculator and four waveforms v1,y1,v2 & y2 on AWD.

    Then how to use this special function abChangeXAxis in the calculator? It has two arguments, right?

    Shoudl I pick up the waveforms first or shoud I key in something like abChangeXAxis(y1 v1) ?

     I tried some combinations but just get various error messages that I do not understand.

    Help !! 

    Thank you so much !!

    ps. again my icfb version is IC 5.1.41

     

    • 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