* $Id$ * DO NOT EDIT. This file generated automagically. * Created: Wed Jul 28 7:48:24 1999 * User: ryu * Char: D-Flop Hold Time Characterization * Data: "d" * Clock: "clk" * Q: "q" * C: "mout" * Trans: "hl" *--- SETUP --------------------------------------------------- .include '/home/ryu/src/autochar/autochar-1.5.3/tech/tsmc35/include/ttlh.sp' .include 'dff_2x.sp' .include /home/ryu/src/autochar/autochar-1.5.3/tech/tsmc35/lib/autochar.sp .options + prpts + rawpts + format .param ihold = 0 .param setup_hold_scale = '1e-12' .param hold = 'ihold*setup_hold_scale' .param slewrate = '4.00002e-11' .param slew_start = '0.1' .param slew_end = '0.9' *--- INPUTS -------------------------------------------------- vclk vclk 0 pulse ( + '0' + 'vhigh' + '1ns+trise/2' + '0' + '0' + 'pwidth+trise/2+tfall/2' + 'period') vd vd 0 pulse ( + 'vhigh' + '0' + '1ns+trise+pwidth' + 'trise' + 'tfall' + 'pwidth+hold' + '4*period') *--- TEST CIRCUIT -------------------------------------------- xdbuf vd d ebuffer xclkbuf vclk clk slewbuffer xflop + q $ q:o + d $ d:i + clk $ clk:i + diff_1 $ clk_n:i + dff_2x e1 diff_1 0 clk vdd -1 *--- LOADS --------------------------------------------------- c0 q 0 100ff *--- MEASURE ------------------------------------------------- .option autostop .measure tran ihold param='ihold' .measure tran hold param='hold' * Measure hold time: .measure tran hold_hl delay v(clk) val='vhigh/2' rise=2 + targ=v(d) val='vhigh/2' cross=2 * Measure clock slew rate: .measure tran clkslew delay v(clk) val='0+0.1*vhigh' rise=2 + targ=v(clk) val='0+0.9*vhigh' rise=2 * Measure internal criterion node: .measure tran vcrit find v(xflop.mout) + when v(clk)='0.8*vhigh' rise=2 .measure tran optpass param='vcrit/vhigh' *--- TRANSIENT ----------------------------------------------- * Measure final clock->q time: .measure tran clk_q delay v(clk) val='vhigh/2' rise=2 + targ=v(q) val='vhigh/2' fall=1 .trans 5ps '2*period' *--- CONTROL ------------------------------------------------- .control # find fail modif loop=20 stop optpass le 0.8 ihold -= (0)600 prtbl set fail = $ihold # find pass modif loop=20 stop 0.8 le optpass ihold += (0)600 prtbl set pass = $ihold set i = 0 set window = `expr $pass - $fail` # Save measurements set save_hold = $hold_hl set save_clkslew = $clkslew set save_clk_q = $clk_q set save_vcrit = $vcrit set save_optpass = $optpass echo Iteration $i: Pass = $pass, Fail = $fail, Window = $window, hold = $save_hold # Binary search while ($window > 5) set i = `expr $i + 1` set sum = `expr $pass + $fail` set midpoint = `expr $sum / 2` modif loop=1 ihold = $midpoint prtbl if ($optpass > 0.8 or $optpass eq 0.8) set pass = $midpoint # Save measurements set save_hold = $hold_hl set save_clkslew = $clkslew set save_clk_q = $clk_q set save_vcrit = $vcrit set save_optpass = $optpass else set fail = $midpoint end set window = `expr $pass - $fail` echo Iteration $i: Pass = $pass, Fail = $fail, Window = $window, hold = $save_hold end echo Final hold_hl = $save_hold echo Final clkslew = $clkslew echo Final clk_q = $clk_q echo Final vcrit = $vcrit echo Final optpass = $optpass .endc * Alter slewrate: .alter .param slewrate = '7.99998e-11' .alter .param slewrate = '1.2e-10' .alter .param slewrate = '1.600002e-10' .alter .param slewrate = '3.19998e-10' .end