• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. plotting from OCEAN script in ADEXL

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 125
  • Views 18642
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

plotting from OCEAN script in ADEXL

Michele Ancis
Michele Ancis over 10 years ago

Hi all,

I am interested in learning how to issue plot commands from within an OCEAN script, basically extending the

already existing OCEAN measurement script. This is because in doing so I hope to get more control and uniformity

with respect to which windows get plotted, which curves on which graphs, colors, labels, what not.

I found that I keep tweaking and working at the way waveforms are plotted and could not really find a way of having this fixed once and for all.

[any suggestions appreciated, anyhow]

I have tried a simple plot( expression) from within the OCEAN measurement script, and that works fine.

However, the reason I am using XL is generally tied to

parametric/corner analyses. Here things change a bit and I probably do not understand the underlying concepts very well...

It may happen that the object I want to plot is a simple, single number, for each parameter point.

That is, the axlOutputResult() will return a single number per simulation point, and if I want to plot a curve vs. swept parameter

I have to RMB click on the name of the output and select "Plot All". This works OK.

Now, I would like to be able to have the same behavior, but use an OCEAN script.

The simple plot(my_result) function does not cut it, as the object passed (my expression) evaluates to a single number, not

something the software is keen on plotting.

Strangely enough, an ocnPrint(my_result) would return - on CIW - all the values!!

I have then tried to reproduce what happens when I "plot All" from the GUI

I can see a function _axlPlotAllOutput(...) - very promising - but I could not find any reference to it in the Help

Anybody knows where to search for it?

Anyhow, I am sure there are other, better ways to do that. But I am not aware of any ;-)

So, the issue at hand is how to "create" a waveform, maybe a set of (x,y) coordinates, from a set of outcomes from

parametric simulations ran by ADEXL

Another closely related topic would be, in case of multi-dimensional sweeps, how to slice the output results at will, similarly

to what happens with the YvsY and change sweep Var GUI buttons. 

But more in general, I would like to gain understanding on how to access these data, what are these? arrays?

Some More Specific Data - and a pseudo-workaround

What I do

I run a simulation with no sweeps inside ADEXL

In the Global Variables area, I then set one single sweep up (but I would likely extend that to more variables)

In the OCEAN results definition script, I calculate something like:

my_res = db(ih('hb "my_node" '(2 -1))))

[ this is coming from the Calculator directly ]

What I get

As said, if I RMB click my_res in the Outputs Pane --> Plot All, then I get what I would expect, the value of my_res Vs. my swept variable

If i do

ocnPrint(my_res)

I also get a list of values printed out in the CIW

If I try

plot(my_res)

I get as many "not a waveform object...deleted" WARNINGS as the points of the sweep (luckily, not many yet).

Some sort of workaround

Now, after much searching I found a tricky way, but again it's clear I'm against Nature because the plot isn't nice...

Here is what I came up with:

Leveraging on the fact that - besides for plot() - the variable "my_res" DOES contain all the points, I create a vector:

my_xv = drCreateVec( 'double 0)

my_yv = drCreateVec( 'double 0)

foreach(val list(my_res)

    drAddElem(my_yv val)

    drAddElem(my_xv i)

    i++

)

my_wave = drCreateWave(my_xv my_yv)

plotStyle('joined)

plot(my_wave)

------------------------------------------------------------------------------------------------------------

Weird Things


The first super frustrating thing is that now I get a plot, but it is all isolated points!! No way to get a line connecting them...

Also, I get N curves, it looks like, as many as the swept points. So despite my vector creation and all, still I am not really getting

the waveform the way I would like it.

Second weird thing, but this is because I do not know the language, you may have noticed that I do not declare i and set it to 0

before the foreach loop. This is because, if I do, then i stays identically zero.

A very dirty workaround I found is that I set it to zero from the CIW, then refresh the results. Otherwise, i keeps increasing

from a refresh to the next (while I am trying things out)

I also tried to write i = 0 after the foreach loop, but the outcome is the same.

Hope this wasn't uselessly too long and somebody can shed some light...

Thanks in advance,

Michele

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Michele,

    You shouldn't really use plot() or indeed any plotting from within an OCEAN measurement script. The primary reason for that is that normally these scripts get run in the "ICRP" (i.e. the background process) which is a non-graphical process. So you won't see the results. The cases where it might work is when you use the re-evaluate button in ADE XL because then the calculations are run in the foreground session (although this may change at some point, because it can be a bit of a bottleneck if you have lots of post-processing to do over many tests and corners and sweeps). Another case is if you're using the optimize single job run feature which was added in IC616 ISR9 - if you're running a single simulation, it uses the ADE XL session to do everything.

    The other things you are seeing are that you are getting family data for each point - and so it contains a single point waveform with the value you want, surrounding by the information about which variables were used. This could be unwrapped, but it's probably the wrong approach for the reasons in the first paragraph above.

    What you could do is use my code in Solution 11854778 (the solution was written by a colleague, but the code is mine, which you could probably guess from the prefix). This allows you to add an OCEAN script which runs across the entire set of data for a test, and then allows you to access all the information - it runs after simulations are complete - can also be re-triggered by hand. This also gives some info on getting the scalar results from ADE XL too.

    I think this approach would fit in with your last observations above.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Michele,

    You shouldn't really use plot() or indeed any plotting from within an OCEAN measurement script. The primary reason for that is that normally these scripts get run in the "ICRP" (i.e. the background process) which is a non-graphical process. So you won't see the results. The cases where it might work is when you use the re-evaluate button in ADE XL because then the calculations are run in the foreground session (although this may change at some point, because it can be a bit of a bottleneck if you have lots of post-processing to do over many tests and corners and sweeps). Another case is if you're using the optimize single job run feature which was added in IC616 ISR9 - if you're running a single simulation, it uses the ADE XL session to do everything.

    The other things you are seeing are that you are getting family data for each point - and so it contains a single point waveform with the value you want, surrounding by the information about which variables were used. This could be unwrapped, but it's probably the wrong approach for the reasons in the first paragraph above.

    What you could do is use my code in Solution 11854778 (the solution was written by a colleague, but the code is mine, which you could probably guess from the prefix). This allows you to add an OCEAN script which runs across the entire set of data for a test, and then allows you to access all the information - it runs after simulations are complete - can also be re-triggered by hand. This also gives some info on getting the scalar results from ADE XL too.

    I think this approach would fit in with your last observations above.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information