void NoximStats::showStats(int curr_node, std::ostream& out, bool header) { if (header) { out << "%" << setw(5) << "src" << setw(5) << "dst" << setw(10) << "delay avg" << setw(10) << "delay max" << setw(15) << "throughput" << setw(13) << "energy" << setw(12) << "received" << setw(12) << "received" << endl; out << "%" << setw(5) << "" << setw(5) << "" << setw(10) << "cycles" << setw(10) << "cycles" << setw(15) << "flits/cycle" << setw(13) << "Joule" << setw(12) << "packets" << setw(12) << "flits" << endl; } for (unsigned int i=0; i<chist.size(); i++) { out << " " << setw(5) << chist[i].src_id << setw(5) << curr_node << setw(10) << getAverageDelay(chist[i].src_id) << setw(10) << getMaxDelay(chist[i].src_id) << setw(15) << getAverageThroughput(chist[i].src_id) << setw(13) << geNoximCommunicationEnergy(chist[i].src_id, curr_node) << setw(12) << chist[i].delays.size() << setw(12) << chist[i].total_received_flits << endl; } out << "% Aggregated average delay (cycles): " << getAverageDelay() << endl; out << "% Aggregated average throughput (flits/cycle): " << getAverageThroughput() << endl; }
double Stats::getAverageThroughput() { double sum = 0.0; for (unsigned int k = 0; k < chist.size(); k++) { double avg = getAverageThroughput(chist[k].src_id); if (avg > 0.0) sum += avg; } return sum; }