gem5 v24.0.0.0
Loading...
Searching...
No Matches
OutputUnit.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Inria
3 * Copyright (c) 2016 Georgia Institute of Technology
4 * Copyright (c) 2008 Princeton University
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met: redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer;
11 * redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution;
14 * neither the name of the copyright holders nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31
32#ifndef __MEM_RUBY_NETWORK_GARNET_0_OUTPUTUNIT_HH__
33#define __MEM_RUBY_NETWORK_GARNET_0_OUTPUTUNIT_HH__
34
35#include <iostream>
36#include <vector>
37
38#include "base/compiler.hh"
43
44namespace gem5
45{
46
47namespace ruby
48{
49
50namespace garnet
51{
52
53class CreditLink;
54class Router;
55
56class OutputUnit : public Consumer
57{
58 public:
59 OutputUnit(int id, PortDirection direction, Router *router,
60 uint32_t consumerVcs);
61 ~OutputUnit() = default;
62 void set_out_link(NetworkLink *link);
63 void set_credit_link(CreditLink *credit_link);
64 void wakeup();
66 void print(std::ostream& out) const {};
67 void decrement_credit(int out_vc);
68 void increment_credit(int out_vc);
69 bool has_credit(int out_vc);
70 bool has_free_vc(int vnet);
71 int select_free_vc(int vnet);
72
74
75 int
77 {
78 return outVcState[vc].get_credit_count();
79 }
80
81 inline int
83 {
84 return m_out_link->get_id();
85 }
86
87 inline void
89 {
90 outVcState[vc].setState(state, curTime);
91 }
92
93 inline bool
94 is_vc_idle(int vc, Tick curTime)
95 {
96 return (outVcState[vc].isInState(IDLE_, curTime));
97 }
98
99 void insert_flit(flit *t_flit);
100
101 inline int
103 {
104 return m_vc_per_vnet;
105 }
106
107 bool functionalRead(Packet *pkt, WriteMask &mask);
108 uint32_t functionalWrite(Packet *pkt);
109
110 private:
117
118 // This is for the network link to consume
120 // vc state of downstream router
122};
123
124} // namespace garnet
125} // namespace ruby
126} // namespace gem5
127
128#endif // __MEM_RUBY_NETWORK_GARNET_0_OUTPUTUNIT_HH__
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
void increment_credit(int out_vc)
Definition OutputUnit.cc:74
GEM5_CLASS_VAR_USED int m_id
void set_out_link(NetworkLink *link)
void decrement_credit(int out_vc)
Definition OutputUnit.cc:62
uint32_t functionalWrite(Packet *pkt)
void set_vc_state(VC_state_type state, int vc, Tick curTime)
Definition OutputUnit.hh:88
bool functionalRead(Packet *pkt, WriteMask &mask)
std::vector< OutVcState > outVcState
void insert_flit(flit *t_flit)
bool is_vc_idle(int vc, Tick curTime)
Definition OutputUnit.hh:94
void set_credit_link(CreditLink *credit_link)
void print(std::ostream &out) const
Definition OutputUnit.hh:66
OutputUnit(int id, PortDirection direction, Router *router, uint32_t consumerVcs)
Definition OutputUnit.cc:49
STL vector class.
Definition stl.hh:37
#define GEM5_CLASS_VAR_USED
Definition compiler.hh:141
atomic_var_t state
Definition helpers.cc:211
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
std::string PortDirection
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