46 #include <Xyce_config.h>
50 #include <N_UTL_Expression.h>
51 #include <N_UTL_Misc.h>
52 #include <N_UTL_Math.h>
53 #include <N_UTL_LogStream.h>
62 #include <N_LAS_Vector.h>
63 #include <N_LAS_Matrix.h>
93 .setDescription(
"Capacitance");
99 .setDescription(
"Semiconductor capacitor width");
102 .setDescription(
"Semiconductor capacitor length");
105 .setDescription(
"Age of capacitor");
107 .setDescription(
"Age degradation coefficient");
111 .setDescription(
"Device temperature");
116 .setDescription(
"Linear Temperature Coefficient");
120 .setDescription(
"Quadratic Temperature Coefficient");
145 .setDescription(
"Junction bottom capacitance");
148 .setDescription(
"Junction sidewall capacitance");
151 .setDescription(
"Default device width");
154 .setDescription(
"Narrowing due to side etching");
200 UserError0(*
this) <<
"Age defined, but no base capacitance given. Can't use age-aware with semiconductor capacitor options";
211 UserError0(*
this) <<
"Could find neither C parameter or L in instance.";
219 dout() <<
"Semiconductor capacitor " <<
getName()
222 <<
"cj = " <<
model_.
cj << std::endl
224 <<
"width = " <<
width << std::endl
225 <<
"length = " <<
length << std::endl
268 bool bsuccess =
true;
269 double difference, factor;
278 dout() <<
"Capacitor " <<
getName() <<
" updateTemperature()"
281 <<
"C = " <<
C << std::endl
282 <<
"temp = " <<
temp << std::endl
283 <<
"temp_tmp = " << temp_tmp << std::endl
285 <<
"difference = " << difference << std::endl
288 <<
"baseCap = " <<
baseCap << std::endl
290 <<
"factor = " << factor << std::endl;
319 :
DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
324 temp(getDeviceOptions().temp.getImmutableValue<double>()),
328 tempCoeff1Given(false),
329 tempCoeff2Given(false),
336 APosEquPosNodeOffset(-1),
337 ANegEquPosNodeOffset(-1),
338 APosEquNegNodeOffset(-1),
339 ANegEquNegNodeOffset(-1),
340 APosEquBraNodeOffset(-1),
341 ANegEquBraNodeOffset(-1),
342 ABraEquBraNodeOffset(-1),
343 ABraEquPosNodeOffset(-1),
344 ABraEquNegNodeOffset(-1),
347 qPosEquPosNodePtr(0),
348 qNegEquPosNodePtr(0),
349 qPosEquNegNodePtr(0),
350 qNegEquNegNodePtr(0),
351 fPosEquBraNodePtr(0),
352 fNegEquBraNodePtr(0),
353 fBraEquBraNodePtr(0),
354 fBraEquPosNodePtr(0),
355 fBraEquNegNodePtr(0),
520 std::vector<sDepend>::iterator d;
524 for (d=begin; d!=end; ++d)
528 UserError0(*
this) <<
"Solution-variable-dependent parameter other than C detected";
543 if (
expPtr->getNumDdt() != 0)
545 UserError0(*
this) <<
"Solution-variable-dependent expression contains time derivatives";
550 dout() <<
"Capacitor " <<
getName()
551 <<
": Found solution-dependent parameter C depending on " <<
expNumVars <<
" variables" << std::endl;
552 if (
expPtr->isTimeDependent())
554 dout() <<
" " <<
"Expression is time-dependent." << std::endl;
558 dout() <<
" " <<
"Expression is not time-dependent." << std::endl;
560 dout() <<
" " <<
"Expression depends on " <<
expPtr->num_vars() <<
" quantity, of which " <<
expPtr->num_vars()-
expNumVars <<
" are not solution vars. " << std::endl;
652 const std::vector<int> & extLIDVecRef)
677 dout() <<
"Capacitor " <<
getName() <<
" Instance::registerLIDs"
680 <<
"li_Pos_ = " <<
li_Pos << std::endl
681 <<
"li_Neg_ = " <<
li_Neg << std::endl;
684 dout() <<
"li_Bra = "<<
li_Bra<< std::endl;
953 int depVarsBaseIndex = 2;
971 dout() <<
"Capacitor " <<
getName() <<
" Instance::registerJacLIDs"
1030 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1106 double v_pos = solVec[
li_Pos];
1107 double v_neg = solVec[
li_Neg];
1111 dout() <<
" ----------------------------------" << std::endl;
1112 dout() <<
"Instance::updatePrimaryState:" << std::endl;
1166 q0 += 0.5*(oldC+
C)*(
vcap-oldVcap);
1170 dout() <<
" Derivatives of C w.r.t variables: " << std::endl;
1173 dout() <<
" expVarDerivs[ "<< i <<
" ] = " <<
expVarDerivs[i] << std::endl;
1348 bool bsuccess =
true;
1376 v_tmp= (Vpos-Vneg-
IC);
1563 Vneg = currSolVector[
li_Neg];
1566 currSolVector[
li_Pos] = Vpos;
1567 nextSolVector[
li_Pos] = Vpos;
1568 currSolVector[
li_Neg] = -Vpos;
1569 nextSolVector[
li_Neg] = -Vpos;
1587 varTypeVec.resize(1);
1588 varTypeVec[0] =
'I';
1644 std::vector<Instance*>::iterator iter;
1648 for (iter=first; iter!=last; ++iter)
1650 (*iter)->processParams();
1678 :
DeviceModel(model_block, configuration.getModelParameters(), factory_block),
1685 tnom(getDeviceOptions().tnom),
1719 std::vector<Instance*>::iterator iter;
1723 for (iter=first; iter!=last; ++iter)
1741 std::vector<Instance*>::const_iterator iter;
1749 os <<
"Number of capacitor instances: " << isize << std::endl;
1750 os <<
" name\t\tmodelName\tParameters" << std::endl;
1752 for (i = 0, iter = first; iter != last; ++iter, ++i)
1754 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
1756 os <<
"\t\tC = " << (*iter)->C;
1757 os <<
"\tIC = " << (*iter)->IC;
1782 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
1827 double v_pos = solVec[ci.
li_Pos];
1828 double v_neg = solVec[ci.
li_Neg];
1829 ci.
vcap = v_pos-v_neg;
1886 dout() <<
" ----------------------------------" << std::endl;
1887 dout() <<
" Master::loadDAEVectors: " << std::endl;
1895 double Vpos (0.0), Vneg (0.0), v_tmp (0.0);
1902 dout() <<
" loading dcop F vector for cap " << ci.
getName() <<
":" << std::endl;
1906 Vpos = solVec[ci.
li_Pos];
1907 Vneg = solVec[ci.
li_Neg];
1928 dout() <<
" f[ " << ci.
li_Pos <<
" ] += " << solVec[ci.
li_Bra]<< std::endl;
1929 dout() <<
" f[ " << ci.
li_Neg <<
" ] += " << -solVec[ci.
li_Bra] << std::endl;
1932 v_tmp= (Vpos-Vneg-ci.
IC);
1936 fVec[ci.
li_Bra] += v_tmp;
1940 dout() <<
" f[ " << ci.
li_Bra <<
" ] += " << v_tmp << std::endl;
1967 dout() <<
" loading Q vector for cap " << ci.
getName() <<
":" << std::endl;
1968 dout() <<
" q[ " << ci.
li_Pos <<
" ] += " << ci.
q0 << std::endl;
1969 dout() <<
" q[ " << ci.
li_Neg <<
" ] += " << -ci.
q0 << std::endl;
2007 dout() <<
" ----------------------------------" << std::endl;
2008 dout() <<
" Master::loadDAEMatrices: " << std::endl;
2017 dout() <<
" loads for capacitor " << ci.
getName() << std::endl;
2023 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
2039 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
2049 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
2118 << expVarDerivs[i] << std::endl;
2177 .registerDevice(
"c", 1)
2178 .registerModelType(
"c", 1);