ruby: network: remove reconfiguration code
authorNilay Vaish <nilay@cs.wisc.edu>
Sat, 29 Jun 2013 02:36:37 +0000 (21:36 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Sat, 29 Jun 2013 02:36:37 +0000 (21:36 -0500)
This code seems not to be of any use now. There is no path in the simulator
that allows for reconfiguring the network. A better approach would be to
take a checkpoint and start the simulation from the checkpoint with the new
configuration.

src/mem/ruby/network/Network.hh
src/mem/ruby/network/Topology.cc
src/mem/ruby/network/Topology.hh
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
src/mem/ruby/network/simple/SimpleNetwork.cc
src/mem/ruby/network/simple/SimpleNetwork.hh

index b0cca6806d0236626bae497e08d68e9b67175e9e..c2c8f322b8e781467de950a6b65442a2470c67af 100644 (file)
@@ -80,16 +80,13 @@ class Network : public ClockedObject
 
     virtual void makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
                              LinkDirection direction,
-                             const NetDest& routing_table_entry,
-                             bool isReconfiguration) = 0;
+                             const NetDest& routing_table_entry) = 0;
     virtual void makeInLink(NodeID src, SwitchID dest, BasicLink* link,
                             LinkDirection direction,
-                            const NetDest& routing_table_entry,
-                            bool isReconfiguration) = 0;
+                            const NetDest& routing_table_entry) = 0;
     virtual void makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                                   LinkDirection direction,
-                                  const NetDest& routing_table_entry,
-                                  bool isReconfiguration) = 0;
+                                  const NetDest& routing_table_entry) = 0;
 
     virtual void reset() = 0;
 
index b8f6fb9149f8ac25d8c6c9db73594f72a1eee52d..bf270cce1a5d97f657c99e844556af3127939b77 100644 (file)
@@ -121,7 +121,7 @@ Topology::Topology(uint32_t num_routers, vector<BasicExtLink *> ext_links,
 }
 
 void
-Topology::createLinks(Network *net, bool isReconfiguration)
+Topology::createLinks(Network *net)
 {
     // Find maximum switchID
     SwitchID max_switch_id = 0;
@@ -179,9 +179,9 @@ Topology::createLinks(Network *net, bool isReconfiguration)
         for (int j = 0; j < topology_weights[i].size(); j++) {
             int weight = topology_weights[i][j];
             if (weight > 0 && weight != INFINITE_LATENCY) {
-                NetDest destination_set = shortest_path_to_node(i, j,
-                                                     topology_weights, dist);
-                makeLink(net, i, j, destination_set, isReconfiguration);
+                NetDest destination_set =
+                        shortest_path_to_node(i, j, topology_weights, dist);
+                makeLink(net, i, j, destination_set);
             }
         }
     }
@@ -206,7 +206,7 @@ Topology::addLink(SwitchID src, SwitchID dest, BasicLink* link,
 
 void
 Topology::makeLink(Network *net, SwitchID src, SwitchID dest,
-                   const NetDest& routing_table_entry, bool isReconfiguration)
+                   const NetDest& routing_table_entry)
 {
     // Make sure we're not trying to connect two end-point nodes
     // directly together
@@ -220,9 +220,7 @@ Topology::makeLink(Network *net, SwitchID src, SwitchID dest,
         src_dest.second = dest;
         link_entry = m_link_map[src_dest];
         net->makeInLink(src, dest - (2 * m_nodes), link_entry.link,
-                        link_entry.direction, 
-                        routing_table_entry,
-                        isReconfiguration);
+                        link_entry.direction, routing_table_entry);
     } else if (dest < 2*m_nodes) {
         assert(dest >= m_nodes);
         NodeID node = dest - m_nodes;
@@ -230,9 +228,7 @@ Topology::makeLink(Network *net, SwitchID src, SwitchID dest,
         src_dest.second = dest;
         link_entry = m_link_map[src_dest];
         net->makeOutLink(src - (2 * m_nodes), node, link_entry.link,
-                         link_entry.direction, 
-                         routing_table_entry,
-                         isReconfiguration);
+                         link_entry.direction, routing_table_entry);
     } else {
         assert((src >= 2 * m_nodes) && (dest >= 2 * m_nodes));
         src_dest.first = src;
@@ -240,7 +236,7 @@ Topology::makeLink(Network *net, SwitchID src, SwitchID dest,
         link_entry = m_link_map[src_dest];
         net->makeInternalLink(src - (2 * m_nodes), dest - (2 * m_nodes),
                               link_entry.link, link_entry.direction,
-                              routing_table_entry, isReconfiguration);
+                              routing_table_entry);
     }
 }
 
index 11b1fe11805bd5e2b3c51012d78bfbd8a698b659..cd0e03d097fe2c50d00d50351db1e04b67956537 100644 (file)
@@ -68,15 +68,14 @@ class Topology
              std::vector<BasicIntLink *> int_links);
 
     uint32_t numSwitches() const { return m_number_of_switches; }
-    void createLinks(Network *net, bool isReconfiguration);
+    void createLinks(Network *net);
     void print(std::ostream& out) const { out << "[Topology]"; }
 
   protected:
     void addLink(SwitchID src, SwitchID dest, BasicLink* link,
                  LinkDirection dir);
     void makeLink(Network *net, SwitchID src, SwitchID dest,
-                  const NetDest& routing_table_entry, 
-                  bool isReconfiguration);
+                  const NetDest& routing_table_entry);
 
     NodeID m_nodes;
     uint32_t m_number_of_switches;
index 4b1e0d0d785f1b5831bf3267b602b5b71beaa066..491a413b4aa2b430a502c300bdea1f9403b68cc3 100644 (file)
@@ -88,8 +88,7 @@ GarnetNetwork_d::init()
         ni->addNode(m_toNetQueues[i], m_fromNetQueues[i]);
         m_ni_ptr_vector.push_back(ni);
     }
-    // false because this isn't a reconfiguration
-    m_topology_ptr->createLinks(this, false);
+    m_topology_ptr->createLinks(this);
 
     // initialize the link's network pointers
    for (vector<NetworkLink_d*>::const_iterator i = m_link_ptr_vector.begin();
@@ -150,26 +149,19 @@ GarnetNetwork_d::reset()
 void
 GarnetNetwork_d::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
                             LinkDirection direction,
-                            const NetDest& routing_table_entry,
-                            bool isReconfiguration)
+                            const NetDest& routing_table_entry)
 {
     assert(src < m_nodes);
 
     GarnetExtLink_d* garnet_link = safe_cast<GarnetExtLink_d*>(link);
+    NetworkLink_d* net_link = garnet_link->m_network_links[direction];
+    CreditLink_d* credit_link = garnet_link->m_credit_links[direction];
 
-    if (!isReconfiguration) {
-        NetworkLink_d* net_link = garnet_link->m_network_links[direction];
-        CreditLink_d* credit_link = garnet_link->m_credit_links[direction];
+    m_link_ptr_vector.push_back(net_link);
+    m_creditlink_ptr_vector.push_back(credit_link);
 
-        m_link_ptr_vector.push_back(net_link);
-        m_creditlink_ptr_vector.push_back(credit_link);
-
-        m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
-        m_ni_ptr_vector[src]->addOutPort(net_link, credit_link);
-    } else {
-        panic("Fatal Error:: Reconfiguration not allowed here");
-        // do nothing
-    }
+    m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
+    m_ni_ptr_vector[src]->addOutPort(net_link, credit_link);
 }
 
 /*
@@ -181,30 +173,22 @@ GarnetNetwork_d::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
 void
 GarnetNetwork_d::makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
                              LinkDirection direction,
-                             const NetDest& routing_table_entry,
-                             bool isReconfiguration)
+                             const NetDest& routing_table_entry)
 {
     assert(dest < m_nodes);
     assert(src < m_router_ptr_vector.size());
     assert(m_router_ptr_vector[src] != NULL);
 
     GarnetExtLink_d* garnet_link = safe_cast<GarnetExtLink_d*>(link);
+    NetworkLink_d* net_link = garnet_link->m_network_links[direction];
+    CreditLink_d* credit_link = garnet_link->m_credit_links[direction];
 
-    if (!isReconfiguration) {
-        NetworkLink_d* net_link = garnet_link->m_network_links[direction];
-        CreditLink_d* credit_link = garnet_link->m_credit_links[direction];
-
-        m_link_ptr_vector.push_back(net_link);
-        m_creditlink_ptr_vector.push_back(credit_link);
+    m_link_ptr_vector.push_back(net_link);
+    m_creditlink_ptr_vector.push_back(credit_link);
 
-        m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
-                                             link->m_weight, 
-                                             credit_link);
-        m_ni_ptr_vector[dest]->addInPort(net_link, credit_link);
-    } else {
-        fatal("Fatal Error:: Reconfiguration not allowed here");
-        // do nothing
-    }
+    m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
+                                         link->m_weight, credit_link);
+    m_ni_ptr_vector[dest]->addInPort(net_link, credit_link);
 }
 
 /*
@@ -214,26 +198,18 @@ GarnetNetwork_d::makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
 void
 GarnetNetwork_d::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                                   LinkDirection direction,
-                                  const NetDest& routing_table_entry,
-                                  bool isReconfiguration)
+                                  const NetDest& routing_table_entry)
 {
     GarnetIntLink_d* garnet_link = safe_cast<GarnetIntLink_d*>(link);
+    NetworkLink_d* net_link = garnet_link->m_network_links[direction];
+    CreditLink_d* credit_link = garnet_link->m_credit_links[direction];
 
-    if (!isReconfiguration) {
-        NetworkLink_d* net_link = garnet_link->m_network_links[direction];
-        CreditLink_d* credit_link = garnet_link->m_credit_links[direction];
-
-        m_link_ptr_vector.push_back(net_link);
-        m_creditlink_ptr_vector.push_back(credit_link);
+    m_link_ptr_vector.push_back(net_link);
+    m_creditlink_ptr_vector.push_back(credit_link);
 
-        m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
-        m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
-                                             link->m_weight, 
-                                             credit_link);
-    } else {
-        fatal("Fatal Error:: Reconfiguration not allowed here");
-        // do nothing
-    }
+    m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
+    m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
+                                         link->m_weight, credit_link);
 }
 
 void
index 912bbb95534b43c613dfb4c2716e7f708e2899f9..9c2cc63bfd80f2f60f5a13f112e95669f29103cf 100644 (file)
@@ -79,16 +79,13 @@ class GarnetNetwork_d : public BaseGarnetNetwork
     // Methods used by Topology to setup the network
     void makeOutLink(SwitchID src, NodeID dest, BasicLink* link, 
                      LinkDirection direction,
-                     const NetDest& routing_table_entry,
-                     bool isReconfiguration);
+                     const NetDest& routing_table_entry);
     void makeInLink(NodeID src, SwitchID dest, BasicLink* link,
                     LinkDirection direction,
-                    const NetDest& routing_table_entry,
-                    bool isReconfiguration);
+                    const NetDest& routing_table_entry);
     void makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                           LinkDirection direction,
-                          const NetDest& routing_table_entry,
-                          bool isReconfiguration);
+                          const NetDest& routing_table_entry);
 
     //! Function for performing a functional write. The return value
     //! indicates the number of messages that were written.
index ee54dc2c5ce9844f4eb47277c490a2641b0a1fb0..77444204ea2452464d8bf471469910f1cf214571 100644 (file)
@@ -82,8 +82,7 @@ GarnetNetwork::init()
         m_ni_ptr_vector.push_back(ni);
     }
 
-    // false because this isn't a reconfiguration :
-    m_topology_ptr->createLinks(this, false);
+    m_topology_ptr->createLinks(this);
 }
 
 GarnetNetwork::~GarnetNetwork()
@@ -112,69 +111,51 @@ GarnetNetwork::reset()
 void
 GarnetNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link, 
                           LinkDirection direction, 
-                          const NetDest& routing_table_entry, 
-                          bool isReconfiguration)
+                          const NetDest& routing_table_entry)
 {
     assert(src < m_nodes);
 
     GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
+    NetworkLink *net_link = garnet_link->m_network_links[direction];
 
-    if (!isReconfiguration) {
-        NetworkLink *net_link = garnet_link->m_network_links[direction];
-        net_link->init_net_ptr(this);
-        m_link_ptr_vector.push_back(net_link);
-        m_router_ptr_vector[dest]->addInPort(net_link);
-        m_ni_ptr_vector[src]->addOutPort(net_link);
-    }         else {
-        fatal("Fatal Error:: Reconfiguration not allowed here");
-        // do nothing
-    }
+    net_link->init_net_ptr(this);
+    m_link_ptr_vector.push_back(net_link);
+    m_router_ptr_vector[dest]->addInPort(net_link);
+    m_ni_ptr_vector[src]->addOutPort(net_link);
 }
 
 void
 GarnetNetwork::makeOutLink(SwitchID src, NodeID dest, BasicLink* link, 
                            LinkDirection direction, 
-                           const NetDest& routing_table_entry, 
-                           bool isReconfiguration)
+                           const NetDest& routing_table_entry)
 {
     assert(dest < m_nodes);
     assert(src < m_router_ptr_vector.size());
     assert(m_router_ptr_vector[src] != NULL);
 
     GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
+    NetworkLink *net_link = garnet_link->m_network_links[direction];
 
-    if (!isReconfiguration) {
-        NetworkLink *net_link = garnet_link->m_network_links[direction];
-        net_link->init_net_ptr(this);
-        m_link_ptr_vector.push_back(net_link);
-        m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
-                                             link->m_weight);
-        m_ni_ptr_vector[dest]->addInPort(net_link);
-    }         else {
-        fatal("Fatal Error:: Reconfiguration not allowed here");
-        //do nothing
-    }
+    net_link->init_net_ptr(this);
+    m_link_ptr_vector.push_back(net_link);
+    m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
+                                         link->m_weight);
+    m_ni_ptr_vector[dest]->addInPort(net_link);
 }
 
 void
 GarnetNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                                 LinkDirection direction, 
-                                const NetDest& routing_table_entry, 
-                                bool isReconfiguration)
+                                const NetDest& routing_table_entry)
 {
     GarnetIntLink* garnet_link = safe_cast<GarnetIntLink*>(link);
+    NetworkLink *net_link = garnet_link->m_network_links[direction];
 
-    if (!isReconfiguration) {
-        NetworkLink *net_link = garnet_link->m_network_links[direction];
-        net_link->init_net_ptr(this);
-        m_link_ptr_vector.push_back(net_link);
-        m_router_ptr_vector[dest]->addInPort(net_link);
-        m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
-                                             link->m_weight);
-    }         else {
-        fatal("Fatal Error:: Reconfiguration not allowed here");
-        // do nothing
-    }
+    net_link->init_net_ptr(this);
+    m_link_ptr_vector.push_back(net_link);
+    m_router_ptr_vector[dest]->addInPort(net_link);
+    m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry,
+                                         link->m_weight);
 
 }
 
index 1db4c9874582b139814093b7ad9e3dfcb64fd2b5..60f3f8b4e475814598e43ed609cd23b207cf6d48 100644 (file)
@@ -70,16 +70,13 @@ class GarnetNetwork : public BaseGarnetNetwork
     // Methods used by Topology to setup the network
     void makeOutLink(SwitchID src, NodeID dest, BasicLink* link, 
                      LinkDirection direction, 
-                     const NetDest& routing_table_entry, 
-                     bool isReconfiguration);
+                     const NetDest& routing_table_entry);
     void makeInLink(NodeID src, SwitchID dest, BasicLink* link, 
                     LinkDirection direction, 
-                    const NetDest& routing_table_entry, 
-                    bool isReconfiguration);
+                    const NetDest& routing_table_entry);
     void makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                           LinkDirection direction, 
-                          const NetDest& routing_table_entry, 
-                          bool isReconfiguration);
+                          const NetDest& routing_table_entry);
 
     //! Function for performing a functional read. The return value
     //! indicates if a message was found that had the required address.
index a51add4a58f6ce6bae6b83ee4ae17a3916cc1ba0..071e1adae73d3c46b96f08db4ff589ab1bf4cada 100644 (file)
@@ -96,8 +96,7 @@ SimpleNetwork::init()
     // The topology pointer should have already been initialized in
     // the parent class network constructor.
     assert(m_topology_ptr != NULL);
-    // false because this isn't a reconfiguration
-    m_topology_ptr->createLinks(this, false);
+    m_topology_ptr->createLinks(this);
 }
 
 void
@@ -130,18 +129,12 @@ SimpleNetwork::~SimpleNetwork()
 void
 SimpleNetwork::makeOutLink(SwitchID src, NodeID dest, BasicLink* link, 
                            LinkDirection direction, 
-                           const NetDest& routing_table_entry, 
-                           bool isReconfiguration)
+                           const NetDest& routing_table_entry)
 {
     assert(dest < m_nodes);
     assert(src < m_switch_ptr_vector.size());
     assert(m_switch_ptr_vector[src] != NULL);
 
-    if (isReconfiguration) {
-        m_switch_ptr_vector[src]->reconfigureOutPort(routing_table_entry);
-        return;
-    }
-
     SimpleExtLink *simple_link = safe_cast<SimpleExtLink*>(link);
 
     m_switch_ptr_vector[src]->addOutPort(m_fromNetQueues[dest],
@@ -156,15 +149,9 @@ SimpleNetwork::makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
 void
 SimpleNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link, 
                           LinkDirection direction, 
-                          const NetDest& routing_table_entry, 
-                          bool isReconfiguration)
+                          const NetDest& routing_table_entry)
 {
     assert(src < m_nodes);
-    if (isReconfiguration) {
-        // do nothing
-        return;
-    }
-
     m_switch_ptr_vector[dest]->addInPort(m_toNetQueues[src]);
 }
 
@@ -172,14 +159,8 @@ SimpleNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
 void
 SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link, 
                                 LinkDirection direction, 
-                                const NetDest& routing_table_entry,
-                                bool isReconfiguration)
+                                const NetDest& routing_table_entry)
 {
-    if (isReconfiguration) {
-        m_switch_ptr_vector[src]->reconfigureOutPort(routing_table_entry);
-        return;
-    }
-
     // Create a set of new MessageBuffers
     std::vector<MessageBuffer*> queues;
     for (int i = 0; i < m_virtual_networks; i++) {
index 8794468229d902d011f0fefb2cc2c9ae93c61dc0..60831ad0fd3852db3873e2ba01c4d0b2e6dc8412 100644 (file)
@@ -73,16 +73,13 @@ class SimpleNetwork : public Network
     // Methods used by Topology to setup the network
     void makeOutLink(SwitchID src, NodeID dest, BasicLink* link, 
                      LinkDirection direction, 
-                     const NetDest& routing_table_entry, 
-                     bool isReconfiguration);
-    void makeInLink(NodeID src, SwitchID dest, BasicLink* link, 
+                     const NetDest& routing_table_entry);
+    void makeInLink(NodeID src, SwitchID dest, BasicLink* link,
                     LinkDirection direction, 
-                    const NetDest& routing_table_entry, 
-                    bool isReconfiguration);
+                    const NetDest& routing_table_entry);
     void makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                           LinkDirection direction, 
-                          const NetDest& routing_table_entry, 
-                          bool isReconfiguration);
+                          const NetDest& routing_table_entry);
 
     void print(std::ostream& out) const;