changeset 9b57f0108bc8 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=9b57f0108bc8
description:
        ruby: Converted Garnet to M5 configuration

diffstat:

28 files changed, 340 insertions(+), 245 deletions(-)
configs/common/Options.py                                         |    2 
configs/ruby/Ruby.py                                              |    7 
src/mem/ruby/network/garnet/BaseGarnetNetwork.cc                  |   46 +++
src/mem/ruby/network/garnet/BaseGarnetNetwork.hh                  |   66 +++++
src/mem/ruby/network/garnet/BaseGarnetNetwork.py                  |   11 
src/mem/ruby/network/garnet/NetworkHeader.hh                      |    2 
src/mem/ruby/network/garnet/SConscript                            |   39 +++
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc     |  122 
+++++-----
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh     |   13 -
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py     |    6 
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc  |    6 
src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc       |    5 
src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh       |    4 
src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc        |    3 
src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc        |    1 
src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc            |    4 
src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh            |    7 
src/mem/ruby/network/garnet/fixed-pipeline/SConscript             |    9 
src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc       |    1 
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc    |  107 
++++----
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh    |   15 -
src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.py    |    6 
src/mem/ruby/network/garnet/flexible-pipeline/NetworkConfig.hh    |   73 -----
src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc |    6 
src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc      |    3 
src/mem/ruby/network/garnet/flexible-pipeline/Router.cc           |   14 -
src/mem/ruby/network/garnet/flexible-pipeline/SConscript          |    5 
src/mem/ruby/system/System.cc                                     |    2 

diffs (truncated from 1006 to 300 lines):

diff -r 341a71fd2600 -r 9b57f0108bc8 configs/common/Options.py
--- a/configs/common/Options.py Fri Jan 29 20:29:30 2010 -0800
+++ b/configs/common/Options.py Fri Jan 29 20:29:32 2010 -0800
@@ -41,6 +41,8 @@
                   help="'crossbar'|'mesh'")
 parser.add_option("--mesh-rows", type="int", default=1,
                   help="the number of rows in the mesh topology")
+parser.add_option("--garnet-network", type="string", default=none,
+                  help="'fixed'|'flexible'")
       
 # Run duration options
 parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick,
diff -r 341a71fd2600 -r 9b57f0108bc8 configs/ruby/Ruby.py
--- a/configs/ruby/Ruby.py      Fri Jan 29 20:29:30 2010 -0800
+++ b/configs/ruby/Ruby.py      Fri Jan 29 20:29:32 2010 -0800
@@ -90,7 +90,12 @@
                                 len(cpu_sequencers),
                                 options.mesh_rows)
 
-    network = SimpleNetwork(topology = net_topology)
+    if options.garnet_network == "fixed":
+        network = GarnetNetwork_d(topology = net_topology)
+    elif options.garnet_network == "flexible":
+        network = GarnetNetwork(topology = net_topology)
+    else:
+        network = SimpleNetwork(topology = net_topology)
 
     #
     # determine the total memory size of the ruby system and verify it is equal
diff -r 341a71fd2600 -r 9b57f0108bc8 
src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc  Fri Jan 29 20:29:32 
2010 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2008 Princeton University
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Niket Agarwal
+ */
+
+#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
+
+BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
+    : Network(p)
+{
+    m_flit_size = p->flit_size;
+    m_number_of_pipe_stages = p->number_of_pipe_stages;
+    m_vcs_per_class = p->vcs_per_class;
+    m_buffer_size = p->buffer_size;
+    m_using_network_testing = p->using_network_testing;
+}
+
+void BaseGarnetNetwork::init()
+{
+    Network::init();
+}
diff -r 341a71fd2600 -r 9b57f0108bc8 
src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh  Fri Jan 29 20:29:32 
2010 -0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2008 Princeton University
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Niket Agarwal
+ */
+
+/*
+ * This header file is used to define all configuration parameters
+ * required by the interconnection network.
+ */
+
+#ifndef BASEGARNETNETWORK_H
+#define BASEGARNETNETWORK_H
+
+#include "mem/ruby/network/garnet/NetworkHeader.hh"
+#include "mem/gems_common/util.hh"
+#include "mem/ruby/network/Network.hh"
+#include "params/BaseGarnetNetwork.hh"
+
+class BaseGarnetNetwork : public Network {
+  public:
+    typedef BaseGarnetNetworkParams Params;
+    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; }
+    int getBufferSize() {return m_buffer_size; }
+
+  protected:
+    int m_flit_size;
+    int m_number_of_pipe_stages;
+    int m_vcs_per_class;
+    int m_buffer_size;
+    bool m_using_network_testing;
+
+};
+
+
+#endif
diff -r 341a71fd2600 -r 9b57f0108bc8 
src/mem/ruby/network/garnet/BaseGarnetNetwork.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py  Fri Jan 29 20:29:32 
2010 -0800
@@ -0,0 +1,11 @@
+from m5.params import *
+from Network import RubyNetwork
+
+class BaseGarnetNetwork(RubyNetwork):
+    type = 'BaseGarnetNetwork'
+    abstract = True
+    flit_size = Param.Int(16, "flit size in bytes")
+    number_of_pipe_stages = Param.Int(4, "router pipeline stages");
+    vcs_per_class = Param.Int(4, "virtual channels per message class");
+    buffer_size = Param.Int(4, "buffer size in bytes");
+    using_network_testing = Param.Bool(False, "network testing enable");
diff -r 341a71fd2600 -r 9b57f0108bc8 
src/mem/ruby/network/garnet/NetworkHeader.hh
--- a/src/mem/ruby/network/garnet/NetworkHeader.hh      Fri Jan 29 20:29:30 
2010 -0800
+++ b/src/mem/ruby/network/garnet/NetworkHeader.hh      Fri Jan 29 20:29:32 
2010 -0800
@@ -41,8 +41,6 @@
 enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
 enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
 
-#define NETCONFIG_DEFAULTS "netconfig.defaults"
-
 #define INFINITE_ 10000
 
 #endif
diff -r 341a71fd2600 -r 9b57f0108bc8 src/mem/ruby/network/garnet/SConscript
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mem/ruby/network/garnet/SConscript    Fri Jan 29 20:29:32 2010 -0800
@@ -0,0 +1,39 @@
+# -*- mode:python -*-
+
+# Copyright (c) 2009 The Hewlett-Packard Development Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Nathan Binkert
+
+Import('*')
+
+if not env['RUBY']:
+    Return()
+
+SimObject('BaseGarnetNetwork.py')
+
+Source('BaseGarnetNetwork.cc')
+
diff -r 341a71fd2600 -r 9b57f0108bc8 
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc     Fri Jan 
29 20:29:30 2010 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc     Fri Jan 
29 20:29:32 2010 -0800
@@ -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);
+    BaseGarnetNetwork::init();
 
-        //added by SS
-        m_network_config_ptr = new NetworkConfig;
-        m_network_config_ptr->init(argv);
+    //
+    // The topology pointer should have already been initialized in the parent 
+    // network constructor.
+    //
+    assert(m_topology_ptr != NULL);
 
-        m_ruby_start = 0;
-        m_flits_recieved = 0;
-        m_flits_injected = 0;
-        m_network_latency = 0.0;
-        m_queueing_latency = 0.0;
+    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));
+    }
 
-        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;
-        }
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to