DOC PREVIEW
MIT 6 012 - Study Guide

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Brief Introduction to HSPICE SimulationWojciech Giziewicz1 IntroductionThis document is based on one written by IhsanDjomehri, Spring 1999.Originally developed at Berkeley in the late 60s andearly 70s, SPICE has evolved into one of the tools ofchoice for circuit simulation. SPICE reads in a list ofcircuit nodes and the elements between them (calledthe SPICE deck since in the early days each elementwas entered on its own punch card, and a whole cir-cuit simulation was thus a deck of cards) and solvesfor the voltages at all nodes. Relevant to our needsin 6.012, the simulation modes include nonlinear DCanalysis (bias or operating point characteristics), lin-ear AC analysis, and transient analysis.2 The SPICE DeckTo run SPICE on Athena, make a new directory foryour SPICE work, then run add hspice to attach theHSPICE locker. The program takes an input file (thedeck) and outputs its results to the terminal. Some-times there can be a lot of output, so it is convenientto redirect it into a file, for example% hspice mydeck.sp > mydeck.out.Use your favourite text editor to create your spicedeck. Each line of the file defines an element of thecircuit. The first line in the file is always treated asa comment. A * at the beginning of any line causesit to be treated as a comment. The general formatfor entering a circuit element is a one-letter identifiermerged with a name, the nodes that connect to it, andthe properties of the element. Numerical propertyvalues are always in SI units (me ters, seconds, volts,etc...) but can be modified by a suffix letter that actsas a multiplier.x k m u n p f10610310−310−610−910−1210−15Begin by sketching out your circuit on paper, label-ing each node with a number or name (only numberswere allowed in the old days), and naming each cir-cuit element. Node 0 is always ground and floatingnodes (a node from which there is no connection toground through circuit elements) will generate an er-ror. Your spice deck will consist of a list of all of yourcircuit elements (order is not important) and anal-ysis commands. The following elements may b e ofinterest:Voltage: Vname N+ N- <qualifier> valueCurrent: Iname N+ N- <qualifier> valueResistor: Rname N+ N- valueCapacitor: Cname N+ N- valueInductor: Lname N+ N- valueDiode: Dname N+ N- modelBJT: Qname Nc Nb Ne modelMOSFET: Mname Nd Ng Ns Nb model+ L=value W=value+ < AD=value AS=value+ PD=value PS=value>Everything appearing in italics is mandatory, param-eters within <> are optional. As shown above, astatement may be broken up into two or more linesby placing a “+” at the beginning of the second andeach subsequent line.Sources and passive devices are defined with a pos-itive and a negative node (N+, N-). Current flowsthrough one of these elements from the positive tonegative node. This is particularly important to re-member for a current source, because the specifiedcurrent flows slightly counter-intuitively through theelement from the positive to the negative node. Typi-cally, one begins by specifying all voltage and currentsources, followed by passives and active devices. Forthe sources, the qualifer input is DC, AC, or a tran-sient function as applicable to the respective analy-sis. A source may b e specified with all three, and theanalysis will choose the appropriate parameter. Ata minimum, the DC value is usually specified (e.g.V1 in gnd DC 1). For an AC signal, one specifiesthe AC magnitude (e.g. V1 in gnd AC 1). The1transient functions of interest are:Pulse Train: PULSE(v1 v2 td tr tf pw per)Piecewise Linear: PWL(t1 v1 t2 v2 ...)Sine Wave: SIN(vo va freq <td>)In the parameter lists above for the pulse train (orsquare wave if appropriate parameters are used), v1and v2 are low and high voltages, td is the time delaybefore starting, tr and tf are the pulse rise and falltimes, pw is the pulse width (time spent at v2), peris the period at which the pulse is repeated. Forthe PWL, a list of time and level pairs is provided.For the SIN function, vo is the offset voltage, va isthe sinusoidal amplitude, freq is the frequency of thesignal, and td is the delay. These functions may beused with current sources, sp ec ifying currents insteadof voltages. Also, note that the SIN function is usedwith a transient analysis and does not in any wayimply an AC analysis.The active device on which we will spend the mosttime is the MOSFET. For this device, four connec-tions are specified: drain, gate, source, and body.The device is referenced to an appropriate model thatdefines its parameters and is included as a card in thedeck in the following form..model name PMOS/NMOS level=num <params>The model is generally provided either in the assign-ment (in the case of this course) or by the manufac-turer in the case of an IC foundry. A MOSFET cardmust also include gate length and width (parametersL and W), and drain and source areas and perime-ters (AD, AS, PD, PS) for accurate transient and ACanalyses.In practice, a design will include a limited numberof MOSFET geometries. At the same time, in a de-sign with more than a handful of transistors it canbe tedious (as well as an important source of errors)to manually calculate and enter the parameters everytime a geometry changes. SPICE provides a facilityto define variables and use expressions of these vari-ables in other cards. The scope of the variables is theentire deck. The following is a simple example:.PARAM Lnmos=1.5u.PARAM Wnmos=3u.PARAM Ldiff=3uM1 out in gnd gnd Nmodel L=Lnmos W=Wnmos+ AD=’Ldiff*Wnmos’ PD=’2*Ldiff+Wnmos+ AS=’Ldiff*Wnmos’ PS=’2*Ldiff+WnmosThe gate length and width, along with source/draindiffuse lengths (all in microns, hence the u suffix)are defined as variables, and a MOSFET as definedin the model Nmodel is declared (source and bodyconnected to ground, gate to node in, drain to nodeout). This method may seem to lead to an unnec-essary amount of typing in a trivial case, but is ex-tremely helpful in a larger design and its use is verystrongly encouraged.3 Performing an AnalysisWhen using HSPICE, the deck should always includethe card.options postAdditionally, appropriate cards are required for dif-ferent types of analysis. The analyses themselves aresaved in separate data files. The following analysesare only a small subset of what may be performed,but they are all that will be required in this course.3.1 DC Analysis.DC Vname1/IName1 start1 stop1 step1+ < Vname2/IName2 start2 stop2 step2>This command performs a DC sweep from the spec-ified start to


View Full Document

MIT 6 012 - Study Guide

Documents in this Course
Quiz #2

Quiz #2

11 pages

Quiz 1

Quiz 1

11 pages

Exam 2

Exam 2

11 pages

Quiz 1

Quiz 1

13 pages

Quiz 2

Quiz 2

14 pages

Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?