• 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. INL simulation issue for temperature sensor

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 124
  • Views 16657
  • 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

INL simulation issue for temperature sensor

wgtkan
wgtkan over 5 years ago

Hello,

I would like to determine the temperature error of my temperature sensor circuit by using a viva function integral non-linearity of a dc temperature simulation. I want to show the output voltage of the sensor against temperature. 

The temperature is swept from -20 to 100C using the DC sweep. And the simulation is working by plotting the output voltage vs temperature. But when I do the INL simulation to determine the temperature error through the viva function, I am getting what seems the temperature error against voltage but not temperature.

Here is what I have in my viva calculator function:

inl(VS("/vot2") 1 ?mode "auto" ?crossType "rising" ?delay 0.0 ?units "abs" ?nbsamples 120)

Instead of getting a plot that looks like this: 

I am getting wrong plot that looks like this:


My cadence virtuoso version is :
Version IC6.1.8-64b.500.9
Spectre spectre191

Thank you so much in advance for your cooperation with this question.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    To make it a bit easier to understand what the input data looks like, can you post a plot of VS("/vot2") ?

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • wgtkan
    wgtkan over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    Thank you for your prompt response.

    I read the documentation on viva. I couldn't figure out how to keep the horizontal axis to temperature. 

    Here is the plot of VS("/vot2").

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to wgtkan

    I'm not entirely sure what you're trying to plot, but the INL function is plotting the deviation of the output voltage from the ideal output voltage. Just because the x-axis of the input signal is temperature, i'm not sure why you would expect the y-axis (or x-axis) of the INL function to be temperature - it would be in the units of the Y-axis.

    I could imagine that you could swap the x and y axis and use INL then (maybe) but I'm not entirely sure what that even would mean, since you'd then have swapped what was the dependent and independent variables.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • wgtkan
    wgtkan over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    I would like to plot the deviation of temperature with respect to temperature to determine the temperature error.

    The temperature sensor’s INL is then the maximum absolute value of the temperature error over the temperature range determined by the two ending-points fit line.

    Is it possible to produce Temperature in the Y-axis from result browser and then use INL?

    I saw this post from one month ago about the INL end point. He wrote a skill code for it. What I want looks similar but I want my plot at only TT process corner. 

    community.cadence.com/.../calculating-the-std-deviation-and-mean-along-the-y-axis-on-a-family-of-waveform

    Thank you so much.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to wgtkan

    Maybe something like this:

    waveVsWave(?x waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2")))  ?y waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2")))-abFirstLastLine(waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2")))))

    For my made up example, this came up with this curve:

    This is using abFirstLastLine from this post. Bit of converting back and forth to change the x-axis, but hopefully it makes some kind of sense.

    My made up netlist (I used v("vot2" ?result "dc-dc") rather than VS("/vot2") since I ran from a netlist):

    //
    
    R1 (vot2 0) resistor r=1.2125k tc1=-0.0025 tc2=2u
    I1 (vot2 0) isource dc=-1m
    
    dc dc param=temp start=-20 stop=100 step=1

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • wgtkan
    wgtkan over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    Thank you very much indeed. It works. 

    I have one question. Is it possible to get the temperature deviation from 0? As shown in the following example.

    Integral Nonlinearity Error (INL) error based upon an end-point
    fit line over the temperature range of [-20
    C, 100C] In the attached plot, over the temperature range of -20C to 100C, the  temperature error
    is bounded within ±0.4
    C over process corners.

    Mine looks like this:

    Will it be possible to include the fitting capability in viva calculator in the future releases?

    Thank you again.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 5 years ago in reply to wgtkan

    Dear wgtkan,

    in the examples you provided, the deviation does not appear to be "from 0". Is that really what you intended to request? I think, instead, you might want the plot to have symmetrical maximum and minimum INL values for each curve in order that you might easily compare the maximum INL value each case provides. This is what I do anyway. If so, you need to use a linear regression for each curve to find the slope and intercept that minimizes the squared error for that data set and compute the INL of each curve with respect to its respective slope and intercept. This is a different calculation than provided by Andrew's abFirstLast() function.

    Andrew has posted a linear regression function which may be used for this purpose.

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to ShawnLogan

    The approach I provided does compute it based on the end points, but that doesn't mean that 0 will be in the centre. That depends on whether your non-linear response is warped in one direction (as it appears to be in both your data and my simple example), or whether it deviates in both directions away from the ideal straight line. So that's a property of the deviation away from the straight line, not how it's calculated.

    Yes you could use a best-fit line (as Shawn suggested, but that wasn't what you asked for - the best fit line curve is in the same thread that you found the abFirstLastLine code), but even that wouldn't guarantee to give the same of curve you wanted, plus I doubt the end points would be at zero in that case (unless they happened to be on the best fit line).

    I don't believe there's any plan to add the abFirstLastLine function as standard to the calculator, but the whole point of the "fx" button in the function panel is to add functions such as this and then they are as useful as if they were built-in defaults. You'll see that we do have a library of such useful functions here: Custom IC Calculator SKILL Function Library (including abFirstLastLine). 

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • wgtkan
    wgtkan over 5 years ago in reply to ShawnLogan

    Hello Shawn,

    Thank you for your response. What want to plot is the INL temperature error. A waveform that looks like this:

    Andrew has posted a linear regression function that may be used for this purpose. So you mean to use something like this:

    waveVsWave(?x waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) ?y (waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) - abBestFit(waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))))))

    I changed the bFirstLastLine  to abBestFit and got somethig that looks like this:

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 5 years ago in reply to wgtkan

    Dear wgtkan,

    When one compute's the INL from a data set and a linear curve fit to the data set, there is no guarantee that one's INL computation will appear symmetric. In other words, there is no guarantee that the minimum and maximum values of the resulting INL computation will be equal in magnitude but opposite in sign. I have a C routine that takes a dataset (x[i[,data[i]) and iterates on the intercept to minimize the overall variation with respect to 0 - or in essence chooses and intercept that will provide maximum and minimum INL values equal in value but opposite in sign.

    Alternately, an algorithm to do this which you might consider follows. Hopefully, it makes some sense to you. Let me know if it does not!

    1. Find INL from initial curve fit to data set x[i],data[i] with i = 1,N for an N point data set

      a. Compute best fit values of slope_best_fit, intercept_best_fit  b. Compute INL_pass_1[i]

    INL_pass_1[i] = data[i] - (slope_best_fit*x[i] + intercept_best_fit)

    2. Re-compute INL using a new intercept modified by the average of the maximum and minimun INL value from INL_pass1[i]

    a. INL_symmetric[i] = data[i] - (slope_best_fit*x[i] + intercept_best_fit + 0.50*(max(INL_pass_1[i]) + min(INL_pass_1[i])))    or    INL_symmetric[i] = INL_pass_1[i] - 0.50*(max(INL_pass_1[i]) + min(INL_pass_1[i]))

    To use this with Andrew's function abBestFit() and the expression you provided, I believe you need to include an additional term that is the average maximum and minimum value of your expression  outermost waveVsWave() . In essence the ymax() and ymin() vanes of the expression contained in the outermost waveVsWave(). If I manage to re-type it correctly, I think it will be something like:

    waveVsWave(?x waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) ?y (waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) - abBestFit(waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2")))))) - 0.50*(ymax(waveVsWave(?x waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) ?y (waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) - abBestFit(waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))))))) + ymin(waveVsWave(?x waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) ?y (waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))) - abBestFit(waveVsWave(?x VS("/vot2") ?y xval(VS("/vot2"))))))))

    I hope this helps...

    Shawn

    • 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