HSPICE辅助设计2010.9SPICEOverviewSimulationInput&ControlsSources&StimuliAnalysisTypesOutputHspui&WaveviewExerciseTipsOUTLINESPICEOverviewCircuitDesignBackgroundtopredictthecircuit/systemcharacteristicaftermanufactureSPICEOverviewCircuitSimulationBackgroundSPICEOverviewSPICEBackgroundSimulationProgramwithIntegratedCircuitEmphasisDevelopedbyUniversityofCalifornia/Berkeley,1972Simulationinsteady-state,transient,andfrequencydomainsWidelyadopted,becomedefactostandardSBTSPICE,HSPICE,Spectre,TSPICE,Pspice,Smartspice…SPICEOverviewSPICESimulationAlgorithm-DCSPICEOverviewSPICESimulationAlgorithm-TranSPICEOverviewBasicFlowforSPICESPICEOverviewHSPICEMeta-Software-Avant!-SynopsysAdvantages模型较多,仿真精度高收敛性强在亚微米和深亚微米工艺中表现出色SPICEOverviewHSPICEDataFlowSmallsignalmodeloftransitor.optionpostnomod.tran100us50ms.printv(1)v(out)i(CL).paramLoad=10kvs10sin(0v0.1v600us00)Egsout02010Rs1250R12010kRLout0LoadCLout0100p.libor.modelor.subcircuitTitleControlsSourcesComponents.alter.paramLoad=5k.endModel&SubcktsEndfileAnalysisInput&ControlsNetlistStructureInput&ControlsNamingConventionsNodeandElementIdentificationoEitherNamesorNumbers,nodelimiters(e.g.src,n3,11,…)o0isALWAYSGroundoTrailingAlphabeticCharacterareignoredinNodeNumber(e.g.5A=5B=5)oGroundmaybe0,GND,!GNDoAllnodesareassumedtobelocaloNodenamescanbeacrossallsubcircuitsby.GLOBALstatement(e.g..GLOBALVDDVSS)Input&ControlsNamingConventionsInstanceandElementNamesInput&ControlsNamingConventionsUnitsResistor(ohm),Capacitor(F),Inductor(H),Voltage(V),Current(A),Length(M),Time(Sec),Frequency(Hz),Temperature(℃).ScaleFactorsF=1e-15P=1e-12N=1e-9U=1e-6M=1e-3K=1e3MEG=X=1e6G=1e9T=1e12DB=20log10FT=0.305Input&ControlsFormatConventionsoAlinemaybecontinuedbyenteringaplussign('+')incolumn1ofthefollowingline.oQuotationmarksmustbeusedtospecifyanalgebraicequation.Bothsingle(‘’)anddouble(“”)quotationmarkscanbeused.(e.g.J=‘A+B*C’,K=“2*J”)oUpperandlowercaseisignoredexceptasfilenamesonUNIX.oTheinputfilecannotcontainlineswithmorethan80columns.oExceptfirstline,Title,andlastline,.END,theorderoftheremaininglinesisarbitrary.Input&Controls.ALTERRerunasimulationwithdifferentmodels/parameters/options…Input&Controls.DATARerunasimulationwithdifferentmodels/parameters/options…Input&Controls.SUBCKTusehierarchicalcircuitsDefinitionCallRemember:AllnodesarelocalInput&Controls.LIBDefinitionms018_v1p8.libCallclocktree.sp.LIBms018_v1p8.libTT.LIBTT.PARAM…….INC‘ms018_v1p8.mdl’.ENDLTT.LIBFF…….ENDLFFInput&ControlsOthers.OPTIONmodifiesvariousaspectsofsimulation(input/output/analysis/accuracy/algorithm,etc.).TEMPspecifiescircuittemperatureforsimulation.DCperformsseveraltypesofsweepsduringDCanalysisfordetails:HSPICEReferenceManual:CommandsandControlOptionsSources&StimuliSourcesIndependentSourcesoAC,DCSourcesoTransientSourcesVoltageandCurrentControlledSourcesoE--VCVSoF--VCCSoG--CCVSoH–CCCSfordetails:HSPICEReferenceManual:SimulationandAnalysisSources&StimuliAC,DCSourcesSources&StimuliTransientSourcesPULSESources&StimuliTransientSourcesSINSources&StimuliTransientSourcesPWL(PiecewiseLinearSource)AnalysisTypesAnalysisTypesDCOperatingPoint.OP.IC.NODESETDCSweep&DCSmallSignalAnalysis.DC.TF.PZACSweep&SmallSignalAnalysis.AC.NOISETransientAnalysis.TRAN.FOURfordetails:HSPICEReferenceManual:SimulationandAnalysisAnalysisTypes.DCtocalculatetransfercurves*NMOSM12100NOSW=10Ul=2UV_GS10V_DS20.OPTPOST.PRINTDCI(M1).DCV_DS050.1V_GS051.MODELNOSNMOSLEVEL=2.ENDM1V_GSV_DSAnalysisTypes.ACtocalculatefrequency-domainresponseASIMPLEACRUN.OPTIONLISTNODEPOST.OP.ACDEC101K1MEG.PRINTACV(1)V(2)I(R2)I(C1)V11010AC1R1121KR2201KC120.001U.ENDAnalysisTypes.Trantocalculatetime-domainresponseInverterCircuit.OPTIONLISTNODEPOST.TRAN200P20N.PRINTTRANV(IN)V(OUT)M1OUTINVCCVCCPCHL=1UW=20UM2OUTIN00NCHL=1UW=20UVCCVCC05VININ00PULSE.24.82N1N1N5N20NCLOADOUT0.75P.MODELPCHPMOSLEVEL=1.MODELNCHNMOSLEVEL=1.ENDOutputOutputFilesSummaryOutputFileTypeExtensionOutputListing.lisDCAnalysisResults.sw#DCAnalysismeasurementResults.ms#ACAnalysisResults.ac#ACAnalysisMeasurementResults.ma#TransientAnalysisResults.tr#TransientAnalysisMeasurementResults.mt#SubcircuitCross-Listing.pa#OperatingPointNodeVoltagesicOutput.MEAS(URE)MeasurementModes:Rise,Fall,DelayAVG,RMS,MIN,MAX,P-PFind-Whenfordetails:HSPICEReferenceManual:CommandsandControlOptionsOutput.MEAS(Rise,Fall,Delay).MEASDC|AC|TRANmeasure_name+TRIGoutvar1VAL=trig_val[TD=td][CROSS=#crosses]+[RISE=#rises][FALL=#falls]+TARGoutvar2VAL=trig_val[TD=td][CROSS=#crosses]+[RISE=#rises][FALL=#falls].MEASTRANtphlTRIGV(in)VAL=2.5VRISE=1+TARGV(out)VAL=2.5VFALL=1.MEASTRANtperiodTRIGV(in)VAL=2.5VCROSS=1+TARGV(in)VAL=2.5VCROSS=3VoltTimetphltperiod0V5V0V5VV(in)V(out)Output.MEASExamples(Rise,Fall,Delay)Output.MEASExamples(Ripple)Output.MEASExamples(OPA)unity-gainfreq,phasemargin,DCgainbandwidth,qualityfactorHSPICEDemoOscillatorforexample.optionlistnodenomod.icV(1)=5.globalVDD.paramLm=0.5uWn=0.7uWp=1.2u.tran0.1n5nVddVDD05.subcktinverterinoutMpoutinVDDVDDmod2W=WpL=LmMnoutin00mod1W=WnL=Lm.ends123inv1inv2inv3MpMn0inoutvddXinv112inverterXinv223inver