54 void SNN::printStatusConnectionMonitor(
int connId) {
55 for (
int monId=0; monId<numConnectionMonitor; monId++) {
64 void SNN::printStatusSpikeMonitor(
int gGrpId) {
66 for (
int g = 0; g < numGroups; g++) {
67 printStatusSpikeMonitor(g);
70 int netId = groupConfigMDMap[gGrpId].netId;
71 int lGrpId = groupConfigMDMap[gGrpId].lGrpId;
72 int monitorId = groupConfigMDMap[gGrpId].spikeMonitorId;
74 if (monitorId == -1)
return;
77 fetchNeuronSpikeCount(gGrpId);
83 for (
int gNId = groupConfigMDMap[gGrpId].gStartN; gNId <= groupConfigMDMap[gGrpId].gEndN; gNId++)
84 grpSpk += managerRuntimeData.
nSpikeCnt[gNId];
87 int runDurationMs = simTime - simTimeLastRunSummary;
89 if (simTime <= simTimeLastRunSummary) {
90 KERNEL_INFO(
"(t=%.3fs) SpikeMonitor for group %s(%d) has %d spikes in %dms (%.2f +/- %.2f Hz)",
91 (
float)(simTime / 1000.0f),
92 groupConfigMap[gGrpId].grpName.c_str(),
100 float meanRate = grpSpk * 1000.0f / runDurationMs / groupConfigMap[gGrpId].numN;
102 if (groupConfigMap[gGrpId].numN > 1) {
103 for (
int gNId = groupConfigMDMap[gGrpId].gStartN; gNId <= groupConfigMDMap[gGrpId].gEndN; gNId++) {
104 float neurRate = managerRuntimeData.
nSpikeCnt[gNId] * 1000.0f / runDurationMs;
105 std += (neurRate - meanRate) * (neurRate - meanRate);
107 std = sqrt(std / (groupConfigs[netId][lGrpId].numN - 1.0));
110 KERNEL_INFO(
"(t=%.3fs) SpikeMonitor for group %s(%d) has %d spikes in %ums (%.2f +/- %.2f Hz)",
112 groupConfigMap[gGrpId].grpName.c_str(),
122 void SNN::printStatusGroupMonitor(
int gGrpId) {
124 for (
int g = 0; g < numGroups; g++) {
125 printStatusGroupMonitor(g);
128 int netId = groupConfigMDMap[gGrpId].netId;
129 int lGrpId = groupConfigMDMap[gGrpId].lGrpId;
130 int monitorId = groupConfigMDMap[gGrpId].groupMonitorId;
132 if (monitorId == -1)
return;
134 std::vector<int> peakTimeVector = groupMonCoreList[monitorId]->
getPeakTimeVector();
135 int numPeaks = peakTimeVector.size();
138 int runDurationMs = simTime - simTimeLastRunSummary;
140 if (simTime <= simTimeLastRunSummary) {
141 KERNEL_INFO(
"(t=%.3fs) GroupMonitor for group %s(%d) has %d peak(s) in %dms",
143 groupConfigMap[gGrpId].grpName.c_str(),
149 KERNEL_INFO(
"(t=%.3fs) GroupMonitor for group %s(%d) has %d peak(s) in %ums",
151 groupConfigMap[gGrpId].grpName.c_str(),
160 void SNN::printConnectionInfo(
short int connId) {
163 KERNEL_INFO(
"Connection ID %d: %s(%d) => %s(%d)", connId, groupConfigMap[connConfig.
grpSrc].grpName.c_str(),
177 KERNEL_INFO(
" - Avg numPreSynapses = %8.2f", avgPreM );
178 KERNEL_INFO(
" - Avg numPostSynapses = %8.2f", avgPostM );
182 void SNN::printConnectionInfo(
int netId, std::list<ConnectConfig>::iterator connIt) {
184 KERNEL_INFO(
" |-+ %s Connection Id %d: %s(%d) => %s(%d)", netId == groupConfigMDMap[connIt->grpDest].netId ?
"Local" :
"External", connIt->connId,
185 groupConfigMap[connIt->grpSrc].grpName.c_str(), connIt->grpSrc,
186 groupConfigMap[connIt->grpDest].grpName.c_str(), connIt->grpDest);
189 KERNEL_INFO(
" |- Max weight = %8.5f", fabs(connIt->maxWt));
190 KERNEL_INFO(
" |- Initial weight = %8.5f", fabs(connIt->initWt));
191 KERNEL_INFO(
" |- Min delay = %8d", connIt->minDelay);
192 KERNEL_INFO(
" |- Max delay = %8d", connIt->maxDelay);
193 KERNEL_INFO(
" |- Radius X = %8.2f", connIt->connRadius.radX);
194 KERNEL_INFO(
" |- Radius Y = %8.2f", connIt->connRadius.radY);
195 KERNEL_INFO(
" |- Radius Z = %8.2f", connIt->connRadius.radZ);
196 KERNEL_INFO(
" |- Num of synapses = %d", connIt->numberOfConnections);
197 float avgPostM = ((float)connIt->numberOfConnections)/groupConfigMap[connIt->grpSrc].numN;
198 float avgPreM = ((float)connIt->numberOfConnections)/groupConfigMap[connIt->grpDest].numN;
199 KERNEL_INFO(
" |- Avg numPreSynapses = %8.2f", avgPreM );
200 KERNEL_INFO(
" |- Avg numPostSynapses = %8.2f", avgPostM );
203 void SNN::printGroupInfo(
int gGrpId) {
204 KERNEL_INFO(
"Group %s(%d): ", groupConfigMap[gGrpId].grpName.c_str(), gGrpId);
208 KERNEL_INFO(
" - Size = %8d", groupConfigMap[gGrpId].numN);
209 KERNEL_INFO(
" - Start Id = %8d", groupConfigMDMap[gGrpId].gStartN);
210 KERNEL_INFO(
" - End Id = %8d", groupConfigMDMap[gGrpId].gEndN);
211 KERNEL_INFO(
" - numPostSynapses = %8d", groupConfigMDMap[gGrpId].numPostSynapses);
212 KERNEL_INFO(
" - numPreSynapses = %8d", groupConfigMDMap[gGrpId].numPreSynapses);
215 KERNEL_INFO(
" - Avg post connections = %8.5f", ((
float)groupConfigMDMap[gGrpId].numPostSynapses)/groupConfigMap[gGrpId].numN);
216 KERNEL_INFO(
" - Avg pre connections = %8.5f", ((
float)groupConfigMDMap[gGrpId].numPreSynapses )/groupConfigMap[gGrpId].numN);
220 KERNEL_INFO(
" - Refractory period = %8.5f", groupConfigMDMap[gGrpId].refractPeriod);
223 if (groupConfigMap[gGrpId].stpConfig.WithSTP) {
225 KERNEL_INFO(
" - STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
226 KERNEL_INFO(
" - STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
227 KERNEL_INFO(
" - STP_tau_u = %8d", (
int) (1.0f/groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
228 KERNEL_INFO(
" - STP_tau_x = %8d", (
int) (1.0f/groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
231 if(groupConfigMap[gGrpId].stdpConfig.WithSTDP) {
234 (groupConfigMap[gGrpId].stdpConfig.WithESTDPtype ==
DA_MOD ? "
DA_MOD" : " UNKNOWN"));
236 (groupConfigMap[gGrpId].stdpConfig.WithISTDPtype ==
DA_MOD?"
DA_MOD":" UNKNOWN"));
237 KERNEL_INFO(" - ALPHA_PLUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_PLUS_EXC);
238 KERNEL_INFO(" - ALPHA_MINUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_MINUS_EXC);
239 KERNEL_INFO(" - TAU_PLUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_PLUS_INV_EXC);
240 KERNEL_INFO(" - TAU_MINUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_MINUS_INV_EXC);
241 KERNEL_INFO(" - BETA_LTP = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTP);
242 KERNEL_INFO(" - BETA_LTD = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTD);
243 KERNEL_INFO(" - LAMBDA = %8.5f", groupConfigMap[gGrpId].stdpConfig.LAMBDA);
244 KERNEL_INFO(" - DELTA = %8.5f", groupConfigMap[gGrpId].stdpConfig.DELTA);
248 void SNN::printGroupInfo(
int netId, std::list<
GroupConfigMD>::iterator grpIt) {
249 int gGrpId = grpIt->gGrpId;
250 KERNEL_INFO(
" |-+ %s Group %s(G:%d,L:%d): ", netId == grpIt->netId ?
"Local" :
"External", groupConfigMap[grpIt->gGrpId].grpName.c_str(), grpIt->gGrpId, grpIt->lGrpId);
254 KERNEL_INFO(
" |- Num of Neurons = %8d", groupConfigMap[grpIt->gGrpId].numN);
255 KERNEL_INFO(
" |- Start Id = (G:%d,L:%d)", grpIt->gStartN, grpIt->lStartN);
256 KERNEL_INFO(
" |- End Id = (G:%d,L:%d)", grpIt->gEndN, grpIt->lEndN);
257 KERNEL_INFO(
" |- numPostSynapses = %8d", grpIt->numPostSynapses);
258 KERNEL_INFO(
" |- numPreSynapses = %8d", grpIt->numPreSynapses);
261 KERNEL_INFO(
" |- Avg post connections = %8.5f", ((
float)grpIt->numPostSynapses) / groupConfigMap[gGrpId].numN);
262 KERNEL_INFO(
" |- Avg pre connections = %8.5f", ((
float)grpIt->numPreSynapses) / groupConfigMap[gGrpId].numN);
266 KERNEL_INFO(
" |- Refractory period = %8.5f", grpIt->refractPeriod);
269 if (groupConfigMap[gGrpId].stpConfig.WithSTP) {
271 KERNEL_INFO(
" |- STP_A = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_A);
272 KERNEL_INFO(
" |- STP_U = %8.5f", groupConfigMap[gGrpId].stpConfig.STP_U);
273 KERNEL_INFO(
" |- STP_tau_u = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_u_inv));
274 KERNEL_INFO(
" |- STP_tau_x = %8d", (
int)(1.0f / groupConfigMap[gGrpId].stpConfig.STP_tau_x_inv));
277 if (groupConfigMap[gGrpId].stdpConfig.WithSTDP) {
280 (groupConfigMap[gGrpId].stdpConfig.WithESTDPtype ==
DA_MOD ? "
DA_MOD" : " UNKNOWN"));
282 (groupConfigMap[gGrpId].stdpConfig.WithISTDPtype ==
DA_MOD ? "
DA_MOD" : " UNKNOWN"));
283 KERNEL_INFO(" |- ALPHA_PLUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_PLUS_EXC);
284 KERNEL_INFO(" |- ALPHA_MINUS_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.ALPHA_MINUS_EXC);
285 KERNEL_INFO(" |- TAU_PLUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_PLUS_INV_EXC);
286 KERNEL_INFO(" |- TAU_MINUS_INV_EXC = %8.5f", groupConfigMap[gGrpId].stdpConfig.TAU_MINUS_INV_EXC);
287 KERNEL_INFO(" |- BETA_LTP = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTP);
288 KERNEL_INFO(" |- BETA_LTD = %8.5f", groupConfigMap[gGrpId].stdpConfig.BETA_LTD);
289 KERNEL_INFO(" |- LAMBDA = %8.5f", groupConfigMap[gGrpId].stdpConfig.LAMBDA);
290 KERNEL_INFO(" |- DELTA = %8.5f", groupConfigMap[gGrpId].stdpConfig.DELTA);
294 void SNN::printSikeRoutingInfo() {
295 if (!spikeRoutingTable.empty()) {
296 KERNEL_INFO(
"***************** Spike Routing Table *************************");
297 for (std::list<RoutingTableEntry>::iterator rteItr = spikeRoutingTable.begin(); rteItr != spikeRoutingTable.end(); rteItr++)
298 KERNEL_INFO(
" |-Source net:[%d] -> Destination net[%d]", rteItr->srcNetId, rteItr->destNetId);