changeset 8439266ec9e5 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=8439266ec9e5
description:
        garnet: separate data and ctrl VCs

        Separate data VCs and ctrl VCs in garnet, as ctrl VCs have 1 buffer per 
VC,
        while data VCs have > 1 buffers per VC. This is for correct power 
estimations.

diffstat:

 src/mem/ruby/network/garnet/BaseGarnetNetwork.cc                 |   3 +-
 src/mem/ruby/network/garnet/BaseGarnetNetwork.hh                 |   6 ++-
 src/mem/ruby/network/garnet/BaseGarnetNetwork.py                 |   3 +-
 src/mem/ruby/network/garnet/NetworkHeader.hh                     |   1 +
 src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc    |   6 +++
 src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh    |  16 
++++++++++
 src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc |   7 ++++
 src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc       |   8 ++++-
 src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.hh       |  10 ++++++
 src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc       |   1 +
 10 files changed, 56 insertions(+), 5 deletions(-)

diffs (169 lines):

diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc  Sun Feb 06 22:14:16 
2011 -0800
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc  Sun Feb 06 22:14:16 
2011 -0800
@@ -36,7 +36,8 @@
     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_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;
 }
 
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh  Sun Feb 06 22:14:16 
2011 -0800
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh  Sun Feb 06 22:14:16 
2011 -0800
@@ -51,13 +51,15 @@
     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; }
+    int getBuffersPerDataVC() {return m_buffers_per_data_vc; }
+    int getBuffersPerCtrlVC() {return m_buffers_per_ctrl_vc; }
 
   protected:
     int m_flit_size;
     int m_number_of_pipe_stages;
     int m_vcs_per_class;
-    int m_buffer_size;
+    int m_buffers_per_data_vc;
+    int m_buffers_per_ctrl_vc;
     bool m_using_network_testing;
 };
 
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/BaseGarnetNetwork.py
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py  Sun Feb 06 22:14:16 
2011 -0800
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py  Sun Feb 06 22:14:16 
2011 -0800
@@ -37,5 +37,6 @@
     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");
+    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 -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/NetworkHeader.hh
--- a/src/mem/ruby/network/garnet/NetworkHeader.hh      Sun Feb 06 22:14:16 
2011 -0800
+++ b/src/mem/ruby/network/garnet/NetworkHeader.hh      Sun Feb 06 22:14:16 
2011 -0800
@@ -36,6 +36,7 @@
 
 enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
 enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
+enum VNET_type {CTRL_VNET_, DATA_VNET_, NUM_VNET_TYPE_};
 enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
 
 #define INFINITE_ 10000
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc     Sun Feb 
06 22:14:16 2011 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc     Sun Feb 
06 22:14:16 2011 -0800
@@ -107,6 +107,12 @@
     for (int i = 0; i < m_router_ptr_vector.size(); i++) {
         m_router_ptr_vector[i]->init();
     }
+
+    m_vnet_type.resize(m_virtual_networks);
+    for (int i = 0; i < m_vnet_type.size(); i++) {
+        m_vnet_type[i] = CTRL_VNET_;
+        // DATA_VNET_ updated later based on traffic
+    }
 }
 
 GarnetNetwork_d::~GarnetNetwork_d()
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh     Sun Feb 
06 22:14:16 2011 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh     Sun Feb 
06 22:14:16 2011 -0800
@@ -68,6 +68,21 @@
     void printConfig(std::ostream& out) const;
     void print(std::ostream& out) const;
 
+    void
+    set_vnet_type(int vc, VNET_type vnet_type)
+    {
+        int vnet = vc/getVCsPerClass();
+        m_vnet_type[vnet] = vnet_type;
+    }
+
+    VNET_type
+    get_vnet_type(int vc)
+    {
+        int vnet = vc/getVCsPerClass();
+        return m_vnet_type[vnet];
+    }
+
+
     inline void increment_injected_flits() { m_flits_injected++; }
     inline void increment_received_flits() { m_flits_received++; }
 
@@ -106,6 +121,7 @@
     GarnetNetwork_d(const GarnetNetwork_d& obj);
     GarnetNetwork_d& operator=(const GarnetNetwork_d& obj);
 
+    std::vector<VNET_type > m_vnet_type;
     // int m_virtual_networks;
     // int m_nodes;
     int m_flits_received, m_flits_injected;
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc  Sun Feb 
06 22:14:16 2011 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc  Sun Feb 
06 22:14:16 2011 -0800
@@ -163,6 +163,13 @@
             // flitisized and an output vc is acquired
             net_msg_ptr->getInternalDestination().removeNetDest(personal_dest);
         }
+        if (num_flits > 1) { // data packet
+            // defining ctrl vnet to be 1-flit packets
+            // and data vnet to be > 1 flit packets
+            m_net_ptr->set_vnet_type(vc, DATA_VNET_);
+            m_out_vc_state[vc]->set_credit_count();
+        }
+
         for (int i = 0; i < num_flits; i++) {
             m_net_ptr->increment_injected_flits();
             flit_d *fl = new flit_d(i, vc, vnet, num_flits, new_msg_ptr);
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc        Sun Feb 
06 22:14:16 2011 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.cc        Sun Feb 
06 22:14:16 2011 -0800
@@ -37,5 +37,11 @@
     m_id = id;
     m_vc_state = IDLE_;
     m_time = g_eventQueue_ptr->getTime();
-    m_credit_count = m_network_ptr->getBufferSize();
+
+    // this value is updated later for data VCs by set_credit_count()
+    m_credit_count = m_network_ptr->getBuffersPerCtrlVC();
+
+    // (num_flits > 1) is used to determine ctrl vs data vnet
+    // in NetworkInterface_d.cc
+    assert(m_credit_count == 1);
 }
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.hh
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.hh        Sun Feb 
06 22:14:16 2011 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutVcState_d.hh        Sun Feb 
06 22:14:16 2011 -0800
@@ -42,6 +42,16 @@
     int get_inport()                { return m_in_port; }
     int get_invc()                  { return m_in_vc; }
     int get_credit_count()          { return m_credit_count; }
+    void
+    set_credit_count()
+    {
+        // only need to initialize credit count for data VCs
+        // constructor sets this to BuffersPerCtrlVC by default
+
+        if (m_network_ptr->get_vnet_type(m_id) == DATA_VNET_)
+            m_credit_count = m_network_ptr->getBuffersPerDataVC();
+    }
+
     void set_inport(int port)       { m_in_port = port; }
     void set_invc(int vc)           { m_in_vc = vc; }
     inline bool
diff -r 48d31b577847 -r 8439266ec9e5 
src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc        Sun Feb 
06 22:14:16 2011 -0800
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc        Sun Feb 
06 22:14:16 2011 -0800
@@ -102,6 +102,7 @@
 OutputUnit_d::update_vc(int vc, int in_port, int in_vc)
 {
     m_outvc_state[vc]->setState(ACTIVE_, g_eventQueue_ptr->getTime() + 1);
+    m_outvc_state[vc]->set_credit_count();
     m_outvc_state[vc]->set_inport(in_port);
     m_outvc_state[vc]->set_invc(in_vc);
     m_router->update_incredit(in_port, in_vc,
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to