• 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 SKILL
  3. How to extract a value from a self-defined plot, maybe using...

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 143
  • Views 19960
  • 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

How to extract a value from a self-defined plot, maybe using ocean script?

Alex Liao
Alex Liao over 9 years ago

Hey,

I have a plot which is gm/id (y-axis) Vs Id/(w/l) (x-axis) by doing a Parametric Analysis of sweeping Vgs.

I found in the result folder, it has lots of sub-folders named as Vg=0.111,..., Vg=0.555, Vg=0.666,..., Vg=0.999. Inside each of them, a /psf folder is there. This is reasonable as plenty of DC points are covered in the Parametric Analysis. Therefore all of those '/psf' result directories' are working together to compose a full plot by providing data and maybe do some interpolations.

I want to extract a value from this big plot and do not know how to do it.

Say, I can read when the X which is id/(w/l) = 5u, the Y which is gm/id = 10. But I want to get Y values by providing X values.

I am thinking since the X-Y in the big plot are one-to-one corresponded, if all the data are summarized in one place composing the complete plot or maybe in a big table, then giving a X and asking for a Y should be straightforward.

I am not quite sure if the waveVsWave will summarize all the data and provide a function to access it.

May refer to my previous post on how to do the plot on self-defined axis:

community.cadence.com/.../1343786

Any idea?

Regards,

Alex

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Alex,

    You want to use the value() function on the waveform, by the sounds of things.

    When given family data (a family of curves, as you get with parametric analysis), the value function returns a waveform of the values at the specified x-axis value. It's also possible to use value on other sweep variables to pick out a particular family member, but I think it's the basic functionality that you're after here.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Alex Liao
    Alex Liao over 9 years ago

    Hey Andrew,

    I know the value() but this time things are a bit different.

    I did sweep the Vg  from 0 to 1V and I could use this following:

    value((pv("M0" "gm" ?result "dcOpInfo") / pv("M0" "id" ?result "dcOpInfo")) 0.5)

    to find the gm/Id value from interpolating at Vg=0.5V. 

    However, now I have manipulated the plot by doing the following steps:

    1. plot gm/id Vs Vgs,

    2.plot id/(w/l) Vs Vgs,

    3.Mouse Right Clicked on the second curve and chose the Y Vs Y...

    4.Now I have the gm/id Vs id/(w/l) curve, just the curve, but I do not have an expression that can be sent back to the calculator to apply the value() function.

    The properties/nature/expression of this new curve are:

    Y is (pv("M0" "gm" ?result "dcOpInfo") / pv("M0" "id" ?result "dcOpInfo"))   // used with respect to Vg (original X-axis) as in step 1.

    X is (pv("M0" "id" ?result "dcOpInfo") / (pv("M0" "w" ?result "instance") / pv("M0" "l" ?result "instance")))  //if it is treated as the original plot in step 2

    If I have one expression that can represent such Y (gm/id) with respect to such changed X ( gm/(w/l) ), then things are easy.

    I think the pv() means property-voltage() so that the Y is any property and the X is the voltage. I hope there can be a function something like property-'id/(w/l)' ();

    Alternative thinking is using ocean script. I played with ocean script before and I know for lots of functions you need to specify a waveform object.

    I would think the waveform object is not the one in step 1. after doing Y Vs Y... and I have no idea how to specify something like"now, the waveform in the current window is the object". And save it as an waveform object by giving a variable name. Then use the value() function is easy also.

    I tweaked the panel a lot and cannot get a solution. 

    Thank you in advance : )

     Alex

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Alex,

    Unfortunately when you've done YvsY you can't (yet) send the expression on the resulting waveform to the calculator. So instead, you'd have to enter the expression yourself:

    waveVsWave(?y pv("M0" "gm" ?result "dcOpInfo") / pv("M0" "id" ?result "dcOpInfo") ?x pv("M0" "id" ?result "dcOpInfo") / (pv("M0" "w" ?result "instance") / pv("M0" "l" ?result "instance")) )

    You can then use value() on that expression to interpolate at whatever the x-axis values are on that transformed waveform.

    Because waveVsWave is not in the calculator (but is available as a SKILL/OCEAN function), you'll have to type it into the calculator rather than having a form to complete.

    I think that should do it...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Alex Liao
    Alex Liao over 9 years ago

    Hey Andrew,

    You are awesome, this does what exactly I want.

    Just one more question on the result or maybe it also can be applied to general cases.

    I did 10 sweeping points (called sampling points), but the waveform are continuous rather than discrete no matter what it is, gm/id Vs Vg or gm/id Vs Id/(w/l).

    I am wondering what kind of algorithm that the Cadence utilizes to make up those intermediate points (any other points between any two neighboring sampling points)?

    Apparently those intermediate points are not from real simulation. To me, it looks more like using something like linear interpolation.

    What do you think?

    Thanks,

    Alex

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Alex,

    I'm not entirely certain what you're referring to by "sampling points", but the simulator doesn't interpolate - it only writes out values that were solved. When you plot a waveform, it plots the actual points that were in the simulation results and draws a straight line between the points.

    Now, if you have two expressions and then plot one versus another, you will have pairs of points that match - both correspond to the same original x-axis and so the points you get then are still all simulated points (again, the lines shown between are a visual artefact to aid us poor humans who have trouble visualising things). You can always see the original points by selecting the trace (or traces) and doing Right Mouse->Trace Properties, turn on symbols and also "show all points" and you'll see the points. You can also pick that it plots  using points rather than joined lines.

    Now, when you use the value function, it will interpolate each curve in the family at that x-axis value - which may no longer correspond to a simulated point - and then plot those interpolated points versus the parameter value for each family member (so the x-axis points  you get in the value graph should correspond to the parameter points you picked).

    If you mean something else, you probably will need to give more details and show some pictures!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Alex Liao
    Alex Liao over 9 years ago

    Andrew,

    Maybe what I described is misleading. Sorry about my poor English.

    I tried to use the Insert/Edit Media to upload a picture but it always gives me:

    "Unfortunately, the page you've requested no longer exists. Please use the search form above to locate the information you're interested in."

    I got a picture to help the explanation and just dragged it in the editor widow. I can view it and think it will do for all users.

    I did sweep Vg from 0 to 1V with 10 steps and want to observe the gm/id .

    The Parametric Analysis would take 10 times of simulation. (say Vg = 0.1, 0.2, 0.3, ...,0.9, 1, I called those 10 points sampling points corresponding to the 10 steps)

    The resultant curve are continuous. I am wondering how could the curve reflect those gm/id points whose X values are intermediate points, like 0.15V, 0.25V.

    If they are from the real simulation then what is the difference from sweeping Vg from 0 to 1V with 100 steps or even 500 steps?

    I believe you did not take it the way as described above in your last reply.

    For me, between any two adjacent sweeping points, linear operation are performed.

    Kind Regards,

    Alex

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Alex,

    I'm not sure I understand you. The curve you are showing clearly has 10 points, corresponding to the 10 points in the parametric sweep. The lines between the points are just a visual aid, drawn by ViVA. It's not really "continuous". If you had 100 points in the parametric sweep, the graph would look smoother because the straight lines between the points would be shorter.

    Whether the points themselves are from simulation is as I described before - it depends on whether the value() function that you used to construct this waveform was picking values at points that were simulated or whether it had to linearly interpolate. How accurate that interpolation was would depend on the number of points in the inner sweep (DC sweep?) that you performed.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Alex Liao
    Alex Liao over 9 years ago

    Andrew,

    Andrew Beckett said:
    The lines between the points are just a visual aid, drawn by ViVA.

    This is what I want.

    Andrew Beckett said:
    How accurate that interpolation was would depend on the number of points in the inner sweep (DC sweep?) that you performed.

    Yes, in the dc sweep, for example, provided as follows. I think if it interpolate at a point with w  between 1.096um and 1.202um, say 6%, then it must be an approximation because the dc sweep did not simulate the w: (6%) point. Is this what you mean?

    " (20 points In total)

    dc: w = 1.096 um (4 %), step = 49.35 nm (2 %)
    dc: w = 1.202 um (8 %), step = 54.11 nm (2 %)
    dc: w = 1.38 um (14 %), step = 62.13 nm (2 %)
    dc: w = 1.514 um (18 %), step = 68.12 nm (2 %)
    dc: w = 1.738 um (24 %), step = 78.21 nm (2 %)
    dc: w = 1.905 um (28 %), step = 85.76 nm (2 %)
    dc: w = 2.188 um (34 %), step = 98.47 nm (2 %)
    dc: w = 2.399 um (38 %), step = 108 nm (2 %)
    dc: w = 2.754 um (44 %), step = 124 nm (2 %)
    dc: w = 3.02 um (48 %), step = 135.9 nm (2 %)
    dc: w = 3.467 um (54 %), step = 156.1 nm (2 %)
    dc: w = 3.802 um (58 %), step = 171.1 nm (2 %)
    dc: w = 4.365 um (64 %), step = 196.5 nm (2 %)
    dc: w = 4.786 um (68 %), step = 215.4 nm (2 %)
    dc: w = 5.495 um (74 %), step = 247.3 nm (2 %)
    dc: w = 6.026 um (78 %), step = 271.2 nm (2 %)
    dc: w = 6.918 um (84 %), step = 311.4 nm (2 %)
    dc: w = 7.586 um (88 %), step = 341.4 nm (2 %)
    dc: w = 8.71 um (94 %), step = 392 nm (2 %)
    dc: w = 9.55 um (98 %), step = 429.8 nm (2 %)

    "

    Thanks,

    Alex

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Alex,

    If the value you are picking doesn't correspond to one of the dc sweep points, then adding more points around the point at which you are interpolating will improve the accuracy of each of the 10 points you are getting in the final curve. This seems pretty obvious to me (and I would think it would be for you too) so maybe I'm really misunderstanding what you're getting at here.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Alex Liao
    Alex Liao over 9 years ago

    Andrew,

    Yeah, now it is clear.

    I had confusion about points in dc sweep and those points in Parametric Sweep.

    Thanks.

    Alex

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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