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.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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
Or:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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)'
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)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Star-Hspice Manual - Release 2001.2 - June 2001