46 #include <Xyce_config.h>
59 #include <N_ERH_ErrorMgr.h>
60 #include <N_IO_CmdParse.h>
61 #include <N_UTL_Misc.h>
62 #include <N_UTL_OptionBlock.h>
96 testJac_absTol(1.0e-8),
97 testJac_SqrtEta(1.0e-8),
98 deviceSens_dp(1.0e-8),
102 numericalJacobianFlag (false),
103 testJacobianFlag (false),
105 testJacStopStep(Util::MachineDependentParams::IntMax()),
107 testJacDeviceName(
""),
108 testJacDeviceNameGiven( false ),
109 voltageLimiterFlag (true),
111 icMultiplier (10000.0),
112 defaultMaxTimeStep (1.0e99),
115 numGainScaleBlocks(1),
116 staggerGainScale(false),
117 randomizeVgstConst(false),
124 zeroResistanceTol(1.0e-100),
125 checkForZeroResistance(true),
126 detailedDeviceCounts(false),
129 debugMinTimestep (0),
130 debugMaxTimestep (Util::MachineDependentParams::IntMax()),
132 debugMaxTime (Util::MachineDependentParams::DoubleMax()),
134 blockAnalysisFlag (false),
135 #ifndef Xyce_NEW_EXCESS_PHASE
136 newExcessPhase (false),
137 defaultNewExcessPhase (false),
139 newExcessPhase (true),
140 defaultNewExcessPhase (true),
142 excessPhaseScalar1 (1.0),
143 excessPhaseScalar2 (1.0),
145 tryToCompact (false),
146 calculateAllLeadCurrents (false),
171 std::list<Util::Param>::const_iterator iter = OB.getParams().begin();
172 std::list<Util::Param>::const_iterator end = OB.getParams().end();
174 for ( ; iter != end; ++iter)
176 std::string tag(iter->uTag());
178 if (tag ==
"DEFAD")
defad = iter->getImmutableValue<
double>();
179 else if (tag ==
"DEFAS")
defas = iter->getImmutableValue<
double>();
180 else if (tag ==
"DEFL")
defl = iter->getImmutableValue<
double>();
181 else if (tag ==
"DEFW")
defw = iter->getImmutableValue<
double>();
182 else if (tag ==
"ABSTOL")
abstol = iter->getImmutableValue<
double>();
183 else if (tag ==
"RELTOL")
reltol = iter->getImmutableValue<
double>();
184 else if (tag ==
"CHGTOL")
chgtol = iter->getImmutableValue<
double>();
185 else if (tag ==
"GMIN")
gmin = iter->getImmutableValue<
double>();
186 else if (tag ==
"GMINSCALAR")
gmin_scalar = iter->getImmutableValue<
double>();
187 else if (tag ==
"GMAX")
gmax = iter->getImmutableValue<
double>();
188 else if (tag ==
"TJRELTOL")
testJac_relTol = iter->getImmutableValue<
double>();
189 else if (tag ==
"TJABSTOL")
testJac_absTol = iter->getImmutableValue<
double>();
190 else if (tag ==
"TJSQRTETA")
testJac_SqrtEta = iter->getImmutableValue<
double>();
191 else if (tag ==
"SENSDP")
deviceSens_dp = iter->getImmutableValue<
double>();
192 else if (tag ==
"TNOM")
tnom = iter->getImmutableValue<
double>()+
CONSTCtoK;
193 else if (tag ==
"TEMP")
196 if ( !iter->isTimeDependent() )
temp.setVal(iter->getImmutableValue<
double>()+
CONSTCtoK);
197 else {
temp.setVal( iter->stringValue() );
temp.setTimeDependent(
true ); }
199 else if (tag ==
"SCALESRC")
scale_src = iter->getImmutableValue<
double>();
200 else if (tag ==
"NUMJAC")
202 else if (tag ==
"TESTJAC")
204 else if (tag ==
"TESTJACSTARTSTEP")
206 else if (tag ==
"TESTJACSTOPSTEP")
208 else if (tag ==
"TESTJACWARN")
209 testJacWarn =
static_cast<bool> (iter->getImmutableValue<
int>());
210 else if (tag ==
"TESTJACDEVICENAME")
215 else if (tag ==
"VOLTLIM")
217 else if (tag ==
"LAMBERTW")
lambertWFlag =
static_cast<int>(iter->getImmutableValue<
int>());
218 else if (tag ==
"ICFAC" )
icMultiplier = iter->getImmutableValue<
double>();
219 else if (tag ==
"MAXTIMESTEP" )
defaultMaxTimeStep = iter->getImmutableValue<
double>();
221 else if (tag ==
"VDSSCALEMIN" )
vdsScaleMin = iter->getImmutableValue<
double>();
222 else if (tag ==
"VGSTCONST" )
vgstConst = iter->getImmutableValue<
double>();
223 else if (tag ==
"NUMGAINSCALEBLOCKS" )
225 else if (tag ==
"STAGGERGAINSCALE")
227 else if (tag ==
"RANDOMIZEVGSTCONST")
229 else if (tag ==
"LENGTH0" )
length0 = iter->getImmutableValue<
double>();
230 else if (tag ==
"WIDTH0" )
width0 = iter->getImmutableValue<
double>();
231 else if (tag ==
"TOX0" )
tox0 = iter->getImmutableValue<
double>();
232 else if (tag ==
"MINRES" )
minRes = iter->getImmutableValue<
double>();
233 else if (tag ==
"MINCAP" )
minCap = iter->getImmutableValue<
double>();
234 else if (tag ==
"NEWMEYER" )
236 else if (tag ==
"SENSDEBUGLEVEL")
240 else if (tag ==
"DEBUGLEVEL")
242 debugLevel = (iter->getImmutableValue<
int>());
245 else if (tag ==
"VERBOSELEVEL")
249 else if (tag ==
"DEBUGMINTIMESTEP")
253 else if (tag ==
"DEBUGMAXTIMESTEP")
257 else if (tag ==
"DEBUGMINTIME")
261 else if (tag ==
"DEBUGMAXTIME")
265 else if (tag ==
"NEWEXCESSPHASE")
267 newExcessPhase =
static_cast<bool> (iter->getImmutableValue<
int>());
269 else if (tag ==
"EXCESSPHASESCALAR1")
273 else if (tag ==
"EXCESSPHASESCALAR2")
277 else if (tag ==
"ZERORESISTANCETOL")
281 else if (tag ==
"CHECKFORZERORESISTANCE")
285 else if (tag ==
"DETAILED_device_counts" )
289 else if (tag ==
"RANDOMSEED" )
291 randomSeed = (iter->getImmutableValue<
long>());
293 else if (tag ==
"TRYTOCOMPACT")
295 tryToCompact =
static_cast<bool> (iter->getImmutableValue<
int>());
297 else if (tag ==
"CALCULATEALLLEADCURRENTS")
303 Report::UserError0() << tag <<
" is not a recognized device package option.";
311 dout() << *
this << std::endl;
377 if( cp.getArgumentValue(
"-dva" ) ==
"off" )
379 lout() <<
"Warning: -dva is no longer a recognized option.\n" << std::endl;
382 if( cp.getArgumentValue(
"-dma" ) ==
"off" )
384 lout() <<
"Warning: -dma is no longer a recognized option.\n" << std::endl;
403 if ( cp.argExists(
"-sdl" ) )
408 if ( cp.argExists(
"-ddl" ) )
410 debugLevel = atoi( cp.getArgumentValue(
"-ddl" ).c_str() );
414 if (cp.argExists(
"-jacobian_test"))
501 os <<
"\n\n-----------------------------------------" << std::endl;
502 os <<
"\tDevice Options:\n";
503 os <<
"\t\tdefad = " << devOp.
defad <<
"\n";
504 os <<
"\t\tdefas = " << devOp.
defas <<
"\n";
505 os <<
"\t\tdefl = " << devOp.
defl <<
"\n";
506 os <<
"\t\tdefw = " << devOp.
defw <<
"\n";
507 os <<
"\t\tabstol = " << devOp.
abstol <<
"\n";
508 os <<
"\t\treltol = " << devOp.
reltol <<
"\n";
509 os <<
"\t\tchgtol = " << devOp.
chgtol <<
"\n";
510 os <<
"\t\tgmin = " << devOp.
gmin <<
"\n";
511 os <<
"\t\tgmin_orig = " << devOp.
gmin_orig <<
"\n";
512 os <<
"\t\tgmin_init = " << devOp.
gmin_init <<
"\n";
513 os <<
"\t\tgmin_scalar = " << devOp.
gmin_scalar <<
"\n";
514 os <<
"\t\tgmax = " << devOp.
gmax <<
"\n";
515 os <<
"\t\ttnom = " << devOp.
tnom <<
"\n";
516 os <<
"\t\tscale_src = " << devOp.
scale_src <<
"\n";
521 os <<
"\t\ttestJacWarn = " << devOp.
testJacWarn <<
"\n";
530 os <<
"\t\tlambertWFlag = " << devOp.
lambertWFlag <<
"\n";
531 os <<
"\t\ticMultiplier = " << devOp.
icMultiplier <<
"\n";
533 os <<
"\t\tvdsScaleMin = " << devOp.
vdsScaleMin <<
"\n";
534 os <<
"\t\tvgstConst = " << devOp.
vgstConst <<
"\n";
538 os <<
"\t\tlength0 = " << devOp.
length0 <<
"\n";
539 os <<
"\t\twidth0 = " << devOp.
width0 <<
"\n";
540 os <<
"\t\ttox0 = " << devOp.
tox0 <<
"\n";
541 os <<
"\t\tminres = " << devOp.
minRes <<
"\n";
542 os <<
"\t\tmincap = " << devOp.
minCap <<
"\n";
544 os <<
"\t\tdebugLevel = " << devOp.
debugLevel <<
"\n";
547 os <<
"\t\tdebugMinTime = " << devOp.
debugMinTime <<
"\n";
548 os <<
"\t\tdebugMaxTime = " << devOp.
debugMaxTime <<
"\n";
549 os <<
"\t\tverboseLevel = " << devOp.
verboseLevel <<
"\n";
555 os <<
"\t\tnewMeyerFlag = " << devOp.
newMeyerFlag <<
"\n";
556 os << Xyce::section_divider;