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

B

Bernd Fischer

Guest
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 wrote:
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.
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
 
On 17 Aug 2006 10:06:17 -0700, "Svenn Bjerkem" <svenn.are@bjerkem.de> wrote:

Bernd Fischer wrote:
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.

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.
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
Principal European Technology Leader
Cadence Design Systems, UK.
 
Thanks guys, especially Andrew, this helps me to move further.

Cheers Bernd
 
Hi Andrew,
do you have an estimation, how fast this conversion would be
compared with ocnPrint (which is probably a native implementation)?

Thanks,
Sylvio

Andrew Beckett wrote:
On 17 Aug 2006 10:06:17 -0700, "Svenn Bjerkem" <svenn.are@bjerkem.de> wrote:


Bernd Fischer wrote:

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.

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.


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
Principal European Technology Leader
Cadence Design Systems, UK.
 
On Tue, 12 Sep 2006 13:52:36 +0200, Sylvio Triebel <Sylvio.Triebel@nospam.com>
wrote:

Hi Andrew,
do you have an estimation, how fast this conversion would be
compared with ocnPrint (which is probably a native implementation)?

Thanks,
Sylvio
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
Principal European Technology Leader
Cadence Design Systems, UK.
 
On Thursday, August 17, 2006 at 2:06:17 PM UTC-3, Svenn Are Bjerkem wrote:
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.

Hi Svenn,

Why not use nutbin format? It is very easy to parse.

Regards
Ignacio
 

Welcome to EDABoard.com

Sponsor

Back
Top