Home > Community > Forums > Custom IC Design > How to use spectre calculator to return x value of a given y? Thanks.

## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# How to use spectre calculator to return x value of a given y? Thanks.

Last post Thu, Apr 3 2014 12:42 PM by fvillota. 17 replies.
 Started by supermos 05 Apr 2011 12:23 PM. Topic has 17 replies and 4785 views
• #### Tue, Apr 5 2011 12:23 PM

• supermos
• Joined on Tue, Apr 5 2011
• Marlborough, MA
• Posts 2
• Points 25
How to use spectre calculator to return x value of a given y? Thanks.
 Hello, I have a question about how to get x value for a given point of y in a waveform. I think the calculator should have this function, but I checked xval function, it doesn't work for me... Let me make my question more specific: for instance, if I sweep variable vinn, the circuit output is called vout, how we can find the vinn for vout = 2V? Thanks and best regards, ej
• Post Points: 20
• #### Wed, Apr 6 2011 3:46 PM

Re: How to use spectre calculator to return x value of a given y? Thanks.
 Use the cross function.Regards,Andrew
• Post Points: 65
• #### Wed, Apr 6 2011 4:01 PM

• supermos
• Joined on Tue, Apr 5 2011
• Marlborough, MA
• Posts 2
• Points 25
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi Andrew, Thanks a lot for your help. Best regards, EJ
• Post Points: 5
• #### Mon, Jul 15 2013 3:03 PM

Re: How to use spectre calculator to return x value of a given y?
 Hi Andrew Using the cross function, it generates a number of points, where the lowest and the highest values are the right values that I want. why not the cross function is showing just two values instead of lot of points in the middle of those two points. I want the exact two x values where the y value is constant (e.g, -4.21). Thank you.
• Post Points: 5
• #### Tue, Nov 19 2013 5:02 PM

Re: How to save the webforms
 Hi Andrew How can I save the webforms in Cadence and later open it and work on it? I saved the forms as .grf file, but later when I open the .grf file, it only shows the expression, but no waveform is there. So, what is the right way to save waveforms and reopen it again at a later time? I have separate waveforms append together from different runs. Thank you.
• Post Points: 20
• #### Wed, Nov 20 2013 12:08 PM

Re: How to save the webforms
 I suggest you read the forum guidelines. You've added two unrelated posts to an old thread, and the forum guidelines tell you not to do that. I'm short of time otherwise I'd split them up - but please don't do this as it makes things very confusing.For your previous post, this is because you've passed 0 as the cross number (the third argument to cross). If you do this, it returns a list of all the crossing points. If you want the first, pass 1; if you want the last, pass -1. You must have had multiple crossing points.For this one, I've no idea what a "webform" is, but assuming you are trying to save the waveforms, then the grf format actually saves the references to the waveforms - not the waveform data itself. You didn't say which version you're using (see the forum guidelines again), so hard to advise you - there are ways of exporting the data into a new database, but it's not that obvious precisely what you were trying to do or if it stands any chance of working in the version you're using.Kindest Regards,Andrew.
• Post Points: 5
• #### Thu, Apr 3 2014 11:05 AM

• fvillota
• Joined on Tue, Mar 19 2013
• Posts 6
• Points 105
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi Andrew, im using IC614 version, and when i try to use the cross function for something similar to was described i obtain this error:*Error* crossMethod: can't handle crossMethod(2.502911e-05 2.4e-05 1 "either" nil nil) Do you know whtas happening here? Thanks in advance, Francisco
• Post Points: 20
• #### Thu, Apr 3 2014 12:08 PM

• smlogan
• Joined on Tue, Jun 10 2014
• Posts 105
• Points 1,800
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Dear Fransisco, If your crossing threshold is 2.4e-05, have you verified by plotting the signal of interest that the waveform crosses 2.4e-05 Shawn
• Post Points: 20
• #### Thu, Apr 3 2014 12:13 PM

• fvillota
• Joined on Tue, Mar 19 2013
• Posts 6
• Points 105
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi Shawn, Thanks for the quick answer. Yes, I've verified in the waveform that the signal crosses the specified point, and also my signal does not have any other rising or falling edge, this is a unique cross point and falling edge. Thanks
• Post Points: 20
• #### Thu, Apr 3 2014 12:33 PM

• smlogan
• Joined on Tue, Jun 10 2014
• Posts 105
• Points 1,800
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi Fransisco, Might your provide the exact syntax of the calculator expression? One item I have occasionally noted is if the crossing point nearly coincides with the start or end of the waveform appears to results in a crossing error.
• Post Points: 35
• #### Thu, Apr 3 2014 12:42 PM

• fvillota
• Joined on Tue, Mar 19 2013
• Posts 6
• Points 105
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi Shawn, This is my calculator expression:cross(IDC("/I0/icv0") 24e-6 1 "either" nil nil  ) My waveform has a constant  behavior, but after some point it starts to decrease, i want to measure the x value which  has 24u in Y axis (24u is close to the maximum value, less than 2% of difference). Regards,  Francisco
• Post Points: 5
• #### Thu, Apr 3 2014 1:53 PM

Re: How to use spectre calculator to return x value of a given y? Thanks.
 Given that crossMethod is the internal function called within the cross function, and it is passed the same arguments as cross, it appears that the first argument to cross has been given as a scalar value rather than a waveform, so it's not surprising that it doesn't work. Regards,Andrew
• Post Points: 20
• #### Thu, Apr 3 2014 2:02 PM

• fvillota
• Joined on Tue, Mar 19 2013
• Posts 6
• Points 105
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi, This is my calculator expresion:cross(IDC("/I0/icv0") 24e-6 1 "either" nil nil  ) Regards,
• Post Points: 50
• #### Thu, Apr 3 2014 2:08 PM

• skillUser
• Joined on Fri, Sep 19 2008
• Austin, TX
• Posts 2,594
• Points 16,040
Re: How to use spectre calculator to return x value of a given y? Thanks.
 Hi,Isn't IDC() going to return a single scalar value rather than a waveform (as Andrew pointed out being the source of the problem for the cross function) ?  In other words, wouldn't the DC current be static, and therefore not cross any thresholds?Hope this helps,Lawrence.
• Post Points: 5
• #### Thu, Apr 3 2014 2:11 PM

Re: How to use spectre calculator to return x value of a given y? Thanks.
 The IDC function returns a current from the dc operating point. So it is a single value - there's no variation and hence it makes no sense to use cross on it. Put another way, it will resolve to a number - there's no x axis, and only a single y value. Andrew
• Post Points: 5