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;
414 #ifdef Xyce_FullSynapseJac
415 APostEquPostNodeOffset = jacLIDVec[1][0];
429 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
430 #ifdef Xyce_FullSynapseJac
432 f_PostEquPostNodePtr = &(dFdx[
li_Post][APostEquPostNodeOffset]);
447 bool bsuccess =
true;
453 double vPre = lastSolVecPtr[
li_Prev];
454 double vPost = lastSolVecPtr[
li_Post];
465 unsigned int aSeed =
static_cast<unsigned int>(time( NULL ) ) ;
526 double Anow = stoVec[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
527 double Bnow = stoVec[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
578 #ifdef Xyce_DEBUG_DEVICE
581 Xyce::dout() << std::endl << section_divider << std::endl;
582 Xyce::dout() <<
" SynapseInstance::updateIntermediateVars" << std::endl;
583 Xyce::dout() <<
"Anow: " << Anow << std::endl;
584 Xyce::dout() <<
"Bnow: " << Bnow << std::endl;
599 didVpost = synapticWeight * (Bnow - Anow);
601 #ifdef Xyce_DEBUG_DEVICE
604 Xyce::dout() << std::endl << section_divider << std::endl;
605 Xyce::dout() <<
"vPost: " << vPost << std::endl;
606 Xyce::dout() <<
"eRev: " << eRev << std::endl;
607 Xyce::dout() <<
"weight: " << synapticWeight << std::endl;
609 Xyce::dout() <<
"ipost: " <<
ipost << std::endl;
610 Xyce::dout() <<
"didVpost: " <<
didVpost << std::endl;
740 #ifdef Xyce_FullSynapseJac
760 bool bsuccess =
true;
778 double deltaAB = factor*
gMax;
783 double Anow = stoVec[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
784 double Bnow = stoVec[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
795 #ifdef Xyce_DEBUG_DEVICE
798 Xyce::dout() << std::endl << section_divider << std::endl;
799 Xyce::dout() <<
" SynapseInstance::outputPlotFiles" << std::endl;
801 Xyce::dout() <<
"weight in store: " << stoVec[
li_weight_store] << std::endl;
819 bool bsuccess =
true;
855 std::vector<Instance*>::iterator iter;
859 for (iter=first; iter!=last; ++iter)
861 (*iter)->processParams();
879 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
913 std::vector<Instance*>::iterator iter;
917 for (iter=first; iter!=last; ++iter)
933 std::vector<Instance*>::const_iterator iter;
940 os <<
"Number of Synapse3 Instances: " << isize << std::endl;
941 os <<
" name model name Parameters" << std::endl;
942 for (i=0, iter=first; iter!=last; ++iter, ++i)
944 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
969 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
983 .registerDevice(
"synapse", 3)
984 .registerModelType(
"synapse", 3);