gem5  v21.1.0.2
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 namespace gem5
46 {
47 
48 namespace ruby
49 {
50 
51 namespace garnet
52 {
53 
54 class GarnetNetwork;
55 
56 class NetworkLink : public ClockedObject, public Consumer
57 {
58  public:
59  typedef NetworkLinkParams Params;
60  NetworkLink(const Params &p);
61  ~NetworkLink() = default;
62 
63  void setLinkConsumer(Consumer *consumer);
64  void setSourceQueue(flitBuffer *src_queue, ClockedObject *srcClockObject);
65  virtual void setVcsPerVnet(uint32_t consumerVcs);
67  link_type getType() { return m_type; }
68  void print(std::ostream& out) const {}
69  int get_id() const { return m_id; }
71  virtual void wakeup();
72 
73  unsigned int getLinkUtilization() const { return m_link_utilized; }
74  const std::vector<unsigned int> & getVcLoad() const { return m_vc_load; }
75 
76  inline bool isReady(Tick curTime)
77  {
78  return linkBuffer.isReady(curTime);
79  }
80 
81  inline flit* peekLink() { return linkBuffer.peekTopFlit(); }
82  inline flit* consumeLink() { return linkBuffer.getTopFlit(); }
83 
84  uint32_t functionalWrite(Packet *);
85  void resetStats();
86 
88  uint32_t bitWidth;
89 
90  private:
91  const int m_id;
94 
96 
97  // Statistical variables
98  unsigned int m_link_utilized;
100 
101  protected:
102  uint32_t m_virt_nets;
106 
107 };
108 
109 } // namespace garnet
110 } // namespace ruby
111 } // namespace gem5
112 
113 #endif // __MEM_RUBY_NETWORK_GARNET_0_NETWORKLINK_HH__
gem5::ruby::garnet::flit
Definition: flit.hh:50
gem5::ruby::garnet::flitBuffer::peekTopFlit
flit * peekTopFlit()
Definition: flitBuffer.hh:72
std::vector< unsigned int >
gem5::ruby::garnet::flitBuffer::isReady
bool isReady(Tick curTime)
Definition: flitBuffer.cc:60
gem5::ruby::garnet::link_type
link_type
Definition: CommonTypes.hh:52
gem5::ruby::Consumer
Definition: Consumer.hh:61
CommonTypes.hh
flitBuffer.hh
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
gem5::ruby::garnet::flitBuffer::getTopFlit
flit * getTopFlit()
Definition: flitBuffer.hh:64
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::X86ISA::type
type
Definition: misc.hh:733
gem5::ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:234
Consumer.hh
clocked_object.hh
gem5::ruby::garnet::flitBuffer
Definition: flitBuffer.hh:50
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40

Generated on Tue Sep 21 2021 12:25:41 for gem5 by doxygen 1.8.17