34 #include "debug/RubyNetwork.hh" 114 for (
int invc_iter = 0; invc_iter <
m_num_vcs; invc_iter++) {
121 int outvc = input_unit->get_outvc(invc);
143 if (invc >= m_num_vcs)
183 int outvc = input_unit->get_outvc(invc);
190 flit *t_flit = input_unit->getTopFlit(invc);
192 DPRINTF(RubyNetwork,
"SwitchAllocator at Router %d " 193 "granted outvc %d at outport %d " 194 "to invc %d at inport %d to flit %s at " 198 output_unit->get_direction()),
201 input_unit->get_direction()),
218 output_unit->decrement_credit(outvc);
236 input_unit->increment_credit(invc,
true,
241 input_unit->increment_credit(invc,
false,
257 if (inport >= m_num_inports)
285 bool has_outvc = (outvc != -1);
286 bool has_credit =
false;
294 if (output_unit->has_free_vc(vnet)) {
307 if (!has_outvc || !has_credit)
316 Cycles t_enqueue_time = input_unit->get_enqueue_time(invc);
321 for (
int vc_offset = 0; vc_offset <
m_vc_per_vnet; vc_offset++) {
322 int temp_vc = vc_base + vc_offset;
324 (input_unit->get_outport(temp_vc) == outport) &&
325 (input_unit->get_enqueue_time(temp_vc) < t_enqueue_time)) {
369 assert(vnet < m_router->get_num_vnets());
void set_outport(int port)
double m_input_arbiter_activity
Cycles is a wrapper class for representing cycle counts, i.e.
std::vector< std::vector< bool > > m_port_requests
void arbitrate_outports()
void grant_switch(int inport, flit *t_flit)
std::vector< std::vector< int > > m_vc_winners
std::string getPortDirectionName(PortDirection direction)
OutputUnit * getOutputUnit(unsigned port)
void schedule_wakeup(Cycles time)
bool has_credit(int out_vc)
GarnetNetwork * get_net_ptr()
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
void clear_request_vector()
double m_output_arbiter_activity
bool send_allowed(int inport, int invc, int outport, int outvc)
int vc_allocate(int outport, int inport, int invc)
SwitchAllocator(Router *router)
std::vector< int > m_round_robin_inport
void advance_stage(flit_stage t_stage, Cycles newTime)
std::vector< int > m_round_robin_invc
InputUnit * getInputUnit(unsigned port)
int select_free_vc(int vnet)