47 #include <Xyce_config.h>
64 #include <N_ERH_ErrorMgr.h>
68 #include <N_LAS_Matrix.h>
69 #include <N_LAS_Vector.h>
70 #include <N_UTL_FeatureTest.h>
85 .setDescription(
"Maximal Synaptic Conductance");
91 .setDescription(
"Transmission Probability");
97 .setDescription(
"Synaptic weight,initial value");
104 .setDescription(
"Presynaptic voltage spike threhsold");
108 .setDescription(
"Time delay between presynaptic signal and postsynaptic response");
112 .setDescription(
"Maximal Synaptic Conductance");
116 .setDescription(
"Postsynaptic Reversal Potential");
120 .setDescription(
"Rise time constant");
124 .setDescription(
"Decay time constant");
128 .setDescription(
"Voltage threshold for a spike event");
132 .setDescription(
"Resting voltage for resting event");
135 .setDescription(
"Synaptic weight,minimum value");
138 .setDescription(
"Synaptic weight,maximum value");
141 .setDescription(
"Synaptic weight,initial value");
145 .setDescription(
"Rate for Longterm potentiation factor (LPF) based on post-synaptic voltage (rate 1)");
149 .setDescription(
"Rate for Longterm potentiation factor (LPF) based on post-synaptic voltage (rate 2)");
153 .setDescription(
"Rate for Longterm potentiation factor (LPF) based on pre-synaptic voltage (rate 3)");
156 .setDescription(
"Long term depression coefficient");
159 .setDescription(
"Long term potentiation coefficient");
162 .setDescription(
"Transmission Probability");
219 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
231 #ifdef Xyce_FullSynapseJac
232 APostEquPostNodeOffset(-1),
233 f_PostEquPostNodePtr(0),
235 transmissionProbability(1.0),
236 transmissionFactor(1),
239 randInitialized(false)
250 #ifdef Xyce_FullSynapseJac
292 const std::vector<int> & extLIDVecRef )
297 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
299 Xyce::dout() << std::endl << section_divider << std::endl;
300 Xyce::dout() <<
" SynapseInstance::registerLIDs" << std::endl;
301 Xyce::dout() <<
" name = " <<
getName() << std::endl;
311 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
313 Xyce::dout() <<
" li_Prev = " <<
li_Prev << std::endl;
314 Xyce::dout() <<
" li_Post = " <<
li_Post << std::endl;
317 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
319 Xyce::dout() << section_divider << std::endl;
398 #ifdef Xyce_FullSynapseJac
399 APostEquPostNodeOffset = jacLIDVec[1][0];
413 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
414 #ifdef Xyce_FullSynapseJac
416 f_PostEquPostNodePtr = &(dFdx[
li_Post][APostEquPostNodeOffset]);
431 bool bsuccess =
true;
437 double vPre = lastSolVecPtr[
li_Prev];
438 double vPost = lastSolVecPtr[
li_Post];
449 unsigned int aSeed =
static_cast<unsigned int>(time( NULL ) ) ;
510 double Anow = stoVec[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
511 double Bnow = stoVec[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
562 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
564 Xyce::dout() << std::endl << section_divider << std::endl;
565 Xyce::dout() <<
" SynapseInstance::updateIntermediateVars" << std::endl;
566 Xyce::dout() <<
"Anow: " << Anow << std::endl;
567 Xyce::dout() <<
"Bnow: " << Bnow << std::endl;
581 didVpost = synapticWeight * (Bnow - Anow);
583 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
585 Xyce::dout() << std::endl << section_divider << std::endl;
586 Xyce::dout() <<
"vPost: " << vPost << std::endl;
587 Xyce::dout() <<
"eRev: " << eRev << std::endl;
588 Xyce::dout() <<
"weight: " << synapticWeight << std::endl;
590 Xyce::dout() <<
"ipost: " <<
ipost << std::endl;
591 Xyce::dout() <<
"didVpost: " <<
didVpost << std::endl;
720 #ifdef Xyce_FullSynapseJac
740 bool bsuccess =
true;
758 double deltaAB = factor*
gMax;
763 double Anow = stoVec[
li_A0_store] * exp( - ( time - t0 ) / tau1 );
764 double Bnow = stoVec[
li_B0_store] * exp( - ( time - t0 ) / tau2 );
775 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
777 Xyce::dout() << std::endl << section_divider << std::endl;
778 Xyce::dout() <<
" SynapseInstance::outputPlotFiles" << std::endl;
780 Xyce::dout() <<
"weight in store: " << stoVec[
li_weight_store] << std::endl;
797 bool bsuccess =
true;
833 std::vector<Instance*>::iterator iter;
837 for (iter=first; iter!=last; ++iter)
839 (*iter)->processParams();
857 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
891 std::vector<Instance*>::iterator iter;
895 for (iter=first; iter!=last; ++iter)
911 std::vector<Instance*>::const_iterator iter;
918 os <<
"Number of Synapse3 Instances: " << isize << std::endl;
919 os <<
" name model name Parameters" << std::endl;
920 for (i=0, iter=first; iter!=last; ++iter, ++i)
922 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
947 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
961 .registerDevice(
"synapse", 3)
962 .registerModelType(
"synapse", 3);
const InstanceName & getName() const
bool updateDependentParameters()
const std::vector< std::vector< int > > & jacobianStamp() const
const SolverState & solverState_
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
double currTimeStep_
Region, BJT, Digital, ThermalResistor, ROM, Charon, Others.
static void loadModelParameters(ParametricData< Model > &model_parameters)
bool updateSecondaryState()
double transmissionProbability
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &Riter, const FactoryBlock &factory_block)
Pure virtual class to augment a linear system.
void setNumStoreVars(int num_store_vars)
void registerStoreLIDs(const std::vector< int > &storeLIDVecRef)
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
int getNumStoreVars() const
std::vector< Param > params
Parameters from the line.
void setParams(const std::vector< Param > ¶ms)
const std::string & getName() const
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
const DeviceOptions & getDeviceOptions() const
double * nextStoVectorRawPtr
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
const DeviceOptions & deviceOptions_
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
Linear::Matrix * dFdxMatrixPtr
bool updateIntermediateVars()
std::vector< Instance * > instanceContainer
The Device class is an interface for device implementations.
void addStoreNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
bool processInstanceParams()
processInstanceParams
bool transmissionProbabilityValueGiven
static Xyce::Util::RandomNumbers randomNumberGenerator_
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
Class Configuration contains device configuration data.
bool updateTemperature(const double &temp_tmp)
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
double transmissionProbability
const SolverState & getSolverState() const
bool updatePrimaryState()
bool processParams()
processParams
static std::vector< std::vector< int > > jacStamp
Linear::Vector * daeFVectorPtr
virtual std::ostream & printOutInstances(std::ostream &os) const
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
const ExternData & extData
double synapticWeightUpdate
ModelBlock represents a .MODEL line from the netlist.
Manages parameter binding for class C.
InstanceBlock represent a device instance line from the netlist.
double currTime_
DeviceEntity for expression time, breakpoints DeviceMgr for dependent parameters, breakpoints...
std::vector< Param > params
double * lastSolVectorRawPtr
bool outputPlotFiles(bool force_final_output)
double * lastStoVectorRawPtr
void setModParams(const std::vector< Param > ¶ms)
int numLeadCurrentStoreVars