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;
736 if( loadLeadCurrent && storeNameMap.empty ())
758 #ifdef Xyce_DEBUG_DEVICE
761 Xyce::dout() << std::endl;
762 Xyce::dout() << section_divider << std::endl;
763 Xyce::dout() <<
" In Instance::registerStateLIDs. name = " <<
getName() << std::endl;
764 Xyce::dout() <<
" Number of State LIDs: " <<
numStateVars << std::endl;
780 #ifdef Xyce_DEBUG_DEVICE
783 Xyce::dout() <<
" State local indices:" << std::endl;
784 Xyce::dout() << std::endl;
786 Xyce::dout() <<
" li_state_qgs = " <<
li_state_qgs << std::endl;
789 Xyce::dout() <<
" li_state_gcgd = " <<
li_state_gcgd << std::endl;;
791 Xyce::dout() << section_divider << std::endl;
855 std::vector<int> map;
856 std::vector< std::vector<int> > map2;
916 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1003 double apart, cpart;
1008 double czgdf2, czgsf2;
1014 double A, B, C, B12, C12, D;
1015 double Idsat, Vdsat;
1018 #ifdef Xyce_DEBUG_DEVICE
1021 Xyce::dout() << subsection_divider << std::endl;
1022 Xyce::dout() <<
" Instance::updateIntermediateVars. name = " <<
getName() << std::endl;
1023 Xyce::dout() <<
" Model name = " <<
model_.
getName() << std::endl;
1024 Xyce::dout() << std::endl;
1025 Xyce::dout().width(25); Xyce::dout().precision(17); Xyce::dout().setf(std::ios::scientific);
1045 #ifdef Xyce_DEBUG_DEVICE
1048 Xyce::dout() <<
" " << std::endl;
1049 Xyce::dout() <<
" Vg = " <<
Vg << std::endl;
1050 Xyce::dout() <<
" Vd = " <<
Vd << std::endl;
1051 Xyce::dout() <<
" Vs = " <<
Vs << std::endl;
1052 Xyce::dout() <<
" Vdp = " <<
Vdp << std::endl;
1053 Xyce::dout() <<
" Vsp = " <<
Vsp << std::endl;
1083 if ((*flagSolVectorPtr)[
li_Drain] == 0 || (*flagSolVectorPtr)[
li_Gate] == 0 ||
1126 #ifdef Xyce_DEBUG_DEVICE
1129 Xyce::dout() <<
" before limiting: " << std::endl;
1130 Xyce::dout() <<
" vgs = " <<
vgs <<
" vgs_old = " <<
vgs_old << std::endl;
1131 Xyce::dout() <<
" vgd = " << vgd <<
" vgd_old = " <<
vgd_old << std::endl;
1139 if (ichk1 == 1) {icheck=1;}
1146 #ifdef Xyce_DEBUG_DEVICE
1149 Xyce::dout() <<
" After limiting: " << std::endl;
1150 Xyce::dout() <<
" vgs = " <<
vgs << std::endl;
1151 Xyce::dout() <<
" vgd = " << vgd << std::endl;
1152 Xyce::dout() <<
" " << std::endl;
1157 #ifdef Xyce_DEBUG_DEVICE
1160 Xyce::dout() <<
"vgs = " <<
vgs << std::endl;
1161 Xyce::dout() <<
"vgd = " << vgd << std::endl;
1162 Xyce::dout() <<
"vds = " <<
vds << std::endl;
1163 Xyce::dout() <<
"Vddp = " <<
Vddp << std::endl;
1164 Xyce::dout() <<
"Vssp = " <<
Vssp << std::endl;
1165 Xyce::dout() <<
"Vgsp = " << Vgsp << std::endl;
1166 Xyce::dout() <<
"Vgdp = " << Vgdp << std::endl;
1167 Xyce::dout() <<
"Vdpsp = " <<
Vdpsp << std::endl;
1168 Xyce::dout() <<
" " << std::endl;
1174 #ifdef Xyce_DEBUG_DEVICE
1179 Xyce::dout() <<
getName() <<
" Something modified the voltages. " << std::endl;
1183 Xyce::dout() <<
getName() <<
" No voltages were limited. " << std::endl;
1185 Xyce::dout() <<
" Voltage before after diff " << std::endl;
1189 Xyce::dout() <<
" " << std::endl;
1269 gm=betap*
vds*(apart+3.0*Bfac*vgst);;
1316 gm=betap*
vds*(apart+3.0*Bfac*vgdt);;
1356 if(A != 0) B = (A-vgst)/A;
1358 if(B >= 0) B12 = sqrt(B);
1365 if(A != 0) C = (
vds - tDelta*
vds/Vdsat + A-vgst)/A;
1367 if(C >= 0) C12 = sqrt(C);
1371 if( dtype*
Vd <= Vdsat )
1378 + betap*tDelta*(1-C12)*
vds/(Vdsat*Vdsat);
1380 + betap*(1-(1-C12)*tDelta/Vdsat-C12);
1388 cdrain = betap*(vgst - (2*A/3)*(1 - B*B12));
1415 if(A != 0) B = (A-vgdt)/A;
1417 if(B >= 0) B12 = sqrt(B);
1424 if(A != 0) C = (-
vds + tDelta*
vds/Vdsat + A-vgdt)/A;
1426 if(C >= 0) C12 = sqrt(C);
1430 if( dtype*
Vs <= Vdsat )
1437 gm += betap*(1-C12)*tDelta*
vds/(Vdsat*Vdsat);
1438 gds = betap*(1 - (1-C12)*tDelta/Vdsat - C12)
1448 cdrain = -betap*(vgdt - (2*A/3)*(1 - B*B12));
1468 if (
vgs < corDepCap)
1471 qgs = twop*czgs*(1-sarg);
1477 +(
vgs*
vgs - fcpb2)/(2*twop));
1490 if (vgd < corDepCap)
1492 sarg=sqrt(1-vgd/
tPB);
1493 qgd = twop*czgd*(1-sarg);
1499 +(vgd*vgd - fcpb2)/(2*twop) );
1512 #ifdef Xyce_DEBUG_DEVICE
1515 Xyce::dout() <<
" Done with Instance::updateIntermediateVars. name = " <<
getName() << std::endl;
1516 Xyce::dout() <<
" mode = " <<
mode << std::endl;
1517 Xyce::dout() <<
" tBeta = " <<
tBeta << std::endl;
1518 Xyce::dout() <<
" Idrain = " <<
Idrain << std::endl;
1519 Xyce::dout() <<
" Isource = " <<
Isource << std::endl;
1520 Xyce::dout() <<
" gds = " <<
gds << std::endl;
1521 Xyce::dout() <<
" gm = " <<
gm << std::endl;
1593 double ceqgd = Dtype*(
qgd);
1595 double cdreq = Dtype*(((-
qgd)+
qgd));
1599 double cdreq_Jdxp = 0.0;
1601 qVec[
li_Gate ] += ( ceqgs+ceqgd);
1607 dQdxdVp[
li_Gate ] -= ( ceqgs_Jdxp+ceqgd_Jdxp);
1650 double ceqgd = Dtype*(
cgd);
1651 double ceqgs = Dtype*((
cg-
cgd));
1652 double cdreq = Dtype*((
cd+
cgd));
1669 fVec[
li_Gate ] += (ceqgs+ceqgd);
1675 dFdxdVp[
li_Gate ] -= ( ceqgs_Jdxp+ceqgd_Jdxp);
1808 bool bsuccess =
true;
1812 double fact1, fact2;
1815 double egfet, egfet1;
1817 double cjfact, cjfact1;
1818 double gmanew, gmaold;
1823 #ifdef Xyce_DEBUG_DEVICE
1827 Xyce::dout() <<
" Instance::Begin of updateTemperature. name = " <<
getName() << std::endl;
1828 Xyce::dout() << std::endl;
1833 if (temp_tmp != -999.0)
temp = temp_tmp;
1857 egfet1 = 1.16 - (7.02e-4*tnom*tnom)/(tnom + 1108);
1859 pbfact = -2.0*vtnom*(1.5*log(fact1) +
CONSTQ*arg1);
1860 pbo = (Pb - pbfact)/fact1;
1861 gmaold = (Pb - pbo)/pbo;
1862 cjfact = 1.0/(1.0 + 0.5*(4e-4*(tnom -
CONSTREFTEMP) - gmaold));
1865 Xyce::dout() <<
"Depletion cap. coeff. FC too large, limited to .95" <<
1866 Xyce::dout() << std::endl;
1879 ratio1 = ratio - 1.0;
1885 arg = -egfet/(2.0*kt) + 1.1150877/(CONSTboltz*2.0*CONSTREFTEMP);
1886 pbfact = -2.0*
vt*(1.5*log(fact2) +
CONSTQ*arg);
1887 tPB = fact2*pbo + pbfact;
1888 gmanew = (tPB - pbo)/pbo;
1894 f1 = tPB*(1.0 - exp((0.5)*xfc))/(0.5);
1908 #ifdef Xyce_DEBUG_DEVICE
1911 Xyce::dout() << std::endl;
1912 Xyce::dout() <<
"temp = "<<
temp << std::endl;
1913 Xyce::dout() <<
"tnom = " << tnom << std::endl;
1914 Xyce::dout() <<
"ratio = " << ratio << std::endl;
1915 Xyce::dout() <<
"vt = " <<
vt << std::endl;
1916 Xyce::dout() <<
"kt = " << kt << std::endl;
1917 Xyce::dout() <<
"fact2 = " << fact2 << std::endl;
1918 Xyce::dout() <<
"egfet = " << egfet << std::endl;
1919 Xyce::dout() <<
"arg = " << arg << std::endl;
1920 Xyce::dout() <<
"pbfact = " << pbfact << std::endl;
1921 Xyce::dout() <<
"pbo = " << pbo << std::endl;
1922 Xyce::dout() <<
"f2 = " <<
f2 << std::endl;
1923 Xyce::dout() <<
"f3 = " <<
f3 << std::endl;
1924 Xyce::dout() <<
"corDepCap = " <<
corDepCap << std::endl;
1925 Xyce::dout() <<
"tBeta = " <<
tBeta << std::endl;
1926 Xyce::dout() <<
"tvt0 = " <<
tvt0 << std::endl;
1927 Xyce::dout() <<
"tPB = " << tPB << std::endl;
1928 Xyce::dout() <<
"tJFETb = " <<
tJFETb << std::endl;
1929 Xyce::dout() <<
"tLambda = " <<
tLambda << std::endl;
1930 Xyce::dout() <<
"tDelta = " <<
tDelta << std::endl;
1931 Xyce::dout() <<
"tTheta = " <<
tTheta << std::endl;
1932 Xyce::dout() <<
"tRD = " <<
tRD << std::endl;
1933 Xyce::dout() <<
"tRS = " <<
tRS << std::endl;
1934 Xyce::dout() <<
" " << std::endl;
1969 bool bsuccess =
true;
1975 bsuccess = bsuccess && btmp;
1995 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ)
2006 double f_ceqgd = Dtype*(ji.
cgd);
2007 double f_ceqgs = Dtype*((ji.
cg-ji.
cgd));
2008 double f_cdreq = Dtype*((ji.
cd+ji.
cgd));
2025 fVec[ji.
li_Gate ] += (f_ceqgs+f_ceqgd);
2031 dFdxdVp[ji.
li_Gate ] -= ( f_ceqgs_Jdxp+f_ceqgd_Jdxp);
2039 double q_ceqgd = Dtype*(ji.
qgd);
2040 double q_ceqgs = Dtype*(((ji.
qgs+ji.
qgd)-ji.
qgd));
2041 double q_cdreq = Dtype*(((-ji.
qgd)+ji.
qgd));
2045 double q_cdreq_Jdxp = 0.0;
2047 qVec[ji.
li_Gate ] += ( q_ceqgs+q_ceqgd);
2053 dQdxdVp[ji.
li_Gate ] -= ( q_ceqgs_Jdxp+q_ceqgd_Jdxp);
2085 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
2167 int sizeInstances = instanceContainer_.size();
2169 for (
int i=0; i<sizeInstances; ++i)
2171 Instance & ji = *(instanceContainer_.at(i));
2241 .registerDevice(
"j", 1)
2242 .registerDevice(
"j", 2)
2243 .registerModelType(
"pjf", 1)
2244 .registerModelType(
"njf", 1)
2245 .registerModelType(
"pjf", 2)
2246 .registerModelType(
"njf", 2);