summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/garnet/fixed-pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network/garnet/fixed-pipeline')
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc128
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh13
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py6
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc6
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc5
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc3
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc1
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh7
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/SConscript9
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc1
12 files changed, 96 insertions, 91 deletions
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 11a34c0ce..7e9fe0762 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
@@ -38,69 +38,67 @@
#include "mem/ruby/network/garnet/fixed-pipeline/CreditLink_d.hh"
#include "mem/ruby/common/NetDest.hh"
-GarnetNetwork_d::GarnetNetwork_d(const string & name)
- : Network(name)
+GarnetNetwork_d::GarnetNetwork_d(const Params *p)
+ : BaseGarnetNetwork(p)
{
+ m_ruby_start = 0;
+ m_flits_recieved = 0;
+ m_flits_injected = 0;
+ m_network_latency = 0.0;
+ m_queueing_latency = 0.0;
+
+ m_router_ptr_vector.clear();
+
+ // Allocate to and from queues
+ m_toNetQueues.setSize(m_nodes); // Queues that are getting messages from protocol
+ m_fromNetQueues.setSize(m_nodes); // Queues that are feeding the protocol
+ m_in_use.setSize(m_virtual_networks);
+ m_ordered.setSize(m_virtual_networks);
+ for (int i = 0; i < m_virtual_networks; i++)
+ {
+ m_in_use[i] = false;
+ m_ordered[i] = false;
+ }
+
+ for (int node = 0; node < m_nodes; node++)
+ {
+ //Setting how many vitual message buffers will there be per Network Queue
+ m_toNetQueues[node].setSize(m_virtual_networks);
+ m_fromNetQueues[node].setSize(m_virtual_networks);
+
+ for (int j = 0; j < m_virtual_networks; j++)
+ {
+ m_toNetQueues[node][j] = new MessageBuffer(); // Instantiating the Message Buffers that interact with the coherence protocol
+ m_fromNetQueues[node][j] = new MessageBuffer();
+ }
+ }
}
void GarnetNetwork_d::init()
{
- Network::init(argv);
-
- //added by SS
- m_network_config_ptr = new NetworkConfig;
- m_network_config_ptr->init(argv);
-
- m_ruby_start = 0;
- m_flits_recieved = 0;
- m_flits_injected = 0;
- m_network_latency = 0.0;
- m_queueing_latency = 0.0;
-
- m_router_ptr_vector.clear();
-
- // Allocate to and from queues
- m_toNetQueues.setSize(m_nodes); // Queues that are getting messages from protocol
- m_fromNetQueues.setSize(m_nodes); // Queues that are feeding the protocol
- m_in_use.setSize(m_virtual_networks);
- m_ordered.setSize(m_virtual_networks);
- for (int i = 0; i < m_virtual_networks; i++)
- {
- m_in_use[i] = false;
- m_ordered[i] = false;
- }
-
- for (int node = 0; node < m_nodes; node++)
- {
- //Setting how many vitual message buffers will there be per Network Queue
- m_toNetQueues[node].setSize(m_virtual_networks);
- m_fromNetQueues[node].setSize(m_virtual_networks);
-
- for (int j = 0; j < m_virtual_networks; j++)
- {
- m_toNetQueues[node][j] = new MessageBuffer(); // Instantiating the Message Buffers that interact with the coherence protocol
- m_fromNetQueues[node][j] = new MessageBuffer();
- }
- }
-
- // Setup the network switches
- m_topology_ptr->makeTopology();
-
- int number_of_routers = m_topology_ptr->numSwitches();
- for (int i=0; i<number_of_routers; i++) {
- m_router_ptr_vector.insertAtBottom(new Router_d(i, this));
- }
-
- for (int i=0; i < m_nodes; i++) {
- NetworkInterface_d *ni = new NetworkInterface_d(i, m_virtual_networks, this);
- ni->addNode(m_toNetQueues[i], m_fromNetQueues[i]);
- m_ni_ptr_vector.insertAtBottom(ni);
- }
- m_topology_ptr->createLinks(this, false); // false because this isn't a reconfiguration
- for(int i = 0; i < m_router_ptr_vector.size(); i++)
- {
- m_router_ptr_vector[i]->init();
- }
+ BaseGarnetNetwork::init();
+
+ //
+ // The topology pointer should have already been initialized in the parent
+ // network constructor.
+ //
+ assert(m_topology_ptr != NULL);
+
+ int number_of_routers = m_topology_ptr->numSwitches();
+ for (int i=0; i<number_of_routers; i++) {
+ m_router_ptr_vector.insertAtBottom(new Router_d(i, this));
+ }
+
+ for (int i=0; i < m_nodes; i++) {
+ NetworkInterface_d *ni = new NetworkInterface_d(i, m_virtual_networks, this);
+ ni->addNode(m_toNetQueues[i], m_fromNetQueues[i]);
+ m_ni_ptr_vector.insertAtBottom(ni);
+ }
+ m_topology_ptr->createLinks(this, false); // false because this isn't a reconfiguration
+ for(int i = 0; i < m_router_ptr_vector.size(); i++)
+ {
+ m_router_ptr_vector[i]->init();
+ }
}
GarnetNetwork_d::~GarnetNetwork_d()
@@ -245,9 +243,9 @@ Time GarnetNetwork_d::getRubyStartTime()
void GarnetNetwork_d::printStats(ostream& out) const
{ double average_link_utilization = 0;
Vector<double > average_vc_load;
- average_vc_load.setSize(m_virtual_networks*m_network_config_ptr->getVCsPerClass());
+ average_vc_load.setSize(m_virtual_networks*m_vcs_per_class);
- for(int i = 0; i < m_virtual_networks*m_network_config_ptr->getVCsPerClass(); i++)
+ for(int i = 0; i < m_virtual_networks*m_vcs_per_class; i++)
{
average_vc_load[i] = 0;
}
@@ -263,7 +261,7 @@ void GarnetNetwork_d::printStats(ostream& out) const
Vector<int > vc_load = m_link_ptr_vector[i]->getVcLoad();
for(int j = 0; j < vc_load.size(); j++)
{
- assert(vc_load.size() == m_network_config_ptr->getVCsPerClass()*m_virtual_networks);
+ assert(vc_load.size() == m_vcs_per_class*m_virtual_networks);
average_vc_load[j] += vc_load[j];
}
}
@@ -271,7 +269,7 @@ void GarnetNetwork_d::printStats(ostream& out) const
out << "Average Link Utilization :: " << average_link_utilization << " flits/cycle" << endl;
out << "-------------" << endl;
- for(int i = 0; i < m_network_config_ptr->getVCsPerClass()*m_virtual_networks; i++)
+ for(int i = 0; i < m_vcs_per_class*m_virtual_networks; i++)
{
average_vc_load[i] = (double(average_vc_load[i]) / (double(g_eventQueue_ptr->getTime()) - m_ruby_start));
out << "Average VC Load [" << i << "] = " << average_vc_load[i] << " flits/cycle " << endl;
@@ -348,3 +346,9 @@ void GarnetNetwork_d::print(ostream& out) const
{
out << "[GarnetNetwork_d]";
}
+
+GarnetNetwork_d *
+GarnetNetwork_dParams::create()
+{
+ return new GarnetNetwork_d(this);
+}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
index ccd3e379a..8a36c1572 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
@@ -33,8 +33,9 @@
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/gems_common/Vector.hh"
-#include "mem/ruby/network/garnet-flexible-pipeline/NetworkConfig.hh"
+#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
#include "mem/ruby/network/Network.hh"
+#include "params/GarnetNetwork_d.hh"
class NetworkInterface_d;
class MessageBuffer;
@@ -44,17 +45,15 @@ class NetDest;
class NetworkLink_d;
class CreditLink_d;
-class GarnetNetwork_d : public Network{
+class GarnetNetwork_d : public BaseGarnetNetwork {
public:
- GarnetNetwork_d(const string & name);
+ typedef GarnetNetwork_dParams Params;
+ GarnetNetwork_d(const Params *p);
~GarnetNetwork_d();
void init();
- //added by SS
- NetworkConfig* getNetworkConfig() { return m_network_config_ptr; }
-
int getNumNodes(){ return m_nodes;}
// returns the queue requested for the given component
@@ -99,8 +98,6 @@ public:
void makeInternalLink(SwitchID src, NodeID dest, const NetDest& routing_table_entry, int link_latency, int link_weight, int bw_multiplier, bool isReconfiguration);
private:
- NetworkConfig* m_network_config_ptr;
-
void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
// Private copy constructor and assignment operator
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py
new file mode 100644
index 000000000..40a8bfb79
--- /dev/null
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py
@@ -0,0 +1,6 @@
+from m5.params import *
+from BaseGarnetNetwork import BaseGarnetNetwork
+
+class GarnetNetwork_d(BaseGarnetNetwork):
+ type = 'GarnetNetwork_d'
+
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 4ba885f60..26399e68e 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
@@ -38,7 +38,7 @@ NetworkInterface_d::NetworkInterface_d(int id, int virtual_networks, GarnetNetwo
m_id = id;
m_net_ptr = network_ptr;
m_virtual_networks = virtual_networks;
- m_vc_per_vnet = m_net_ptr->getNetworkConfig()->getVCsPerClass();
+ m_vc_per_vnet = m_net_ptr->getVCsPerClass();
m_num_vcs = m_vc_per_vnet*m_virtual_networks;
m_vc_round_robin = 0;
@@ -109,7 +109,7 @@ bool NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
Vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
- int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getNetworkConfig()->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
+ int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
for(int ctr = 0; ctr < dest_nodes.size(); ctr++) // loop because we will be converting all multicast messages into unicast messages
{
@@ -216,7 +216,7 @@ void NetworkInterface_d::wakeup()
if(t_flit->get_type() == TAIL_ || t_flit->get_type() == HEAD_TAIL_)
{
free_signal = true;
- if(!m_net_ptr->getNetworkConfig()->isNetworkTesting()) // When we are doing network only testing, the messages do not have to be buffered into the message buffers
+ if(!m_net_ptr->isNetworkTesting()) // When we are doing network only testing, the messages do not have to be buffered into the message buffers
{
outNode_ptr[t_flit->get_vnet()]->enqueue(t_flit->get_msg_ptr(), 1); // enqueueing for protocol buffer. This is not required when doing network only testing
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
index 229497085..92b2d44f8 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
@@ -29,7 +29,6 @@
*/
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh"
-#include "mem/ruby/network/garnet-flexible-pipeline/NetworkConfig.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
/*
@@ -54,9 +53,9 @@ NetworkLink_d::NetworkLink_d(int id, int link_latency, GarnetNetwork_d *net_ptr)
m_latency = link_latency;
linkBuffer = new flitBuffer_d();
m_link_utilized = 0;
- m_vc_load.setSize(m_net_ptr->getNetworkConfig()->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks());
+ m_vc_load.setSize(m_net_ptr->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks());
- for(int i = 0; i < m_net_ptr->getNetworkConfig()->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks(); i++)
+ for(int i = 0; i < m_net_ptr->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks(); i++)
m_vc_load[i] = 0;
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
index 1fad7509d..6ee1dcdfb 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
@@ -53,8 +53,8 @@ public:
int get_id(){return m_id;}
void wakeup();
- double calculate_offline_power(power_bus*);
- double calculate_power();
+ double calculate_offline_power(power_bus*) { return 0.0; }
+ double calculate_power() { return 0.0; }
inline bool isReady()
{
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc
index 958886573..921f8701a 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc
@@ -29,7 +29,6 @@
*/
#include "mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.hh"
-#include "mem/ruby/network/garnet-flexible-pipeline/NetworkConfig.hh"
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
OutVcState_d::OutVcState_d(int id, GarnetNetwork_d *network_ptr)
@@ -38,5 +37,5 @@ OutVcState_d::OutVcState_d(int id, GarnetNetwork_d *network_ptr)
m_id = id;
m_vc_state = IDLE_;
m_time = g_eventQueue_ptr->getTime();
- m_credit_count = m_network_ptr->getNetworkConfig()->getBufferSize();
+ m_credit_count = m_network_ptr->getBufferSize();
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
index 8a371bb5f..7934dc9bd 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
@@ -30,7 +30,6 @@
#include "mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
-#include "mem/ruby/network/garnet-flexible-pipeline/NetworkConfig.hh"
OutputUnit_d::OutputUnit_d(int id, Router_d *router)
{
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
index 89a893e3a..7185249e4 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
@@ -44,9 +44,9 @@ Router_d::Router_d(int id, GarnetNetwork_d *network_ptr)
m_id = id;
m_network_ptr = network_ptr;
m_virtual_networks = network_ptr->getNumberOfVirtualNetworks();
- m_vc_per_vnet = m_network_ptr->getNetworkConfig()->getVCsPerClass();
+ m_vc_per_vnet = m_network_ptr->getVCsPerClass();
m_num_vcs = m_virtual_networks*m_vc_per_vnet;
- m_flit_width = m_network_ptr->getNetworkConfig()->getFlitSize();
+ m_flit_width = m_network_ptr->getFlitSize();
m_routing_unit = new RoutingUnit_d(this);
m_vc_alloc = new VCallocator_d(this);
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
index eca621479..505353089 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
@@ -74,8 +74,11 @@ public:
void swarb_req();
void power_router_initialize(power_router *router, power_router_info *info);
- double calculate_power();
- double calculate_offline_power(power_router*, power_router_info*);
+ double calculate_power() { return 0.0; }
+ double calculate_offline_power(power_router*, power_router_info*)
+ {
+ return 0.0;
+ }
void calculate_performance_numbers();
private:
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/SConscript b/src/mem/ruby/network/garnet/fixed-pipeline/SConscript
index 84f4ba378..d3cf45878 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/SConscript
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/SConscript
@@ -30,14 +30,13 @@
Import('*')
-# temporarily disable
-Return()
-
if not env['RUBY']:
Return()
-Source('GarnetNetwork_d.cc')
-Source('InputUnit_d.cc')
+SimObject('GarnetNetwork_d.py')
+
+Source('GarnetNetwork_d.cc', Werror=False)
+Source('InputUnit_d.cc', Werror=False)
Source('NetworkInterface_d.cc')
Source('NetworkLink_d.cc')
Source('OutVcState_d.cc')
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
index 7bfb4948d..e08c70769 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
@@ -28,7 +28,6 @@
* Authors: Niket Agarwal
*/
-#include "mem/ruby/network/garnet-flexible-pipeline/NetworkConfig.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh"