Hi all,

I am simulating a Nyquist ADC by giving a slow varying input ramp, collecting the sampled output code (and reconstructed by a verilogA model) and then plotting it versus the input signal (waveVsWave calculator function), hence getting the transfer characteristics of the ADC.

Now I would like to remove the offset and gain error, in order to take the difference between this corrected output and input, to observe the DNL.

Is there any built-in function to do that in the calculator or simple ocean script?

For the offset subtraction would be quite trivial, just subtract to the output its value at Vin=0.

But to find the gain error correction factor "gec" such that Vout*gec is the output characterstics without gain error, the proper Vin points must be chosen such that Vin(end) is the Vin corresponding to the last output code step + LSB/2 and Vin(start) corresponding to the first output code step -LSB/2.

To better explain, see example plot of an output characteristics of the ADC: the gec would be ideally calculated by [Vin(M4)-Vin(M5)]/[Vout(M4)-Vout(M5)] with reference to the markers M4,M5,M6,M7, such that Vin(M4)-Vin(M6)=LSB/2 and Vin(M4)-Vin(M7)=-LSB/2.

M5 and M4 are on the minimum and maximum ADC output code respectively, therefore the quantization error is diverging on their outer sides

Therefore finding a way to automatically extract the location of these M4 and M5 points is what I am looking for, without having to manually export data to matlab or any other program to do it manually for each corner/design parameter.

Note that depending on the corner the ADC gain error could be different, and therefore when I am sweeping a fixed range for the input voltage, in principle it is not possible to just use INTERCEPT/SLOPE functions of excel for example, because the regions where quantization noise diverges would start from different input voltages, but those functions would try to minimize the error thorugh all the input range. So such a method would require also to extract beforehand the region of the characteristics where quantization noise is within 0.5*LSB.

Any suggestion, or idea for different approaches, in case similar automatic functions are not available, would be highly appreciated.

virtuoso version ICADVM20.1

Thank you

Best regards