Download - Optimization With HSpice

Transcript
Page 1: Optimization With HSpice

Optimization With HSpice

Page 2: 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

Page 3: Optimization With HSpice

Before you start optimizing

• How are you going to test the design’s quality?– Simulated loading

• Resistive

• Capacitive

• Both

– In circuit testing

Page 4: Optimization With HSpice

Optimization syntax

• The HSpice manual is located in ~cg477/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

Page 5: Optimization With HSpice

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

Page 6: Optimization With HSpice

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.

Page 7: Optimization With HSpice

Example: buffer• ************************• .MODEL model1 OPT ITROPT=30• .PARAM TransP=OPT1 (16, 4, 50, 1)• .PARAM TransN=OPT1 (27, 4, 50, 1)• .DC Va 0V 3.3V 0.0001 SWEEP OPTIMIZE=OPT1 RESULTS=transpt MODEL=model1• ************************• .DC Va 0 3.3 0.001• .MEASURE DC transpt WHEN v(q0)=v(a) CROSS=LAST goal=1.2• * other hspice commands• m1000 vdd a q0 vdd pch w=TransP l=2• + ad=96 pd=44 as=80 ps=42 • m1001 q1 q0 vdd vdd pch w=TransP l=2• + ad=80 pd=42 as=0 ps=0 • m1002 gnd a q0 gnd nch w=TransN l=2• + ad=138 pd=150 as=115 ps=102 • m1003 q1 q0 gnd gnd nch w=TransN l=2• + ad=115 pd=102 as=0 ps=0

Vin

Vout

Page 8: Optimization With HSpice

Examples: gain 2 amplifier• ********************************************• .MODEL model1 OPT ITROPT=30 • .PARAM Pbv1=OPT1 (3.233, 0.00, 3.30) Pbv2=OPT1 (0.932, 0.00, 3.30)• *.PARAM Tbv1=OPT1 (28, 3, 50, 1) Tbv2=OPT1 (29, 3, 50, 1)• .PARAM Tbv1=25• .PARAM Tbv2=44• .PARAM Tain=58• .param trans_pt=trans_pt_low• .DC Vain 0.5V 2.50V 0.001 SWEEP OPTIMIZE=OPT1 RESULTS=slope_mid,curve_area MODEL=model1• ********************************************• .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(t1) 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(t1)-ideal_curve(v(ain))") from=interval_low to=interval_high goal=0.0001• * additional spice statements are here (but not applicable to this example)• m1000 t1 bv1 Vdd GND nch w=Tbv1 l=2• + ad=431 pd=420 as=250 ps=220• m1001 t1 bv2 GND GND nch w=Tbv2 l=2• + ad=0 pd=0 as=788 ps=732• m1002 GND ain t1 GND nch w=Tain l=2• + ad=0 pd=0 as=0 ps=0