




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















Fabricating a chip is a lengthy and expensive process. Designers need to estimate the delay of circuits and test the functionality of unusual ideas without repeating the fabrica- tion process too many times. Simulation is the art of building a model of a physical chip, then mathematically evaluating the model. It is much cheaper than fabrication, but is only as good as the quality of the model. Moreover, learning what is important to model and what can be ignored can be challenging and evaluating a detailed model takes large amounts of time.
There are many levels of model accuracy. HSPICE is one of the most detailed simulation tools; it can use complex transistor models and solve the differential equations to predict currents and voltages. However, even HSPICE is very limited because the user must know what cases to simulate. Transistors vary by at least a factor of 2 in performance over pro- cessing extremes; therefore a single simulation cannot possibly match all chips. Moreover, two transistors on the same chip do not perform identically. If a circuit’s operation depends on the degree to which ideally identical devices match, the designer must identify the possible mismatch and include it in the simulation. Similarly, if power supply or ther- mal variations impact circuit performance, they may have to be modeled. As with any computer program, garbage in-garbage out.
Even with fairly simple models, HSPICE takes too long to run on large circuits. Individual gates are acceptable; larger modules such as 64 bit adders push the limits of what can be simulated in a reasonable amount of time. Therefore, HSPICE is generally reserved to characterize a library and verify potentially risky circuits. Other less detailed simulators are used to verify the entire chip and estimate the timing of all the paths. These other tools, such as static timing analyzers, base timing information upon simpler models curve fit to data from a modest number of SPICE simulations.
This section gives a brief example of using HSPICE. If you have never used the simulator, you will probably want a more detailed tutorial. For instance, a tutorial and lengthy refer- ence manual are available at:
http://yake.ecn.purdue.edu/~seib/ee255/spicehandouts.html
(c) 1997 David Harris
Those who like a hard copy of a reference manual may prefer the 3-volume HSPICE User’s Manual. Volume I is especially handy for power users who want to take advantage of advanced measurement and optimization commands.
The following code is an example of a SPICE deck which measures the delay through an inverter. The first line should always be a comment because it is ignored by SPICE.
example.hsp
Written 9/13/97 by David Harris
.param Supply=2.5* Set voltage .protect * Don’t print the contents of library .lib ‘~/lib/cad/spice/hp0.6u/opConditions.lib’ TT
.opt scale=0.35u* Define lambda
.global Vdd Gnd Vdd Vdd Gnd ‘Supply’
.subckt inv In Out N=8 P=
x1 In Out inv * Inverter C1 Out Gnd 0.1pF
Such a log often reveals when a circuit is being run through SPICE dozens of times with minor tweaks between runs, consuming days of engineering effort while making minimal improvement in circuit performance.
Such careful and limited use of SPICE is the most important step toward high productivity circuit design. However, there are a few technical features of HSPICE not found in other SPICE simulators that also help productivity. They include waveform viewing, good pro- gramming style support, measurement statements, and optimization.
By placing a .options post statement in your HSPICE deck, you can direct the simulator to write binary dumps of the complete simulation results to disk. For example, when you run a .TRAN transient analysis, the simulator will produce a deck_name.tr0 file listing all cir- cuit voltages and currents as a function of time.
You can then run the mwaves waveform viewer on the deck_name.tr0 file to plot any volt- ages and currents of interest.
Waveform viewing is most useful when a circuit is not behaving the way you expect. You can trace the problem from the outputs which are behaving strangely to the inputs and see at which point internal nodes behave unexpectedly. Frequently, this reveals simple typos in the SPICE deck instrumentation code which would have been difficult to find without a waveform viewer.
Remember that SPICE decks are just software. All the good practices of software design apply to SPICE deck design as well. These include:
- Format decks to be easy to read - Use self-explanatory node and parameter names (never name a node foo!) - Use comments - Use parameters to make constants easy to change - Use hierarchy to make circuits more comprehensible
If you write clear and easy to understand SPICE decks, you will be rewarded years later when you need to revisit the deck and discover why the fabricated chip is not acting as expected. You often can also reuse much of your deck for similar simulations.
Parameters are useful for any feature of a circuit that might change. Transistor widths are especially popular. If you expect to port the circuit to another process in the future, making channel length a parameter by specifying λ is also useful.
SPICE decks take advantage of hierarchy through the .subckt command. The deck below combines many of these elements of good software design. The inverter subcircuit is
given default transistor widths that can be overridden by a call to the subcircuit. Channel length and diffusion parasitics are given as a function of lambda. The assumptions are commented and the variable names are easy to read (as opposed to naming In and Out n and n2).
.subckt inv In Out N=8u P=16u
As noted in the earlier example, HSPICE measure statements are very useful to report simulated results. With other versions of SPICE, one often must plot tables of output volt- ages, then manually read off propagation delays.
The most common use of measure statements is to compute the time between a trigger event and a target event. Another common use is to compute functions of other measured variables, such as the average of rise and fall delays. Examples of these uses are:
CAD tools can automatically generate SPICE decks, then pull the measured results out of deck_name.mt0 files.
More details on .MEASURE can be found in the Simulation Output and Controls chapter of the HSPICE Users Manual (page 3-13 of the 1996 edition). Even derivatives and inte- grals can be measured!
Often, it is interesting to see how an output varies for different values of a parameter and thus to find the optimal value of the parameter. This can be done by tweaking the value of the parameter by hand and running many simulations, a tedious process. HSPICE auto-
m1 Out In Gnd Gnd nmos l=’2*lambda’ w=N
x1 In Inb inv * set appropriate slope x2 Inb Inv inv M=’fanout’ DUT x3 Inv Out3 inv M=’fanout * fanout’ load x4 Out3 Out4 inv M=’fanout * fanout * fanout’
Vin In Gnd pulse 0 ‘Supply’ 1ns 0.1ns 0.1ns 4ns 10ns
.measure invR
.param pnratio = opt1(2, 0.5, 3)
.end
This deck finds a pnratio of 1.38 to minimize average delay for the particular process.
HSPICE optimization is notorious for not converging or converging on the wrong answer. In general, nonlinear optimization problems are tricky and can’t be guaranteed to con- verge; HSPICE’s algorithms don’t do a very good job when optimizations involve more than one variable. The moral is to only use optimization for simple problems and to sanity check the results.
One of the most important applications of a detailed circuit simulator like HSPICE is to extract process parameters which can be used by other simpler simulators and estimation schemes. For example, to use the hand estimation techniques we have been studying, we need to know the values of R, C, τ, and a FO4 delay. We can compute these values with two HSPICE simulations.
First consider delay, i.e. τ and the FO4 delay. The delay of a FO4 inverter in τ is t (^) intrinsic +
fanout * (1+pnratio). Fanout is 4 and we’ll assume we design the gate with a 2:1 P/N ratio. Thus, the delay is 12+tintrinsic. t (^) intrinsic depends on the diffusion and wire parasitics; we
have estimated it earlier as 3, for a total FO4 delay of 15τ. Even if our intrinsic delay var- ied from 1.5 to 4.5, 50% estimation errors, the FO4 delay would only vary by 10%. Thus, defining τ to be 1/15 of a FO4 delay is a good approximation. Therefore, we can build a test deck to measure the FO4 delay, as shown in Figure 5.
FIGURE 1. Inverter Delay Schematic
The fanout parameter is set to 4; M is a multiplier indicating M copies of a gate should be ganged in parallel. The first inverter is used to produce an appropriate input slope on node Inb. The second inverter is the FO4 inverter being measured. The third inverter is a load providing a fanout of 4 to the second inverter. Interestingly, the effective gate capacitance of the third inverter depends on how fast its output switches because there is some cou- pling between gate and drain of each transistor that gets magnified by the Miller effect when the output switches. Therefore, we provide a fourth inverter to load the load and set approximately the correct Miller effect.
A HSPICE deck can now model this circuit and measure the delay from Inb to Inv. Since rise and fall delays are unlikely to match, we can use the average delay as the FO4 delay, then compute τ as 1/15 of the measured FO4 delay.
In
P:16 Inb Inv
N:
Out3 Out
delay
P:
N:
P:
N:
P:
N:
M = ’fanout’ M=’fanoutfanout’M=’fanoutfanoutfanout’*
FIGURE 3. Curve fitting delay vs. fanout for 2-input NOR (0.8 μ m process)
The physical parameters of a chip vary from die to die and across individual dice. In order to keep yield high, a chip should operate correctly over a wide range of process variation. The best and worst case processing over which the chip should work are called process corners. The amount of variation across a chip is called process tilt.
Different dice may see different:
- Polysilicon linewidth (channel length) - NMOS Vt - PMOS Vt - Oxide thickness - Parasitic capacitances
Some of these parameters such as oxide thickness correlate well between NMOS and PMOS transistors because they are set for both kinds in a single step. Others such as threshold voltages correlate poorly because they are set by different processing steps. Therefore, the performance of NMOS and PMOS transistors may vary independently. For each kind of transistor, we identify typical (T), fast (F), and slow (S) processing. A process can therefore be characterized by two letters, one for NMOS and one for PMOS. This is shown in Figure 8:
FIGURE 4. Process Corners
Notice how the FF corners and SS corners are more extreme than the FS and SF corners. This is because some parameters like oxide thickness track for both flavors of transistors and therefore cannot improve one flavor while making the other flavor worse.
Environmental variations, particularly of voltage and temperature, can make as much dif- ference as processing. Therefore High and Low voltage and temperature corners are gen- erally defined. For example, a chip normally operating at VDD=2.5 volts may use a high VDD of 2.75 and low VDD of 2.25. A high temperature may be 120 degrees C and a low temperature may be 0 degrees C for a part operating in the commercial temperature envi- ronment, since the actual transistor temperature on a hot die may far exceed the ambient temperature. Finally, an additional letter is sometimes added representing metal perfor- mance.
The uses of various corners are summarized in Table 1. The SF and FS corners are impor- tant for ratioed circuits such as pseudo-NMOS which fail if the PMOS is too strong, but run very slowly when the PMOS is too weak. The last two corners are important for self- timed circuits and other applications where there are races. If the amount of wire and gate delay are not equal, margin must be provided so the race does not cause failure in either corner.
TABLE 1. Process Corners NMOS PMOS Wire Supply Temp Check For T T T Nom Med 85 typical chips F F F +10% Low 0 max power S S S -10% Hi 125 slowest chips F S T Low High ratioed circuit failure S F T High Low ratioed circuit failure F F S High Low gates outracing wire S S F Low High wire outracing gates
NMOS Speed
PMOS Speed
FIGURE 5. Inverter Switching Thresholds
Notice how increasing the P/N ratio also raises the input voltage for which the output reaches VDD/2. In the process shown, a P/N ratio of 2.5 centers the curve so that an input of VDD/2 produces an output of VDD/2.
Using a higher or lower P/N ratio favors rising or falling outputs, respectively. For exam- ple, with a P/N ratio of 4/1, the input does not have to fall as far as VDD/2 before the out- put could switch. We call such a circuit a “high skewed” gate and use it on paths where the critical transition is a rising output. Similarly, a 1/1 P/N ratio could be used in a “low skewed” gate for critical falling outputs. A 2/1 P/N ratio roughly centers the gate; depend- ing on relative mobilities, a ratio of 2/1-3/1 may be needed. Even higher or lower skews may be used, but they greatly slow the non-critical edge and severely reduce noise mar- gins so a range of 1/1 to 4/1 is generally preferred.
P/N ratios apply to other static CMOS gates besides inverters. For example, a normal skew NAND2 gate uses equal sized NMOS and PMOS transistors because the NMOS are in series. A high-skew NAND2 doubles the PMOS width, while a low-skew NAND2 dou- bles the NMOS width. Similarly, a normal skew NOR2 gate uses PMOS transistors four times the NMOS width. A high skew NOR2 uses 8x PMOS, while a low skew NOR2 uses 2x PMOS transistors. Skewing NOR gates high is rarely done because such large PMOS transistors are needed.
Normal skew gates have equal rise and fall resistances. However, this is not optimal for average circuit delay. By using a smaller P/N ratio, the input load can be significantly reduced while only somewhat slowing the rising output. Thus, the average delay of a gate decreases, though the rise and fall times become unbalanced. Consider an inverter driving a fanout of f with an NMOS transistor sized at one unit and a PMOS transistor sized β times larger, as shown in Figure 2. Suppose the gate has equal rise and fall times for β = k (i.e. 2). Neglect parasitic capacitances because they turn out to not affect the conclusions.
FIGURE 6. P/N ratio of inverter
The falling delay is f(1+β) τ. The rising delay is (k/β)f(1+β) τ. Thus, the average delay of the gate is:
(EQ 1)
We can solve for the P/N ratio β that minimizes delay by taking the derivative and setting it to 0:
(EQ 2)
Therefore, the optimal P/N ratio to minimize average path delay is the square root of the ratio that gives equal rise/fall resistances. Since the mobility ratios are 2-3, the best P/N ratios for average delay are 1.4-1.7; 1.5 is a convenient number to use.
For more complex gates, the same analysis holds: average delay is optimized by setting the P/N ratio to the square root of that which gives equal rise/fall resistances. Thus, a NOR3 gate which requires a P/N ratio of 6 for equal rise/fall resistance can be designed instead with a ratio of sqrt(6) = 2.45, greatly reducing area and power as well as average delay!
Figure 3 summarizes the P/N ratios of simple gates sized for equal rise/fall resistance (normal skew), high skew, low skew, and minimum average delay. Unless otherwise spec-
f(1+β)
β
Static CMOS gates are the simplest and easiest to use circuit family. Their advantages include:
- Very robust -- “nearly idiotproof!” - “Zero” DC power (leakage => nothing is zero in the real world) - Low AC power - Insensitive to process variation, if you wait long enough - Scales well to low voltage - Handled well by synthesis tools and simulators - Well understood
Thus, static CMOS gates should be used by default unless there is a good reason to do oth- erwise. Designers have a few tricks to squeeze maximum performance out of static gates. They include topology selection, skewing gates, optimizing for critical inputs, and perhaps tapering stacks. Let’s discuss each further.
The most important part of creating fast circuits is to choose a good topology of gates. The right number of stages depends on the total gain of the path and should result in a gain of about 4 per stage, though anything in the range 2-6 is not bad. Thus, if very little logic must be performed but the fanout is large, simple stages like 2-input gates and inverters should be used. If lots of logic must be performed but little fanout is necessary, complex multiple input gates should be used. CMOS logic has the advantage of supporting arbi- trary AND-OR-invert structures as well as simple NAND and NOR gates.
Nevertheless, beyond a certain point, complex gates are always slower than two stages of simpler gates. This occurs because delay from internal parasitics increases quadratically with the number of series transistors. The maximum number of series transistors in a typi- cal CMOS gate should be about 4 NMOS or 3 PMOS. An exception is that 5 series NMOS devices in domino gates are sometimes acceptable, especially since the bottom one may be a wide clocked transistor that turns on early.
DeMorgan’s law provides a fair amount of flexibility choosing between NAND and NOR gates. In general, NAND gates are preferable because their series stacks consist of fast NMOS transistors rather than slower PMOS transistors. This is clear from the logical efforts of gates.
When a transition in a particular direction is known to be most critical, CMOS gates may be skewed to favor that transition, as mentioned in a previous lecture. This speeds up the
critical edge at the expense of the other edge. Care must be taken to ensure the other edge does not become a performance limiter. How do we compute the logical effort of such skewed gates?
The logical effort of a skewed gate is equal to it’s input capacitance divided by the input capacitance of an inverter that has the same drive strength on the critical transition. For example, Figure 1 shows the sizing and logical efforts of skewed inverters, NAND gates, and NOR gates.
FIGURE 8. P/N Ratios
As expected, skewed gates have lower logical effort because less input capacitance is ded- icated to the non-critical edge.
The delay of a gate depends on the input pattern. For example, consider a 2-input NOR gate shown in Figure 2. Input A is closest to the rail and is thus called the outside input. Input B is closest to the middle and thus is called the inside input.
FIGURE 9. 2-input NOR gate
Consider the delay from A and B falling to the output rising. If A falls first, it can charge up the capacitance on node X. When B arrives, the output will respond quickly because X is already set and because charge sharing between node X and the output will further reduce the delay. On the other hand, if B falls first, X will be low. When A arrives, the out-
Inverter NAND2 NOR
Normal Skew
High Skew
Low Skew
FIGURE 11. Twisting stacks for average delay
As we have seen earlier, delay of long series transistor stacks increases quadratically with the number of series transistors because both resistance and parasitic capacitance increase proportionally to the number of transistors. It would be convenient to be able to build taller stacks without parasitic delay getting out of hand. To do this, some designers have proposed tapering their transistor stacks to use wider transistors near the rails. This leads to an interesting derivation which suggests gate delay really can increase only linearly with stack height. Unfortunately, it overlooks several practical problems that overshadow the potential benefits. Let’s look more closely at tapering stacks, then see why it is usually a bad idea.
Figure 5 shows a stack of three transistors with contacts between each. The delay is qua- dratic in the number of series transistors. Figure 6 shows a tapered stack of three series transistors. The transistors near the bottom of the stack are larger, providing more current to discharge the internal parasitics. With suitable choice of tapering, the delay can be shown to increase only linearly with the number of series transistors.
FIGURE 12. Contacted 3 transistor stack
FIGURE 13. Tapered 3 transistor stack
There are two drawbacks with this tapering. One is that the transistors near the rail must be quite large. This increases the loading on previous stages. If the previous stages were also critical, the increased delay of the previous stage may swamp out savings in delay of the tapered stage.
4 λ
4 λ
16 λ
16 λ A B
4 λ 4 λ
8 λ
8 λ 8 λ
8 λ
May have worst case
always average case
4 λ (^) GND
OUT
More subtly, the spacing between gates in a tapered stack is larger than the spacing between uncontacted transistors. Therefore, tapering an uncontacted tack can actually increase diffusion parasitics. Thus, it is usually a good idea only to taper stacks at con- tacted nodes.
Despite these limitations, tapering is occasionally useful. If non-critical early signals can drive transistors close to the rails, widening these transistors is beneficial. Since the sig- nals were early anyway, their load can be increased without overall performance penalty. These wide transistors near the rails can now supply more current when the critical inputs arrive near the middle of the gate. A common application of this is to double the width of the clocked pulldown transistor in a dynamic gate. As long as the clock arrives well before the critical inputs, this will speed up the dynamic gate. A drawback is increased clock loading and power consumption.
Another popular static circuit family is pass-transistor logic. The idea is to use transistors as switches to efficiently implement multiplexors and related structures. The simplest 2- input multiplexor imaginable can be implemented with just two pass transistors, as shown in Figure 7. It has two major limitations: the output does not swing rail-to-rail, and the output is not buffered so the gate cannot be cascaded to drive arbitrary other gates. These limitations can be overcome by adding explicit buffers and by either employing both NMOS and PMOS transistors in parallel to pass both 0’s and 1’s effectively or by provid- ing a level restoration circuit on the output. These options lead to several flavors of pass- transistor logic: CPL, DPL, SRPL, LEAP, etc. We’ll look at these variations, then consider how to size pass transistors and conclude with recommended applications.
FIGURE 14. Simple Pass-transistor multiplexor
4 λ (^) GND
OUT