ruby: change advance_stage for flit_d
authorDavid Hashe <david.hashe@amd.com>
Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)
committerDavid Hashe <david.hashe@amd.com>
Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)
Sets m_stage.second to the second parameter of the function.
Then, for every place where advance_stage is called, adds
a cycle to the argument being passed.

src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.cc
src/mem/ruby/network/garnet/fixed-pipeline/flit_d.hh

index 6cb60032a0b2a39a49b7a7b9eaae29fd767cfd01..fb147babc2ca8cd010a40a8ddfafa6f91be78c36 100644 (file)
@@ -81,7 +81,7 @@ InputUnit_d::wakeup()
 
             m_vcs[vc]->set_enqueue_time(m_router->curCycle());
         } else {
-            t_flit->advance_stage(SA_, m_router->curCycle());
+            t_flit->advance_stage(SA_, m_router->curCycle() + Cycles(1));
             m_router->swarb_req();
         }
         // write flit into input buffer
index 8d8378738a2a8c2c62d54227cdb50068b87add28..cd8f974f63089df5ce0ef275608eca11a9264168 100644 (file)
@@ -58,7 +58,7 @@ RoutingUnit_d::RC_stage(flit_d *t_flit, InputUnit_d *in_unit, int invc)
 {
     int outport = routeCompute(t_flit);
     in_unit->updateRoute(invc, outport, m_router->curCycle());
-    t_flit->advance_stage(VA_, m_router->curCycle());
+    t_flit->advance_stage(VA_, m_router->curCycle() + Cycles(1));
     m_router->vcarb_req();
 }
 
index cabf435f42c1eaa07e7f99dcc397a39ea30b089e..21fbfe6e5b7cc36035e670f8503a2a087e6bd88d 100644 (file)
@@ -178,7 +178,7 @@ SWallocator_d::arbitrate_outports()
 
                 // remove flit from Input Unit
                 flit_d *t_flit = m_input_unit[inport]->getTopFlit(invc);
-                t_flit->advance_stage(ST_, m_router->curCycle());
+                t_flit->advance_stage(ST_, m_router->curCycle() + Cycles(1));
                 t_flit->set_vc(outvc);
                 t_flit->set_outport(outport);
                 t_flit->set_time(m_router->curCycle() + Cycles(1));
index 4b4a4f323aecae1d798988e9f88176cac5f3f32b..911c5a6ebc63fddb933e4f94c49946c963b1bed1 100644 (file)
@@ -73,7 +73,7 @@ Switch_d::wakeup()
         flit_d *t_flit = m_switch_buffer[inport]->peekTopFlit();
         if (t_flit->is_stage(ST_, m_router->curCycle())) {
             int outport = t_flit->get_outport();
-            t_flit->advance_stage(LT_, m_router->curCycle());
+            t_flit->advance_stage(LT_, m_router->curCycle() + Cycles(1));
             t_flit->set_time(m_router->curCycle() + Cycles(1));
 
             // This will take care of waking up the Network Link
index 109d2a3be5793b2ee9d994e8e3896f623e2a0da7..4db087188c34e8550ca792ff4e0c96b1f9df3391 100644 (file)
@@ -57,7 +57,7 @@ VirtualChannel_d::grant_vc(int out_vc, Cycles curTime)
     m_vc_state.first = ACTIVE_;
     m_vc_state.second = curTime + Cycles(1);
     flit_d *t_flit = m_input_buffer->peekTopFlit();
-    t_flit->advance_stage(SA_, curTime);
+    t_flit->advance_stage(SA_, curTime + Cycles(1));
 }
 
 bool
index 55187bd14d527a184efd5ccfb873c758624933c4..eb076d613ee2ee375103bf151462206b6f0cc786 100644 (file)
@@ -66,10 +66,10 @@ class flit_d
     }
 
     void
-    advance_stage(flit_stage t_stage, Cycles curTime)
+    advance_stage(flit_stage t_stage, Cycles newTime)
     {
         m_stage.first = t_stage;
-        m_stage.second = curTime + Cycles(1);
+        m_stage.second = newTime;
     }
 
     std::pair<flit_stage, Cycles> get_stage() { return m_stage; }