setting the independent variable of a awd plot

Discussion in 'Cadence' started by Svenn Are Bjerkem, May 31, 2005.

  1. Hi,

    I try to set the independent variable (x-axis) of a plot from OCEAN or
    SKILL to be an expression. I can do this interactively by adding the
    waveform to the plot and then use the Axes->X axes.. and then set Plot
    vs. independent variable to be the waveform that I want to have as
    x-axis. I wonder how I can do this from a script.. I have looked around
    in the awv* functions without becoming much more help.

    Maybe it isn't possible in awd.
     
    Svenn Are Bjerkem, May 31, 2005
    #1
  2. Svenn,

    There is a function which was added for this in IC5141, ocnYvsYplot().
    Unfortunately we seem to have neglected to document it - it is public though.

    ocnYvsYplot(@key wave1 wave2 expr1 expr2 titleList colorList )

    wave1 - Reference wave against which
    the wave provided needs to be plotted
    wave2 - wave which is to be plotted against
    reference wave
    expr1 - reference Expression against which
    the expression provided needs to be plotted
    expr2 - Expressions which is to be plotted
    against reference expression
    titleList - list of waveform titles(if the waveform is simple then
    only one label will be required else if the waveform is
    param wave, then list of labels need to be provided.
    colorList - list of waveform colorList(if the waveform is simple then
    only one color will be required else if the waveform is
    param wave, then list of colors need to be provided.

    I'll file a PCR to get this documented.

    Another way of doing it is to use this code - this is how I've done it before
    (and is covered in solution 1844933 on sourcelink):

    /* 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.

    ***************************************************

    SCCS Info: @(#) abChangeXAxis.il 05/21/02.13:10:35 1.2

    */

    /*******************************************************************
    * *
    * (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)
    (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
    )
    )


    /***************************************************************
    * *
    * (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
    )
    )
     
    Andrew Beckett, May 31, 2005
    #2
  3. Actually it _is_ documented. It's in Chapter 8 of the OCEAN Reference Manual.
    What happened was that I tried searching for it in cdsFinder, or by using
    listFunctions("^ocn") and didn't find it. Turns out that it is mistakenly
    tagged as ocnPrint. If you do a search in cdsFinder for ocnPrint - you'll get
    two matches - click on the second, and it will give the description of
    ocnYvsYplot.

    Looks like a bit of cutting and pasting went on, and it inherited the tag from
    ocnPrint.

    I'll file a PCR to get _that_ fixed!

    Regards,

    Andrew.
     
    Andrew Beckett, May 31, 2005
    #3
  4. Hi Andrew,

    actually I found the function by seaching the pdf. It works a little
    different than I was picturing in my head and, thus, thought that there
    could exist another function that just swapped the axis. When looking at
    your code, it doesn't seem to be as easy as that.
     
    Svenn Are Bjerkem, Jun 2, 2005
    #4
  5. Well it is as simple as that if the x-axes of the original data were the same
    (that's all that happens in my code). There are some advantages of using the
    approach used in my code - if you have several simulations, you can plot
    a versus b for each different simulation on the same graph - whereas if you do
    it within the waveform tool you have to pick the axis as being b from one
    specific simulation run - which would probably do the wrong thing in plotting
    the other simulations.

    I've not played with ocnYvsYplot yet, so don't know how that behaves.

    Regards,

    Andrew.
     
    Andrew Beckett, Jun 3, 2005
    #5
  6. Thanks to my recently arrived courtesy copy of the Cadence SKILL
    Functions Quick Reference I found the function waveVsWave() which is
    taking the y-values of one waveform and use them as x-values of another
    waveform. Since all waveforms has the same original x-axis from the
    parametric run, I can plot any waveform vs any other waveform.

    The CSFQR is really a nice piece of work. The human optical pattern
    recognition is far better than searching in acrobat documents.
     
    Svenn Are Bjerkem, Jun 27, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.