Go to the documentation of this file.
35 #include "debug/RubyNetwork.hh"
49 return (
l1.m_value <
l2.m_value);
76 for (
int i = 0;
i < in.size(); ++
i) {
77 if (in[
i] !=
nullptr) {
78 in[
i]->setConsumer(
this);
79 in[
i]->setIncomingLink(port);
87 const NetDest& routing_table_entry)
116 for (
int counter = 0; counter <
m_in.size(); counter++) {
119 if (incoming >=
m_in.size()) {
124 if (
m_in[incoming].size() <= vnet) {
129 if (buffer ==
nullptr) {
150 while (buffer->
isReady(current_time)) {
151 DPRINTF(RubyNetwork,
"incoming: %d\n", incoming);
155 net_msg_ptr = msg_ptr.get();
156 DPRINTF(RubyNetwork,
"Message: %s\n", (*net_msg_ptr));
158 output_links.clear();
159 output_link_destinations.clear();
172 for (
int out = 0; out <
m_out.size(); out++) {
178 for (
int out = 0; out <
m_out.size(); out++) {
179 int out_queue_length = 0;
181 out_queue_length +=
m_out[out][
v]->getSize(current_time);
184 (out_queue_length << 8) |
199 DPRINTF(RubyNetwork,
"dst: %s\n", dst);
205 output_links.push_back(link);
211 output_link_destinations.push_back(msg_dsts.
AND(dst));
218 assert(msg_dsts.
count() == 0);
222 for (
int i = 0;
i < output_links.size();
i++) {
223 int outgoing = output_links[
i];
225 if (!
m_out[outgoing][vnet]->areNSlotsAvailable(1, current_time))
228 DPRINTF(RubyNetwork,
"Checking if node is blocked ..."
229 "outgoing: %d, vnet: %d, enough: %d\n",
230 outgoing, vnet, enough);
236 DPRINTF(RubyNetwork,
"Can't deliver message since a node "
238 DPRINTF(RubyNetwork,
"Message: %s\n", (*net_msg_ptr));
242 MsgPtr unmodified_msg_ptr;
244 if (output_links.size() > 1) {
252 unmodified_msg_ptr = msg_ptr->clone();
260 for (
int i=0;
i<output_links.size();
i++) {
261 int outgoing = output_links[
i];
265 msg_ptr = unmodified_msg_ptr->clone();
270 net_msg_ptr = msg_ptr.get();
274 DPRINTF(RubyNetwork,
"Enqueuing net msg from "
275 "inport[%d][%d] to outport [%d][%d].\n",
276 incoming, vnet, outgoing, vnet);
278 m_out[outgoing][vnet]->enqueue(msg_ptr, current_time,
290 int lowest_prio_vnet = 0;
296 highest_prio_vnet = 0;
302 for (
int vnet = highest_prio_vnet;
303 (vnet * decrementer) >= (decrementer * lowest_prio_vnet);
304 vnet -= decrementer) {
SimpleNetwork * m_network_ptr
std::vector< LinkOrder > m_link_order
Tick dequeue(Tick current_time, bool decrement_messages=true)
Updates the delay cycles of the message at the head of the queue, removes it from the queue and retur...
void operateMessageBuffer(MessageBuffer *b, int incoming, int vnet)
virtual const NetDest & getDestination() const
void addOutPort(const std::vector< MessageBuffer * > &out, const NetDest &routing_table_entry)
void print(std::ostream &out) const
std::vector< std::vector< MessageBuffer * > > m_out
uint64_t Tick
Tick count type.
std::vector< NetDest > m_routing_table
void operateVnet(int vnet)
bool operator<(const LinkOrder &l1, const LinkOrder &l2)
bool isVNetOrdered(int vnet) const
const MsgPtr & peekMsgPtr() const
Tick cyclesToTicks(Cycles c) const
bool getAdaptiveRouting()
uint32_t m_virtual_networks
void addInPort(const std::vector< MessageBuffer * > &in)
bool isReady(Tick current_time) const
PerfectSwitch(SwitchID sid, Switch *, uint32_t)
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 init(SimpleNetwork *)
std::shared_ptr< Message > MsgPtr
void storeEventInfo(int info)
Overload hash function for BasicBlockRange type.
const int PRIORITY_SWITCH_LIMIT
Cycles is a wrapper class for representing cycle counts, i.e.
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
bool intersectionIsNotEmpty(const NetDest &other_netDest) const
const SwitchID m_switch_id
std::vector< int > m_pending_message_count
NetDest AND(const NetDest &andNetDest) const
void removeNetDest(const NetDest &netDest)
void scheduleEvent(Cycles timeDelta)
std::vector< std::vector< MessageBuffer * > > m_in
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17