34#include "debug/RubyNetwork.hh"
118 for (
int invc_iter = 0; invc_iter <
m_num_vcs; invc_iter++) {
121 if (input_unit->need_stage(invc,
SA_,
curTick())) {
125 int outvc = input_unit->get_outvc(invc);
182 int outvc = input_unit->get_outvc(invc);
189 flit *t_flit = input_unit->getTopFlit(invc);
191 DPRINTF(RubyNetwork,
"SwitchAllocator at Router %d "
192 "granted outvc %d at outport %d "
193 "to invc %d at inport %d to flit %s at "
197 output_unit->get_direction()),
200 input_unit->get_direction()),
217 output_unit->decrement_credit(outvc);
228 assert(!(input_unit->isReady(invc,
curTick())));
231 input_unit->set_vc_idle(invc,
curTick());
235 input_unit->increment_credit(invc,
true,
curTick());
239 input_unit->increment_credit(invc,
false,
curTick());
291 bool has_outvc = (outvc != -1);
292 bool has_credit =
false;
300 if (output_unit->has_free_vc(vnet)) {
313 if (!has_outvc || !has_credit)
327 for (
int vc_offset = 0; vc_offset <
m_vc_per_vnet; vc_offset++) {
328 int temp_vc = vc_base + vc_offset;
329 if (input_unit->need_stage(temp_vc,
SA_,
curTick()) &&
330 (input_unit->get_outport(temp_vc) == outport) &&
331 (input_unit->get_enqueue_time(temp_vc) < t_enqueue_time)) {
379 assert(vnet < m_router->get_num_vnets());
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
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...
Cycles is a wrapper class for representing cycle counts, i.e.
bool alreadyScheduled(Tick time)
int select_free_vc(int vnet)
bool has_credit(int out_vc)
OutputUnit * getOutputUnit(unsigned port)
GarnetNetwork * get_net_ptr()
std::string getPortDirectionName(PortDirection direction)
void grant_switch(int inport, flit *t_flit)
void schedule_wakeup(Cycles time)
uint32_t get_vc_per_vnet()
InputUnit * getInputUnit(unsigned port)
std::vector< int > m_vc_winners
std::vector< int > m_round_robin_invc
void clear_request_vector()
std::vector< int > m_round_robin_inport
std::vector< int > m_port_requests
bool send_allowed(int inport, int invc, int outport, int outvc)
double m_input_arbiter_activity
int vc_allocate(int outport, int inport, int invc)
double m_output_arbiter_activity
void arbitrate_outports()
SwitchAllocator(Router *router)
void advance_stage(flit_stage t_stage, Tick newTime)
void set_outport(int port)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Tick
Tick count type.