void Stats::receivedFlit(const double arrival_time, const Flit & flit) { if (arrival_time - GlobalParams::reset_time < warm_up_time) return; int i = searchCommHistory(flit.src_id); if (i == -1) { // first flit received from a given source // initialize CommHist structure CommHistory ch; ch.src_id = flit.src_id; ch.total_received_flits = 0; chist.push_back(ch); i = chist.size() - 1; } if (flit.flit_type == FLIT_TYPE_HEAD) chist[i].delays.push_back(arrival_time - flit.timestamp); chist[i].total_received_flits++; chist[i].last_received_flit_time = arrival_time - warm_up_time; }
void NoximStats::receivedFlit(const double arrival_time, const NoximFlit & flit) { if (arrival_time - DEFAULT_RESET_TIME < warm_up_time) return; int i = searchCommHistory(flit.src_id); if (i == -1) { // first flit received from a given source // initialize CommHist structure CommHistory ch; ch.src_id = flit.src_id; ch.total_received_flits = 0; chist.push_back(ch); i = chist.size() - 1; } if (flit.flit_type == FLIT_TYPE_HEAD){ chist[i].delays.push_back (arrival_time - flit.timestamp_ni); chist[i].ni_delays.push_back(arrival_time - flit.timestamp_ni); chist[i].nw_delays.push_back(arrival_time - flit.timestamp_nw); //cout<<arrival_time<<"\t"<<flit.timestamp<<"\t"<<flit.timestamp_ni<<"\t"<<flit.timestamp_nw<<endl; } chist[i].total_received_flits++; chist[i].last_received_flit_time = arrival_time - warm_up_time; }
void NoximStats::receivedFlit(const double arrival_time,const NoximFlit & flit) { if (arrival_time - DEFAULT_RESET_TIME < warm_up_time || flit.is_nack) return; int i = searchCommHistory(flit.src_id); if (i == -1) { // first flit received from a given source // initialize CommHist structure CommHistory ch; ch.src_id = flit.src_id; ch.total_received_flits = 0; chist.push_back(ch); i = chist.size() - 1; } if (flit.flit_type == FLIT_TYPE_HEAD) chist[i].delays.push_back(arrival_time - flit.timestamp); chist[i].total_received_flits++; chist[i].last_received_flit_time = arrival_time - warm_up_time; total_received_flits_for_channel[flit.channel] += 1; }
double NoximStats::getAverageThroughput(const int src_id) { int i = searchCommHistory(src_id); assert(i >= 0); if (chist[i].total_received_flits == 0) return -1.0; else return (double)chist[i].total_received_flits/(double)chist[i].last_received_flit_time; }
double Stats::getAverageDelay(const int src_id) { double sum = 0.0; int i = searchCommHistory(src_id); assert(i >= 0); for (unsigned int j = 0; j < chist[i].delays.size(); j++) sum += chist[i].delays[j]; return sum / (double) chist[i].delays.size(); }
double Stats::getMaxDelay(const int src_id) { double maxd = -1.0; int i = searchCommHistory(src_id); assert(i >= 0); for (unsigned int j = 0; j < chist[i].delays.size(); j++) if (chist[i].delays[j] > maxd) { maxd = chist[i].delays[j]; } return maxd; }
double NoximStats::getMaxDelay(const int src_id) { double maxd = -1.0; int i = searchCommHistory(src_id); assert(i >= 0); for (unsigned int j = 0; j < chist[i].delays.size(); j++) if (chist[i].delays[j] > maxd) { // cout << src_id << " -> " << id << ": " << chist[i].delays[j] << endl; maxd = chist[i].delays[j]; } return maxd; }
double Stats::getAverageThroughput(const int src_id) { int i = searchCommHistory(src_id); assert(i >= 0); // not using GlobalParams::simulation_time since // the value must takes into account the invokation time // (when called before simulation ended, e.g. turi signal) int current_sim_cycles = sc_time_stamp().to_double()/GlobalParams::clock_period_ps - warm_up_time - GlobalParams::reset_time; if (chist[i].total_received_flits == 0) return -1.0; else return (double) chist[i].total_received_flits / current_sim_cycles; //(double) chist[i].last_received_flit_time; }