Go to the documentation of this file.
36 #include "debug/RubyNetwork.hh"
54 return (
l1.m_value <
l2.m_value);
81 for (
int i = 0;
i < in.size(); ++
i) {
82 if (in[
i] !=
nullptr) {
83 in[
i]->setConsumer(
this);
84 in[
i]->setIncomingLink(port);
92 const NetDest& routing_table_entry)
101 m_out.push_back(out);
121 for (
int counter = 0; counter <
m_in.size(); counter++) {
124 if (incoming >=
m_in.size()) {
129 if (
m_in[incoming].size() <= vnet) {
134 if (buffer ==
nullptr) {
155 while (buffer->
isReady(current_time)) {
156 DPRINTF(RubyNetwork,
"incoming: %d\n", incoming);
160 net_msg_ptr = msg_ptr.get();
161 DPRINTF(RubyNetwork,
"Message: %s\n", (*net_msg_ptr));
163 output_links.clear();
164 output_link_destinations.clear();
177 for (
int out = 0; out <
m_out.size(); out++) {
183 for (
int out = 0; out <
m_out.size(); out++) {
184 int out_queue_length = 0;
186 out_queue_length +=
m_out[out][
v]->getSize(current_time);
189 (out_queue_length << 8) |
204 DPRINTF(RubyNetwork,
"dst: %s\n", dst);
210 output_links.push_back(link);
216 output_link_destinations.push_back(msg_dsts.
AND(dst));
223 assert(msg_dsts.
count() == 0);
227 for (
int i = 0;
i < output_links.size();
i++) {
228 int outgoing = output_links[
i];
230 if (!
m_out[outgoing][vnet]->areNSlotsAvailable(1, current_time))
233 DPRINTF(RubyNetwork,
"Checking if node is blocked ..."
234 "outgoing: %d, vnet: %d, enough: %d\n",
235 outgoing, vnet, enough);
241 DPRINTF(RubyNetwork,
"Can't deliver message since a node "
243 DPRINTF(RubyNetwork,
"Message: %s\n", (*net_msg_ptr));
247 MsgPtr unmodified_msg_ptr;
249 if (output_links.size() > 1) {
257 unmodified_msg_ptr = msg_ptr->clone();
265 for (
int i=0;
i<output_links.size();
i++) {
266 int outgoing = output_links[
i];
270 msg_ptr = unmodified_msg_ptr->clone();
275 net_msg_ptr = msg_ptr.get();
279 DPRINTF(RubyNetwork,
"Enqueuing net msg from "
280 "inport[%d][%d] to outport [%d][%d].\n",
281 incoming, vnet, outgoing, vnet);
283 m_out[outgoing][vnet]->enqueue(msg_ptr, current_time,
295 int lowest_prio_vnet = 0;
301 highest_prio_vnet = 0;
307 for (
int vnet = highest_prio_vnet;
308 (vnet * decrementer) >= (decrementer * lowest_prio_vnet);
309 vnet -= decrementer) {
std::vector< std::vector< MessageBuffer * > > m_out
std::shared_ptr< Message > MsgPtr
NetDest AND(const NetDest &andNetDest) const
void operateMessageBuffer(MessageBuffer *b, int incoming, int vnet)
bool isVNetOrdered(int vnet) const
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...
std::vector< NetDest > m_routing_table
std::enable_if_t< std::is_integral_v< T >, T > random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
void removeNetDest(const NetDest &netDest)
const MsgPtr & peekMsgPtr() const
Cycles is a wrapper class for representing cycle counts, i.e.
const int PRIORITY_SWITCH_LIMIT
void addInPort(const std::vector< MessageBuffer * > &in)
bool getAdaptiveRouting()
Tick cyclesToTicks(Cycles c) const
void init(SimpleNetwork *)
void scheduleEvent(Cycles timeDelta)
std::vector< std::vector< MessageBuffer * > > m_in
uint64_t Tick
Tick count type.
const SwitchID m_switch_id
std::vector< int > m_pending_message_count
SignedBitfield< 31, 0 > sw
bool operator<(const LinkOrder &l1, const LinkOrder &l2)
SimpleNetwork * m_network_ptr
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...
bool isReady(Tick current_time) const
uint32_t m_virtual_networks
void print(std::ostream &out) const
void operateVnet(int vnet)
PerfectSwitch(SwitchID sid, Switch *, uint32_t)
bool intersectionIsNotEmpty(const NetDest &other_netDest) const
virtual const NetDest & getDestination() const
void storeEventInfo(int info)
std::vector< LinkOrder > m_link_order
void addOutPort(const std::vector< MessageBuffer * > &out, const NetDest &routing_table_entry)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Generated on Tue Dec 21 2021 11:34:33 for gem5 by doxygen 1.8.17