46 #include <Xyce_config.h>
70 #include <N_ERH_ErrorMgr.h>
72 #include <N_LAS_Matrix.h>
73 #include <N_LAS_Vector.h>
83 .setDescription(
"Device temperature");
88 .setDescription(
"Device area");
95 .setDescription(
"Flicker noise exponent");
100 .setDescription(
"Doping tail parameter (level 1)");
105 .setDescription(
"Transconductance parameter");
111 .setDescription(
"Zero-bias gate-source junction capacitance");
117 .setDescription(
"Zero-bias gate-drain junction capacitance");
122 .setDescription(
"Coefficient for forward-bias depletion capacitance");
127 .setDescription(
"Gate junction saturation current");
131 .setDescription(
"Flicker noise coefficient");
136 .setDescription(
"Channel length modulation");
141 .setDescription(
"Gate junction potential");
147 .setDescription(
"Drain ohmic resistance");
153 .setDescription(
"Source ohmic resistance");
161 .setDescription(
"Threshold voltage");
166 .setDescription(
"Saturation voltage parrameter (level 2)");
171 .setDescription(
"Mobility modulation parameter (level 2)");
205 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
267 std::vector<Instance*>::iterator iter;
271 for (iter=first; iter!=last; ++iter)
289 std::vector<Instance*>::const_iterator iter;
296 os <<
"Number of JFET Instances: " << isize << std::endl;
297 os <<
" name model name Parameters" << std::endl;
299 for (i=0, iter=first; iter!=last; ++iter, ++i)
301 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
327 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
357 std::vector<Instance*>::iterator iter;
361 for (iter=first; iter!=last; ++iter)
363 (*iter)->processParams();
384 :
DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
392 temp(getDeviceOptions().temp.getImmutableValue<double>()),
453 ADrainEquDrainNodeOffset(-1),
454 ADrainEquDrainPrimeNodeOffset(-1),
456 AGateEquGateNodeOffset(-1),
457 AGateEquDrainPrimeNodeOffset(-1),
458 AGateEquSourcePrimeNodeOffset(-1),
460 ASourceEquSourceNodeOffset(-1),
461 ASourceEquSourcePrimeNodeOffset(-1),
463 ADrainPrimeEquDrainNodeOffset(-1),
464 ADrainPrimeEquGateNodeOffset(-1),
465 ADrainPrimeEquDrainPrimeNodeOffset(-1),
466 ADrainPrimeEquSourcePrimeNodeOffset(-1),
468 ASourcePrimeEquGateNodeOffset(-1),
469 ASourcePrimeEquSourceNodeOffset(-1),
470 ASourcePrimeEquDrainPrimeNodeOffset(-1),
471 ASourcePrimeEquSourcePrimeNodeOffset(-1),
476 f_DrainEquDrainNodePtr(0),
477 f_DrainEquDrainPrimeNodePtr(0),
479 f_GateEquGateNodePtr(0),
480 f_GateEquDrainPrimeNodePtr(0),
481 f_GateEquSourcePrimeNodePtr(0),
483 f_SourceEquSourceNodePtr(0),
484 f_SourceEquSourcePrimeNodePtr(0),
486 f_DrainPrimeEquDrainNodePtr(0),
487 f_DrainPrimeEquGateNodePtr(0),
488 f_DrainPrimeEquDrainPrimeNodePtr(0),
489 f_DrainPrimeEquSourcePrimeNodePtr(0),
491 f_SourcePrimeEquGateNodePtr(0),
492 f_SourcePrimeEquSourceNodePtr(0),
493 f_SourcePrimeEquDrainPrimeNodePtr(0),
494 f_SourcePrimeEquSourcePrimeNodePtr(0),
498 q_DrainEquDrainNodePtr(0),
499 q_DrainEquDrainPrimeNodePtr(0),
501 q_GateEquGateNodePtr(0),
502 q_GateEquDrainPrimeNodePtr(0),
503 q_GateEquSourcePrimeNodePtr(0),
505 q_SourceEquSourceNodePtr(0),
506 q_SourceEquSourcePrimeNodePtr(0),
508 q_DrainPrimeEquDrainNodePtr(0),
509 q_DrainPrimeEquGateNodePtr(0),
510 q_DrainPrimeEquDrainPrimeNodePtr(0),
511 q_DrainPrimeEquSourcePrimeNodePtr(0),
513 q_SourcePrimeEquGateNodePtr(0),
514 q_SourcePrimeEquSourceNodePtr(0),
515 q_SourcePrimeEquDrainPrimeNodePtr(0),
516 q_SourcePrimeEquSourcePrimeNodePtr(0),
641 const std::vector<int> & extLIDVecRef )
648 #ifdef Xyce_DEBUG_DEVICE
651 Xyce::dout() << std::endl << section_divider << std::endl;
652 Xyce::dout() <<
" Instance::registerLIDs. name = " <<
getName() << std::endl;
653 Xyce::dout() <<
" number of internal variables: " <<
numIntVars << std::endl;
654 Xyce::dout() <<
" number of external variables: " <<
numExtVars << std::endl;
682 #ifdef Xyce_DEBUG_DEVICE
685 Xyce::dout() <<
"\n variable local indices:\n";
686 Xyce::dout() <<
" li_Drain = " <<
li_Drain << std::endl;
687 Xyce::dout() <<
" li_DrainPrime = " <<
li_DrainPrime << std::endl;
688 Xyce::dout() <<
" li_Source = " <<
li_Source << std::endl;
689 Xyce::dout() <<
" li_SourcePrime = " <<
li_SourcePrime << std::endl;
690 Xyce::dout() <<
" li_Gate = " <<
li_Gate << std::endl;
692 Xyce::dout() << section_divider << std::endl;
716 tmpstr =
getName()+
"_drainprime";
723 tmpstr =
getName()+
"_sourceprime";
743 if( loadLeadCurrent && storeNameMap.empty ())
747 std::string modName(getName());
748 spiceInternalName(modName);
750 tmpstr = modName+
":DEV_ID";
751 storeNameMap[ li_store_dev_id ] = tmpstr;
752 tmpstr = modName+
":DEV_IS";
753 storeNameMap[ li_store_dev_is ] = tmpstr;
754 tmpstr = modName+
":DEV_IG";
755 storeNameMap[ li_store_dev_ig ] = tmpstr;
773 #ifdef Xyce_DEBUG_DEVICE
776 Xyce::dout() << std::endl;
777 Xyce::dout() << section_divider << std::endl;
778 Xyce::dout() <<
" In Instance::registerStateLIDs. name = " <<
getName() << std::endl;
779 Xyce::dout() <<
" Number of State LIDs: " <<
numStateVars << std::endl;
795 #ifdef Xyce_DEBUG_DEVICE
798 Xyce::dout() <<
" State local indices:" << std::endl;
799 Xyce::dout() << std::endl;
801 Xyce::dout() <<
" li_state_qgs = " <<
li_state_qgs << std::endl;
804 Xyce::dout() <<
" li_state_gcgd = " <<
li_state_gcgd << std::endl;;
806 Xyce::dout() << section_divider << std::endl;
870 std::vector<int> map;
871 std::vector< std::vector<int> > map2;
931 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1018 double apart, cpart;
1023 double czgdf2, czgsf2;
1029 double A, B, C, B12, C12, D;
1030 double Idsat, Vdsat;
1033 #ifdef Xyce_DEBUG_DEVICE
1036 Xyce::dout() << subsection_divider << std::endl;
1037 Xyce::dout() <<
" Instance::updateIntermediateVars. name = " <<
getName() << std::endl;
1038 Xyce::dout() <<
" Model name = " <<
model_.
getName() << std::endl;
1039 Xyce::dout() << std::endl;
1040 Xyce::dout().width(25); Xyce::dout().precision(17); Xyce::dout().setf(std::ios::scientific);
1060 #ifdef Xyce_DEBUG_DEVICE
1063 Xyce::dout() <<
" " << std::endl;
1064 Xyce::dout() <<
" Vg = " <<
Vg << std::endl;
1065 Xyce::dout() <<
" Vd = " <<
Vd << std::endl;
1066 Xyce::dout() <<
" Vs = " <<
Vs << std::endl;
1067 Xyce::dout() <<
" Vdp = " <<
Vdp << std::endl;
1068 Xyce::dout() <<
" Vsp = " <<
Vsp << std::endl;
1098 if ((*flagSolVectorPtr)[
li_Drain] == 0 || (*flagSolVectorPtr)[
li_Gate] == 0 ||
1141 #ifdef Xyce_DEBUG_DEVICE
1144 Xyce::dout() <<
" before limiting: " << std::endl;
1145 Xyce::dout() <<
" vgs = " <<
vgs <<
" vgs_old = " <<
vgs_old << std::endl;
1146 Xyce::dout() <<
" vgd = " << vgd <<
" vgd_old = " <<
vgd_old << std::endl;
1154 if (ichk1 == 1) {icheck=1;}
1161 #ifdef Xyce_DEBUG_DEVICE
1164 Xyce::dout() <<
" After limiting: " << std::endl;
1165 Xyce::dout() <<
" vgs = " <<
vgs << std::endl;
1166 Xyce::dout() <<
" vgd = " << vgd << std::endl;
1167 Xyce::dout() <<
" " << std::endl;
1172 #ifdef Xyce_DEBUG_DEVICE
1175 Xyce::dout() <<
"vgs = " <<
vgs << std::endl;
1176 Xyce::dout() <<
"vgd = " << vgd << std::endl;
1177 Xyce::dout() <<
"vds = " <<
vds << std::endl;
1178 Xyce::dout() <<
"Vddp = " <<
Vddp << std::endl;
1179 Xyce::dout() <<
"Vssp = " <<
Vssp << std::endl;
1180 Xyce::dout() <<
"Vgsp = " << Vgsp << std::endl;
1181 Xyce::dout() <<
"Vgdp = " << Vgdp << std::endl;
1182 Xyce::dout() <<
"Vdpsp = " <<
Vdpsp << std::endl;
1183 Xyce::dout() <<
" " << std::endl;
1189 #ifdef Xyce_DEBUG_DEVICE
1194 Xyce::dout() <<
getName() <<
" Something modified the voltages. " << std::endl;
1198 Xyce::dout() <<
getName() <<
" No voltages were limited. " << std::endl;
1200 Xyce::dout() <<
" Voltage before after diff " << std::endl;
1204 Xyce::dout() <<
" " << std::endl;
1284 gm=betap*
vds*(apart+3.0*Bfac*vgst);;
1331 gm=betap*
vds*(apart+3.0*Bfac*vgdt);;
1371 if(A != 0) B = (A-vgst)/A;
1373 if(B >= 0) B12 = sqrt(B);
1380 if(A != 0) C = (
vds - tDelta*
vds/Vdsat + A-vgst)/A;
1382 if(C >= 0) C12 = sqrt(C);
1386 if( dtype*
Vd <= Vdsat )
1393 + betap*tDelta*(1-C12)*
vds/(Vdsat*Vdsat);
1395 + betap*(1-(1-C12)*tDelta/Vdsat-C12);
1403 cdrain = betap*(vgst - (2*A/3)*(1 - B*B12));
1430 if(A != 0) B = (A-vgdt)/A;
1432 if(B >= 0) B12 = sqrt(B);
1439 if(A != 0) C = (-
vds + tDelta*
vds/Vdsat + A-vgdt)/A;
1441 if(C >= 0) C12 = sqrt(C);
1445 if( dtype*
Vs <= Vdsat )
1452 gm += betap*(1-C12)*tDelta*
vds/(Vdsat*Vdsat);
1453 gds = betap*(1 - (1-C12)*tDelta/Vdsat - C12)
1463 cdrain = -betap*(vgdt - (2*A/3)*(1 - B*B12));
1483 if (
vgs < corDepCap)
1486 qgs = twop*czgs*(1-sarg);
1492 +(
vgs*
vgs - fcpb2)/(2*twop));
1505 if (vgd < corDepCap)
1507 sarg=sqrt(1-vgd/
tPB);
1508 qgd = twop*czgd*(1-sarg);
1514 +(vgd*vgd - fcpb2)/(2*twop) );
1527 #ifdef Xyce_DEBUG_DEVICE
1530 Xyce::dout() <<
" Done with Instance::updateIntermediateVars. name = " <<
getName() << std::endl;
1531 Xyce::dout() <<
" mode = " <<
mode << std::endl;
1532 Xyce::dout() <<
" tBeta = " <<
tBeta << std::endl;
1533 Xyce::dout() <<
" Idrain = " <<
Idrain << std::endl;
1534 Xyce::dout() <<
" Isource = " <<
Isource << std::endl;
1535 Xyce::dout() <<
" gds = " <<
gds << std::endl;
1536 Xyce::dout() <<
" gm = " <<
gm << std::endl;
1608 double ceqgd = Dtype*(
qgd);
1610 double cdreq = Dtype*(((-
qgd)+
qgd));
1614 double cdreq_Jdxp = 0.0;
1616 qVec[
li_Gate ] += ( ceqgs+ceqgd);
1622 dQdxdVp[
li_Gate ] -= ( ceqgs_Jdxp+ceqgd_Jdxp);
1665 double ceqgd = Dtype*(
cgd);
1666 double ceqgs = Dtype*((
cg-
cgd));
1667 double cdreq = Dtype*((
cd+
cgd));
1684 fVec[
li_Gate ] += (ceqgs+ceqgd);
1690 dFdxdVp[
li_Gate ] -= ( ceqgs_Jdxp+ceqgd_Jdxp);
1823 bool bsuccess =
true;
1827 double fact1, fact2;
1830 double egfet, egfet1;
1832 double cjfact, cjfact1;
1833 double gmanew, gmaold;
1838 #ifdef Xyce_DEBUG_DEVICE
1842 Xyce::dout() <<
" Instance::Begin of updateTemperature. name = " <<
getName() << std::endl;
1843 Xyce::dout() << std::endl;
1848 if (temp_tmp != -999.0)
temp = temp_tmp;
1872 egfet1 = 1.16 - (7.02e-4*tnom*tnom)/(tnom + 1108);
1874 pbfact = -2.0*vtnom*(1.5*log(fact1) +
CONSTQ*arg1);
1875 pbo = (Pb - pbfact)/fact1;
1876 gmaold = (Pb - pbo)/pbo;
1877 cjfact = 1.0/(1.0 + 0.5*(4e-4*(tnom -
CONSTREFTEMP) - gmaold));
1880 Xyce::dout() <<
"Depletion cap. coeff. FC too large, limited to .95" <<
1881 Xyce::dout() << std::endl;
1894 ratio1 = ratio - 1.0;
1900 arg = -egfet/(2.0*kt) + 1.1150877/(CONSTboltz*2.0*CONSTREFTEMP);
1901 pbfact = -2.0*
vt*(1.5*log(fact2) +
CONSTQ*arg);
1902 tPB = fact2*pbo + pbfact;
1903 gmanew = (tPB - pbo)/pbo;
1909 f1 = tPB*(1.0 - exp((0.5)*xfc))/(0.5);
1923 #ifdef Xyce_DEBUG_DEVICE
1926 Xyce::dout() << std::endl;
1927 Xyce::dout() <<
"temp = "<<
temp << std::endl;
1928 Xyce::dout() <<
"tnom = " << tnom << std::endl;
1929 Xyce::dout() <<
"ratio = " << ratio << std::endl;
1930 Xyce::dout() <<
"vt = " <<
vt << std::endl;
1931 Xyce::dout() <<
"kt = " << kt << std::endl;
1932 Xyce::dout() <<
"fact2 = " << fact2 << std::endl;
1933 Xyce::dout() <<
"egfet = " << egfet << std::endl;
1934 Xyce::dout() <<
"arg = " << arg << std::endl;
1935 Xyce::dout() <<
"pbfact = " << pbfact << std::endl;
1936 Xyce::dout() <<
"pbo = " << pbo << std::endl;
1937 Xyce::dout() <<
"f2 = " <<
f2 << std::endl;
1938 Xyce::dout() <<
"f3 = " <<
f3 << std::endl;
1939 Xyce::dout() <<
"corDepCap = " <<
corDepCap << std::endl;
1940 Xyce::dout() <<
"tBeta = " <<
tBeta << std::endl;
1941 Xyce::dout() <<
"tvt0 = " <<
tvt0 << std::endl;
1942 Xyce::dout() <<
"tPB = " << tPB << std::endl;
1943 Xyce::dout() <<
"tJFETb = " <<
tJFETb << std::endl;
1944 Xyce::dout() <<
"tLambda = " <<
tLambda << std::endl;
1945 Xyce::dout() <<
"tDelta = " <<
tDelta << std::endl;
1946 Xyce::dout() <<
"tTheta = " <<
tTheta << std::endl;
1947 Xyce::dout() <<
"tRD = " <<
tRD << std::endl;
1948 Xyce::dout() <<
"tRS = " <<
tRS << std::endl;
1949 Xyce::dout() <<
" " << std::endl;
1984 bool bsuccess =
true;
1990 bsuccess = bsuccess && btmp;
2021 double f_ceqgd = Dtype*(ji.
cgd);
2022 double f_ceqgs = Dtype*((ji.
cg-ji.
cgd));
2023 double f_cdreq = Dtype*((ji.
cd+ji.
cgd));
2040 fVec[ji.
li_Gate ] += (f_ceqgs+f_ceqgd);
2046 dFdxdVp[ji.
li_Gate ] -= ( f_ceqgs_Jdxp+f_ceqgd_Jdxp);
2054 double q_ceqgd = Dtype*(ji.
qgd);
2055 double q_ceqgs = Dtype*(((ji.
qgs+ji.
qgd)-ji.
qgd));
2056 double q_cdreq = Dtype*(((-ji.
qgd)+ji.
qgd));
2060 double q_cdreq_Jdxp = 0.0;
2062 qVec[ji.
li_Gate ] += ( q_ceqgs+q_ceqgd);
2068 dQdxdVp[ji.
li_Gate ] -= ( q_ceqgs_Jdxp+q_ceqgd_Jdxp);
2100 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
2182 int sizeInstances = instanceContainer_.size();
2184 for (
int i=0; i<sizeInstances; ++i)
2186 Instance & ji = *(instanceContainer_.at(i));
2256 .registerDevice(
"j", 1)
2257 .registerDevice(
"j", 2)
2258 .registerModelType(
"pjf", 1)
2259 .registerModelType(
"njf", 1)
2260 .registerModelType(
"pjf", 2)
2261 .registerModelType(
"njf", 2);