53 void SNN::printStatusConnectionMonitor(
int connId) {
54 for (
int monId=0; monId<numConnectionMonitor; monId++) {
63 void SNN::printStatusSpikeMonitor(
int gGrpId) {
65 for (
int g = 0; g < numGroups; g++) {
66 printStatusSpikeMonitor(g);
69 int netId = groupConfigMDMap[gGrpId].netId;
70 int lGrpId = groupConfigMDMap[gGrpId].lGrpId;
71 int monitorId = groupConfigMDMap[gGrpId].spikeMonitorId;
73 if (monitorId == -1)
return;
76 fetchNeuronSpikeCount(gGrpId);
82 for (
int gNId = groupConfigMDMap[gGrpId].gStartN; gNId <= groupConfigMDMap[gGrpId].gEndN; gNId++)
83 grpSpk += managerRuntimeData.
nSpikeCnt[gNId];
86 int runDurationMs = simTime - simTimeLastRunSummary;
88 if (simTime <= simTimeLastRunSummary) {
89 KERNEL_INFO(
"(t=%.3fs) SpikeMonitor for group %s(%d) has %d spikes in %dms (%.2f +/- %.2f Hz)",
90 (
float)(simTime / 1000.0f),
91 groupConfigMap[gGrpId].grpName.c_str(),
99 float meanRate = grpSpk * 1000.0f / runDurationMs / groupConfigMap[gGrpId].numN;
101 if (groupConfigMap[gGrpId].numN > 1) {
102 for (
int gNId = groupConfigMDMap[gGrpId].gStartN; gNId <= groupConfigMDMap[gGrpId].gEndN; gNId++) {
103 float neurRate = managerRuntimeData.
nSpikeCnt[gNId] * 1000.0f / runDurationMs;
104 std += (neurRate - meanRate) * (neurRate - meanRate);
106 std = sqrt(std / (groupConfigs[netId][lGrpId].numN - 1.0));
109 KERNEL_INFO(
"(t=%.3fs) SpikeMonitor for group %s(%d) has %d spikes in %ums (%.2f +/- %.2f Hz)",
111 groupConfigMap[gGrpId].grpName.c_str(),
121 void SNN::printStatusGroupMonitor(
int gGrpId) {
123 for (
int g = 0; g < numGroups; g++) {
124 printStatusGroupMonitor(g);
127 int netId = groupConfigMDMap[gGrpId].netId;
128 int lGrpId = groupConfigMDMap[gGrpId].lGrpId;
129 int monitorId = groupConfigMDMap[gGrpId].groupMonitorId;
131 if (monitorId == -1)
return;
133 std::vector<int> peakTimeVector = groupMonCoreList[monitorId]->
getPeakTimeVector();
134 int numPeaks = peakTimeVector.size();
137 int runDurationMs = simTime - simTimeLastRunSummary;
139 if (simTime <= simTimeLastRunSummary) {
140 KERNEL_INFO(
"(t=%.3fs) GroupMonitor for group %s(%d) has %d peak(s) in %dms",
142 groupConfigMap[gGrpId].grpName.c_str(),
148 KERNEL_INFO(
"(t=%.3fs) GroupMonitor for group %s(%d) has %d peak(s) in %ums",
150 groupConfigMap[gGrpId].grpName.c_str(),
159 void SNN::printConnectionInfo(
short int connId) {
162 KERNEL_INFO(
"Connection ID %d: %s(%d) => %s(%d)", connId, groupConfigMap[connConfig.
grpSrc].grpName.c_str(),
176 KERNEL_INFO(
" - Avg numPreSynapses = %8.2f", avgPreM );
177 KERNEL_INFO(
" - Avg numPostSynapses = %8.2f", avgPostM );
181 void SNN::printConnectionInfo(
int netId, std::list<ConnectConfig>::iterator connIt) {
183 KERNEL_INFO(
" |-+ %s Connection Id %d: %s(%d) => %s(%d)", netId == groupConfigMDMap[connIt->grpDest].netId ?
"Local" :
"External", connIt->connId,
184 groupConfigMap[connIt->grpSrc].grpName.c_str(), connIt->grpSrc,
185 groupConfigMap[connIt->grpDest].grpName.c_str(), connIt->grpDest);
188 KERNEL_INFO(
" |- Max weight = %8.5f", fabs(connIt->maxWt));
189 KERNEL_INFO(
" |- Initial weight = %8.5f", fabs(connIt->initWt));
190 KERNEL_INFO(
" |- Min delay = %8d", connIt->minDelay);
191 KERNEL_INFO(
" |- Max delay = %8d", connIt->maxDelay);
192 KERNEL_INFO(
" |- Radius X = %8.2f", connIt->connRadius.radX);
193 KERNEL_INFO(
" |- Radius Y = %8.2f", connIt->connRadius.radY);
194 KERNEL_INFO(
" |- Radius Z = %8.2f", connIt->connRadius.radZ);
195 KERNEL_INFO(
" |- Num of synapses = %d", connIt->numberOfConnections);
196 float avgPostM = ((float)connIt->numberOfConnections)/groupConfigMap[connIt->grpSrc].numN;
197 float avgPreM = ((float)connIt->numberOfConnections)/groupConfigMap[connIt->grpDest].numN;
198 KERNEL_INFO(
" |- Avg numPreSynapses = %8.2f", avgPreM );
199 KERNEL_INFO(
" |- Avg numPostSynapses = %8.2f", avgPostM );
202 void SNN::printGroupInfo(
int gGrpId) {
203 KERNEL_INFO(
"Group %s(%d): ", groupConfigMap[gGrpId].grpName.c_str(), gGrpId);
207 KERNEL_INFO(
" - Size = %8d", groupConfigMap[gGrpId].numN);
208 KERNEL_INFO(
" - Start Id = %8d", groupConfigMDMap[gGrpId].gStartN);
209 KERNEL_INFO(
" - End Id = %8d", groupConfigMDMap[gGrpId].gEndN);
210 KERNEL_INFO(
" - numPostSynapses = %8d", groupConfigMDMap[gGrpId].numPostSynapses);
211 KERNEL_INFO(
" - numPreSynapses = %8d", groupConfigMDMap[gGrpId].numPreSynapses);
214 KERNEL_INFO(
" - Avg post connections = %8.5f", ((
float)groupConfigMDMap[gGrpId].numPostSynapses)/groupConfigMap[gGrpId].numN);
215 KERNEL_INFO(
" - Avg pre connections = %8.5f", ((
float)groupConfigMDMap[gGrpId].numPreSynapses )/groupConfigMap[gGrpId].numN);
219 KERNEL_INFO(
" - Refractory period = %8.5f", groupConfigMDMap[gGrpId].refractPeriod);
222 if (groupConfigMap[gGrpId].stpConfig.WithSTP) {
224 KERNEL_INFO(
" - STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
225 KERNEL_INFO(
" - STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
226 KERNEL_INFO(
" - STP_tau_u = %8d", (
int) (1.0f/groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
227 KERNEL_INFO(
" - STP_tau_x = %8d", (
int) (1.0f/groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
230 if(groupConfigMap[gGrpId].stdpConfig.WithSTDP) {
233 (groupConfigMap[gGrpId].stdpConfig.WithESTDPtype ==
DA_MOD ? "
DA_MOD" : " UNKNOWN"));
235 (groupConfigMap[gGrpId].stdpConfig.WithISTDPtype ==
DA_MOD?"
DA_MOD":" UNKNOWN"));
236 KERNEL_INFO(" - ALPHA_PLUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_PLUS_EXC);
237 KERNEL_INFO(" - ALPHA_MINUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_MINUS_EXC);
238 KERNEL_INFO(" - TAU_PLUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_PLUS_INV_EXC);
239 KERNEL_INFO(" - TAU_MINUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_MINUS_INV_EXC);
240 KERNEL_INFO(" - BETA_LTP = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTP);
241 KERNEL_INFO(" - BETA_LTD = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTD);
242 KERNEL_INFO(" - LAMBDA = %8.5f", groupConfigMap[gGrpId].stdpConfig.LAMBDA);
243 KERNEL_INFO(" - DELTA = %8.5f", groupConfigMap[gGrpId].stdpConfig.DELTA);
247 void SNN::printGroupInfo(
int netId, std::list<
GroupConfigMD>::iterator grpIt) {
248 int gGrpId = grpIt->gGrpId;
249 KERNEL_INFO(
" |-+ %s Group %s(G:%d,L:%d): ", netId == grpIt->netId ?
"Local" :
"External", groupConfigMap[grpIt->gGrpId].grpName.c_str(), grpIt->gGrpId, grpIt->lGrpId);
253 KERNEL_INFO(
" |- Num of Neurons = %8d", groupConfigMap[grpIt->gGrpId].numN);
254 KERNEL_INFO(
" |- Start Id = (G:%d,L:%d)", grpIt->gStartN, grpIt->lStartN);
255 KERNEL_INFO(
" |- End Id = (G:%d,L:%d)", grpIt->gEndN, grpIt->lEndN);
256 KERNEL_INFO(
" |- numPostSynapses = %8d", grpIt->numPostSynapses);
257 KERNEL_INFO(
" |- numPreSynapses = %8d", grpIt->numPreSynapses);
260 KERNEL_INFO(
" |- Avg post connections = %8.5f", ((
float)grpIt->numPostSynapses) / groupConfigMap[gGrpId].numN);
261 KERNEL_INFO(
" |- Avg pre connections = %8.5f", ((
float)grpIt->numPreSynapses) / groupConfigMap[gGrpId].numN);
265 KERNEL_INFO(
" |- Refractory period = %8.5f", grpIt->refractPeriod);
268 if (groupConfigMap[gGrpId].stpConfig.WithSTP) {
270 KERNEL_INFO(
" |- STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
271 KERNEL_INFO(
" |- STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
272 KERNEL_INFO(
" |- STP_tau_u = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
273 KERNEL_INFO(
" |- STP_tau_x = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
276 if (groupConfigMap[gGrpId].stdpConfig.WithSTDP) {
279 (groupConfigMap[gGrpId].stdpConfig.WithESTDPtype ==
DA_MOD ? "
DA_MOD" : " UNKNOWN"));
281 (groupConfigMap[gGrpId].stdpConfig.WithISTDPtype ==
DA_MOD ? "
DA_MOD" : " UNKNOWN"));
282 KERNEL_INFO(" |- ALPHA_PLUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_PLUS_EXC);
283 KERNEL_INFO(" |- ALPHA_MINUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_MINUS_EXC);
284 KERNEL_INFO(" |- TAU_PLUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_PLUS_INV_EXC);
285 KERNEL_INFO(" |- TAU_MINUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_MINUS_INV_EXC);
286 KERNEL_INFO(" |- BETA_LTP = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTP);
287 KERNEL_INFO(" |- BETA_LTD = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTD);
288 KERNEL_INFO(" |- LAMBDA = %8.5f", groupConfigMap[gGrpId].stdpConfig.LAMBDA);
289 KERNEL_INFO(" |- DELTA = %8.5f", groupConfigMap[gGrpId].stdpConfig.DELTA);
293 void SNN::printSikeRoutingInfo() {
294 if (!spikeRoutingTable.empty()) {
295 KERNEL_INFO(
"***************** Spike Routing Table *************************");
296 for (std::list<RoutingTableEntry>::iterator rteItr = spikeRoutingTable.begin(); rteItr != spikeRoutingTable.end(); rteItr++)
297 KERNEL_INFO(
" |-Source net:[%d] -> Destination net[%d]", rteItr->srcNetId, rteItr->destNetId);