Top Down Modeling and Test Bench Development: Verification Case Study: Pipeline ADC
Top Down Modeling and Test Bench Development: Verification Case Study: Pipeline ADC
Top Down Modeling and Test Bench Development: Verification Case Study: Pipeline ADC
• 3v supplies
• Differential Signal path .25 – 2.25v
• Vcm = 1.25
• Digital Error Correction
Trap to Avoid
Early Simulation Results
aren’t the same thing as a
Top-Down Verification
program!
• Delays
– Compare outputs at clock edge and after MAX Tp spec
– Mismatch at other times indicates wrong prop delays in models
• Input Range
– Simple Low to High Sweep – to hit all Codes
– Mismatch in output codes indicates wrong input model/ sampling delay
• Open a Log File (include date & time in name – Thx to Jon Brenner)
initial begin
$system("rm now.txt; date +%Y%m%d_%H%M > now.txt "); // update datestring
datefile = $fopen("now.txt","r"); // open the date for read
rstat = $fscanf(datefile,"%s",datestring );
$fclose(datefile);
filestring = {filename, datestring,".dat"};
fileid = $ fopen(filestring );
$fstrobe(fileid,
"ADC Output Data Comparison File : Testblock %M : date %s.%s.%s:%s",
datestring[8*13:8*9+1],datestring[8*9:8*7+1],datestring [8*7:8*5+1],
datestring[8*4:1]);
$fstrobe(fileid, "Time Delta : O ## U (DUT) sb= (GLD) O ## U");
Do the Math!
always @(negedge strt_fnsh ) begin
counting = 0;
if (totcount > 0) begin
idealbin = totcount/numcodes; // numcodes is real
for (j = 0; j<= maxcode; j = j+1) begin
dnl[j] = (bins[j]/idealbin) - 1.0;
if (j>0) inl[j ] = inl[j-1] +dnl[j ];
else inl[j ] = dnl[j];
$fdisplay(inlfile, "%10.3g # bin %d",inl[j], j ); // for SPW plotting
$fdisplay(dnlfile, "%10.3g # bin %d",dnl[j], j ); // for SPW plotting
$fdisplay(datafile, "%d %d %10.3g %10.3g ", j, bins[j], dnl[j ], inl[j] );
if (dnl[j] > dnlmax) dnlmax = dnl[j ];
else if (-dnl[j] > dnlmax ) dnlmax = -dnl[j];
if (inl[j] > inlmax) inlmax = inl[j];
else if (-inl[j] > inlmax ) inlmax = -inl[j];
end
$fstrobe( datafile, "\n max abs dnl: %10.3g inl: %10.3g ", dnlmax, inlmax);
$strobe( "\n %s max abs dnl: %10.3g inl: %10.3g ", filename, dnlmax, inlmax);
end
end
SAH
SampHold.vams
real posval, negval ;
// Analog Values in Discrete time events
wreal res_p = posval; wreal res_m = negval;
// initialize the variables in Initial Block
always @(negedge clk ) begin
sampval = V(ain_p , ain_n);
vn = vnoise * ($dist_normal(seedn,0,1000)%6000) / 1000.0;
posval = V(cmref) + gain*(sampval+vos+vn)/2;
if (posval > vhi) posval = vhi;
else if (posval < vlo ) posval = vlo;
negval = V(cmref) - gain*(sampval+vos+vn)/2;
if (negval > vhi) negval = vhi;
else if (negval < vlo ) negval = vlo;
end
always @(posedge clk ) begin
sampval = 0;
posval = V(cmref);
negval = V(cmref);
end
• Models Fixed Gain and Offset errors + Gaussian Noise @ Sample rate
Transfer Function 10 01
00 10
100 100
Residue
Vin
00 01 10
PLADC_1r5b_stage.vams
real res_pl , res_mi; wreal res_p , res_m; wreal ain_p , ain_n ;
assign res_p = res_pl; assign res_m = res_mi;
always @(posedge clk ) begin // sample the input
#(td/1n) code = 2'bx; // set to unknown until other edge of clock
res_pl = V(cmref);
res_mi = V(cmref);
end
always @(negedge clk ) begin // evaluate and drive the outputs
vn = vnoise * ($dist_normal(seedn,0,1000)%6000) / 1000.0;
valin = ain_p - ain_n;
refin = V(adcrefp , adcrefn);
#(td/1n) code = 1+((valin+vospcomp)>refin)-((valin+vosncomp)<-refin);
#(td/1n) resout = (valin+vosamp+vn )*Cgain + (1.0-
code)*V(dacrefp,dacrefn );
res_pl = V(cmref)+0.5*resout;
res_mi = V(cmref) -0.5*resout;
end
Flash Stage
PLADC_flash.vams
PLADC_DigCorr4.vams
always @(posedge PHIodd) begin
#Td // just the even bits
St2a = St2; St4a = St4; code = Sum;
overflow = Over || (OF &&
St1c[1] && St2c[1] && St3b[1] && St4b[1] && St5a[1] &&
St5a[0]);
underflow = UF && !St1c && !St2c && !St3b && !St4b && !St5a ;
end
always @(posedge PHIeven) begin
#Td // need to do this in order,
// or use non-blocking with the same delay?
St1c = St1b; St1b = St1a; St1a = St1; //1
St2c = St2b; St2b = St2a; //2
St3b = St3a; St3a = St3; //3
St4b = St4a; St5a = St5; //4 & 5
Sum = St5a + (St4b<<1) + (St3b<<2) + (St2c<<3) + (St1c<<4);
// these are clocked and EVALUATED on other Edge
Over = Sum[6]; OF = OFlast; UF = UFlast;
end
Sw_no.vams
// log Cubic Spline Transition
analog function real lcubefn ;
input x,K; real x,K;
lcubefn = (x<=0)?1:(x>=1)?K: pow(K,(3 -2*x)*x*x);
endfunction
initial Control = 0;
always @( posedge control) Control = 1;
always @( negedge control) Control = 0;
analog begin
@(initial_step) begin
if (Control == 1) swres = 0.0; // on means R is minimum
else swres = 1.0; // off means R is maximum
end
@(posedge Control) swres = 0.0; // on means R is minimum
@(negedge Control) swres = 1.0; // off means R is maximum
// RoutExponent calculated from a transistion function
rsmooth = transition(swres, tdelay,trise,tfall);
rout = ron*lcubefn(rsmooth,roff/ron );
V(vin,vout) <+ I(vin,vout )*rout;
end
CompDiffLatched.vams
reg d, D;
assign D_ = !D;
analog begin
@(initial_step) begin
halfhys = hys/2.0;
Tplh = (td + trise/2)/1n; Tphl = (td + tfall/2)/1n;
end
vin =V(vin_p,vin_n ) - V(ref_p,ref_n ) + p_off + n_off ;
end
initial begin
TPlh = 1; TPhl = 1; // value will be corrected soon
#0.1 TPlh = Tplh ; TPhl = Tphl; // until analog initial_step
d = vin>0; // initialize the register
end
always @(cross(vin - halfhys , +1 )) if (enable) d = 1;
always @(cross(vin + halfhys , -1 )) if (enable) d = 0;
always @(posedge enable) begin
if ((vin < -halfhys)&&(d)) d = 0;
else if ((vin > halfhys)&&(!d)) d = 1;
end
always @(posedge d) # TPlh D = d;
CompLatched.vams is easier!
always @(negedge d) # TPhl D = d;
PLADC_StgClkGen.vams
initial begin
Y2 = 1;
Y1 = 0;
Y1a = 0;
Y1b = 0;
end
always @(posedge A) begin
#Tdhl2 Y2 = !A;
#Tdlh1 Y1 = A;
#Tdlh1a Y1a = A;
#Tdlh1b Y1b = A;
end
always @(negedge A) begin
#Tdhl1b Y1b = A;
#Tdhl1a Y1a = A;
#Tdhl1 Y1 = A;
#Tdlh2 Y2 = !A;
end
Summary
Questions?
References
• J. Doenberg, HS Lee, DA Hodges, “ Full-Speed Testing of A/D Converters” IEEE Journal of Solid-State
Circuits(1984), Vol. 19, No. 6, Dec. 1984, 820-827
• TE Linnenbrink, SJ Tilden, MT Miller, “ ADC Testing with IEEE-Std 1241-2000” Proceedings IEEE Instrumentation
and Measurement Conference 2001, 1986-1991
• G. Chiorboli, C. Morandi , “ ADC Modeling and Testing” Proceedings IEEE Instrumentation and Measurement
Conference 2001, 1992-1999
• Nyquist data converter testing and yield analysis using behavioral simulation
Liu, E.W.Y.; Sangiovanni -Vincentelli, A.L.
Computer-Aided Design, 1993. ICCAD -93. Digest of Technical Papers., 1993 IEEE/ACM International Conference on
, 1993 Page(s): 341 -348
• Influence of the architecture on ADC error modeling
Arpaia, P.; Daponte, P.; Michaeli, L.
Instrumentation and Measurement, IEEE Transactions on , Vol.48, Iss.5, 1999
Pages: 956- 966
• Metrological characterisation of analog-to-digital converters-a state of the art
Arpaia, P.; Cennamo, F.; Daponte , P.
Advanced A/D and D/A Conversion Techniques and Their Applications, 1999. Third International Conference on
(Conf. Publ. No. 466) , 1999
Page(s): 134 -144
• Some thoughts on sine wave ADC testing
Sugawara, H.; Kobayashi, H.; Arpaia, P.
Instrumentation and Measurement Technology Conference, 2000. IMTC 2000. Proceedings of the 17th IEEE , 2000
Page(s): 125 -130 vol.1
• J. David, “ Functional Verification Of A Differential Operational Amplifier” International Cadence User Group,
2001
More References
• Behavioral simulation of a 3-bit flash ADC
Mantooth, H.A.; Allen, P.E.
Circuits and Systems, 1990., IEEE International Symposium on , 1990
Page(s): 1356 -1359 vol.2
• Behavioral model of pipeline ADC by using SIMULINK(R)
Bilhan, E.; Estrada-Gutierrez, P.C.; Valero-Lopez, A.Y.; Maloberti, F.
Mixed-Signal Design, 2001. SSMSD. 2001 Southwest Symposium on , 2001 Page(s): 147 -151
• Behavioral modeling and simulation of data converters
Liu, E.; Gielen, G.; Chang, H.; Sangiovanni-Vincentelli, A.L.; Gray, P.R.
Circuits and Systems, 1992. ISCAS '92. Proceedings., 1992 IEEE International Symposium on ,
Volume: 5 , 1992
Page(s): 2144 -2147 vol.5
• IEEE Std 1241: the benefits and risks of ADC histogram testing
Max, S.
Instrumentation and Measurement Technology Conference, 2001. IMTC 2001. Proceedings of the
18th IEEE , Volume: 1 , 2001
Page(s): 704 -709 vol.1
• Fast accurate and complete ADC testing
Max, S.
Test Conference, 1989. Proceedings. Meeting the Tests of Time., International , 1989
Page(s): 111 -117
• FFT Testing of ADCs
Odom, Bill
Conference on Analog and Mixed-Signal Applications, 1998 Proceedings
Page(s): 201-203
• New High Speed Technique for Pipeline ADC Design
Sarraj, Maher
Conference on Analog and Mixed-Signal Applications, 1998 Proceedings
Page(s): 205-208
2002 IEEE International Workshop on
Behavioral Modeling and Simulation
Bibliography
Don Lewis “Testing Operational Amplifiers” Electronics Test ( Benwill Publishing) January 1979
Don Lewis “Compensation of Linear IC Test Loops” Electronics Test ( Benwill Publishing) May 1979
David Johns, Ken Martin,”Analog Integrated Circuit Design”, Wiley & Sons, New York 1997, esp chapter 6.
Jacob Millman, “MicroElectronics: Digital and Analog Circuits and Systems” McGraw-Hill 1979
Paul Gray and Robert Meyer “Analysis and Design of Analog Integrated Circuits: 2nd Ed” Wiley & Sons 1984
C.F. Wojslaw & E.A. Moustakas “Operational Amplifiers” Wiley & Sons, NY, 1986
Dan Fitzpatrickj , Ira Miller, “Analog Behavioral Modeling with the Verilog -A Language” Kluwer, Boston, 1998
Samir Palnitkar , “ Verilog HDL” SunSoft, Mountain View, CA 1996
Ken Kundert, “The Designer’s Guide to Spice & Spectre”, Kluwer, Boston, 1995
J.E. Solomon. "The monolithic op amp: a tutorial study." IEEE Jo urnal of Solid-State Circuits(1974) SC -9.6 (Dec. 1974
(Special Issue on Analog Circuits)): 314-332. (Also published as Application Note AN -A from National
Semiconductor)
G.Ferri and W. Sansen “A Rail-toRail Constant-g m Low-Voltage CMOS Operational Transconductance Amplifier.” IEEE
Journal of Solid-State Circuits(1997), vol 32, October 1997 1563-1567.
M. Yamatke, “A Simplified Test-Set for Op Amp Characterization” National Semiconductor Application Note 24, April
1986