Go to the documentation of this file.
34 #include "debug/RubyNetwork.hh"
114 for (
int invc_iter = 0; invc_iter <
m_num_vcs; invc_iter++) {
117 if (input_unit->need_stage(invc,
SA_,
curTick())) {
121 int outvc = input_unit->get_outvc(invc);
178 int outvc = input_unit->get_outvc(invc);
185 flit *t_flit = input_unit->getTopFlit(invc);
187 DPRINTF(RubyNetwork,
"SwitchAllocator at Router %d "
188 "granted outvc %d at outport %d "
189 "to invc %d at inport %d to flit %s at "
193 output_unit->get_direction()),
196 input_unit->get_direction()),
213 output_unit->decrement_credit(outvc);
224 assert(!(input_unit->isReady(invc,
curTick())));
227 input_unit->set_vc_idle(invc,
curTick());
231 input_unit->increment_credit(invc,
true,
curTick());
235 input_unit->increment_credit(invc,
false,
curTick());
287 bool has_outvc = (outvc != -1);
288 bool has_credit =
false;
296 if (output_unit->has_free_vc(vnet)) {
309 if (!has_outvc || !has_credit)
323 for (
int vc_offset = 0; vc_offset <
m_vc_per_vnet; vc_offset++) {
324 int temp_vc = vc_base + vc_offset;
325 if (input_unit->need_stage(temp_vc,
SA_,
curTick()) &&
326 (input_unit->get_outport(temp_vc) == outport) &&
327 (input_unit->get_enqueue_time(temp_vc) < t_enqueue_time)) {
375 assert(vnet < m_router->get_num_vnets());
InputUnit * getInputUnit(unsigned port)
std::vector< std::vector< int > > m_vc_winners
OutputUnit * getOutputUnit(unsigned port)
bool has_credit(int out_vc)
void advance_stage(flit_stage t_stage, Tick newTime)
uint64_t Tick
Tick count type.
int vc_allocate(int outport, int inport, int invc)
uint32_t get_vc_per_vnet()
void clear_request_vector()
std::vector< int > m_round_robin_invc
double m_input_arbiter_activity
void set_outport(int port)
void schedule_wakeup(Cycles time)
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
SwitchAllocator(Router *router)
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
void grant_switch(int inport, flit *t_flit)
int select_free_vc(int vnet)
std::vector< int > m_round_robin_inport
void arbitrate_outports()
std::string getPortDirectionName(PortDirection direction)
Cycles is a wrapper class for representing cycle counts, i.e.
bool send_allowed(int inport, int invc, int outport, int outvc)
std::vector< std::vector< bool > > m_port_requests
GarnetNetwork * get_net_ptr()
bool alreadyScheduled(Tick time)
Tick curTick()
The current simulated tick.
double m_output_arbiter_activity
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17