46 #include <Xyce_config.h>
63 #include <N_ERH_ErrorMgr.h>
67 #include <N_LAS_Matrix.h>
68 #include <N_LAS_Vector.h>
93 .setDescription(
"Presynaptic voltage spike threhsold");
97 .setDescription(
"Time delay between presynaptic signal and postsynaptic response");
101 .setDescription(
"Maximal Synaptic Conductance");
105 .setDescription(
"Postsynaptic Reversal Potential");
109 .setDescription(
"Rise time constant");
113 .setDescription(
"Decay time constant");
152 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
160 #ifdef Xyce_FullSynapseJac
161 APostEquPostNodeOffset(-1),
162 f_PostEquPostNodePtr(0),
166 randInitialized(false)
177 #ifdef Xyce_FullSynapseJac
226 const std::vector<int> & extLIDVecRef )
231 #ifdef Xyce_DEBUG_DEVICE
234 Xyce::dout() << std::endl << section_divider << std::endl;
235 Xyce::dout() <<
" SynapseInstance::registerLIDs" << std::endl;
236 Xyce::dout() <<
" name = " <<
getName() << std::endl;
247 #ifdef Xyce_DEBUG_DEVICE
250 Xyce::dout() <<
" li_Prev = " <<
li_Prev << std::endl;
251 Xyce::dout() <<
" li_Post = " <<
li_Post << std::endl;
260 #ifdef Xyce_DEBUG_DEVICE
263 Xyce::dout() << section_divider << std::endl;
354 #ifdef Xyce_FullSynapseJac
355 APostEquPostNodeOffset = jacLIDVec[1][0];
369 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
370 #ifdef Xyce_FullSynapseJac
372 f_PostEquPostNodePtr = &(dFdx[
li_Post][APostEquPostNodeOffset]);
387 bool bsuccess =
true;
402 unsigned int aSeed =
static_cast<unsigned int>(time( NULL ) ) ;
410 double vPre = lastSolVecPtr[
li_Prev];
411 double vPost = lastSolVecPtr[
li_Post];
442 double Anow = stoVector[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
443 double Bnow = stoVector[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
451 double cond = Bnow-Anow;
452 ipost = cond*(vPost-eRev);
455 #ifdef Xyce_DEBUG_DEVICE
458 Xyce::dout() << std::endl << section_divider << std::endl;
459 Xyce::dout() <<
" SynapseInstance::updateIntermediateVars" << std::endl;
460 Xyce::dout() <<
"Anow: " << Anow << std::endl;
461 Xyce::dout() <<
"Bnow: " << Bnow << std::endl;
462 Xyce::dout() <<
"vPost: " << vPost << std::endl;
463 Xyce::dout() <<
"eRev: " << eRev << std::endl;
464 Xyce::dout() <<
"ipost: " <<
ipost << std::endl;
465 Xyce::dout() <<
"didVpost: " << didVpost << std::endl;
593 #ifdef Xyce_FullSynapseJac
613 bool bsuccess =
true;
632 double deltaAB = factor*
gMax;
636 double Anow = stoVector[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
637 double Bnow = stoVector[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
675 bool bsuccess =
true;
712 std::vector<Instance*>::iterator iter;
716 for (iter=first; iter!=last; ++iter)
718 (*iter)->processParams();
736 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
770 std::vector<Instance*>::iterator iter;
774 for (iter=first; iter!=last; ++iter)
790 std::vector<Instance*>::const_iterator iter;
797 os <<
"Number of Synapse4 Instances: " << isize << std::endl;
798 os <<
" name model name Parameters" << std::endl;
799 for (i=0, iter=first; iter!=last; ++iter, ++i)
801 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
826 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
847 bool bsuccess =
true;
850 #pragma omp parallel for reduction (&&:bsuccess)
855 bool tmpBool = (*it)->updateIntermediateVars();
856 bsuccess = bsuccess && tmpBool;
885 bool Master::loadDAEVectors(
double * solVec,
double * fVec,
double * qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ)
893 bool bsuccess =
true;
903 bool tmpBool = (*it)->loadDAEFVector();
904 bsuccess = bsuccess && tmpBool;
926 bool bsuccess =
true;
936 bool tmpBool = (*it)->loadDAEdFdx();
937 bsuccess = bsuccess && tmpBool;
952 .registerDevice(
"synapse", 4)
953 .registerModelType(
"synapse", 4);