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;
333 std::string baseString(
getName() +
"_");
334 std::string tempString;
336 tempString = baseString +
"A0";
338 tempString = baseString +
"B0";
340 tempString = baseString +
"T0";
344 tempString =
getName() +
":DEV_I";
375 #ifdef Xyce_FullSynapseJac
376 APostEquPostNodeOffset = jacLIDVec[1][0];
390 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
391 #ifdef Xyce_FullSynapseJac
393 f_PostEquPostNodePtr = &(dFdx[
li_Post][APostEquPostNodeOffset]);
408 bool bsuccess =
true;
423 unsigned int aSeed =
static_cast<unsigned int>(time( NULL ) ) ;
431 double vPre = lastSolVecPtr[
li_Prev];
432 double vPost = lastSolVecPtr[
li_Post];
463 double Anow = stoVector[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
464 double Bnow = stoVector[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
472 double cond = Bnow-Anow;
473 ipost = cond*(vPost-eRev);
476 #ifdef Xyce_DEBUG_DEVICE
479 Xyce::dout() << std::endl << section_divider << std::endl;
480 Xyce::dout() <<
" SynapseInstance::updateIntermediateVars" << std::endl;
481 Xyce::dout() <<
"Anow: " << Anow << std::endl;
482 Xyce::dout() <<
"Bnow: " << Bnow << std::endl;
483 Xyce::dout() <<
"vPost: " << vPost << std::endl;
484 Xyce::dout() <<
"eRev: " << eRev << std::endl;
485 Xyce::dout() <<
"ipost: " <<
ipost << std::endl;
486 Xyce::dout() <<
"didVpost: " << didVpost << std::endl;
614 #ifdef Xyce_FullSynapseJac
634 bool bsuccess =
true;
653 double deltaAB = factor*
gMax;
657 double Anow = stoVector[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
658 double Bnow = stoVector[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
696 bool bsuccess =
true;
733 std::vector<Instance*>::iterator iter;
737 for (iter=first; iter!=last; ++iter)
739 (*iter)->processParams();
757 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
791 std::vector<Instance*>::iterator iter;
795 for (iter=first; iter!=last; ++iter)
811 std::vector<Instance*>::const_iterator iter;
818 os <<
"Number of Synapse4 Instances: " << isize << std::endl;
819 os <<
" name model name Parameters" << std::endl;
820 for (i=0, iter=first; iter!=last; ++iter, ++i)
822 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
847 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
868 bool bsuccess =
true;
871 #pragma omp parallel for reduction (&&:bsuccess)
876 bool tmpBool = (*it)->updateIntermediateVars();
877 bsuccess = bsuccess && tmpBool;
914 bool bsuccess =
true;
924 bool tmpBool = (*it)->loadDAEFVector();
925 bsuccess = bsuccess && tmpBool;
947 bool bsuccess =
true;
957 bool tmpBool = (*it)->loadDAEdFdx();
958 bsuccess = bsuccess && tmpBool;
973 .registerDevice(
"synapse", 4)
974 .registerModelType(
"synapse", 4);