Silly script: Extracting family waveform data to plot multiple XY plots in Cadence ADE

A colleague of mine recently struggled to plot multiple XY plots using the Cadence ADE simulator.

Assume you have a nonlinear circuit of some kind (see below where we have added some AM modulation, some limiter and a squaring circuitry to form some kind of nonlinearity) and you would like to plot the good old XY plots to investigate e.g. the IV-curves or any other types of hysteresis or so. In the Cadence ADE environment, this can simply be done by going to the (version 6 and above) Axis > Y vs Y ... and select what you have on the Y-axis. Easy-peasy.

dd

dd3

The problem however occurs with family plots (from parametric sweeps). The interface to the waveform viewer does not allow you to do a convenient XY plot. In the Y-Y option in the menu you can only select one out of all the waveforms, it is not possible to do it on a element-to-element basis. Selecting one of them brings it into a mess.

dd2

Notice that the new min and max X values are the same in both XY plots – even though we change the input amplitude in the parametric sweep.

dd4

It can be done in a tedious way: select for each single curve a new X curve and then plot it and drag it to a new window. However, with e.g. 20 curves and beyond this grows to something not that pleasant. Especially, if you have to re-simulate.

“Obviously” a piece of OCEAN script would solve this brilliantly since you would have control over the different loops you do and you would quite easily extract the individual waveforms and plot them in the same window.

If one wants to avoid the scripts the option is to add some simple code snippet in the Virtuoso window. Assume we want to plot the vOut (along Y axis) as function of vIn (along X axis) for each one of the parametric sweeps. We can try with the following code to extract one of the waveforms:


yyy = VT("/vOut")
xxx = VT("/vIn")
waveNo = 0
xVec = drGetWaveformYVec( drGetElem( drGetWaveformYVec(xxx) waveNo) )
yVec = drGetWaveformYVec( drGetElem( drGetWaveformYVec(yyy) waveNo) )
(setq wave (drCreateEmptyWaveform))
(drPutWaveformXVec wave xVec)
(drPutWaveformYVec wave yVec)
(plot wave)

(With a little bit of copy from some of the brilliant Andrew Beckett’s posts…)

and then it is just to wrap your favourite for/while loop on top of that and change your waveNo accordingly. (Check when drGetElem( drGetWaveformYVec(yyy) waveNo) evaluates to nil to abort the loop). The result becomes something like this:

dd5

where we now see the min and max values of the X axes change with input amplitude.

Advertisements

2 thoughts on “Silly script: Extracting family waveform data to plot multiple XY plots in Cadence ADE

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s