diff options
author | Tushar Krishna <tushar@csail.mit.edu> | 2011-03-21 22:51:58 -0400 |
---|---|---|
committer | Tushar Krishna <tushar@csail.mit.edu> | 2011-03-21 22:51:58 -0400 |
commit | 09c3a97a4c9aace6e2c52823679b31323cab42f6 (patch) | |
tree | d0340677be5f6cd4c10456fb70a46c1374f28e99 /src/mem/ruby/network/garnet | |
parent | d7aa794155a46a403825f82c1ea62cd38b9de788 (diff) | |
download | gem5-09c3a97a4c9aace6e2c52823679b31323cab42f6.tar.xz |
This patch adds the network tester for simple and garnet networks.
The tester code is in testers/networktest.
The tester can be invoked by configs/example/ruby_network_test.py.
A dummy coherence protocol called Network_test is also addded for network-only simulations and testing. The protocol takes in messages from the tester and just pushes them into the network in the appropriate vnet, without storing any state.
Diffstat (limited to 'src/mem/ruby/network/garnet')
6 files changed, 13 insertions, 23 deletions
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc index 3e5e1cbe8..19b4c3d04 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc @@ -38,7 +38,6 @@ BaseGarnetNetwork::BaseGarnetNetwork(const Params *p) m_vcs_per_class = p->vcs_per_class; m_buffers_per_data_vc = p->buffers_per_data_vc; m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc; - m_using_network_testing = p->using_network_testing; } void diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh index 4a1856e43..d01225232 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh @@ -36,6 +36,7 @@ #ifndef __MEM_RUBY_NETWORK_GARNET_BASEGARNETNETWORK_HH__ #define __MEM_RUBY_NETWORK_GARNET_BASEGARNETNETWORK_HH__ +#include "math.h" #include "mem/ruby/network/garnet/NetworkHeader.hh" #include "mem/ruby/network/Network.hh" #include "params/BaseGarnetNetwork.hh" @@ -47,7 +48,6 @@ class BaseGarnetNetwork : public Network BaseGarnetNetwork(const Params *p); void init(); - bool isNetworkTesting() {return m_using_network_testing; } int getFlitSize() {return m_flit_size; } int getNumPipeStages() {return m_number_of_pipe_stages; } int getVCsPerClass() {return m_vcs_per_class; } @@ -60,7 +60,6 @@ class BaseGarnetNetwork : public Network int m_vcs_per_class; int m_buffers_per_data_vc; int m_buffers_per_ctrl_vc; - bool m_using_network_testing; }; #endif // __MEM_RUBY_NETWORK_GARNET_BASEGARNETNETWORK_HH__ diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py index 44b6bd149..3594e93b6 100644 --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py @@ -39,4 +39,3 @@ class BaseGarnetNetwork(RubyNetwork): vcs_per_class = Param.Int(4, "virtual channels per message class"); buffers_per_data_vc = Param.Int(4, "buffers per data virtual channel"); buffers_per_ctrl_vc = Param.Int(1, "buffers per ctrl virtual channel"); - using_network_testing = Param.Bool(False, "network testing enable"); diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc index dbfabc8f1..f0b8ccce7 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc @@ -307,15 +307,15 @@ GarnetNetwork_d::printStats(ostream& out) const } out << "-------------" << endl; - // out << "Total flits injected = " << m_flits_injected << endl; - // out << "Total flits received = " << m_flits_received << endl; + out << "Total flits injected = " << m_flits_injected << endl; + out << "Total flits received = " << m_flits_received << endl; out << "Average network latency = " << ((double) m_network_latency/ (double) m_flits_received)<< endl; - // out << "Average queueing latency = " - // << ((double) m_queueing_latency/ (double) m_flits_received)<< endl; - // out << "Average latency = " - // << ((double) (m_queueing_latency + m_network_latency) / - // (double) m_flits_received)<< endl; + out << "Average queueing (at source NI) latency = " + << ((double) m_queueing_latency/ (double) m_flits_received)<< endl; + out << "Average latency = " + << ((double) (m_queueing_latency + m_network_latency) / + (double) m_flits_received)<< endl; out << "-------------" << endl; double m_total_link_power = 0.0; diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc index 8299a294f..14105a38c 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -241,12 +241,9 @@ NetworkInterface_d::wakeup() bool free_signal = false; if (t_flit->get_type() == TAIL_ || t_flit->get_type() == HEAD_TAIL_) { free_signal = true; - // When we are doing network only testing, the messages do not - // have to be buffered into the protocol buffers - if (!m_net_ptr->isNetworkTesting()) { - outNode_ptr[t_flit->get_vnet()]-> - enqueue(t_flit->get_msg_ptr(), 1); - } + + outNode_ptr[t_flit->get_vnet()]->enqueue( + t_flit->get_msg_ptr(), 1); } // Simply send a credit back since we are not buffering // this flit in the NI diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc index afc841a1b..60ec09e58 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc @@ -262,12 +262,8 @@ NetworkInterface::wakeup() DPRINTF(RubyNetwork, "m_id: %d, Message delivered at time: %lld\n", m_id, g_eventQueue_ptr->getTime()); - // When we are doing network only testing, the messages do not - // have to be buffered into the message buffers of the protocol - if (!m_net_ptr->isNetworkTesting()) { - outNode_ptr[t_flit->get_vnet()]->enqueue( - t_flit->get_msg_ptr(), 1); - } + outNode_ptr[t_flit->get_vnet()]->enqueue( + t_flit->get_msg_ptr(), 1); // signal the upstream router that this vc can be freed now inNetLink->release_vc_link(t_flit->get_vc(), |