This section discusses how to define specific parameters so that the simulation provides the appropriate output. Define simulation parameters using the .OPTION and .MEASURE statements and specific variable element definitions.
Some types of output variables for DC and transient analyses are:
The codes that you can use to specify the element templates for output are summarized in Print Control Options.
Defines the nodes between which the voltage difference (n1-n2) is to be printed or plotted. When n2 is omitted, the voltage difference between n1 and ground (node 0) is given. |
This example specifies the current through the first node of resistor R1.
The above example specifies the current through the fourth node (the substrate node) of the MOSFET M1, which is defined in subcircuit X1.
The last example specifies the current through the second node (the base node) of the bipolar transistor Q1.
Define each branch circuit by a single element statement. Star-Hspice evaluates branch currents by inserting a zero-volt power supply in series with branch elements.
If Star-Hspice cannot interpret a .PRINT or .PLOT statement containing a branch current, a warning is generated.
Branch current direction for the elements in Figures Resistor (node1, node2) through MOSFET (node1, node2, node3, node4) - n-channel is defined in terms of arrow notation (current direction) and node position number (terminal type).
For power calculations, Star-Hspice computes dissipated or stored power in each passive element (R, L, C), and source (V, I, G, E, F, and H) by multiplying the voltage across an element and its corresponding branch current. However, for semiconductor devices, Star-Hspice calculates only the dissipated power. The power stored in the device junction or parasitic capacitances is excluded from the device power computation. Equations for calculating the power dissipated in different types of devices are shown in the following sections.
Star-Hspice also computes the total power dissipated in the circuit, which is the sum of the power dissipated in the devices, resistors, independent current sources, and all the dependent sources. For hierarchical designs, Star-Hspice computes the power dissipation for each subcircuit as well.
Output the instantaneous element power and the total power dissipation using a .PRINT or .PLOT statement.
.PRINT <DC | TRAN> P(element_or_subcircuit_name)POWER
Power calculation is associated only with transient and DC sweep analyses. The .MEASURE statement can be used to compute the average, rms, minimum, maximum, and peak-to-peak value of the power. The POWER keyword invokes the total power dissipation output.
.PRINT TRAN P(M1) P(VIN) P(CLOAD) POWER
.PRINT TRAN P(Q1) P(DIO) P(J10) POWER
.PRINT TRAN POWER $ Total transient analysis power
* dissipation
.PLOT DC POWER P(IIN) P(RLOAD) P(R1)
.PLOT DC POWER P(V1) P(RLOAD) P(VS)
.PRINT TRAN P(Xf1) P(Xf1.Xh1)
Output variables for AC analysis include:
AC output variable types are listed in AC Output Variable Types. The type symbol is appended to the variable symbol to form the output variable name. For example, VI is the imaginary part of the voltage, or IM is the magnitude of the current.
Specify real or imaginary parts, magnitude, phase, decibels, and group delay for voltages and currents.
Specifies the voltage output type (see AC Output Variable Types) |
|
Specifies node names. If n2 is omitted, ground (node 0) is assumed. |
The above example plots the magnitude of the AC voltage of node 5 using the output variable VM. The voltage at node 5 is plotted with the VDB output variable. The phase of the nodal voltage at node 5 is plotted with the VP output variable.
Since an AC analysis produces complex results, the values of real or imaginary parts of complex voltages of AC analysis and their magnitude, phase, decibel, and group delay values are calculated using either the SPICE or Star-Hspice method and the control option ACOUT. The default for Star-Hspice is ACOUT = 1. To use the SPICE method, set ACOUT = 0.
The SPICE method is typically used to calculate the nodal vector difference in comparing adjacent nodes in a circuit. It is used to find phase or magnitude across a capacitor, inductor, or semiconductor device.
Use the Star-Hspice method to calculate an inter-stage gain in a circuit (such as an amplifier circuit) and to compare its gain, phase, and magnitude.
The following example defines the AC analysis output variables for the Star-Hspice method and then for the SPICE method.
VR(N1,N2) = REAL [V(N1,0)] - REAL [V(N2,0)]
VI(N1,N2) = IMAG [V(N1,0)] - IMAG [V(N2,0)]
VM(N1,0) = [VR(N1,0)
VM(N2,0) = [VR(N2,0)
VM(N1,N2) = VM(N1,0) - VM(N2,0)
VP(N1,0) = ARCTAN[VI(N1,0)/VR(N1,0)]
VP(N2,0) = ARCTAN[VI(N2,0)/VR(N2,0)]
VP(N1,N2) = VP(N1,0) - VP(N2,0)
VDB(N1,N2) = 20 · LOG10(VM(N1,0)/VM(N2,0))
VR(N1,N2) = REAL [V(N1,0) - V(N2,0)]
VI(N1,N2) = IMAG [V(N1,0) - V(N2,0)]
VM(N1,N2) = [VR(N1,N2)
VP(N1,N2) = ARCTAN[VI(N1,N2)/VR(N1,N2)]
VDB(N1,N2) = 20 · LOG10[VM(N1,N2)]
Current output type (see AC Output Variable Types) |
|
Voltage source element name. If an independent power supply is within a subcircuit, its current output is accessed by appending a dot and the subcircuit name to the element name, for example, IM(X1.Vxxx). |
.PLOT AC IR(V1) IM(VN2B) IP(X1.X2.VSRC)
Current output type (see AC Output Variable Types) |
|
Node position number in the element statement. For example, if the element contains four nodes, IM3 denotes the magnitude of the branch current output for the third node. |
|
Element name. If the element is within a subcircuit, its current output is accessed by appending a dot and the subcircuit name to the element name, for example, IM3(X1.Wwww). |
.PRINT AC IP1(Q5) IM1(Q5) IDB4(X1.M1)
If the form In(Xxxx) is used for AC analysis output, the magnitude IMn(Xxxx) is the value printed.
The group time delay, TD, is associated with AC analysis and is defined as the negative derivative of phase, in radians, with respect to radian frequency. In Star-Hspice, the difference method is used to compute TD, as follows
where phase1 and phase2 are the phases, in degrees, of the specified signal at the frequencies f1 and f2, in Hertz.
.PRINT AC VT(10) VT(2,25) IT(RL)
.PLOT AC IT1(Q1) IT3(M15) IT(D1)
INTEG.SP ACTIVE INTEGRATOR
****** INPUT LISTING
******
V1 1 0 .5 AC 1
R1 1 2 2K
C1 2 3 5NF
E3 3 0 2 0 -1000.0
.AC DEC 15 1K 100K
.PLOT AC VT(3) (0,4U) VP(3)
.END
Xij (z), ZIN(z), ZOUT(z), YIN(z), YOUT(z)
Specifies Z for impedance, Y for admittance, H for hybrid, or S for scattering parameters |
|
i and j can be 1 or 2. They identify which matrix parameter is printed. |
|
Output type (see AC Output Variable Types). If z is omitted, the magnitude of the output variable is printed. |
|
Input impedance. For a one port network ZIN, Z11, and H11 are the same |
|
Input admittance. For a one-port network, YIN and Y11 are the same. |
|
.PRINT AC Z11(R) Z12(R) Y21(I) Y22 S11 S11(DB)
.PRINT AC ZIN(R) ZIN(I) YOUT(M) YOUT(P) H11(M)
.PLOT AC S22(M) S22(P) S21(R) H21(P) H12(R)
This section describes the variables used for noise and distortion analysis.
Prints the magnitude and decibel values of the second harmonic distortion component through the load resistor specified in the .DISTO statement (not shown).
Element templates are used in .PRINT, .PLOT, .PROBE, and .GRAPH statements for output of user-input parameters, state variables, stored charges, capacitor currents, capacitances, and derivatives of variables. The Star-Hspice element templates are listed at the end of this chapter.
Property name of an element, such as a user-input parameter, state variable, stored charge, capacitance current, capacitance, or derivative of a variable |
.PLOT TRAN V(1,12) I(X2.VSIN) I2(Q3) DI01:GD
.PRINT TRAN X2.M1:CGGBO M1:CGDBO X2.M1:CGSBO
Star-Hspice Manual - Release 2001.2 - June 2001