************************************
* Worst-case nwell model for hspice by JP
* initial resistance = 950 ohms/sq
* width correction = 0.66u
* resistance width correction = 1.2u - 0.66u = 0.54u
* resistance length correction = -0.2u
* temperature coefficient = 0.80 %/C
************************************

.model nwellmodel R bulk=GND cox=2.18e-4 dw=-0.27u dlr=0.1u rsh=950 tc1r=0.008
EOF
} elsif($nwellres eq 'best') {
	print STDERR "Adding best-case nwell model\n";
	print <<EOF;

************************************
* Best-case nwell model for hspice by JP
* initial resistance = 511 ohms/sq
* width correction = 0.66u
* temperature coefficient = 0.80 %/C
************************************

.model nwellmodel R bulk=GND cox=1.87e-4 dw=-0.27u dlr=0.1u rsh=511 tc1r=0.008
EOF
} elsif($nwellres eq 'nominal') {
	print STDERR "Adding nominal-case nwell model\n";
	print <<EOF;

************************************
* Nominal-case nwell model for hspice by JP
* initial resistance = 750 ohms/sq
* width correction = 0.66u
* temperature coefficient = 0.80 %/C
************************************

.model nwellmodel R bulk=GND cox=2.08e-4 dw=-0.27u dlr=0.1u rsh=750 tc1r=0.008
EOF
}

print STDERR "$nmod MOS models processed.\n";
print STDERR "$nomod other models and $nsubckt subcircuits deleted.\n";
print STDERR "$nparam .PARAM statements deleted.\n";
exit 0;
######################################################################
