47 #include <Xyce_config.h>
64 #include <N_ERH_ErrorMgr.h>
68 #include <N_LAS_Matrix.h>
69 #include <N_LAS_Vector.h>
102 .setDescription(
"Presynaptic voltage spike threhsold");
106 .setDescription(
"Time delay between presynaptic signal and postsynaptic response");
110 .setDescription(
"Maximal Synaptic Conductance");
114 .setDescription(
"Postsynaptic Reversal Potential");
118 .setDescription(
"Rise time constant");
122 .setDescription(
"Decay time constant");
126 .setDescription(
"Voltage threshold for a spike event");
129 .setDescription(
"Resting voltage for resting event");
131 .setDescription(
"Synaptic weight, minimum value");
133 .setDescription(
"Synaptic weight, maximum value");
135 .setDescription(
"Synaptic weight, initial value");
138 .setDescription(
"Rate for Longterm potentiation factor (LPF) based on post-synaptic voltage (rate 1)");
141 .setDescription(
"Rate for Longterm potentiation factor (LPF) based on post-synaptic voltage (rate 2)");
144 .setDescription(
"Rate for Longterm potentiation factor (LPF) based on pre-synaptic voltage (rate 3)");
146 .setDescription(
"Long term depression coefficient");
148 .setDescription(
"Long term potentiation coefficient");
150 .setDescription(
"Transmission Probability");
189 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
201 #ifdef Xyce_FullSynapseJac
202 APostEquPostNodeOffset(-1),
203 f_PostEquPostNodePtr(0),
205 transmissionProbability(1.0),
206 transmissionFactor(1),
209 randInitialized(false)
220 #ifdef Xyce_FullSynapseJac
282 const std::vector<int> & extLIDVecRef )
287 #ifdef Xyce_DEBUG_DEVICE
290 Xyce::dout() << std::endl << section_divider << std::endl;
291 Xyce::dout() <<
" SynapseInstance::registerLIDs" << std::endl;
292 Xyce::dout() <<
" name = " <<
getName() << std::endl;
303 #ifdef Xyce_DEBUG_DEVICE
306 Xyce::dout() <<
" li_Prev = " <<
li_Prev << std::endl;
307 Xyce::dout() <<
" li_Post = " <<
li_Post << std::endl;
311 #ifdef Xyce_DEBUG_DEVICE
314 Xyce::dout() << section_divider << std::endl;
374 std::string baseString(
getName() +
"_");
375 std::string tempString;
376 tempString = baseString +
"A0";
378 tempString = baseString +
"B0";
380 tempString = baseString +
"T0";
382 tempString = baseString +
"W";
384 tempString = baseString +
"VL1";
386 tempString = baseString +
"VL2";
388 tempString = baseString +
"VL3";
392 tempString =
getName() +
":DEV_I";
424 #ifdef Xyce_FullSynapseJac
425 APostEquPostNodeOffset = jacLIDVec[1][0];
439 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
440 #ifdef Xyce_FullSynapseJac
442 f_PostEquPostNodePtr = &(dFdx[
li_Post][APostEquPostNodeOffset]);
457 bool bsuccess =
true;
463 double vPre = lastSolVecPtr[
li_Prev];
464 double vPost = lastSolVecPtr[
li_Post];
475 unsigned int aSeed =
static_cast<unsigned int>(time( NULL ) ) ;
536 double Anow = stoVec[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
537 double Bnow = stoVec[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
588 #ifdef Xyce_DEBUG_DEVICE
591 Xyce::dout() << std::endl << section_divider << std::endl;
592 Xyce::dout() <<
" SynapseInstance::updateIntermediateVars" << std::endl;
593 Xyce::dout() <<
"Anow: " << Anow << std::endl;
594 Xyce::dout() <<
"Bnow: " << Bnow << std::endl;
609 didVpost = synapticWeight * (Bnow - Anow);
611 #ifdef Xyce_DEBUG_DEVICE
614 Xyce::dout() << std::endl << section_divider << std::endl;
615 Xyce::dout() <<
"vPost: " << vPost << std::endl;
616 Xyce::dout() <<
"eRev: " << eRev << std::endl;
617 Xyce::dout() <<
"weight: " << synapticWeight << std::endl;
619 Xyce::dout() <<
"ipost: " <<
ipost << std::endl;
620 Xyce::dout() <<
"didVpost: " <<
didVpost << std::endl;
750 #ifdef Xyce_FullSynapseJac
770 bool bsuccess =
true;
788 double deltaAB = factor*
gMax;
793 double Anow = stoVec[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
794 double Bnow = stoVec[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
805 #ifdef Xyce_DEBUG_DEVICE
808 Xyce::dout() << std::endl << section_divider << std::endl;
809 Xyce::dout() <<
" SynapseInstance::outputPlotFiles" << std::endl;
811 Xyce::dout() <<
"weight in store: " << stoVec[
li_weight_store] << std::endl;
829 bool bsuccess =
true;
865 std::vector<Instance*>::iterator iter;
869 for (iter=first; iter!=last; ++iter)
871 (*iter)->processParams();
889 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
923 std::vector<Instance*>::iterator iter;
927 for (iter=first; iter!=last; ++iter)
943 std::vector<Instance*>::const_iterator iter;
950 os <<
"Number of Synapse3 Instances: " << isize << std::endl;
951 os <<
" name model name Parameters" << std::endl;
952 for (i=0, iter=first; iter!=last; ++iter, ++i)
954 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
979 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
993 .registerDevice(
"synapse", 3)
994 .registerModelType(
"synapse", 3);