| Author |
Message |
Svenn Are Bjerkem
Guest
|
Posted:
Mon Nov 08, 2004 5:56 pm Post subject:
Accessing monte carlo data from ocean |
|
|
Hi,
I wanted to write a function to extract the envelope of a monte carlo
simulation.
Pseudo code:
Output of circuit is Y(f)
Final table is ymax(f) maximum at a given freq
Final table is ymin(f) minimum at a given freq
for each run in montecarlo run
for each frequency of run
check if Y(f) < ymin(f) or Y(f) > ymax(f)
store/replace ymin(f) or ymax(f) with Y(f) if true
end
end
end
After this run I am supposed to have two tables ymin(f) and ymax(f) that
are waveforms describing the lowest and highest values at each frequency.
My problem is that
value(VF("/aol2_outp") 'montecarlo 1.0)
returns a wave object and not a list because ocean also wants to return
the temperature. With ocnPrint() I get some descriptive text at the
beginning which I have to filter away.
Is there somewhere an ocean command that will return a list like
(f1 y1 f2 y2 f3 y3 ... fn yn)
that I have overseen?
--
Svenn
|
|
| Back to top |
|
 |
fogh
Guest
|
Posted:
Mon Nov 08, 2004 9:49 pm Post subject:
Re: Accessing monte carlo data from ocean |
|
|
You have a wave object and you want list. That is definitely doable. I gave you
an example of this last 28 october, when you asked how to write a waveform to file.
There are most likely other ways to do it, using only public functions. Look
in the analog artist manual for "^dr" functions, and in the skill language user
manual for list manipulation topics.
Svenn Are Bjerkem wrote:
| Quote: | Hi,
I wanted to write a function to extract the envelope of a monte carlo
simulation.
Pseudo code:
Output of circuit is Y(f)
Final table is ymax(f) maximum at a given freq
Final table is ymin(f) minimum at a given freq
for each run in montecarlo run
for each frequency of run
check if Y(f) < ymin(f) or Y(f) > ymax(f)
store/replace ymin(f) or ymax(f) with Y(f) if true
end
end
end
After this run I am supposed to have two tables ymin(f) and ymax(f) that
are waveforms describing the lowest and highest values at each frequency.
My problem is that
value(VF("/aol2_outp") 'montecarlo 1.0)
returns a wave object and not a list because ocean also wants to return
the temperature. With ocnPrint() I get some descriptive text at the
beginning which I have to filter away.
Is there somewhere an ocean command that will return a list like
(f1 y1 f2 y2 f3 y3 ... fn yn)
that I have overseen? |
|
|
| Back to top |
|
 |
Andrew Beckett
Guest
|
Posted:
Tue Nov 09, 2004 11:35 am Post subject:
Re: Accessing monte carlo data from ocean |
|
|
Svenn,
Hopefully this code will help:
/* 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
Regards,
Andrew.
On Mon, 08 Nov 2004 13:56:29 +0100, Svenn Are Bjerkem <svenn.are@bjerkem.de> wrote:
| Quote: | Hi,
I wanted to write a function to extract the envelope of a monte carlo
simulation.
Pseudo code:
Output of circuit is Y(f)
Final table is ymax(f) maximum at a given freq
Final table is ymin(f) minimum at a given freq
for each run in montecarlo run
for each frequency of run
check if Y(f) < ymin(f) or Y(f) > ymax(f)
store/replace ymin(f) or ymax(f) with Y(f) if true
end
end
end
After this run I am supposed to have two tables ymin(f) and ymax(f) that
are waveforms describing the lowest and highest values at each frequency.
My problem is that
value(VF("/aol2_outp") 'montecarlo 1.0)
returns a wave object and not a list because ocean also wants to return
the temperature. With ocnPrint() I get some descriptive text at the
beginning which I have to filter away.
Is there somewhere an ocean command that will return a list like
(f1 y1 f2 y2 f3 y3 ... fn yn)
that I have overseen? |
|
|
| Back to top |
|
 |
Svenn Are Bjerkem
Guest
|
Posted:
Tue Nov 09, 2004 11:55 am Post subject:
Re: Accessing monte carlo data from ocean |
|
|
fogh wrote:
| Quote: | You have a wave object and you want list. That is definitely doable. I
gave you an example of this last 28 october, when you asked how to write
a waveform to file.
|
Oops!! Made a complete fool out of myself there. Problem is that I
changed employer between that date and now, and I left my stuff behind.
Thanks for the reminder.
--
Svenn |
|
| Back to top |
|
 |
Svenn Are Bjerkem
Guest
|
Posted:
Tue Nov 09, 2004 12:23 pm Post subject:
Re: Accessing monte carlo data from ocean |
|
|
Svenn Are Bjerkem wrote:
| Quote: | fogh wrote:
You have a wave object and you want list. That is definitely doable. I
gave you an example of this last 28 october, when you asked how to
write a waveform to file.
Oops!! Made a complete fool out of myself there. Problem is that I
changed employer between that date and now, and I left my stuff behind.
Thanks for the reminder.
|
Got up too early this morning, I think. First I understood last 28. Oct
as 28. Oct. 2003, then I discover that I hadn't read the reply from fogh
I got on 28. Oct 2004 when I tried to find it on groups.google.
--
Svenn |
|
| Back to top |
|
 |
|
|
|
|