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");
96 .setDescription(
"Flicker noise exponent");
101 .setDescription(
"Doping tail parameter");
106 .setDescription(
"Transconductance parameter");
111 .setDescription(
"Saturation voltage parameter");
117 .setDescription(
"Zero-bias gate-source junction capacitance");
123 .setDescription(
"Zero-bias gate-drain junction capacitance");
128 .setDescription(
"Coefficient for forward-bias depletion capacitance");
133 .setDescription(
"Gate junction saturation current");
138 .setDescription(
"Flicker noise coefficient");
143 .setDescription(
"Channel length modulation");
148 .setDescription(
"Gate junction potential");
154 .setDescription(
"Drain ohmic resistance");
160 .setDescription(
"Source ohmic resistance");
167 .setDescription(
"Threshold voltage");
200 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
262 std::vector<Instance*>::iterator iter;
266 for (iter=first; iter!=last; ++iter)
284 std::vector<Instance*>::const_iterator iter;
291 os <<
"Number of MESFET Instances: " << isize << std::endl;
292 os <<
" name model name Parameters" << std::endl;
294 for (i=0, iter=first; iter!=last; ++iter, ++i)
296 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
322 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
352 std::vector<Instance*>::iterator iter;
356 for (iter=first; iter!=last; ++iter)
358 (*iter)->processParams();
378 :
DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
386 temp(getDeviceOptions().temp.getImmutableValue<double>()),
429 ADrainEquDrainNodeOffset(-1),
430 ADrainEquDrainPrimeNodeOffset(-1),
432 AGateEquGateNodeOffset(-1),
433 AGateEquDrainPrimeNodeOffset(-1),
434 AGateEquSourcePrimeNodeOffset(-1),
436 ASourceEquSourceNodeOffset(-1),
437 ASourceEquSourcePrimeNodeOffset(-1),
439 ADrainPrimeEquDrainNodeOffset(-1),
440 ADrainPrimeEquGateNodeOffset(-1),
441 ADrainPrimeEquDrainPrimeNodeOffset(-1),
442 ADrainPrimeEquSourcePrimeNodeOffset(-1),
444 ASourcePrimeEquGateNodeOffset(-1),
445 ASourcePrimeEquSourceNodeOffset(-1),
446 ASourcePrimeEquDrainPrimeNodeOffset(-1),
447 ASourcePrimeEquSourcePrimeNodeOffset(-1),
452 f_DrainEquDrainNodePtr(0),
453 f_DrainEquDrainPrimeNodePtr(0),
455 f_GateEquGateNodePtr(0),
456 f_GateEquDrainPrimeNodePtr(0),
457 f_GateEquSourcePrimeNodePtr(0),
459 f_SourceEquSourceNodePtr(0),
460 f_SourceEquSourcePrimeNodePtr(0),
462 f_DrainPrimeEquDrainNodePtr(0),
463 f_DrainPrimeEquGateNodePtr(0),
464 f_DrainPrimeEquDrainPrimeNodePtr(0),
465 f_DrainPrimeEquSourcePrimeNodePtr(0),
467 f_SourcePrimeEquGateNodePtr(0),
468 f_SourcePrimeEquSourceNodePtr(0),
469 f_SourcePrimeEquDrainPrimeNodePtr(0),
470 f_SourcePrimeEquSourcePrimeNodePtr(0),
474 q_DrainEquDrainNodePtr(0),
475 q_DrainEquDrainPrimeNodePtr(0),
477 q_GateEquGateNodePtr(0),
478 q_GateEquDrainPrimeNodePtr(0),
479 q_GateEquSourcePrimeNodePtr(0),
481 q_SourceEquSourceNodePtr(0),
482 q_SourceEquSourcePrimeNodePtr(0),
484 q_DrainPrimeEquDrainNodePtr(0),
485 q_DrainPrimeEquGateNodePtr(0),
486 q_DrainPrimeEquDrainPrimeNodePtr(0),
487 q_DrainPrimeEquSourcePrimeNodePtr(0),
489 q_SourcePrimeEquGateNodePtr(0),
490 q_SourcePrimeEquSourceNodePtr(0),
491 q_SourcePrimeEquDrainPrimeNodePtr(0),
492 q_SourcePrimeEquSourcePrimeNodePtr(0),
616 const std::vector<int> & extLIDVecRef )
623 #ifdef Xyce_DEBUG_DEVICE
626 Xyce::dout() << std::endl << section_divider << std::endl;
627 Xyce::dout() <<
" Instance::registerLIDs" << std::endl;
628 Xyce::dout() <<
" name = " <<
getName() << std::endl;
629 Xyce::dout() <<
" number of internal variables: " <<
numIntVars << std::endl;
630 Xyce::dout() <<
" number of external variables: " <<
numExtVars << std::endl;
658 #ifdef Xyce_DEBUG_DEVICE
661 Xyce::dout() <<
"\n variable local indices:\n";
662 Xyce::dout() <<
" li_Drain = " <<
li_Drain << std::endl;
663 Xyce::dout() <<
" li_DrainPrime = " <<
li_DrainPrime << std::endl;
664 Xyce::dout() <<
" li_Source = " <<
li_Source << std::endl;
665 Xyce::dout() <<
" li_SourcePrime = " <<
li_SourcePrime << std::endl;
666 Xyce::dout() <<
" li_Gate = " <<
li_Gate << std::endl;
668 Xyce::dout() << section_divider << std::endl;
712 if( loadLeadCurrent && storeNameMap.empty ())
735 #ifdef Xyce_DEBUG_DEVICE
738 Xyce::dout() << std::endl;
739 Xyce::dout() << section_divider << std::endl;
740 Xyce::dout() <<
" In Instance::registerStateLIDs\n\n";
741 Xyce::dout() <<
" name = " <<
getName() << std::endl;
742 Xyce::dout() <<
" Number of State LIDs: " <<
numStateVars << std::endl;
756 #ifdef Xyce_DEBUG_DEVICE
759 Xyce::dout() <<
" State local indices:" << std::endl;
760 Xyce::dout() << std::endl;
762 Xyce::dout() <<
" li_state_qgs = " <<
li_state_qgs << std::endl;
765 Xyce::dout() <<
" li_state_gcgd = " <<
li_state_gcgd << std::endl;;
767 Xyce::dout() << section_divider << std::endl;
832 std::vector<int> map;
833 std::vector< std::vector<int> > map2;
893 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
985 double czgdf2, czgsf2;
993 double prod, denom, invdenom, afact, lfact;
995 #ifdef Xyce_DEBUG_DEVICE
998 Xyce::dout() << subsection_divider << std::endl;
999 Xyce::dout() <<
" Instance::updateIntermediateVars.\n"<<std::endl;
1000 Xyce::dout() <<
" name = " <<
getName() << std::endl;
1001 Xyce::dout() <<
" Model name = " <<
model_.
getName() << std::endl;
1002 Xyce::dout() <<
" dtype is " <<
model_.
dtype << std::endl;
1003 Xyce::dout() << std::endl;
1004 Xyce::dout().width(25); Xyce::dout().precision(17); Xyce::dout().setf(std::ios::scientific);
1024 #ifdef Xyce_DEBUG_DEVICE
1027 Xyce::dout() <<
" " << std::endl;
1028 Xyce::dout() <<
" Vg = " <<
Vg << std::endl;
1029 Xyce::dout() <<
" Vd = " <<
Vd << std::endl;
1030 Xyce::dout() <<
" Vs = " <<
Vs << std::endl;
1031 Xyce::dout() <<
" Vdp = " <<
Vdp << std::endl;
1032 Xyce::dout() <<
" Vsp = " <<
Vsp << std::endl;
1062 if ((*flagSolVectorPtr)[
li_Drain] == 0 || (*flagSolVectorPtr)[
li_Gate] == 0 ||
1102 #ifdef Xyce_DEBUG_DEVICE
1105 Xyce::dout() <<
" before limiting: " << std::endl;
1106 Xyce::dout() <<
" vgs = " <<
vgs <<
" vgs_old = " <<
vgs_old << std::endl;
1107 Xyce::dout() <<
" vgd = " << vgd <<
" vgd_old = " <<
vgd_old << std::endl;
1115 if (ichk1 == 1) {icheck=1;}
1122 #ifdef Xyce_DEBUG_DEVICE
1125 Xyce::dout() <<
" After limiting: " << std::endl;
1126 Xyce::dout() <<
" vgs = " <<
vgs << std::endl;
1127 Xyce::dout() <<
" vgd = " << vgd << std::endl;
1128 Xyce::dout() <<
" " << std::endl;
1133 #ifdef Xyce_DEBUG_DEVICE
1136 Xyce::dout() <<
"vgs = " <<
vgs << std::endl;
1137 Xyce::dout() <<
"vgd = " << vgd << std::endl;
1138 Xyce::dout() <<
"vds = " <<
vds << std::endl;
1139 Xyce::dout() <<
"Vddp = " <<
Vddp << std::endl;
1140 Xyce::dout() <<
"Vssp = " <<
Vssp << std::endl;
1141 Xyce::dout() <<
"Vgsp = " << Vgsp << std::endl;
1142 Xyce::dout() <<
"Vgdp = " << Vgdp << std::endl;
1143 Xyce::dout() <<
"Vdpsp = " <<
Vdpsp << std::endl;
1144 Xyce::dout() <<
" " << std::endl;
1150 #ifdef Xyce_DEBUG_DEVICE
1155 Xyce::dout() <<
" Something modified the voltages. " << std::endl;
1156 Xyce::dout() <<
" Voltage before after diff " << std::endl;
1158 Xyce::dout() <<
" vgd " <<
vgd_orig <<
" " << vgd <<
" " << vgd-
vgd_orig << std::endl;
1160 Xyce::dout() <<
" " << std::endl;
1226 denom = 1 +
tMESb*vgst;
1228 if (vds >= ( 3/
tAlpha ) )
1233 cdrain = betap*vgst*vgst*invdenom;
1234 gm = betap*vgst*(1 + denom)*invdenom*invdenom;
1242 afact = 1 -
tAlpha*vds/3;
1243 lfact = 1 - afact*afact*afact;
1244 cdrain = betap*vgst*vgst*invdenom*lfact;
1245 gm = betap*vgst*(1 + denom)*invdenom*invdenom*lfact;
1269 denom = 1 +
tMESb*vgdt;
1273 cdrain = -betap*vgdt*vgdt*invdenom;
1274 gm = -betap*vgdt*(1 + denom)*invdenom*invdenom;
1282 afact = 1 +
tAlpha*vds/3;
1283 lfact = 1 - afact*afact*afact;
1284 cdrain = -betap*vgdt*vgdt*invdenom*lfact;
1285 gm = -betap*vgdt*(1 + denom)*invdenom*invdenom*lfact;
1303 if (
vgs < corDepCap)
1306 qgs = twop*czgs*(1-sarg);
1312 +(
vgs*
vgs - fcpb2)/(2*twop));
1325 if (vgd < corDepCap)
1327 sarg=sqrt(1-vgd/
tPB);
1328 qgd = twop*czgd*(1-sarg);
1334 +(vgd*vgd - fcpb2)/(2*twop) );
1347 #ifdef Xyce_DEBUG_DEVICE
1350 Xyce::dout() <<
" Done with Instance::updateIntermediateVars." << std::endl;
1351 Xyce::dout() <<
" mode = " <<
mode << std::endl;
1352 Xyce::dout() <<
" tBeta = " <<
tBeta << std::endl;
1353 Xyce::dout() <<
" Idrain = " <<
Idrain << std::endl;
1354 Xyce::dout() <<
" Isource = " <<
Isource << std::endl;
1355 Xyce::dout() <<
" gds = " <<
gds << std::endl;
1356 Xyce::dout() <<
" gm = " <<
gm << std::endl;
1428 double ceqgd = Dtype*(
qgd);
1430 double cdreq = Dtype*(((-
qgd)+
qgd));
1434 double cdreq_Jdxp = 0.0;
1436 qVec[
li_Gate ] += ( ceqgs+ceqgd);
1442 dQdxdVp[
li_Gate ] -= ( ceqgs_Jdxp+ceqgd_Jdxp);
1469 double ceqgd = Dtype*(
cgd);
1470 double ceqgs = Dtype*((
cg-
cgd));
1471 double cdreq = Dtype*((
cd+
cgd));
1487 fVec[
li_Gate ] += (ceqgs+ceqgd);
1493 dFdxdVp[
li_Gate ] -= ( ceqgs_Jdxp+ceqgd_Jdxp);
1582 bool bsuccess =
true;
1586 double fact1, fact2;
1589 double egfet, egfet1;
1591 double cjfact, cjfact1;
1592 double gmanew, gmaold;
1597 #ifdef Xyce_DEBUG_DEVICE
1601 Xyce::dout() <<
" Instance::Begin of updateTemperature. \n";
1602 Xyce::dout() <<
" name = " <<
getName() << std::endl;
1603 Xyce::dout() << std::endl;
1608 if (temp_tmp != -999.0)
temp = temp_tmp;
1628 egfet1 = 1.16 - (7.02e-4*tnom*tnom)/(tnom + 1108);
1630 pbfact = -2.0*vtnom*(1.5*log(fact1) +
CONSTQ*arg1);
1631 pbo = (Pb - pbfact)/fact1;
1632 gmaold = (Pb - pbo)/pbo;
1633 cjfact = 1.0/(1.0 + 0.5*(4e-4*(tnom -
CONSTREFTEMP) - gmaold));
1636 Xyce::dout() <<
"Depletion cap. coeff. FC too large, limited to .95" <<
1637 Xyce::dout() << std::endl;
1650 ratio1 = ratio - 1.0;
1656 arg = -egfet/(2.0*kt) + 1.1150877/(CONSTboltz*2.0*CONSTREFTEMP);
1657 pbfact = -2.0*
vt*(1.5*log(fact2) +
CONSTQ*arg);
1658 tPB = fact2*pbo + pbfact;
1659 gmanew = (tPB - pbo)/pbo;
1665 f1 = tPB*(1.0 - exp((0.5)*xfc))/(0.5);
1678 #ifdef Xyce_DEBUG_DEVICE
1681 Xyce::dout() <<
"temp = "<<
temp << std::endl;
1682 Xyce::dout() <<
"tnom = " << tnom << std::endl;
1683 Xyce::dout() <<
"ratio = " << ratio << std::endl;
1684 Xyce::dout() <<
"vt = " <<
vt << std::endl;
1685 Xyce::dout() <<
"kt = " << kt << std::endl;
1686 Xyce::dout() <<
"fact2 = " << fact2 << std::endl;
1687 Xyce::dout() <<
"egfet = " << egfet << std::endl;
1688 Xyce::dout() <<
"arg = " << arg << std::endl;
1689 Xyce::dout() <<
"pbfact = " << pbfact << std::endl;
1690 Xyce::dout() <<
"PB = " << Pb << std::endl;
1691 Xyce::dout() <<
"pbo = " << pbo << std::endl;
1692 Xyce::dout() <<
"f2 = " <<
f2 << std::endl;
1693 Xyce::dout() <<
"f3 = " <<
f3 << std::endl;
1694 Xyce::dout() <<
"corDepCap= " <<
corDepCap << std::endl;
1695 Xyce::dout() <<
"tBeta = " <<
tBeta << std::endl;
1696 Xyce::dout() <<
"tvt0 = " <<
tvt0 << std::endl;
1697 Xyce::dout() <<
"tPB = " << tPB << std::endl;
1698 Xyce::dout() <<
"tMESb = " <<
tMESb << std::endl;
1699 Xyce::dout() <<
"tLambda = " <<
tLambda << std::endl;
1701 Xyce::dout() <<
"tRD = " <<
tRD << std::endl;
1702 Xyce::dout() <<
"tRS = " <<
tRS << std::endl;
1703 Xyce::dout() <<
" " << std::endl;
1737 bool bsuccess =
true;
1744 bsuccess = bsuccess && btmp;
1764 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ)
1775 double f_ceqgd = Dtype*(ji.
cgd);
1776 double f_ceqgs = Dtype*((ji.
cg-ji.
cgd));
1777 double f_cdreq = Dtype*((ji.
cd+ji.
cgd));
1792 fVec[ji.
li_Gate ] += (f_ceqgs+f_ceqgd);
1798 dFdxdVp[ji.
li_Gate ] -= ( f_ceqgs_Jdxp+f_ceqgd_Jdxp);
1807 double q_ceqgd = Dtype*(ji.
qgd);
1808 double q_ceqgs = Dtype*(((ji.
qgs+ji.
qgd)-ji.
qgd));
1809 double q_cdreq = Dtype*(((-ji.
qgd)+ji.
qgd));
1813 double q_cdreq_Jdxp = 0.0;
1815 qVec[ji.
li_Gate ] += ( q_ceqgs+q_ceqgd);
1821 dQdxdVp[ji.
li_Gate ] -= ( q_ceqgs_Jdxp+q_ceqgd_Jdxp);
1855 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1937 int sizeInstances = instanceContainer_.size();
1938 for (
int i=0; i<sizeInstances; ++i)
1940 Instance & ji = *(instanceContainer_.at(i));
2010 .registerDevice(
"z", 1)
2011 .registerModelType(
"nmf", 1)
2012 .registerModelType(
"pmf", 1);