CARLsim  6.1.0
CARLsim: a GPU-accelerated SNN simulator
snn_datastructures.h
Go to the documentation of this file.
1 /* * Copyright (c) 2016 Regents of the University of California. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions
5 * are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * 3. The names of its contributors may not be used to endorse or promote
15 * products derived from this software without specific prior written
16 * permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * *********************************************************************************************** *
31 * CARLsim
32 * created by: (MDR) Micah Richert, (JN) Jayram M. Nageswaran
33 * maintained by:
34 * (MA) Mike Avery <averym@uci.edu>
35 * (MB) Michael Beyeler <mbeyeler@uci.edu>,
36 * (KDC) Kristofor Carlson <kdcarlso@uci.edu>
37 * (TSC) Ting-Shuo Chou <tingshuc@uci.edu>
38 * (HK) Hirak J Kashyap <kashyaph@uci.edu>
39 *
40 * CARLsim v1.0: JM, MDR
41 * CARLsim v2.0/v2.1/v2.2: JM, MDR, MA, MB, KDC
42 * CARLsim3: MB, KDC, TSC
43 * CARLsim4: TSC, HK
44 * CARLsim5: HK, JX, KC
45 * CARLsim6: LN, JX, KC, KW
46 *
47 * CARLsim available from http://socsci.uci.edu/~jkrichma/CARLsim/
48 * Ver 12/31/2021
49 */
50 
51 #ifndef _SNN_DATASTRUCTURES_H_
52 #define _SNN_DATASTRUCTURES_H_
53 
54 
55 
56 // include CUDA version-dependent macros and include files
57 #ifndef __NO_CUDA__
58  #include <cuda_version_control.h>
59  #include <curand.h>
60 #endif
61 
62 
63 
64 
75 enum MemType {
78 };
79 
82 
84 enum SNNState {
89 };
90 
91 typedef struct DelayInfo_s {
93  short delay_length;
94 } DelayInfo;
95 
96 typedef struct SynInfo_s {
97  int gsId;
98  int nId;
99 } SynInfo;
100 
102 typedef struct STDPConfig_s {
103  STDPConfig_s() : WithSTDP(false), WithESTDP(false), WithISTDP(false),
104  WithESTDPtype(UNKNOWN_STDP), WithISTDPtype(UNKNOWN_STDP), WithESTDPcurve(UNKNOWN_CURVE), WithISTDPcurve(UNKNOWN_CURVE)
105  {}
106  bool WithSTDP;
107  bool WithESTDP; // LN2021 FIXME: consolidate E/I as it is connection based now
108  bool WithISTDP;
109  STDPType WithESTDPtype; // LN2021 FIXME: dito
111  STDPCurve WithESTDPcurve; // LN2021 FIXME: dito
117  float GAMMA; // LN2021 FIXME: apply unit (C++11) or variant (C++17)
118  float KAPPA;
119  float OMEGA;
120  float TAU_PLUS_INV_INB; // LN2021 FIXME : redundant, see dito
124  float BETA_LTP; // LN2021 FIXME: variant
125  float BETA_LTD;
126  float LAMBDA;
127  float DELTA;
128 #ifdef LN_I_CALC_TYPES
129  // PKA_PLC_MOD // LN2021 FIXME: when applying variant
130  int NM_PKA;
131  int NM_PLC;
132  float W_PLC;
133  float W_PKA;
134 #endif
135 } STDPConfig;
136 
138 typedef struct STPConfig_s {
139  STPConfig_s() : WithSTP(false), STP_A(-1.0f), STP_U(-1.0f), STP_tau_u_inv(-1.0f), STP_tau_x_inv(-1.0f)
140  {}
141 
142  bool WithSTP;
143  float STP_A; // scaling factor
144  float STP_U;
145  float STP_tau_u_inv; // facilitatory
146  float STP_tau_x_inv; // depressive
147 } STPConfig;
148 
150 typedef struct HomeostasisConfig_s {
151  HomeostasisConfig_s() : WithHomeostasis(false), baseFiring(-1.0f), baseFiringSD(-1.0f),
152  avgTimeScale(-1.0f), avgTimeScaleInv(-1.0f), avgTimeScaleDecay(-1.0f),
153  homeostasisScale(-1.0f)
154  {}
155 
157  float baseFiring;
164 
166 typedef struct NeuromodulatorConfig_s {
167  NeuromodulatorConfig_s() : baseDP(1.0f), base5HT(1.0f), baseACh(1.0f), baseNE(1.0f),
168  decayDP(0.99f), decay5HT(0.99f), decayACh(0.99f), decayNE(0.99f),
169  releaseDP(0.04f), release5HT(0.04f), releaseACh(0.04f), releaseNE(0.04f),
170  activeDP(true), active5HT(true), activeACh(true), activeNE(true)
171  {}
172 
173  float baseDP;
174  float base5HT;
175  float baseACh;
176  float baseNE;
177 
178  float decayDP;
179  float decay5HT;
180  float decayACh;
181  float decayNE;
182 
183  float releaseDP;
184  float release5HT;
185  float releaseACh;
186  float releaseNE;
187 
188  bool activeDP;
189  bool active5HT;
190  bool activeACh;
191  bool activeNE;
193 
194 #ifdef LN_I_CALC_TYPES
195 typedef struct ConductanceConfig_s {
197  ConductanceConfig_s(): dAMPA(.0), rNMDA(.0), dNMDA(.0), sNMDA(.0), dGABAa(.0), rGABAb(.0), dGABAb(.0), sGABAb(.0) {};
198  // rollbacked back, due to .. backward compatibilty, needs to be copied from sim / network like ... icalctype see \todo compileNetwork ... setupNetwork etc
199  // apply same defaults as in SNNinit former global .. to ensure backward compatibility (deprecated)
200  //ConductanceConfig_s() {
201  // dAMPA = float(1.0 - 1.0 / 5.0); // some default decay and rise times
202  // rNMDA = float(1.0 - 1.0 / 10.0);
203  // dNMDA = float(1.0 - 1.0 / 150.0);
204  // sNMDA = float(1.0);
205  // dGABAa = float(1.0 - 1.0 / 6.0);
206  // rGABAb = float(1.0 - 1.0 / 100.0);
207  // dGABAb = float(1.0 - 1.0 / 150.0);
208  // sGABAb = float(1.0);
209  //};
210 
211  float dAMPA;
212  float rNMDA;
213  float dNMDA;
214  float sNMDA;
215  float dGABAa;
216  float rGABAb;
217  float dGABAb;
218  float sGABAb;
220 
221 
222 
223 
225 typedef struct ACNE12Config_s {
226  ACNE12Config_s() : p1(.0f), p2(.0f) {};
227  float p1;
228  float p2;
229 } ACNE12Config;
230 
234 typedef struct NM4wConfig_s {
235  float w[NM_NE+3] = { 1.f, 1.f, 1.f, 1.f, 0.25f, 1.0f };
236 } NM4wConfig;
237 
240 typedef struct NM4STPConfig_s {
241  bool WithNM4STP = false;
242  float w_STP_U[NM_NE + 3] = { 1.f, 0.f, 0.f, 0.f, 1.f, 1.f };
243  float w_STP_tau_u[NM_NE + 3] = { 1.f, 0.f, 0.f, 0.f, 1.f, 1.f };
244  float w_STP_tau_x[NM_NE + 3] = { 1.f, 0.f, 0.f, 0.f, 1.f, 1.f };
245 } NM4STPConfig;
246 
247 
248 #endif
249 
250 
251 
252 typedef struct ConnectionInfo_s {
253  int grpSrc;
254  int grpDest;
255  int nSrc;
256  int nDest;
258  float initWt;
259  float maxWt;
260  int preSynId;
261  short int connId;
262  uint8_t delay;
263  // bool withSTDP;
264 
265  bool operator== (const struct ConnectionInfo_s& conn) {
266  return (nSrc + srcGLoffset == conn.nSrc);
267  }
269 
278 typedef struct ConnectConfig_s
279 {
280 #ifdef LN_I_CALC_TYPES
281  ConnectConfig_s(): icalcType(UNKNOWN_ICALC) {};
282 #endif
283  int grpSrc;
284  int grpDest;
285  uint8_t maxDelay;
286  uint8_t minDelay;
287  float maxWt;
288  float initWt;
289  float minWt;
291  float mulSynFast;
292  float mulSynSlow;
293  int connectionMonitorId; // ToDo: move to ConnectConfigMD
294  uint32_t connProp;
298  short int connId;
299  int numberOfConnections; // ToDo: move to ConnectConfigMD
301 #ifdef LN_I_CALC_TYPES
303 #endif
304 } ConnectConfig;
305 
311 typedef struct ConnectConfigMD_s {
312  ConnectConfigMD_s() : gConnId(-1), lConnId(-1), connectionMonitorId(-1), numberOfConnections(-1)
313  {}
314  int gConnId;
315  int lConnId;
319 
328 typedef struct ConnectConfigRT_s {
329 
330  float* mulSynFast;
331  float* mulSynSlow;
332 
333  int grpSrc;
334  int grpDest;
335 
336  // LN2021 FIXME refact ptxas error : File uses too much global constant data (0x105c0 bytes, 0x10000 max)
337 
338  bool WithSTDP;
339  bool WithESTDP;
340  bool WithISTDP;
349  float GAMMA;
350  float KAPPA;
351  float OMEGA;
356  float BETA_LTP;
357  float BETA_LTD;
358  float LAMBDA;
359  float DELTA;
360 #ifdef LN_I_CALC_TYPES
361  int NM_PKA;
362  int NM_PLC;
363  float W_PKA;
364  float W_PLC;
366 #endif
368 
369 typedef struct compConnectionInfo_s {
370  int grpSrc, grpDest;
371  short int connId;
373 
382 typedef struct compConnectConfig_s {
383  int grpSrc, grpDest;
384  short int connId;
386 
388 typedef struct NeuralDynamicsConfig_s {
389  NeuralDynamicsConfig_s() : Izh_a(-1.0f), Izh_a_sd(-1.0f), Izh_b(-1.0f), Izh_b_sd(-1.0f),
390  Izh_c(-1.0f), Izh_c_sd(-1.0f), Izh_d(-1.0f), Izh_d_sd(-1.0f),
391  Izh_C(-1.0f), Izh_C_sd(-1.0f), Izh_k(-1.0f), Izh_k_sd(-1.0f),
392  Izh_vr(-1.0f), Izh_vr_sd(1.0f), Izh_vt(1.0f), Izh_vt_sd(-1.0f),
393  Izh_vpeak(-1.0f), Izh_vpeak_sd(-1.0f), lif_tau_m(-1),
394  lif_tau_ref(-1), lif_vTh(1.0f), lif_vReset(0.0f), lif_minRmem(1.0f),
395  lif_maxRmem(1.0f)
396  {}
397  float Izh_C;
398  float Izh_C_sd;
399  float Izh_k;
400  float Izh_k_sd;
401  float Izh_vr;
402  float Izh_vr_sd;
403  float Izh_vt;
404  float Izh_vt_sd;
405  float Izh_vpeak;
407  float Izh_a;
408  float Izh_a_sd;
409  float Izh_b;
410  float Izh_b_sd;
411  float Izh_c;
412  float Izh_c_sd;
413  float Izh_d;
414  float Izh_d_sd;
415  int lif_tau_m;
417  float lif_vTh;
418  float lif_vReset;
419  double lif_minRmem;
420  double lif_maxRmem;
422 
431 typedef struct GroupConfig_s {
432  GroupConfig_s() : grpName("N/A"), preferredNetId(-2), type(0), numN(-1), isSpikeGenerator(false), spikeGenFunc(NULL),
433  WithSTDP(false), WithDA_MOD(false)
434 #ifdef LN_I_CALC_TYPES
435  , icalcType(UNKNOWN_ICALC)
436  , with_NMDA_rise(false)
437  , with_GABAb_rise(false)
438 #endif
439 #ifdef LN_AXON_PLAST
440  , WithAxonPlast(false)
441  , AxonPlast_TAU(25)
442 #endif
443  {}
444 
445  // properties of neural group size and location
446  std::string grpName;
448  unsigned int type;
449  int numN;
452  bool isLIF;
454 
457 
458  bool WithSTDP;
459  bool WithDA_MOD;
460 #ifdef LN_I_CALC_TYPES
461  bool WithPKA_PLC_MOD; //
462 #endif
463 
465 
466  Grid3D grid; //<! location information of neurons
468  // STDPConfig stdpConfig;
472 #ifdef LN_I_CALC_TYPES
480 #endif
481 #ifdef LN_AXON_PLAST
482  bool WithAxonPlast; // 2022 VTE, Wavefront
483  int AxonPlast_TAU; // tau of the eligibity trace, e.g. 10, e_i(t+1) = e_i(t)(1.0f - 1.0f/AxonPlast_TAU)
484 #endif
485 } GroupConfig;
486 
487 typedef struct GroupConfigMD_s {
488  GroupConfigMD_s() : gGrpId(-1), gStartN(-1), gEndN(-1),
489  lGrpId(-1), lStartN(-1), lEndN(-1),
490  netId(-1), maxOutgoingDelay(1), fixedInputWts(true), hasExternalConnect(false),
491  LtoGOffset(0), GtoLOffset(0), numPostSynapses(0), numPreSynapses(0), Noffset(0),
492  spikeMonitorId(-1), neuronMonitorId(-1), groupMonitorId(-1), currTimeSlice(1000), sliceUpdateTime(0), homeoId(-1), ratePtr(NULL)
493  {}
494 
495  int gGrpId;
496  int gStartN;
497  int gEndN;
498  int netId;
499  int lGrpId;
500  int lStartN;
501  int lEndN;
515  int homeoId;
516  int Noffset;
518 
519  bool operator== (const struct GroupConfigMD_s& grp) {
520  return (gGrpId == grp.gGrpId);
521  }
522 } GroupConfigMD;
523 
532 typedef struct GroupConfigRT_s {
533  int netId;
534  int gGrpId;
535  int gStartN;
536  int gEndN;
537  int lGrpId;
538  int lStartN;
539  int lEndN;
542  unsigned int Type;
543  int numN;
548  bool WithSTP;
549  bool WithSTDP;
550  bool WithDA_MOD; // \todo LN smell
551  // bool WithESTDP; //!< published by GroupConfig \sa GroupConfig
552  // bool WithISTDP; //!< published by GroupConfig \sa GroupConfig
553  // STDPType WithESTDPtype; //!< published by GroupConfig \sa GroupConfig
554  // STDPType WithISTDPtype; //!< published by GroupConfig \sa GroupConfig
555  // STDPCurve WithESTDPcurve; //!< published by GroupConfig \sa GroupConfig
556  // STDPCurve WithISTDPcurve; //!< published by GroupConfig \sa GroupConfig
560  int Noffset;
561  int8_t MaxDelay;
562 
563  float STP_A;
564  float STP_U;
567  // float TAU_PLUS_INV_EXC; //!< published by GroupConfig \sa GroupConfig
568  // float TAU_MINUS_INV_EXC; //!< published by GroupConfig \sa GroupConfig
569  // float ALPHA_PLUS_EXC; //!< published by GroupConfig \sa GroupConfig
570  // float ALPHA_MINUS_EXC; //!< published by GroupConfig \sa GroupConfig
571  // float GAMMA; //!< published by GroupConfig \sa GroupConfig
572  // float KAPPA; //!< published by GroupConfig \sa GroupConfig
573  // float OMEGA; //!< published by GroupConfig \sa GroupConfig
574  // float TAU_PLUS_INV_INB; //!< published by GroupConfig \sa GroupConfig
575  // float TAU_MINUS_INV_INB; //!< published by GroupConfig \sa GroupConfig
576  // float ALPHA_PLUS_INB; //!< published by GroupConfig \sa GroupConfig
577  // float ALPHA_MINUS_INB; //!< published by GroupConfig \sa GroupConfig
578  // float BETA_LTP; //!< published by GroupConfig \sa GroupConfig
579  // float BETA_LTD; //!< published by GroupConfig \sa GroupConfig
580  // float LAMBDA; //!< published by GroupConfig \sa GroupConfig
581  // float DELTA; //!< published by GroupConfig \sa GroupConfig
582 
584  float avgTimeScale;
588 
589  // parameters of neuromodulator
590  float baseDP;
591  float base5HT;
592  float baseACh;
593  float baseNE;
594  float decayDP;
595  float decay5HT;
596  float decayACh;
597  float decayNE;
598  float releaseDP;
599  float release5HT;
600  float releaseACh;
601  float releaseNE;
602  bool activeDP;
603  bool active5HT;
604  bool activeACh;
605  bool activeNE;
606 
608  bool isLIF;
609 
613  int compNeighbors[4];
614  float compCoupling[4];
616 
617 #ifdef LN_I_CALC_TYPES
618  unsigned int icalcType;
621  // flattened struct ConductanceConfig (GroupConfig.conductanceConfig)
622  float dAMPA;
623  float rNMDA;
624  float dNMDA;
625  float sNMDA;
626  float dGABAa;
627  float rGABAb;
628  float dGABAb;
629  float sGABAb;
630  // flattened struct ACNE12Config (GroupConfig.acne12Config)
631  float acne12p1;
632  float acne12p2;
633  // flattened struct NM4wConfig (GroupConfig.nm4wConfig)
634  float nm4w[NM_NE+3];
635 
636  //flattend struct NM4STPConfig (GroupConfig.nm4StpConfig), requires MAX_GRP_PER_SNN << 128
637  bool WithNM4STP;
638  float wstpu[NM_NE + 3];
639  float wstptauu[NM_NE + 3];
640  float wstptaux[NM_NE + 3];
641 
642  //flattend struct NM4STPConfig for MAX_GRP_PER_SNN << 2^16
643  // GPU issue: ptxas error : File uses too much global constant data (0x12140 bytes, 0x10000 max)
644  //NM4STPConfig* nm4stp; //!< Array size = last index + 1 + additional elementsnorm + base
645 
646 #endif
647 
648 #ifdef LN_AXON_PLAST
651 #endif
652 
653 
654 } GroupConfigRT;
655 
656 typedef struct RuntimeData_s {
657  unsigned int spikeCountSec;
658  unsigned int spikeCountD1Sec;
659  unsigned int spikeCountD2Sec;
660  unsigned int spikeCountExtRxD1Sec;
661  unsigned int spikeCountExtRxD2Sec;
662  unsigned int spikeCount;
663  unsigned int spikeCountD1;
664  unsigned int spikeCountD2;
665  unsigned int nPoissonSpikes;
666  unsigned int spikeCountLastSecLeftD2;
667  unsigned int spikeCountExtRxD2;
668  unsigned int spikeCountExtRxD1;
669 
670  float* voltage;
671  float* nextVoltage;
672  float* recovery;
673  float* Izh_C;
674  float* Izh_k;
675  float* Izh_vr;
676  float* Izh_vt;
677  float* Izh_vpeak;
678  float* Izh_a;
679  float* Izh_b;
680  float* Izh_c;
681  float* Izh_d;
682  float* current;
683  float* totalCurrent;
684  float* extCurrent;
685 
686  int* lif_tau_m;
688  int* lif_tau_ref_c; // current refractory of the neuron
689  float* lif_vTh;
690  float* lif_vReset;
691  float* lif_gain;
692  float* lif_bias;
693 
697  bool* curSpike;
698 
699 #define LN_I_CALC_TYPES__REQUIRED_FOR_NETWORK_LEVEL
700  // conductances and stp values
701  float* gNMDA;
702  float* gNMDA_r;
703  float* gNMDA_d;
704  float* gAMPA;
705  float* gGABAa;
706  float* gGABAb;
707  float* gGABAb_r;
708  float* gGABAb_d;
709 
710  int* I_set;
711 
713  bool allocated;
714 
715  /* Tsodyks & Markram (1998), where the short-term dynamics of synapses is characterized by three parameters:
716  U (which roughly models the release probability of a synaptic vesicle for the first spike in a train of spikes),
717  maxDelay_ (time constant for recovery from depression), and F (time constant for recovery from facilitation). */
718  float* stpx;
719  float* stpu;
720 
721  unsigned short* Npre;
722  unsigned short* Npre_plastic;
724  unsigned short* Npost;
725 
728 
729  float* wtChange;
730  float* wt;
731  float* maxSynWt;
732 
733  unsigned int* cumulativePost;
734  unsigned int* cumulativePre;
735 
736  short int* connIdsPreIdx;
737  short int* grpIds;
738 
747 
749  unsigned int* timeTableD1;
750  unsigned int* timeTableD2;
751 
754 
755 #ifdef LN_AXON_PLAST
756  unsigned* firingTimesD2;
757 #endif
758 
761 
764 
766  float* randNum;
767 #ifndef __NO_CUDA__
769  int3* groupIdInfo;
770 #endif
771 
772  int* nSpikeCnt;
773 
775  float* baseFiringInv;
776  float* baseFiring;
777  float* avgFiring;
778 
782  float* grpDA;
783  float* grp5HT;
784  float* grpACh;
785  float* grpNE;
786 
787  // group monitor assistive buffers
788  float* grpDABuffer;
789  float* grp5HTBuffer;
790  float* grpAChBuffer;
791  float* grpNEBuffer;
792 
793  // neuron monitor assistive buffers
794  float* nVBuffer;
795  float* nUBuffer;
796  float* nIBuffer;
797 
798  unsigned int* spikeGenBits;
799 #ifndef __NO_CUDA__
800  curandGenerator_t gpuRandGen;
801 #endif
802 } RuntimeData;
803 
804 typedef struct GlobalNetworkConfig_s {
805  GlobalNetworkConfig_s() : numN(0), numNReg(0), numNPois(0),
806  numNExcReg(0), numNInhReg(0), numNExcPois(0), numNInhPois(0),
807  numSynNet(0), maxDelay(-1), numN1msDelay(0), numN2msDelay(0),
808  simIntegrationMethod(FORWARD_EULER),
809  simNumStepsPerMs(2), timeStep(0.5)
810  {}
811 
812  int numN;
815  int numNReg;
816  int numComp;
819  int numNPois;
820  int numSynNet;
821  int maxDelay;
824 
827  float timeStep;
829 
831 
836 typedef struct NetworkConfigRT_s {
837  // global configuration for maximum axonal delay
838  int maxDelay;
839 
840  // configurations for boundries of neural types
841  int numN;
844  int numNReg;
845  int numComp;
848  int numNPois;
853 
854  // configurations for runtime data sizes
855  unsigned int I_setLength;
856  size_t I_setPitch;
857  size_t STP_Pitch;
862  unsigned int maxSpikesD2;
863  unsigned int maxSpikesD1;
864 
865  // configurations for assigned groups and connections
866  int numGroups;
869  //int numAssignedConnections; //!< number of connections assigned to this local network
870 
871  // configurations for execution features
873 #define LN_I_CALC_TYPES__REQUIRED_FOR_NETWORK_LEVEL
881 
882  // please note that spike monitor and connection monitor don't need this flag because no extra buffer is required
883  // for neuron monitor, the kernel allocates extra buffers to store v, u, i values of each monitored neuron
884  bool sim_with_nm; // simulation with neuron monitor
885 
886  // stdp, da-stdp configurations
889 
890  // conductance configurations
891 #define LN_I_CALC_TYPES__REQUIRED_FOR_NETWORK_LEVEL
894 #ifndef LN_I_CALC_TYPES
895  double dAMPA;
896  double rNMDA;
897  double dNMDA;
898  double sNMDA;
899  double dGABAa;
900  double rGABAb;
901  double dGABAb;
902  double sGABAb;
903 #endif
904 
907  float timeStep;
909 
910 
912 
916 typedef struct RoutingTableEntry_s {
917  RoutingTableEntry_s() : srcNetId(-1), destNetId(-1) {}
918 
919  RoutingTableEntry_s(int srcNetId_, int destNetId_) : srcNetId(srcNetId_), destNetId(destNetId_) {}
920 
921  int srcNetId;
923 
924  bool operator== (const struct RoutingTableEntry_s& rte) const {
925  return (srcNetId == rte.srcNetId && destNetId == rte.destNetId);
926  }
928 
929 
931 
937 typedef struct ThreadStruct_s {
938  void* snn_pointer;
939  int netId;
940  int lGrpId;
941  int startIdx;
942  int endIdx;
944 } ThreadStruct;
945 
946 #endif
struct ConnectConfigRT_s ConnectConfigRT
The runtime configuration of a connection.
float * maxSynWt
maximum synaptic weight for a connection
float * voltage
membrane potential for each regular neuron
Class for generating Poisson spike trains.
Definition: poisson_rate.h:88
bool WithDA_MOD
True if at least one connection group is WithDA_MOD.
struct ConductanceConfig_s ConductanceConfig
ACh,NE configurations (ANCK12, K12,K13,..)
float rGABAb
multiplication factor for rise time of GABAb
struct NM4STPConfig_s NM4STPConfig
float * randNum
firing random number. max value is 10,000
float ALPHA_MINUS_EXC
published by GroupConfig
float mulSynFast
factor to be applied to either gAMPA or gGABAa
float p1
sample param 1 for ACh
int numNSpikeGen
number of poisson neurons generating spikes based on callback functions
int * synSpikeTime
stores the last spike time of a synapse
float decayNE
decay rate for Noradrenaline, published by GroupConfig
SNNState
the state of spiking neural network, used with in kernel.
int NM_PLC
published by GroupConfig
float p2
sample param 2 for NE
STDPCurve WithISTDPcurve
published by GroupConfig
struct ConnectConfigMD_s ConnectConfigMD
the intermediate data of connect config
float KAPPA
published by GroupConfig
float sNMDA
scaling factor for NMDA amplitude
IcalcType icalcType
conduction of receptor determined by connection
int numNExcReg
number of regular excitatory neurons
int numNAssigned
number of total neurons assigned to the local network
bool WithSTDP
True if at least one connection group is WithSTDP.
struct RoutingTableEntry_s RoutingTableEntry
runtime spike routing table entry
struct NM4wConfig_s NM4wConfig
int numNPois
number of poisson neurons
float LAMBDA
published by GroupConfig
int numPreSynNet
the total number of pre-connections in a network
int GtoLOffset
published by GroupConfigMD
float W_PLC
published by GroupConfig
float timeStep
inverse of simNumStepsPerMs
float homeostasisScale
published by GroupConfig
float dAMPA
multiplication factor for decay time of AMPA conductance (gAMPA[i] *= dAMPA)
unsigned int * timeTableD1
firing table, only used in CPU_MODE currently
int * nSpikeCnt
homeostatic plasticity variables
float rGABAb
multiplication factor for rise time of GABAb
int numNRateGen
number of poisson neurons generating spikes based on firing rate
float * baseFiringInv
only used on GPU
struct STDPConfig_s STDPConfig
short-term plasiticity configurations
unsigned int spikeCountD1Sec
the total number of spikes with axonal delay == 1 in 1 second, used in CPU_MODE currently ...
unsigned int spikeCountD1
the total number of spikes with anxonal delay == 1 in a simulation, used in CPU_MODE currently ...
struct STPConfig_s STPConfig
homeostatic plasticity configurations
int numN2msDelay
number of neurons with maximum out going axonal delay >= 2 ms
unsigned int spikeCountExtRxD2
the number of external spikes with axonal delay > 1 in a simulation, used in CPU_MODE currently ...
float DELTA
published by GroupConfig
ACNE12Config acneConfig
ACNE config at group level.
struct GlobalNetworkConfig_s GlobalNetworkConfig
bool activeACh
flag for Acetylcholine
float GAMMA
published by GroupConfig
float baseACh
baseline concentration of Acetylcholine
bool allocated
true if all data has been allocated
float decayDP
decay rate for Dopaamine, published by GroupConfig
runtime data is allocated on CPU (main) memory
float TAU_PLUS_INV_INB
published by GroupConfig
float * gAMPA
conductance of gAMPA
float acne12p2
sample param 2 for ACNE15
struct HomeostasisConfig_s HomeostasisConfig
neuromodulator configurations
float decayACh
decay rate for Acetylcholine
int numSynNet
number of total synaptic connections in the global network
struct NetworkConfigRT_s NetworkConfigRT
runtime network configuration
int * lif_tau_m
parameters for a LIF spiking group
unsigned int * cumulativePre
int maxDelay
maximum axonal delay in the gloabl network
bool activeNE
flag for Noradrenaline
bool isLIF
True = a LIF spiking group.
unsigned * firingTimesD2
stores the actual firing time
float * Npre_plasticInv
stores the 1/number of plastic input connections, only used on GPU
unsigned int spikeCountD2
the total number of spikes with anxonal delay > 1 in a simulation, used in CPU_MODE currently ...
float * mulSynFast
factor to be applied to either gAMPA or gGABAa
int numN
number of neurons in th local network
int gEndN
published by GroupConfigMD
unknown curve type
short int connId
connectID of the element in the linked list
STDPCurve WithISTDPcurve
float sNMDA
scaling factor for NMDA amplitude
int currTimeSlice
timeSlice is used by the Poisson generators in order to not generate too many or too few spikes withi...
integrationMethod_t simIntegrationMethod
integration method (forward-Euler or Fourth-order Runge-Kutta)
float ALPHA_PLUS_EXC
published by GroupConfig
STDPType
STDP flavors.
float dGABAb
multiplication factor for decay time of GABAb
float ALPHA_MINUS_INB
published by GroupConfig
int numN
published by GroupConfig
float decay5HT
decay rate for Serotonin, published by GroupConfig
float * wt
stores the weight change of a synaptic connection
struct GroupConfigRT_s GroupConfigRT
The runtime configuration of a group.
used for relaying callback to ConnectionGenerator
Definition: callback_core.h:91
MemType
type of memory pointer
float baseNE
baseline concentration of Noradrenaline, published by GroupConfig
int numPreSynapses
the total number of pre-connections of a group, published by GroupConfigMD
int netId
published by GroupConfigMD
The configuration of a connection.
int NM_PKA
published by GroupConfig
int ** extFiringTableD1
external firing table, only used on GPU
float dNMDA
multiplication factor for decay time of NMDA
bool isSpikeGenerator
published by GroupConfig
NM4wConfig nm4wConfig
NM4 config at group level.
float releaseDP
release per spike for Dopaamine
runtime data is allocated on GPU memory
int numNExcPois
number of excitatory poisson neurons
bool active5HT
flag for Serotonin
unsigned short * Npre_plastic
stores the number of plastic input connections to a neuron
int gGrpId
published by GroupConfigMD
struct NeuralDynamicsConfig_s NeuralDynamicsConfig
float sGABAb
scaling factor for GABAb amplitude
bool hasExternalConnect
published by GroupConfigMD
struct SynInfo_s SynInfo
long-term plasiticity configurations
int numPostSynapses
the total number of post-connections of a group, published by GroupConfigMD
unsigned int spikeCountLastSecLeftD2
the nubmer of spike left in the last second, used in CPU_MODE currently
STDPCurve
STDP curves.
A struct to arrange neurons on a 3D grid (a primitive cubic Bravais lattice with cubic side length 1)...
int simNumStepsPerMs
number of steps per 1 millisecond
bool WithSTDP
published by GroupConfig
float decayDP
decay rate for Dopamine
float dGABAb
multiplication factor for decay time of GABAb
bool isSpikeGenFunc
published by GroupConfig
float BETA_LTP
published by GroupConfig
float baseDP
baseline concentration of Dopamine, published by GroupConfig
int lGrpId
published by GroupConfigMD
used for relaying callback to SpikeGenerator
Definition: callback_core.h:71
int numN1msDelay
number of neurons with maximum out going axonal delay = 1 ms
float decayACh
decay rate for Acetylcholine, published by GroupConfig
float rNMDA
multiplication factor for rise time of NMDA
struct DelayInfo_s DelayInfo
int maxDelay
maximum axonal delay in the gloabl network
short int * connIdsPreIdx
connectId, per synapse, presynaptic cumulative indexing
unsigned int spikeCount
the total number of spikes in a simulation, used in CPU_MODE currently
struct ConnectionInfo_s ConnectionInfo
float mulSynSlow
factor to be applied to either gNMDA or gGABAb
int * I_set
an array of bits indicating which synapse got a spike
struct compConnectConfig_s compConnectConfig
The configuration of a compartmental connection.
bool WithNM4STP
if group has targeted STP
int numNPois
number of poisson neurons in the global network
The configuration of a compartmental connection.
float OMEGA
published by GroupConfig
bool withParamModel_9
False = 4 parameter model; 1 = 9 parameter model.
bool with_GABAb_rise
replaces sim_with_GABAb_rise
unsigned short * Npost
stores the number of output connections from a neuron.
unsigned int spikeCountExtRxD1Sec
curandGenerator_t gpuRandGen
float acne12p1
sample param 1 for ACNE15
int numNExcPois
number of excitatory poisson neurons in the global network
size_t I_setPitch
used for GPU only
int8_t MaxDelay
published by GroupConfigMD
bool withParamModel_9
False = 4 parameter model; 1 = 9 parameter model.
float avgTimeScaleInv
published by GroupConfig
bool WithSTDP
published by GroupConfig
int Noffset
the offset of spike generator (poisson) neurons [0, numNPois)
NeuralDynamicsConfig neuralDynamicsConfig
unsigned int Type
published by GroupConfig
the intermediate data of connect config
unsigned int spikeCountExtRxD2Sec
bool WithHomeostasis
published by GroupConfig
struct compConnectionInfo_s compConnectionInfo
IcalcType icalcType
calculation of input current is defined at group level and replaces the COBA/CUBA flags ...
float base5HT
baseline concentration of Serotonin, published by GroupConfig
IcalcType icalcType
published by GroupConfig
conType_t
connection types, used internally (externally it&#39;s a string)
float connProbability
connection probability
float releaseDP
release per spike for Dopaamine
struct ACNE12Config_s ACNE12Config
IcalcType
input current calculation
int * lastSpikeTime
stores the last spike time of a neuron
float * gGABAa
conductance of gGABAa
SynInfo * preSynapticIds
STDPType WithISTDPtype
published by GroupConfig
unsigned int spikeCountD2Sec
the total number of spikes with axonal delay > 1 in 1 second, used in CPU_MODE currently ...
float releaseACh
release per spike for Acetylcholine
struct GroupConfigMD_s GroupConfigMD
The runtime configuration of a connection.
unsigned short * Npre
stores the number of input connections to a neuron
float * mulSynSlow
factor to be applied to either gNMDA or gGABAb
integrationMethod_t
Integration methods.
int maxNumPreSynN
the maximum number of pre-syanptic connections among neurons
float wtChangeDecay
the wtChange decay
PoissonRate * ratePtr
float dGABAa
multiplication factor for decay time of GABAa
int Noffset
the offset of spike generator (poisson) neurons [0, numNPois), published by GroupConfigMD ...
RoutingTableEntry_s(int srcNetId_, int destNetId_)
float TAU_MINUS_INV_INB
published by GroupConfig
unsigned int spikeCountExtRxD1
the number of external spikes with axonal delay == 1 in a simulation, used in CPU_MODE currently ...
STDPType WithESTDPtype
float dAMPA
multiplication factor for decay time of AMPA conductance (gAMPA[i] *= dAMPA)
int3 * groupIdInfo
.x , .y: the start and end index of neurons in a group, .z: gourd id, used for group Id calculations ...
The configuration of a group.
int gsId
group id and synapse id
bool sim_with_GABAb_rise
a flag to inform whether to compute GABAb rise time
int nId
neuron id
bool activeDP
flag for Dopaamine
The runtime configuration of a group.
unsigned int * timeTableD2
firing table, only used in CPU_MODE currently
int numNReg
number of regular (spking) neurons
NM4STPConfig nm4StpConfig
NM4 weighted STP param.
bool activeDP
flag for Dopaamine
STDPCurve WithESTDPcurve
bool with_NMDA_rise
replaces sim_with_NMDA_rise
float baseDP
baseline concentration of Dopamine
float decayNE
decay rate for Noradrenaline
float avgTimeScale_decay
published by GroupConfig
int numNInhReg
number of regular inhibitory neurons in the global network
int numN
number of neurons in the global network
int lEndN
published by GroupConfigMD
float * gGABAb
conductance of gGABAb
struct ThreadStruct_s ThreadStruct
CPU multithreading subroutine (that takes single argument) struct argument.
DelayInfo * postDelayInfo
delay information
size_t STP_Pitch
numN rounded upwards to the nearest 256 boundary, used for GPU only
float baseACh
baseline concentration of Acetylcholine, published by GroupConfig
int numNInhPois
number of inhibitory poisson neurons in the global network
int ** extFiringTableD2
external firing table, only used on GPU
int numGroups
number of local groups in this local network
integrationMethod_t simIntegrationMethod
integration method (forward-Euler or Fourth-order Runge-Kutta)
int LtoGOffset
published by GroupConfigMD
float STP_A
published by GroupConfig
bool WithISTDP
published by GroupConfig
float STP_U
published by GroupConfig
int numNExcReg
number of regular excitatory neurons in the global network
float BETA_LTD
published by GroupConfig
bool with_GABAb_rise
replaces sim_with_GABAb_rise
float STP_tau_x_inv
published by GroupConfig
float TAU_PLUS_INV_EXC
published by GroupConfig
SynInfo * postSynapticIds
10 bit syn id, 22 bit neuron id, ordered based on delay
int lStartN
published by GroupConfigMD
int numNExternal
number of external neurons in the view of the local network
unsigned int * cumulativePost
int numConnections
number of local connections in this local network
bool activeACh
flag for Acetylcholine
unsigned int maxSpikesD2
the estimated maximum number of spikes with delay >= 2 in a network
NeuromodulatorConfig neuromodulatorConfig
int numComp
number of compartmental neurons
used to initialize by default constructor
float baseNE
baseline concentration of Noradrenaline
struct NeuromodulatorConfig_s NeuromodulatorConfig
conductance configurations
struct GroupConfig_s GroupConfig
The configuration of a group.
int maxNumPostSynN
the maximum number of post-synaptic connections among neurons
int numPostSynNet
the total number of post-connections in a network
int numNInhPois
number of inhibitory poisson neurons
runtime spike routing table entry
struct ConnectConfig_s ConnectConfig
The configuration of a connection.
unsigned int type
unsigned int * spikeGenBits
CPU multithreading subroutine (that takes single argument) struct argument.
float base5HT
baseline concentration of Serotonin
short int * grpIds
int simNumStepsPerMs
number of steps per 1 millisecond
bool with_NMDA_rise
replaces sim_with_NMDA_rise
int numGroupsAssigned
number of groups assigned to this local network
int gStartN
published by GroupConfigMD
int numComp
number of compartmental neurons
unsigned int icalcType
float releaseNE
release per spike for Noradrenaline
ConductanceConfig conductanceConfig
conductance config at group level
float TAU_MINUS_INV_EXC
published by GroupConfig
HomeostasisConfig homeoConfig
runtime network configuration
int numNReg
number of regular (spking) neurons in the global network
std::string grpName
int lif_tau_m
parameters for a LIF spiking group
float avgTimeScale
< homeostatic plasticity variables
float releaseACh
release per spike for Acetylcholine
bool WithSTP
published by GroupConfig
STDPType WithISTDPtype
bool active5HT
flag for Serotonin
unsigned int spikeCountSec
the total number of spikes in 1 second, used in CPU_MODE currently
SpikeGeneratorCore * spikeGenFunc
float dGABAa
multiplication factor for decay time of GABAa
float * gNMDA
conductance of gNMDA
float sGABAb
scaling factor for GABAb amplitude
bool FixedInputWts
published by GroupConfigMD
ConnectionGeneratorCore * conn
bool activeNE
flag for Noradrenaline
float STP_tau_u_inv
published by GroupConfig
unsigned int nPoissonSpikes
the total number of spikes of poisson neurons, used in CPU_MODE currently
STDPCurve WithESTDPcurve
published by GroupConfig
bool WithESTDP
published by GroupConfig
bool sim_with_NMDA_rise
a flag to inform whether to compute NMDA rise time
unsigned int maxSpikesD1
the estimated maximum number of spikes with delay == 1 in a network
float decay5HT
decay rate for Serotonin
float * wtChange
stores the weight change of a synaptic connection
float releaseNE
release per spike for Noradrenaline
STDPType WithESTDPtype
published by GroupConfig
unsigned int I_setLength
used for GPU only
float release5HT
release per spike for Serotonin
float ALPHA_PLUS_INB
published by GroupConfig
float rNMDA
multiplication factor for rise time of NMDA
float * nextVoltage
membrane potential buffer (next/future time step) for each regular neuron
struct RuntimeData_s RuntimeData
int numNInhReg
number of regular inhibitory neurons
float release5HT
release per spike for Serotonin
float W_PKA
published by GroupConfig
int2 * neuronAllocation
.x: [31:0] index of the first neuron, .y: [31:16] number of neurons, [15:0] group id ...
float dNMDA
multiplication factor for decay time of NMDA
A struct to specify the receptive field (RF) radius in 3 dimensions.
float timeStep
inverse of simNumStepsPerMs