gem5  v20.1.0.0
NetworkLink.hh
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 
33 #ifndef __MEM_RUBY_NETWORK_GARNET_0_NETWORKLINK_HH__
34 #define __MEM_RUBY_NETWORK_GARNET_0_NETWORKLINK_HH__
35 
36 #include <iostream>
37 #include <vector>
38 
42 #include "params/NetworkLink.hh"
43 #include "sim/clocked_object.hh"
44 
45 class GarnetNetwork;
46 
47 class NetworkLink : public ClockedObject, public Consumer
48 {
49  public:
50  typedef NetworkLinkParams Params;
51  NetworkLink(const Params *p);
52  ~NetworkLink() = default;
53 
54  void setLinkConsumer(Consumer *consumer);
55  void setSourceQueue(flitBuffer *src_queue, ClockedObject *srcClockObject);
56  virtual void setVcsPerVnet(uint32_t consumerVcs);
58  link_type getType() { return m_type; }
59  void print(std::ostream& out) const {}
60  int get_id() const { return m_id; }
62  virtual void wakeup();
63 
64  unsigned int getLinkUtilization() const { return m_link_utilized; }
65  const std::vector<unsigned int> & getVcLoad() const { return m_vc_load; }
66 
67  inline bool isReady(Tick curTime)
68  {
69  return linkBuffer.isReady(curTime);
70  }
71 
72  inline flit* peekLink() { return linkBuffer.peekTopFlit(); }
73  inline flit* consumeLink() { return linkBuffer.getTopFlit(); }
74 
75  uint32_t functionalWrite(Packet *);
76  void resetStats();
77 
79  uint32_t bitWidth;
80 
81  private:
82  const int m_id;
85 
87 
88  // Statistical variables
89  unsigned int m_link_utilized;
91 
92  protected:
93  uint32_t m_virt_nets;
97 
98 };
99 
100 #endif // __MEM_RUBY_NETWORK_GARNET_0_NETWORKLINK_HH__
flitBuffer
Definition: flitBuffer.hh:41
flit
Definition: flit.hh:41
type
uint8_t type
Definition: inet.hh:421
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
std::vector< unsigned int >
CommonTypes.hh
flitBuffer.hh
flitBuffer::getTopFlit
flit * getTopFlit()
Definition: flitBuffer.hh:55
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
Consumer
Definition: Consumer.hh:43
Consumer.hh
link_type
link_type
Definition: CommonTypes.hh:43
flitBuffer::isReady
bool isReady(Tick curTime)
Definition: flitBuffer.cc:51
clocked_object.hh
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
GarnetNetwork
Definition: GarnetNetwork.hh:50
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
flitBuffer::peekTopFlit
flit * peekTopFlit()
Definition: flitBuffer.hh:64

Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17