Optimization With HSpice Before you start optimizing What
Optimization With HSpice
Before you start optimizing • What are you optimizing for? – Linearity (as in an amplifier) – Gain – Frequency response – Drive ability – Transition point – Speed
Before you start optimizing • How are you going to test the design’s quality? – Simulated loading • Resistive • Capacitive • Both – In circuit testing
Optimization syntax • The HSpice manual is located in ~cg 477/tools/hspice/98/98. 4/docs • The syntax is described in detail in chapter 12 • This is a brief introduction • I will show examples afterwards
Optimization statements • . MODEL modelname OPT optimization parameters • . PARAM parameter=OPTxxx(optimization range specification) • . DC, . AC, or. TRANS statement with MODEL=modelname, OPT=OPTxxx, and RESULTS=measurename(s) • . MEASURE statement with GOAL specified
Limitations • You can optimize transistor sizes to shift transition points, gain, linearity, etc. • Transistor optimization is difficult even for HSpice. My experience has been that it is mostly useful for aiding in sizing. • HSpice is very useful for bias voltage determination. • If you are close to the best choice for an optimization parameter, HSpice will have difficulty finding that best choice. It can get you close, however.
Example: buffer • • • • • ************. MODEL model 1 OPT ITROPT=30. PARAM Trans. P=OPT 1 (16, 4, 50, 1). PARAM Trans. N=OPT 1 (27, 4, 50, 1). DC Va 0 V 3. 3 V 0. 0001 SWEEP OPTIMIZE=OPT 1 RESULTS=transpt MODEL=model 1 ************. DC Va 0 3. 3 0. 001. MEASURE DC transpt WHEN v(q 0)=v(a) CROSS=LAST goal=1. 2 * other hspice commands m 1000 vdd a q 0 vdd pch w=Trans. P l=2 + ad=96 pd=44 as=80 ps=42 m 1001 q 0 vdd pch w=Trans. P l=2 + ad=80 pd=42 as=0 ps=0 m 1002 gnd a q 0 gnd nch w=Trans. N l=2 + ad=138 pd=150 as=115 ps=102 m 1003 q 1 q 0 gnd nch w=Trans. N l=2 + ad=115 pd=102 as=0 ps=0
Examples: gain 2 amplifier • • • • • • • **********************. MODEL model 1 OPT ITROPT=30. PARAM Pbv 1=OPT 1 (3. 233, 0. 00, 3. 30) Pbv 2=OPT 1 (0. 932, 0. 00, 3. 30) *. PARAM Tbv 1=OPT 1 (28, 3, 50, 1) Tbv 2=OPT 1 (29, 3, 50, 1). PARAM Tbv 1=25. PARAM Tbv 2=44. PARAM Tain=58. param trans_pt=trans_pt_low. DC Vain 0. 5 V 2. 50 V 0. 001 SWEEP OPTIMIZE=OPT 1 RESULTS=slope_mid, curve_area MODEL=model 1 **********************. param slope_cur="-sqrt(2)". param trans_pt_low=1. 150. param trans_pt_high=1. 250. param interval_low="trans_pt-(trans_pt_high-trans_pt_low)/2". param interval_high="trans_pt+(trans_pt_high-trans_pt_low)/2". param interval_low_mid="(trans_pt+interval_low)/2". param interval_high_mid="(trans_pt+interval_high)/2". param interval_center="trans_pt-sign((trans_pt_high-trans_pt_low)/2, trans_pt-(trans_pt_high+trans_pt_low)/2)". meas DC slope_mid deriv v(t 1) at=trans_pt goal=slope_cur weight=200. param ideal_curve(vin)= "slope_cur*(vin-trans_pt)+trans_pt". meas DC curve_area integ par("v(t 1)-ideal_curve(v(ain))") from=interval_low to=interval_high goal=0. 0001 * additional spice statements are here (but not applicable to this example) m 1000 t 1 bv 1 Vdd GND nch w=Tbv 1 l=2 + ad=431 pd=420 as=250 ps=220 m 1001 t 1 bv 2 GND nch w=Tbv 2 l=2 + ad=0 pd=0 as=788 ps=732 m 1002 GND ain t 1 GND nch w=Tain l=2 + ad=0 pd=0 as=0 ps=0
- Slides: 8