| set spice = /usr/local/bin/ngspice |
| echo "usage: getres nmodel_file pmodel_file dev_file" |
| echo "can't open spice nfet model file '"$1"'" |
| echo "can't open spice pfet model file '"$2"'" |
| echo "can't open device configuration file '"$argv[3]"'" |
| set nmos = `grep -i "\.MODEL" $1 | grep -i NMOS` |
| set pmos = `grep -i "\.MODEL" $1 | grep -i PMOS` |
| echo "can't find nmos .MODEL card in '"$1"'" |
| echo "can't find pmos .MODEL card in '"$1"'" |
| ed - <<end tmp.spi >& /dev/null |
| g/N_FET/s/N_FET/$nmos[2]/g |
| g/P_FET/s/P_FET/$pmos[2]/g |
| g/N_WITH/s/N_WITH/$nwith/g |
| g/P_WITH/s/P_WITH/$pwith/g |
| $spice -n -b -r spi.out tmp.spi |
| echo "something went wrong with spice, look at 'tmp.spi'" |
| ./findr -c $cap -n $nwith,$nlen -p $pwith,$plen spi.out |& tee resists |