Miscellaneous

Q: Should I include the gate edge of the source and drain when specifying the PD and PS (periphery of the drain and source respectively, used for calculating parasitic diodes)?

A: For ACM=0 or 2, you do include the gate edge of the source and drain when calculating PS and PD. For ACM=3, you do not include the source or drain edges when specifying PS and PD. PS and PD are not used for ACM=1.

Solution: 133

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Q: Is there a difference between parameters defined on the .SUBCKT line and those defined in the subcircuit body?

A: Parameters defined on the .subckt line are in the same namespace as parameters defined within the body of the subcircuit.

The following two subcircuits are equivalent:

.SUBCKT sub1 in out l=10u w=5u

.ENDS

Or:

.SUBCKT sub2 in out

.PARAM l=10u w=5u

.ENDS


NOTE: Both forms of the subcircuit accept the parameters "l" and "w" on element instance lines.

Solution: 139

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Q: How can I simplify repetitive complex measurements?

A: Encapsulate the functionality of your measurements/probes in subcircuits. Subcircuits do not have to contain elements. They can contain complex measurement routines to make measurements less tedious. If you make judicious choices for the instance names, parsing the output becomes relatively easy. For example, calculate AC transfer functions for arbitrary nodes in your netlist:

.PARAM mag(a,b) = 'sqrt(a*a+b*b)'

.SUBCKT Xfer in out

.PROBE AC xfer

par('mag(vr(in)*vr(out)+vi(in)*vi(out),vi(in)*vr(out)-vi(out)*vr(in))/mag(vr(out),vi(out))')

*xfer = mag(in/out) (note the voltages at in and out are complex)

.ENDS

Solution: 142

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Star-Hspice Manual - Release 2001.2 - June 2001