gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
45namespace gem5
46{
47
48namespace ruby
49{
50
51namespace garnet
52{
53
54class GarnetNetwork;
55
56class 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
85 uint32_t functionalWrite(Packet *);
86 void resetStats();
87
89 uint32_t bitWidth;
90
91 private:
92 const int m_id;
95
97
98 // Statistical variables
99 unsigned int m_link_utilized;
101
102 protected:
103 uint32_t m_virt_nets;
107
108};
109
110} // namespace garnet
111} // namespace ruby
112} // namespace gem5
113
114#endif // __MEM_RUBY_NETWORK_GARNET_0_NETWORKLINK_HH__
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Cycles is a wrapper class for representing cycle counts, i.e.
Definition types.hh:79
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
bool isReady(Tick curTime)
Definition flitBuffer.cc:60
STL vector class.
Definition stl.hh:37
ClockedObject declaration and implementation.
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Tick
Tick count type.
Definition types.hh:58

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0