gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NetworkInterface.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Advanced Micro Devices, Inc.
3  * Copyright (c) 2020 Inria
4  * Copyright (c) 2016 Georgia Institute of Technology
5  * Copyright (c) 2008 Princeton University
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met: redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer;
12  * redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution;
15  * neither the name of the copyright holders nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 
34 
35 #include <cassert>
36 #include <cmath>
37 
38 #include "base/cast.hh"
39 #include "debug/RubyNetwork.hh"
44 
46  : ClockedObject(p), Consumer(this), m_id(p.id),
47  m_virtual_networks(p.virt_nets), m_vc_per_vnet(0),
48  m_vc_allocator(m_virtual_networks, 0),
49  m_deadlock_threshold(p.garnet_deadlock_threshold),
50  vc_busy_counter(m_virtual_networks, 0)
51 {
53  niOutVcs.resize(0);
54 }
55 
56 void
58  CreditLink *credit_link)
59 {
60  InputPort *newInPort = new InputPort(in_link, credit_link);
61  inPorts.push_back(newInPort);
62  DPRINTF(RubyNetwork, "Adding input port:%s with vnets %s\n",
63  in_link->name(), newInPort->printVnets());
64 
65  in_link->setLinkConsumer(this);
66  credit_link->setSourceQueue(newInPort->outCreditQueue(), this);
67  if (m_vc_per_vnet != 0) {
68  in_link->setVcsPerVnet(m_vc_per_vnet);
69  credit_link->setVcsPerVnet(m_vc_per_vnet);
70  }
71 
72 }
73 
74 void
76  CreditLink *credit_link,
77  SwitchID router_id, uint32_t consumerVcs)
78 {
79  OutputPort *newOutPort = new OutputPort(out_link, credit_link, router_id);
80  outPorts.push_back(newOutPort);
81 
82  assert(consumerVcs > 0);
83  // We are not allowing different physical links to have different vcs
84  // If it is required that the Network Interface support different VCs
85  // for every physical link connected to it. Then they need to change
86  // the logic within outport and inport.
87  if (niOutVcs.size() == 0) {
88  m_vc_per_vnet = consumerVcs;
89  int m_num_vcs = consumerVcs * m_virtual_networks;
90  niOutVcs.resize(m_num_vcs);
91  outVcState.reserve(m_num_vcs);
92  m_ni_out_vcs_enqueue_time.resize(m_num_vcs);
93  // instantiating the NI flit buffers
94  for (int i = 0; i < m_num_vcs; i++) {
96  outVcState.emplace_back(i, m_net_ptr, consumerVcs);
97  }
98 
99  // Reset VC Per VNET for input links already instantiated
100  for (auto &iPort: inPorts) {
101  NetworkLink *inNetLink = iPort->inNetLink();
102  inNetLink->setVcsPerVnet(m_vc_per_vnet);
103  credit_link->setVcsPerVnet(m_vc_per_vnet);
104  }
105  } else {
106  fatal_if(consumerVcs != m_vc_per_vnet,
107  "%s: Connected Physical links have different vc requests: %d and %d\n",
108  name(), consumerVcs, m_vc_per_vnet);
109  }
110 
111  DPRINTF(RubyNetwork, "OutputPort:%s Vnet: %s\n",
112  out_link->name(), newOutPort->printVnets());
113 
114  out_link->setSourceQueue(newOutPort->outFlitQueue(), this);
115  out_link->setVcsPerVnet(m_vc_per_vnet);
116  credit_link->setLinkConsumer(this);
117  credit_link->setVcsPerVnet(m_vc_per_vnet);
118 }
119 
120 void
123 {
124  inNode_ptr = in;
125  outNode_ptr = out;
126 
127  for (auto& it : in) {
128  if (it != nullptr) {
129  it->setConsumer(this);
130  }
131  }
132 }
133 
134 void
136 {
137  // An output MessageBuffer has dequeued something this cycle and there
138  // is now space to enqueue a stalled message. However, we cannot wake
139  // on the same cycle as the dequeue. Schedule a wake at the soonest
140  // possible time (next cycle).
142 }
143 
144 void
146 {
147  int vnet = t_flit->get_vnet();
148 
149  // Latency
151  Tick network_delay =
152  t_flit->get_dequeue_time() -
153  t_flit->get_enqueue_time() - cyclesToTicks(Cycles(1));
154  Tick src_queueing_delay = t_flit->get_src_delay();
155  Tick dest_queueing_delay = (curTick() - t_flit->get_dequeue_time());
156  Tick queueing_delay = src_queueing_delay + dest_queueing_delay;
157 
158  m_net_ptr->increment_flit_network_latency(network_delay, vnet);
159  m_net_ptr->increment_flit_queueing_latency(queueing_delay, vnet);
160 
161  if (t_flit->get_type() == TAIL_ || t_flit->get_type() == HEAD_TAIL_) {
163  m_net_ptr->increment_packet_network_latency(network_delay, vnet);
164  m_net_ptr->increment_packet_queueing_latency(queueing_delay, vnet);
165  }
166 
167  // Hops
169 }
170 
171 /*
172  * The NI wakeup checks whether there are any ready messages in the protocol
173  * buffer. If yes, it picks that up, flitisizes it into a number of flits and
174  * puts it into an output buffer and schedules the output link. On a wakeup
175  * it also checks whether there are flits in the input link. If yes, it picks
176  * them up and if the flit is a tail, the NI inserts the corresponding message
177  * into the protocol buffer. It also checks for credits being sent by the
178  * downstream router.
179  */
180 
181 void
183 {
184  std::ostringstream oss;
185  for (auto &oPort: outPorts) {
186  oss << oPort->routerID() << "[" << oPort->printVnets() << "] ";
187  }
188  DPRINTF(RubyNetwork, "Network Interface %d connected to router:%s "
189  "woke up. Period: %ld\n", m_id, oss.str(), clockPeriod());
190 
191  assert(curTick() == clockEdge());
192  MsgPtr msg_ptr;
193  Tick curTime = clockEdge();
194 
195  // Checking for messages coming from the protocol
196  // can pick up a message/cycle for each virtual net
197  for (int vnet = 0; vnet < inNode_ptr.size(); ++vnet) {
198  MessageBuffer *b = inNode_ptr[vnet];
199  if (b == nullptr) {
200  continue;
201  }
202 
203  if (b->isReady(curTime)) { // Is there a message waiting
204  msg_ptr = b->peekMsgPtr();
205  if (flitisizeMessage(msg_ptr, vnet)) {
206  b->dequeue(curTime);
207  }
208  }
209  }
210 
212 
213  // Check if there are flits stalling a virtual channel. Track if a
214  // message is enqueued to restrict ejection to one message per cycle.
215  checkStallQueue();
216 
217  /*********** Check the incoming flit link **********/
218  DPRINTF(RubyNetwork, "Number of input ports: %d\n", inPorts.size());
219  for (auto &iPort: inPorts) {
220  NetworkLink *inNetLink = iPort->inNetLink();
221  if (inNetLink->isReady(curTick())) {
222  flit *t_flit = inNetLink->consumeLink();
223  DPRINTF(RubyNetwork, "Recieved flit:%s\n", *t_flit);
224  assert(t_flit->m_width == iPort->bitWidth());
225 
226  int vnet = t_flit->get_vnet();
227  t_flit->set_dequeue_time(curTick());
228 
229  // If a tail flit is received, enqueue into the protocol buffers
230  // if space is available. Otherwise, exchange non-tail flits for
231  // credits.
232  if (t_flit->get_type() == TAIL_ ||
233  t_flit->get_type() == HEAD_TAIL_) {
234  if (!iPort->messageEnqueuedThisCycle &&
235  outNode_ptr[vnet]->areNSlotsAvailable(1, curTime)) {
236  // Space is available. Enqueue to protocol buffer.
237  outNode_ptr[vnet]->enqueue(t_flit->get_msg_ptr(), curTime,
238  cyclesToTicks(Cycles(1)));
239 
240  // Simply send a credit back since we are not buffering
241  // this flit in the NI
242  Credit *cFlit = new Credit(t_flit->get_vc(),
243  true, curTick());
244  iPort->sendCredit(cFlit);
245  // Update stats and delete flit pointer
246  incrementStats(t_flit);
247  delete t_flit;
248  } else {
249  // No space available- Place tail flit in stall queue and
250  // set up a callback for when protocol buffer is dequeued.
251  // Stat update and flit pointer deletion will occur upon
252  // unstall.
253  iPort->m_stall_queue.push_back(t_flit);
254  m_stall_count[vnet]++;
255 
256  outNode_ptr[vnet]->registerDequeueCallback([this]() {
257  dequeueCallback(); });
258  }
259  } else {
260  // Non-tail flit. Send back a credit but not VC free signal.
261  Credit *cFlit = new Credit(t_flit->get_vc(), false,
262  curTick());
263  // Simply send a credit back since we are not buffering
264  // this flit in the NI
265  iPort->sendCredit(cFlit);
266 
267  // Update stats and delete flit pointer.
268  incrementStats(t_flit);
269  delete t_flit;
270  }
271  }
272  }
273 
274  /****************** Check the incoming credit link *******/
275 
276  for (auto &oPort: outPorts) {
277  CreditLink *inCreditLink = oPort->inCreditLink();
278  if (inCreditLink->isReady(curTick())) {
279  Credit *t_credit = (Credit*) inCreditLink->consumeLink();
280  outVcState[t_credit->get_vc()].increment_credit();
281  if (t_credit->is_free_signal()) {
282  outVcState[t_credit->get_vc()].setState(IDLE_,
283  curTick());
284  }
285  delete t_credit;
286  }
287  }
288 
289 
290  // It is possible to enqueue multiple outgoing credit flits if a message
291  // was unstalled in the same cycle as a new message arrives. In this
292  // case, we should schedule another wakeup to ensure the credit is sent
293  // back.
294  for (auto &iPort: inPorts) {
295  if (iPort->outCreditQueue()->getSize() > 0) {
296  DPRINTF(RubyNetwork, "Sending a credit %s via %s at %ld\n",
297  *(iPort->outCreditQueue()->peekTopFlit()),
298  iPort->outCreditLink()->name(), clockEdge(Cycles(1)));
299  iPort->outCreditLink()->
301  }
302  }
303  checkReschedule();
304 }
305 
306 void
308 {
309  // Check all stall queues.
310  // There is one stall queue for each input link
311  for (auto &iPort: inPorts) {
312  iPort->messageEnqueuedThisCycle = false;
313  Tick curTime = clockEdge();
314 
315  if (!iPort->m_stall_queue.empty()) {
316  for (auto stallIter = iPort->m_stall_queue.begin();
317  stallIter != iPort->m_stall_queue.end(); ) {
318  flit *stallFlit = *stallIter;
319  int vnet = stallFlit->get_vnet();
320 
321  // If we can now eject to the protocol buffer,
322  // send back credits
323  if (outNode_ptr[vnet]->areNSlotsAvailable(1,
324  curTime)) {
325  outNode_ptr[vnet]->enqueue(stallFlit->get_msg_ptr(),
326  curTime, cyclesToTicks(Cycles(1)));
327 
328  // Send back a credit with free signal now that the
329  // VC is no longer stalled.
330  Credit *cFlit = new Credit(stallFlit->get_vc(), true,
331  curTick());
332  iPort->sendCredit(cFlit);
333 
334  // Update Stats
335  incrementStats(stallFlit);
336 
337  // Flit can now safely be deleted and removed from stall
338  // queue
339  delete stallFlit;
340  iPort->m_stall_queue.erase(stallIter);
341  m_stall_count[vnet]--;
342 
343  // If there are no more stalled messages for this vnet, the
344  // callback on it's MessageBuffer is not needed.
345  if (m_stall_count[vnet] == 0)
346  outNode_ptr[vnet]->unregisterDequeueCallback();
347 
348  iPort->messageEnqueuedThisCycle = true;
349  break;
350  } else {
351  ++stallIter;
352  }
353  }
354  }
355  }
356 }
357 
358 // Embed the protocol message into flits
359 bool
361 {
362  Message *net_msg_ptr = msg_ptr.get();
363  NetDest net_msg_dest = net_msg_ptr->getDestination();
364 
365  // gets all the destinations associated with this message.
366  std::vector<NodeID> dest_nodes = net_msg_dest.getAllDest();
367 
368  // Number of flits is dependent on the link bandwidth available.
369  // This is expressed in terms of bytes/cycle or the flit size
370  OutputPort *oPort = getOutportForVnet(vnet);
371  assert(oPort);
372  int num_flits = (int)divCeil((float) m_net_ptr->MessageSizeType_to_int(
373  net_msg_ptr->getMessageSize()), (float)oPort->bitWidth());
374 
375  DPRINTF(RubyNetwork, "Message Size:%d vnet:%d bitWidth:%d\n",
377  vnet, oPort->bitWidth());
378 
379  // loop to convert all multicast messages into unicast messages
380  for (int ctr = 0; ctr < dest_nodes.size(); ctr++) {
381 
382  // this will return a free output virtual channel
383  int vc = calculateVC(vnet);
384 
385  if (vc == -1) {
386  return false ;
387  }
388  MsgPtr new_msg_ptr = msg_ptr->clone();
389  NodeID destID = dest_nodes[ctr];
390 
391  Message *new_net_msg_ptr = new_msg_ptr.get();
392  if (dest_nodes.size() > 1) {
393  NetDest personal_dest;
394  for (int m = 0; m < (int) MachineType_NUM; m++) {
395  if ((destID >= MachineType_base_number((MachineType) m)) &&
396  destID < MachineType_base_number((MachineType) (m+1))) {
397  // calculating the NetDest associated with this destID
398  personal_dest.clear();
399  personal_dest.add((MachineID) {(MachineType) m, (destID -
400  MachineType_base_number((MachineType) m))});
401  new_net_msg_ptr->getDestination() = personal_dest;
402  break;
403  }
404  }
405  net_msg_dest.removeNetDest(personal_dest);
406  // removing the destination from the original message to reflect
407  // that a message with this particular destination has been
408  // flitisized and an output vc is acquired
409  net_msg_ptr->getDestination().removeNetDest(personal_dest);
410  }
411 
412  // Embed Route into the flits
413  // NetDest format is used by the routing table
414  // Custom routing algorithms just need destID
415 
416  RouteInfo route;
417  route.vnet = vnet;
418  route.net_dest = new_net_msg_ptr->getDestination();
419  route.src_ni = m_id;
420  route.src_router = oPort->routerID();
421  route.dest_ni = destID;
422  route.dest_router = m_net_ptr->get_router_id(destID, vnet);
423 
424  // initialize hops_traversed to -1
425  // so that the first router increments it to 0
426  route.hops_traversed = -1;
427 
429  for (int i = 0; i < num_flits; i++) {
431  flit *fl = new flit(i, vc, vnet, route, num_flits, new_msg_ptr,
433  net_msg_ptr->getMessageSize()),
434  oPort->bitWidth(), curTick());
435 
436  fl->set_src_delay(curTick() - msg_ptr->getTime());
437  niOutVcs[vc].insert(fl);
438  }
439 
441  outVcState[vc].setState(ACTIVE_, curTick());
442  }
443  return true ;
444 }
445 
446 // Looking for a free output vc
447 int
449 {
450  for (int i = 0; i < m_vc_per_vnet; i++) {
451  int delta = m_vc_allocator[vnet];
452  m_vc_allocator[vnet]++;
453  if (m_vc_allocator[vnet] == m_vc_per_vnet)
454  m_vc_allocator[vnet] = 0;
455 
456  if (outVcState[(vnet*m_vc_per_vnet) + delta].isInState(
457  IDLE_, curTick())) {
458  vc_busy_counter[vnet] = 0;
459  return ((vnet*m_vc_per_vnet) + delta);
460  }
461  }
462 
463  vc_busy_counter[vnet] += 1;
465  "%s: Possible network deadlock in vnet: %d at time: %llu \n",
466  name(), vnet, curTick());
467 
468  return -1;
469 }
470 
471 void
473 {
474  int vc = oPort->vcRoundRobin();
475 
476  for (int i = 0; i < niOutVcs.size(); i++) {
477  vc++;
478  if (vc == niOutVcs.size())
479  vc = 0;
480 
481  int t_vnet = get_vnet(vc);
482  if (oPort->isVnetSupported(t_vnet)) {
483  // model buffer backpressure
484  if (niOutVcs[vc].isReady(curTick()) &&
485  outVcState[vc].has_credit()) {
486 
487  bool is_candidate_vc = true;
488  int vc_base = t_vnet * m_vc_per_vnet;
489 
490  if (m_net_ptr->isVNetOrdered(t_vnet)) {
491  for (int vc_offset = 0; vc_offset < m_vc_per_vnet;
492  vc_offset++) {
493  int t_vc = vc_base + vc_offset;
494  if (niOutVcs[t_vc].isReady(curTick())) {
495  if (m_ni_out_vcs_enqueue_time[t_vc] <
497  is_candidate_vc = false;
498  break;
499  }
500  }
501  }
502  }
503  if (!is_candidate_vc)
504  continue;
505 
506  // Update the round robin arbiter
507  oPort->vcRoundRobin(vc);
508 
509  outVcState[vc].decrement_credit();
510 
511  // Just removing the top flit
512  flit *t_flit = niOutVcs[vc].getTopFlit();
513  t_flit->set_time(clockEdge(Cycles(1)));
514 
515  // Scheduling the flit
516  scheduleFlit(t_flit);
517 
518  if (t_flit->get_type() == TAIL_ ||
519  t_flit->get_type() == HEAD_TAIL_) {
521  }
522 
523  // Done with this port, continue to schedule
524  // other ports
525  return;
526  }
527  }
528  }
529 }
530 
531 
532 
539 void
541 {
542  // Schedule each output link
543  for (auto &oPort: outPorts) {
544  scheduleOutputPort(oPort);
545  }
546 }
547 
550 {
551  for (auto &iPort : inPorts) {
552  if (iPort->isVnetSupported(vnet)) {
553  return iPort;
554  }
555  }
556 
557  return nullptr;
558 }
559 
560 /*
561  * This function returns the outport which supports the given vnet.
562  * Currently, HeteroGarnet does not support multiple outports to
563  * support same vnet. Thus, this function returns the first-and
564  * only outport which supports the vnet.
565  */
568 {
569  for (auto &oPort : outPorts) {
570  if (oPort->isVnetSupported(vnet)) {
571  return oPort;
572  }
573  }
574 
575  return nullptr;
576 }
577 void
579 {
580  OutputPort *oPort = getOutportForVnet(t_flit->get_vnet());
581 
582  if (oPort) {
583  DPRINTF(RubyNetwork, "Scheduling at %s time:%ld flit:%s Message:%s\n",
584  oPort->outNetLink()->name(), clockEdge(Cycles(1)),
585  *t_flit, *(t_flit->get_msg_ptr()));
586  oPort->outFlitQueue()->insert(t_flit);
588  return;
589  }
590 
591  panic("No output port found for vnet:%d\n", t_flit->get_vnet());
592  return;
593 }
594 
595 int
597 {
598  for (int i = 0; i < m_virtual_networks; i++) {
599  if (vc >= (i*m_vc_per_vnet) && vc < ((i+1)*m_vc_per_vnet)) {
600  return i;
601  }
602  }
603  fatal("Could not determine vc");
604 }
605 
606 
607 // Wakeup the NI in the next cycle if there are waiting
608 // messages in the protocol buffer, or waiting flits in the
609 // output VC buffer.
610 // Also check if we have to reschedule because of a clock period
611 // difference.
612 void
614 {
615  for (const auto& it : inNode_ptr) {
616  if (it == nullptr) {
617  continue;
618  }
619 
620  while (it->isReady(clockEdge())) { // Is there a message waiting
621  scheduleEvent(Cycles(1));
622  return;
623  }
624  }
625 
626  for (auto& ni_out_vc : niOutVcs) {
627  if (ni_out_vc.isReady(clockEdge(Cycles(1)))) {
628  scheduleEvent(Cycles(1));
629  return;
630  }
631  }
632 
633  // Check if any input links have flits to be popped.
634  // This can happen if the links are operating at
635  // a higher frequency.
636  for (auto &iPort : inPorts) {
637  NetworkLink *inNetLink = iPort->inNetLink();
638  if (inNetLink->isReady(curTick())) {
639  scheduleEvent(Cycles(1));
640  return;
641  }
642  }
643 
644  for (auto &oPort : outPorts) {
645  CreditLink *inCreditLink = oPort->inCreditLink();
646  if (inCreditLink->isReady(curTick())) {
647  scheduleEvent(Cycles(1));
648  return;
649  }
650  }
651 }
652 
653 void
654 NetworkInterface::print(std::ostream& out) const
655 {
656  out << "[Network Interface]";
657 }
658 
659 uint32_t
661 {
662  uint32_t num_functional_writes = 0;
663  for (auto& ni_out_vc : niOutVcs) {
664  num_functional_writes += ni_out_vc.functionalWrite(pkt);
665  }
666 
667  for (auto &oPort: outPorts) {
668  num_functional_writes += oPort->outFlitQueue()->functionalWrite(pkt);
669  }
670  return num_functional_writes;
671 }
NetworkInterface::addInPort
void addInPort(NetworkLink *in_link, CreditLink *credit_link)
Definition: NetworkInterface.cc:57
GarnetNetwork::increment_received_flits
void increment_received_flits(int vnet)
Definition: GarnetNetwork.hh:125
flit::get_vnet
int get_vnet()
Definition: flit.hh:56
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
GarnetNetwork::increment_total_hops
void increment_total_hops(int hops)
Definition: GarnetNetwork.hh:140
NetDest::add
void add(MachineID newElement)
Definition: NetDest.cc:39
flit::get_msg_ptr
MsgPtr & get_msg_ptr()
Definition: flit.hh:59
NetworkInterface::OutputPort::vcRoundRobin
int vcRoundRobin()
Definition: NetworkInterface.hh:156
GarnetNetwork::increment_flit_network_latency
void increment_flit_network_latency(Tick latency, int vnet)
Definition: GarnetNetwork.hh:128
RouteInfo::dest_ni
int dest_ni
Definition: CommonTypes.hh:61
NetworkInterface::print
void print(std::ostream &out) const
Definition: NetworkInterface.cc:654
Message::getDestination
virtual const NetDest & getDestination() const
Definition: Message.hh:108
flit
Definition: flit.hh:41
GarnetNetwork::get_router_id
int get_router_id(int ni, int vnet)
Definition: GarnetNetwork.cc:355
RouteInfo
Definition: CommonTypes.hh:47
NetworkInterface::OutputPort::printVnets
std::string printVnets()
Definition: NetworkInterface.hh:146
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
flit::get_enqueue_time
Tick get_enqueue_time()
Definition: flit.hh:52
NetworkInterface::get_vnet
int get_vnet(int vc)
Definition: NetworkInterface.cc:596
NetworkInterface::m_net_ptr
GarnetNetwork * m_net_ptr
Definition: NetworkInterface.hh:261
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:59
Credit::is_free_signal
bool is_free_signal()
Definition: Credit.hh:58
NetworkInterface::OutputPort::outFlitQueue
flitBuffer * outFlitQueue()
Definition: NetworkInterface.hh:102
cast.hh
GarnetNetwork::increment_packet_queueing_latency
void increment_packet_queueing_latency(Tick latency, int vnet)
Definition: GarnetNetwork.hh:119
std::vector< MessageBuffer * >
Message::getMessageSize
virtual const MessageSizeType & getMessageSize() const
Definition: Message.hh:72
NetworkInterface::outVcState
std::vector< OutVcState > outVcState
Definition: NetworkInterface.hh:269
MachineID
Definition: MachineID.hh:50
flitBuffer.hh
NetworkInterface::m_id
const NodeID m_id
Definition: NetworkInterface.hh:262
flit::get_route
RouteInfo get_route()
Definition: flit.hh:58
NetworkInterface::OutputPort::bitWidth
uint32_t bitWidth()
Definition: NetworkInterface.hh:125
NetworkInterface::m_vc_allocator
std::vector< int > m_vc_allocator
Definition: NetworkInterface.hh:265
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
GarnetNetwork::increment_injected_flits
void increment_injected_flits(int vnet)
Definition: GarnetNetwork.hh:124
IDLE_
@ IDLE_
Definition: CommonTypes.hh:40
Credit
Definition: Credit.hh:45
GarnetNetwork::increment_injected_packets
void increment_injected_packets(int vnet)
Definition: GarnetNetwork.hh:109
GarnetNetwork::increment_received_packets
void increment_received_packets(int vnet)
Definition: GarnetNetwork.hh:110
GarnetNetwork::increment_packet_network_latency
void increment_packet_network_latency(Tick latency, int vnet)
Definition: GarnetNetwork.hh:113
NetworkInterface::m_deadlock_threshold
int m_deadlock_threshold
Definition: NetworkInterface.hh:268
divCeil
T divCeil(const T &a, const U &b)
Definition: intmath.hh:114
flit::set_dequeue_time
void set_dequeue_time(Tick time)
Definition: flit.hh:69
NetworkInterface::wakeup
void wakeup()
Definition: NetworkInterface.cc:182
NetworkInterface::addOutPort
void addOutPort(NetworkLink *out_link, CreditLink *credit_link, SwitchID router_id, uint32_t consumerVcs)
Definition: NetworkInterface.cc:75
Clocked::cyclesToTicks
Tick cyclesToTicks(Cycles c) const
Definition: clocked_object.hh:224
flit::set_src_delay
void set_src_delay(Tick delay)
Definition: flit.hh:68
NetworkInterface::vc_busy_counter
std::vector< int > vc_busy_counter
Definition: NetworkInterface.hh:283
NetworkInterface::inPorts
std::vector< InputPort * > inPorts
Definition: NetworkInterface.hh:267
RouteInfo::src_router
int src_router
Definition: CommonTypes.hh:60
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
NetworkInterface::m_virtual_networks
const int m_virtual_networks
Definition: NetworkInterface.hh:263
NetworkInterface::outNode_ptr
std::vector< MessageBuffer * > outNode_ptr
Definition: NetworkInterface.hh:281
NetworkInterface::Params
GarnetNetworkInterfaceParams Params
Definition: NetworkInterface.hh:55
NetworkInterface::addNode
void addNode(std::vector< MessageBuffer * > &inNode, std::vector< MessageBuffer * > &outNode)
Definition: NetworkInterface.cc:121
NetworkInterface::scheduleOutputLink
void scheduleOutputLink()
This function looks at the NI buffers if some buffer has flits which are ready to traverse the link i...
Definition: NetworkInterface.cc:540
RouteInfo::src_ni
int src_ni
Definition: CommonTypes.hh:59
Consumer
Definition: Consumer.hh:55
Clocked::clockEdge
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...
Definition: clocked_object.hh:174
GarnetNetwork::increment_flit_queueing_latency
void increment_flit_queueing_latency(Tick latency, int vnet)
Definition: GarnetNetwork.hh:134
flit::get_type
flit_type get_type()
Definition: flit.hh:60
ACTIVE_
@ ACTIVE_
Definition: CommonTypes.hh:40
Network::MessageSizeType_to_int
static uint32_t MessageSizeType_to_int(MessageSizeType size_type)
Definition: Network.cc:158
NetworkInterface::NetworkInterface
NetworkInterface(const Params &p)
Definition: NetworkInterface.cc:45
flit::get_dequeue_time
Tick get_dequeue_time()
Definition: flit.hh:53
NetworkInterface::checkReschedule
void checkReschedule()
Definition: NetworkInterface.cc:613
NetDest::clear
void clear()
Definition: NetDest.cc:79
NetworkInterface::InputPort
Definition: NetworkInterface.hh:180
NetworkInterface::scheduleFlit
void scheduleFlit(flit *t_flit)
Definition: NetworkInterface.cc:578
NetworkInterface::getInportForVnet
InputPort * getInportForVnet(int vnet)
Definition: NetworkInterface.cc:549
NetworkInterface::incrementStats
void incrementStats(flit *t_flit)
Definition: NetworkInterface.cc:145
Clocked::clockPeriod
Tick clockPeriod() const
Definition: clocked_object.hh:214
MsgPtr
std::shared_ptr< Message > MsgPtr
Definition: Message.hh:53
flit::set_time
void set_time(Tick time)
Definition: flit.hh:65
RouteInfo::net_dest
NetDest net_dest
Definition: CommonTypes.hh:56
NetworkInterface::OutputPort::isVnetSupported
bool isVnetSupported(int pVnet)
Definition: NetworkInterface.hh:130
NetworkInterface::calculateVC
int calculateVC(int vnet)
Definition: NetworkInterface.cc:448
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:182
NetworkInterface::InputPort::outCreditQueue
flitBuffer * outCreditQueue()
Definition: NetworkInterface.hh:194
TAIL_
@ TAIL_
Definition: CommonTypes.hh:38
GarnetNetwork::isVNetOrdered
bool isVNetOrdered(int vnet) const
Definition: GarnetNetwork.hh:78
MessageBuffer.hh
flitBuffer::insert
void insert(flit *flt)
Definition: flitBuffer.hh:70
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:197
flit::get_vc
int get_vc()
Definition: flit.hh:57
NetworkInterface::OutputPort::routerID
int routerID()
Definition: NetworkInterface.hh:120
ArmISA::b
Bitfield< 7 > b
Definition: miscregs_types.hh:376
Consumer::scheduleEventAbsolute
void scheduleEventAbsolute(Tick timeAbs)
Definition: Consumer.cc:57
NetworkInterface::m_vc_per_vnet
int m_vc_per_vnet
Definition: NetworkInterface.hh:264
NetworkInterface::flitisizeMessage
bool flitisizeMessage(MsgPtr msg_ptr, int vnet)
Definition: NetworkInterface.cc:360
NetworkInterface::m_stall_count
std::vector< int > m_stall_count
Definition: NetworkInterface.hh:271
flit::get_src_delay
Tick get_src_delay()
Definition: flit.hh:62
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:258
Credit.hh
NetworkInterface::OutputPort::outNetLink
NetworkLink * outNetLink()
Definition: NetworkInterface.hh:108
RouteInfo::dest_router
int dest_router
Definition: CommonTypes.hh:62
Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:79
NetworkInterface::dequeueCallback
void dequeueCallback()
Definition: NetworkInterface.cc:135
Message
Definition: Message.hh:56
HEAD_TAIL_
@ HEAD_TAIL_
Definition: CommonTypes.hh:38
NodeID
unsigned int NodeID
Definition: TypeDefines.hh:34
NetworkInterface::niOutVcs
std::vector< flitBuffer > niOutVcs
Definition: NetworkInterface.hh:275
curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:43
RouteInfo::hops_traversed
int hops_traversed
Definition: CommonTypes.hh:63
NetworkInterface::m_ni_out_vcs_enqueue_time
std::vector< Tick > m_ni_out_vcs_enqueue_time
Definition: NetworkInterface.hh:276
NetworkInterface::getOutportForVnet
OutputPort * getOutportForVnet(int vnet)
Definition: NetworkInterface.cc:567
NetworkInterface::outPorts
std::vector< OutputPort * > outPorts
Definition: NetworkInterface.hh:266
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
MessageBuffer
Definition: MessageBuffer.hh:68
NetworkInterface::InputPort::printVnets
std::string printVnets()
Definition: NetworkInterface.hh:237
fatal_if
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition: logging.hh:219
RouteInfo::vnet
int vnet
Definition: CommonTypes.hh:55
Message.hh
NetDest::getAllDest
std::vector< NodeID > getAllDest()
Definition: NetDest.cc:106
NetworkInterface.hh
NetDest
Definition: NetDest.hh:39
NetworkInterface::OutputPort
Definition: NetworkInterface.hh:83
NetworkInterface::checkStallQueue
void checkStallQueue()
Definition: NetworkInterface.cc:307
NetworkInterface::functionalWrite
uint32_t functionalWrite(Packet *)
Definition: NetworkInterface.cc:660
SwitchID
unsigned int SwitchID
Definition: TypeDefines.hh:35
INFINITE_
#define INFINITE_
Definition: CommonTypes.hh:66
ArmISA::id
Bitfield< 33 > id
Definition: miscregs_types.hh:247
ArmISA::m
Bitfield< 0 > m
Definition: miscregs_types.hh:389
NetDest::removeNetDest
void removeNetDest(const NetDest &netDest)
Definition: NetDest.cc:70
Consumer::scheduleEvent
void scheduleEvent(Cycles timeDelta)
Definition: Consumer.cc:50
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
NetworkInterface::inNode_ptr
std::vector< MessageBuffer * > inNode_ptr
Definition: NetworkInterface.hh:279
NetworkInterface::scheduleOutputPort
void scheduleOutputPort(OutputPort *oPort)
Definition: NetworkInterface.cc:472
flit::m_width
uint32_t m_width
Definition: flit.hh:105

Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17