gem5  v21.1.0.2
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 
44 namespace gem5
45 {
46 
47 namespace ruby
48 {
49 
50 namespace garnet
51 {
52 
53 class CreditLink;
54 class Router;
55 
56 class 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
88  set_vc_state(VC_state_type state, int vc, Tick curTime)
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  uint32_t functionalWrite(Packet *pkt);
108 
109  private:
116 
117  // This is for the network link to consume
119  // vc state of downstream router
121 };
122 
123 } // namespace garnet
124 } // namespace ruby
125 } // namespace gem5
126 
127 #endif // __MEM_RUBY_NETWORK_GARNET_0_OUTPUTUNIT_HH__
gem5::ruby::garnet::flit
Definition: flit.hh:50
gem5::ruby::garnet::OutputUnit
Definition: OutputUnit.hh:56
gem5::ruby::garnet::OutputUnit::functionalWrite
uint32_t functionalWrite(Packet *pkt)
Definition: OutputUnit.cc:176
gem5::ruby::garnet::OutputUnit::get_credit_count
int get_credit_count(int vc)
Definition: OutputUnit.hh:76
gem5::ruby::PortDirection
std::string PortDirection
Definition: Topology.hh:68
gem5::ruby::garnet::OutputUnit::get_outlink_id
int get_outlink_id()
Definition: OutputUnit.hh:82
gem5::ruby::garnet::OutputUnit::getVcsPerVnet
int getVcsPerVnet()
Definition: OutputUnit.hh:102
gem5::ruby::garnet::OutputUnit::m_router
Router * m_router
Definition: OutputUnit.hh:110
gem5::ruby::garnet::OutputUnit::print
void print(std::ostream &out) const
Definition: OutputUnit.hh:66
gem5::ruby::garnet::Router
Definition: Router.hh:66
gem5::ruby::garnet::OutputUnit::m_id
GEM5_CLASS_VAR_USED int m_id
Definition: OutputUnit.hh:111
gem5::ruby::garnet::OutputUnit::outVcState
std::vector< OutVcState > outVcState
Definition: OutputUnit.hh:120
std::vector
STL vector class.
Definition: stl.hh:37
gem5::ruby::garnet::OutputUnit::has_free_vc
bool has_free_vc(int vnet)
Definition: OutputUnit.cc:98
gem5::ruby::Consumer
Definition: Consumer.hh:61
CommonTypes.hh
GEM5_CLASS_VAR_USED
#define GEM5_CLASS_VAR_USED
Definition: compiler.hh:189
gem5::ruby::garnet::OutputUnit::decrement_credit
void decrement_credit(int out_vc)
Definition: OutputUnit.cc:62
gem5::ruby::garnet::OutputUnit::insert_flit
void insert_flit(flit *t_flit)
Definition: OutputUnit.cc:169
gem5::ruby::garnet::OutputUnit::m_direction
PortDirection m_direction
Definition: OutputUnit.hh:112
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::OutputUnit::has_credit
bool has_credit(int out_vc)
Definition: OutputUnit.cc:89
gem5::ruby::garnet::OutputUnit::set_out_link
void set_out_link(NetworkLink *link)
Definition: OutputUnit.cc:157
gem5::ruby::garnet::OutputUnit::m_out_link
NetworkLink * m_out_link
Definition: OutputUnit.hh:114
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::ruby::garnet::OutputUnit::getOutQueue
flitBuffer * getOutQueue()
Definition: OutputUnit.cc:151
gem5::ruby::garnet::OutputUnit::set_credit_link
void set_credit_link(CreditLink *credit_link)
Definition: OutputUnit.cc:163
gem5::ruby::garnet::OutputUnit::increment_credit
void increment_credit(int out_vc)
Definition: OutputUnit.cc:74
compiler.hh
gem5::ruby::garnet::IDLE_
@ IDLE_
Definition: CommonTypes.hh:49
gem5::ruby::garnet::VC_state_type
VC_state_type
Definition: CommonTypes.hh:49
OutVcState.hh
Consumer.hh
gem5::ruby::garnet::OutputUnit::wakeup
void wakeup()
Definition: OutputUnit.cc:133
gem5::ruby::garnet::OutputUnit::OutputUnit
OutputUnit(int id, PortDirection direction, Router *router, uint32_t consumerVcs)
Definition: OutputUnit.cc:49
gem5::ruby::garnet::OutputUnit::m_vc_per_vnet
int m_vc_per_vnet
Definition: OutputUnit.hh:113
gem5::ruby::garnet::OutputUnit::m_credit_link
CreditLink * m_credit_link
Definition: OutputUnit.hh:115
gem5::ruby::garnet::flitBuffer
Definition: flitBuffer.hh:50
gem5::ruby::garnet::OutputUnit::set_vc_state
void set_vc_state(VC_state_type state, int vc, Tick curTime)
Definition: OutputUnit.hh:88
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::ruby::garnet::OutputUnit::get_direction
PortDirection get_direction()
Definition: OutputUnit.hh:73
gem5::ruby::garnet::OutputUnit::select_free_vc
int select_free_vc(int vnet)
Definition: OutputUnit.cc:111
gem5::ruby::garnet::OutputUnit::~OutputUnit
~OutputUnit()=default
gem5::ruby::garnet::OutputUnit::outBuffer
flitBuffer outBuffer
Definition: OutputUnit.hh:118
gem5::ruby::garnet::OutputUnit::is_vc_idle
bool is_vc_idle(int vc, Tick curTime)
Definition: OutputUnit.hh:94

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