ruby: change advance_stage for flit_d
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.
This commit is contained in:
parent
f9fa242f42
commit
8b32dad4d8
6 changed files with 7 additions and 7 deletions
|
@ -81,7 +81,7 @@ InputUnit_d::wakeup()
|
||||||
|
|
||||||
m_vcs[vc]->set_enqueue_time(m_router->curCycle());
|
m_vcs[vc]->set_enqueue_time(m_router->curCycle());
|
||||||
} else {
|
} else {
|
||||||
t_flit->advance_stage(SA_, m_router->curCycle());
|
t_flit->advance_stage(SA_, m_router->curCycle() + Cycles(1));
|
||||||
m_router->swarb_req();
|
m_router->swarb_req();
|
||||||
}
|
}
|
||||||
// write flit into input buffer
|
// write flit into input buffer
|
||||||
|
|
|
@ -58,7 +58,7 @@ RoutingUnit_d::RC_stage(flit_d *t_flit, InputUnit_d *in_unit, int invc)
|
||||||
{
|
{
|
||||||
int outport = routeCompute(t_flit);
|
int outport = routeCompute(t_flit);
|
||||||
in_unit->updateRoute(invc, outport, m_router->curCycle());
|
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();
|
m_router->vcarb_req();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ SWallocator_d::arbitrate_outports()
|
||||||
|
|
||||||
// remove flit from Input Unit
|
// remove flit from Input Unit
|
||||||
flit_d *t_flit = m_input_unit[inport]->getTopFlit(invc);
|
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_vc(outvc);
|
||||||
t_flit->set_outport(outport);
|
t_flit->set_outport(outport);
|
||||||
t_flit->set_time(m_router->curCycle() + Cycles(1));
|
t_flit->set_time(m_router->curCycle() + Cycles(1));
|
||||||
|
|
|
@ -73,7 +73,7 @@ Switch_d::wakeup()
|
||||||
flit_d *t_flit = m_switch_buffer[inport]->peekTopFlit();
|
flit_d *t_flit = m_switch_buffer[inport]->peekTopFlit();
|
||||||
if (t_flit->is_stage(ST_, m_router->curCycle())) {
|
if (t_flit->is_stage(ST_, m_router->curCycle())) {
|
||||||
int outport = t_flit->get_outport();
|
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));
|
t_flit->set_time(m_router->curCycle() + Cycles(1));
|
||||||
|
|
||||||
// This will take care of waking up the Network Link
|
// This will take care of waking up the Network Link
|
||||||
|
|
|
@ -57,7 +57,7 @@ VirtualChannel_d::grant_vc(int out_vc, Cycles curTime)
|
||||||
m_vc_state.first = ACTIVE_;
|
m_vc_state.first = ACTIVE_;
|
||||||
m_vc_state.second = curTime + Cycles(1);
|
m_vc_state.second = curTime + Cycles(1);
|
||||||
flit_d *t_flit = m_input_buffer->peekTopFlit();
|
flit_d *t_flit = m_input_buffer->peekTopFlit();
|
||||||
t_flit->advance_stage(SA_, curTime);
|
t_flit->advance_stage(SA_, curTime + Cycles(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -66,10 +66,10 @@ class flit_d
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
advance_stage(flit_stage t_stage, Cycles curTime)
|
advance_stage(flit_stage t_stage, Cycles newTime)
|
||||||
{
|
{
|
||||||
m_stage.first = t_stage;
|
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; }
|
std::pair<flit_stage, Cycles> get_stage() { return m_stage; }
|
||||||
|
|
Loading…
Reference in a new issue