48 #include <Xyce_config.h>
52 #include <N_UTL_Misc.h>
77 #include <N_LAS_Vector.h>
78 #include <N_LAS_Matrix.h>
91 .setDescription(
"internal Resistance");
98 .setDescription(
"Lower limit of ADC voltage range");
102 .setDescription(
"Upper limit of ADC voltage range");
106 .setDescription(
"Settling time");
140 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
146 outputBitVectorWidth_(1),
152 APosEquPosNodeOffset(-1),
153 APosEquNegNodeOffset(-1),
154 ANegEquPosNodeOffset(-1),
155 ANegEquNegNodeOffset(-1)
187 if (
R != 0.0)
G = 1.0/
R;
214 const std::vector<int> & extLIDVecRef)
221 Xyce::dout() << std::endl << section_divider << std::endl;
222 Xyce::dout() <<
" ADCInstance::registerLIDs" << std::endl;
223 Xyce::dout() <<
" name = " <<
getName() << std::endl;
237 Xyce::dout() <<
" li_Pos = " <<
li_Pos << std::endl;
242 Xyce::dout() <<
" li_Neg = " <<
li_Neg << std::endl;
245 Xyce::dout() << section_divider << std::endl;
300 bool bsuccess =
true;
349 TVVEC_Out.insert(TVVEC_Out.end(),
TVVEC.begin(),
TVVEC.end());
367 std::vector< std::pair<double,double> >::iterator itVec;
370 itVec = lower_bound(
TVVEC.begin(),
TVVEC.end(),std::pair<double,double>(earliestTime,0.0));
389 bool bsuccess =
true;
416 bool bsuccess =
true;
422 Xyce::dout() << subsection_divider <<std::endl;
423 Xyce::dout() <<
" name = " <<
getName() << std::endl;
424 Xyce::dout() <<
" G = " <<
G << std::endl;
449 bool bsuccess =
true;
463 double deltaV(0.0), vFrac(0.0);
505 Xyce::dout() <<
"In Instance::getInstanceBreakPoints. deltaV = " << deltaV
506 <<
" and output state is " << newState
507 <<
" vFrac = " << vFrac <<
" nQuantLevels = " <<
nQuantLevels_ << std::endl;
513 long long int timeInFS =
static_cast<long long int>(
517 #ifdef Xyce_OLD_PRE_ROLLBACK
518 breakPointTimes.push_back( Util::BreakPoint(timeInFS*1e-15,PAUSE_BREAKPOINT));
530 TVVEC.push_back(std::pair<double,double>(timeInFS*1e-15,deltaV));
535 Xyce::dout() <<
"ADC ----------------------------------------" << std::endl;
536 Xyce::dout() <<
"ADC Debug output. name = " <<
getName() << std::endl;
537 Xyce::dout() <<
"ADC setting pause breakpoint for " << currentTime << std::endl;
538 double approxTime = timeInFS*1e-15;
539 Xyce::dout() <<
"ADC Approximated time, to nearest femptosecond: " << approxTime << std::endl;
540 Xyce::dout() <<
"ADC Time value pairs: " << std::endl;
542 std::vector< std::pair<double, double> >::iterator beg =
TVVEC.begin();
543 std::vector< std::pair<double, double> >::iterator end =
TVVEC.end();
544 std::vector< std::pair<double, double> >::iterator itTV = beg;
546 for (; itTV!=end; ++itTV)
548 std::pair<double, double> & tvPair = *itTV;
549 Xyce::dout() <<
"ADC time: " << tvPair.first <<
" value: " << tvPair.second << std::endl;
552 Xyce::dout() <<
"ADC ----------------------------------------" << std::endl;
569 double vPos(0.0), vNeg(0.0), deltaV(0.0), vFrac(0.0);
580 TVVEC.push_back(std::pair<double,double>(0.0,deltaV));
608 std::vector<Instance*>::iterator iter;
612 for (iter=first; iter!=last; ++iter)
614 (*iter)->processParams();
656 for (
int i=0; i<width;++i)
661 Xyce::dout() <<
"Instance::setBitVectorWidth name = "
662 <<
getName() <<
" width = " << width
680 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
681 lowerVoltageLimit_(0.0),
682 upperVoltageLimit_(5.0),
712 std::vector<Instance*>::iterator iter;
716 for (iter=first; iter!=last; ++iter)
732 std::vector<Instance*>::const_iterator iter;
738 os <<
" name\t\tmodelName\tParameters" << std::endl;
740 for (i = 0, iter = first; iter != last; ++iter, ++i)
742 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
753 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
852 bool bSuccess =
true;
856 std::string adcName(di.
getName());
858 std::map<std::string,double> TmpMap;
860 ADCMap[adcName] = TmpMap;
875 bool bSuccess =
true;
881 std::string adcName(di.
getName());
883 std::vector<std::pair <double,double> > TmpVec;
888 vPos = solVector[di.
li_Pos];
889 vNeg = solVector[di.
li_Neg];
890 TmpVec.push_back(std::pair<double,double>(currentTime, vPos-vNeg));
891 TimeVoltageMap[adcName] = TmpVec;
906 bool bsuccess =
true;
911 bsuccess = bsuccess && tmpBool;
927 .registerDevice(
"adc", 1)
928 .registerModelType(
"adc", 1);