SKILL: How to convert a waveform object into a list?

Discussion in 'Cadence' started by Bernd Fischer, Aug 17, 2006.

  1. Hi,

    I'm curios if it is possible to convert a
    waveform object into a list?


    I knew that I can use 'ocnPrint', e.g.
    ocnPrint( o_wave ?output t_file )
    to print a waveform object into a file.

    But I want to postprocess the data before
    I write them to a file. And I didn't want to
    do a cost effective file out, file in and file out
    again.

    Thanks Bernd
     
    Bernd Fischer, Aug 17, 2006
    #1
  2. How about using some of the functions that Andew use to create
    waveforms with new xaxis in his abChangeXAxis function? I just saw it
    the other day when the question plot somewave vs otherwave in ocean
    showed up again. drGetWaveform* should also give some hits in
    cdsFinder.

    I personally don't like the way ocnPrint formats the data because it is
    more or less useless without further processing. I need to move a lot
    of ocnPrint data over in excel to postprocess because we haven't
    discovered qtiplot, or labplot in my company yet. (But I would rather
    like to have something that perl can read in to use
    Spreadsheet::WriteExcel perl module)

    Any perl hackers out there who have time and energy to write a wrapper
    around the psf executable to extract data from the psfbin waveform data
    on a command line base. (No OCEAN here) I would gladly cooperate.
     
    Svenn Bjerkem, Aug 17, 2006
    #2
  3. A SKILL function to do what Bernd wants:

    /* abWaveToList.il

    Author A.D.Beckett
    Group Custom IC (UK), Cadence Design Systems Ltd.
    Language SKILL
    Date Nov 17, 2003
    Modified
    By

    Convert a waveform to a list

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

    SCCS Info: @(#) abWaveToList.il 11/17/03.15:08:15 1.1

    */

    /************************************************************************
    * *
    * (abWaveToList wave @key transpose) *
    * *
    * Take a waveform object, and return it as a list of xy pairs. Or *
    * if transpose is set, it returns a list of x values followed by a list *
    * of y values. *
    * *
    ************************************************************************/


    (procedure (abWaveToList wave @key transpose)
    (let (xList yList xyList len
    (xVec (drGetWaveformXVec wave))
    (yVec (drGetWaveformYVec wave))
    )
    (setq len (drVectorLength xVec))
    ;-----------------------------------------------------------------
    ; Return value of this if is the list
    ;-----------------------------------------------------------------
    (if transpose
    (progn
    (for i 0 (sub1 len)
    (setq xList (tconc xList (drGetElem xVec i)))
    (setq yList (tconc yList (drGetElem yVec i)))
    )
    (list (car xList) (car yList))
    )
    ; else
    (progn
    (for i 0 (sub1 len)
    (setq xyList (tconc xyList (list (drGetElem xVec i)
    (drGetElem yVec i))))
    )
    (car xyList)
    )
    ) ; if
    ) ; let
    ) ; procedure



    Andrew.
     
    Andrew Beckett, Aug 18, 2006
    #3
  4. Thanks guys, especially Andrew, this helps me to move further.

    Cheers Bernd
     
    Bernd Fischer, Aug 18, 2006
    #4
  5. Hi Andrew,
    do you have an estimation, how fast this conversion would be
    compared with ocnPrint (which is probably a native implementation)?

    Thanks,
    Sylvio
     
    Sylvio Triebel, Sep 12, 2006
    #5
  6. I don't think there would be much in it. I've not done any profiling, but I
    expect it to be similar speed.

    Andrew.
     
    Andrew Beckett, Oct 8, 2006
    #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.