mem-garnet: Added packet distribution stats
Trace data and control traffic between all source-destination pairs. This is for identifying packet distribution and bottleneck of the interconnect network. Change-Id: Iffc9c16fd1e02ab8f7c5382cec822bf57a43a057 JIRA: https://gem5.atlassian.net/browse/GEM5-861 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40275 Reviewed-by: Srikant Bharadwaj <srikant.bharadwaj@amd.com> Maintainer: Srikant Bharadwaj <srikant.bharadwaj@amd.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -500,6 +500,25 @@ GarnetNetwork::regStats()
|
||||
.name(name() + ".avg_vc_load")
|
||||
.flags(Stats::pdf | Stats::total | Stats::nozero | Stats::oneline)
|
||||
;
|
||||
|
||||
// Traffic distribution
|
||||
for (int source = 0; source < m_routers.size(); ++source) {
|
||||
m_data_traffic_distribution.push_back(std::vector<Stats::Scalar *>());
|
||||
m_ctrl_traffic_distribution.push_back(std::vector<Stats::Scalar *>());
|
||||
|
||||
for (int dest = 0; dest < m_routers.size(); ++dest) {
|
||||
Stats::Scalar *data_packets = new Stats::Scalar();
|
||||
Stats::Scalar *ctrl_packets = new Stats::Scalar();
|
||||
|
||||
data_packets->name(name() + ".data_traffic_distribution." + "n" +
|
||||
std::to_string(source) + "." + "n" + std::to_string(dest));
|
||||
m_data_traffic_distribution[source].push_back(data_packets);
|
||||
|
||||
ctrl_packets->name(name() + ".ctrl_traffic_distribution." + "n" +
|
||||
std::to_string(source) + "." + "n" + std::to_string(dest));
|
||||
m_ctrl_traffic_distribution[source].push_back(ctrl_packets);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -554,6 +573,19 @@ GarnetNetwork::print(std::ostream& out) const
|
||||
out << "[GarnetNetwork]";
|
||||
}
|
||||
|
||||
void
|
||||
GarnetNetwork::update_traffic_distribution(RouteInfo route)
|
||||
{
|
||||
int src_node = route.src_router;
|
||||
int dest_node = route.dest_router;
|
||||
int vnet = route.vnet;
|
||||
|
||||
if (m_vnet_type[vnet] == DATA_VNET_)
|
||||
(*m_data_traffic_distribution[src_node][dest_node])++;
|
||||
else
|
||||
(*m_ctrl_traffic_distribution[src_node][dest_node])++;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
GarnetNetwork::functionalWrite(Packet *pkt)
|
||||
{
|
||||
|
||||
@@ -142,6 +142,8 @@ class GarnetNetwork : public Network
|
||||
m_total_hops += hops;
|
||||
}
|
||||
|
||||
void update_traffic_distribution(RouteInfo route);
|
||||
|
||||
protected:
|
||||
// Configuration
|
||||
int m_num_rows;
|
||||
@@ -185,6 +187,9 @@ class GarnetNetwork : public Network
|
||||
Stats::Scalar m_total_hops;
|
||||
Stats::Formula m_avg_hops;
|
||||
|
||||
std::vector<std::vector<Stats::Scalar *>> m_data_traffic_distribution;
|
||||
std::vector<std::vector<Stats::Scalar *>> m_ctrl_traffic_distribution;
|
||||
|
||||
private:
|
||||
GarnetNetwork(const GarnetNetwork& obj);
|
||||
GarnetNetwork& operator=(const GarnetNetwork& obj);
|
||||
|
||||
@@ -426,6 +426,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
|
||||
route.hops_traversed = -1;
|
||||
|
||||
m_net_ptr->increment_injected_packets(vnet);
|
||||
m_net_ptr->update_traffic_distribution(route);
|
||||
for (int i = 0; i < num_flits; i++) {
|
||||
m_net_ptr->increment_injected_flits(vnet);
|
||||
flit *fl = new flit(i, vc, vnet, route, num_flits, new_msg_ptr,
|
||||
|
||||
Reference in New Issue
Block a user