gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RubyRequest.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-2021 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2009 Mark D. Hill and David A. Wood
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #ifndef __MEM_RUBY_SLICC_INTERFACE_RUBYREQUEST_HH__
42 #define __MEM_RUBY_SLICC_INTERFACE_RUBYREQUEST_HH__
43 
44 #include <ostream>
45 #include <vector>
46 
50 #include "mem/ruby/protocol/Message.hh"
51 #include "mem/ruby/protocol/PrefetchBit.hh"
52 #include "mem/ruby/protocol/RubyAccessMode.hh"
53 #include "mem/ruby/protocol/RubyRequestType.hh"
54 
55 namespace gem5
56 {
57 
58 namespace ruby
59 {
60 
61 class RubyRequest : public Message
62 {
63  public:
66  RubyRequestType m_Type;
68  RubyAccessMode m_AccessMode;
69  int m_Size;
70  PrefetchBit m_Prefetch;
75  int m_wfid;
76  uint64_t m_instSeqNum;
79  bool m_isTlbi;
80  // Should be uint64, but SLICC complains about casts
82  // GPU cache bypass flags. GLC bypasses L1 while SLC bypasses both L1 and
83  // L2 if set to true. They are set to false by default and they must be
84  // explicitly set to true in the program in order to bypass caches
85  bool m_isGLCSet;
86  bool m_isSLCSet;
87 
88  RubyRequest(Tick curTime, uint64_t _paddr, int _len,
89  uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
90  PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
91  ContextID _proc_id = 100, ContextID _core_id = 99)
92  : Message(curTime),
93  m_PhysicalAddress(_paddr),
94  m_Type(_type),
95  m_ProgramCounter(_pc),
96  m_AccessMode(_access_mode),
97  m_Size(_len),
98  m_Prefetch(_pb),
99  m_pkt(_pkt),
100  m_contextId(_core_id),
101  m_htmFromTransaction(false),
103  m_isTlbi(false),
105  {
107  if (_pkt) {
108  m_isGLCSet = m_pkt->req->isGLCSet();
109  m_isSLCSet = m_pkt->req->isSLCSet();
110  } else {
111  m_isGLCSet = 0;
112  m_isSLCSet = 0;
113  }
114  }
115 
117  RubyRequest(Tick curTime,
118  uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
119  PacketPtr _pkt, ContextID _proc_id, ContextID _core_id)
120  : Message(curTime),
122  m_Type(_type),
123  m_ProgramCounter(_pc),
124  m_AccessMode(_access_mode),
125  m_Size(0),
126  m_Prefetch(PrefetchBit_No),
127  m_pkt(_pkt),
128  m_contextId(_core_id),
129  m_htmFromTransaction(false),
131  m_isTlbi(false),
133  {
134  assert(m_pkt->req->isMemMgmt());
135  if (_pkt) {
136  m_isGLCSet = m_pkt->req->isGLCSet();
137  m_isSLCSet = m_pkt->req->isSLCSet();
138  } else {
139  m_isGLCSet = 0;
140  m_isSLCSet = 0;
141  }
142  }
143 
144  RubyRequest(Tick curTime, uint64_t _paddr, int _len,
145  uint64_t _pc, RubyRequestType _type,
146  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
147  unsigned _proc_id, unsigned _core_id,
148  int _wm_size, std::vector<bool> & _wm_mask,
149  DataBlock & _Data,
150  uint64_t _instSeqNum = 0)
151  : Message(curTime),
152  m_PhysicalAddress(_paddr),
153  m_Type(_type),
154  m_ProgramCounter(_pc),
155  m_AccessMode(_access_mode),
156  m_Size(_len),
157  m_Prefetch(_pb),
158  m_pkt(_pkt),
159  m_contextId(_core_id),
160  m_writeMask(_wm_size,_wm_mask),
161  m_WTData(_Data),
162  m_wfid(_proc_id),
163  m_instSeqNum(_instSeqNum),
164  m_htmFromTransaction(false),
166  m_isTlbi(false),
168  {
170  if (_pkt) {
171  m_isGLCSet = m_pkt->req->isGLCSet();
172  m_isSLCSet = m_pkt->req->isSLCSet();
173  } else {
174  m_isGLCSet = 0;
175  m_isSLCSet = 0;
176  }
177  }
178 
179  RubyRequest(Tick curTime, uint64_t _paddr, int _len,
180  uint64_t _pc, RubyRequestType _type,
181  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
182  unsigned _proc_id, unsigned _core_id,
183  int _wm_size, std::vector<bool> & _wm_mask,
184  DataBlock & _Data,
186  uint64_t _instSeqNum = 0)
187  : Message(curTime),
188  m_PhysicalAddress(_paddr),
189  m_Type(_type),
190  m_ProgramCounter(_pc),
191  m_AccessMode(_access_mode),
192  m_Size(_len),
193  m_Prefetch(_pb),
194  m_pkt(_pkt),
195  m_contextId(_core_id),
196  m_writeMask(_wm_size,_wm_mask,_atomicOps),
197  m_WTData(_Data),
198  m_wfid(_proc_id),
199  m_instSeqNum(_instSeqNum),
200  m_htmFromTransaction(false),
202  m_isTlbi(false),
204  {
206  if (_pkt) {
207  m_isGLCSet = m_pkt->req->isGLCSet();
208  m_isSLCSet = m_pkt->req->isSLCSet();
209 
210  } else {
211  m_isGLCSet = 0;
212  m_isSLCSet = 0;
213  }
214  }
215 
216  RubyRequest(Tick curTime) : Message(curTime) {}
217  MsgPtr clone() const
218  { return std::shared_ptr<Message>(new RubyRequest(*this)); }
219 
220  Addr getLineAddress() const { return m_LineAddress; }
222  const RubyRequestType& getType() const { return m_Type; }
224  const RubyAccessMode& getAccessMode() const { return m_AccessMode; }
225  const int& getSize() const { return m_Size; }
226  const PrefetchBit& getPrefetch() const { return m_Prefetch; }
227  RequestPtr getRequestPtr() const { return m_pkt->req; }
228 
229  void print(std::ostream& out) const;
230  bool functionalRead(Packet *pkt);
231  bool functionalRead(Packet *pkt, WriteMask &mask);
232  bool functionalWrite(Packet *pkt);
233 };
234 
235 inline std::ostream&
236 operator<<(std::ostream& out, const RubyRequest& obj)
237 {
238  obj.print(out);
239  out << std::flush;
240  return out;
241 }
242 
243 } // namespace ruby
244 } // namespace gem5
245 
246 #endif //__MEM_RUBY_SLICC_INTERFACE_RUBYREQUEST_HH__
gem5::ruby::RubyRequest::m_isSLCSet
bool m_isSLCSet
Definition: RubyRequest.hh:86
gem5::ruby::RubyRequest::functionalRead
bool functionalRead(Packet *pkt)
The two functions below are used for reading / writing the message functionally.
Definition: RubyRequest.cc:69
gem5::ruby::MsgPtr
std::shared_ptr< Message > MsgPtr
Definition: Message.hh:59
gem5::ruby::RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _paddr, int _len, uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb, unsigned _proc_id, unsigned _core_id, int _wm_size, std::vector< bool > &_wm_mask, DataBlock &_Data, uint64_t _instSeqNum=0)
Definition: RubyRequest.hh:144
gem5::ruby::WriteMask
Definition: WriteMask.hh:59
gem5::ruby::RubyRequest::m_WTData
DataBlock m_WTData
Definition: RubyRequest.hh:74
gem5::ruby::operator<<
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition: BoolVec.cc:49
gem5::Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:377
gem5::ruby::RubyRequest::m_wfid
int m_wfid
Definition: RubyRequest.hh:75
gem5::ruby::RubyRequest::m_htmFromTransaction
bool m_htmFromTransaction
Definition: RubyRequest.hh:77
gem5::ruby::RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode, PacketPtr _pkt, ContextID _proc_id, ContextID _core_id)
RubyRequest for memory management commands.
Definition: RubyRequest.hh:117
gem5::ruby::RubyRequest::m_writeMask
WriteMask m_writeMask
Definition: RubyRequest.hh:73
std::vector< bool >
gem5::ruby::RubyRequest::getRequestPtr
RequestPtr getRequestPtr() const
Definition: RubyRequest.hh:227
gem5::ruby::makeLineAddress
Addr makeLineAddress(Addr addr)
Definition: Address.cc:60
gem5::ruby::RubyRequest::functionalWrite
bool functionalWrite(Packet *pkt)
Definition: RubyRequest.cc:85
gem5::mask
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
Definition: bitfield.hh:63
gem5::ruby::RubyRequest::m_contextId
ContextID m_contextId
Definition: RubyRequest.hh:72
gem5::ruby::RubyRequest
Definition: RubyRequest.hh:61
gem5::ruby::RubyRequest::print
void print(std::ostream &out) const
Definition: RubyRequest.cc:54
gem5::ruby::RubyRequest::m_instSeqNum
uint64_t m_instSeqNum
Definition: RubyRequest.hh:76
gem5::ruby::RubyRequest::getPrefetch
const PrefetchBit & getPrefetch() const
Definition: RubyRequest.hh:226
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
DataBlock.hh
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
WriteMask.hh
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
gem5::ruby::RubyRequest::m_pkt
PacketPtr m_pkt
Definition: RubyRequest.hh:71
gem5::ruby::RubyRequest::m_isGLCSet
bool m_isGLCSet
Definition: RubyRequest.hh:85
gem5::ruby::RubyRequest::m_LineAddress
Addr m_LineAddress
Definition: RubyRequest.hh:65
gem5::ruby::RubyRequest::getAccessMode
const RubyAccessMode & getAccessMode() const
Definition: RubyRequest.hh:224
gem5::ruby::RubyRequest::m_PhysicalAddress
Addr m_PhysicalAddress
Definition: RubyRequest.hh:64
gem5::ruby::RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _paddr, int _len, uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb=PrefetchBit_No, ContextID _proc_id=100, ContextID _core_id=99)
Definition: RubyRequest.hh:88
gem5::ruby::RubyRequest::m_Type
RubyRequestType m_Type
Definition: RubyRequest.hh:66
gem5::ruby::RubyRequest::getSize
const int & getSize() const
Definition: RubyRequest.hh:225
std::pair< int, AtomicOpFunctor * >
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::ruby::RubyRequest::m_tlbiTransactionUid
Addr m_tlbiTransactionUid
Definition: RubyRequest.hh:81
gem5::ruby::RubyRequest::getProgramCounter
Addr getProgramCounter() const
Definition: RubyRequest.hh:223
gem5::ruby::RubyRequest::m_isTlbi
bool m_isTlbi
Definition: RubyRequest.hh:79
gem5::ruby::RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _paddr, int _len, uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb, unsigned _proc_id, unsigned _core_id, int _wm_size, std::vector< bool > &_wm_mask, DataBlock &_Data, std::vector< std::pair< int, AtomicOpFunctor * > > _atomicOps, uint64_t _instSeqNum=0)
Definition: RubyRequest.hh:179
gem5::ruby::RubyRequest::clone
MsgPtr clone() const
Definition: RubyRequest.hh:217
Address.hh
gem5::ruby::RubyRequest::m_htmTransactionUid
uint64_t m_htmTransactionUid
Definition: RubyRequest.hh:78
gem5::ruby::RubyRequest::m_ProgramCounter
Addr m_ProgramCounter
Definition: RubyRequest.hh:67
gem5::ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:239
gem5::ruby::RubyRequest::m_Prefetch
PrefetchBit m_Prefetch
Definition: RubyRequest.hh:70
gem5::ruby::RubyRequest::RubyRequest
RubyRequest(Tick curTime)
Definition: RubyRequest.hh:216
gem5::ruby::Message
Definition: Message.hh:62
gem5::ruby::RubyRequest::m_Size
int m_Size
Definition: RubyRequest.hh:69
gem5::ruby::RubyRequest::getType
const RubyRequestType & getType() const
Definition: RubyRequest.hh:222
gem5::ruby::DataBlock
Definition: DataBlock.hh:60
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ruby::RubyRequest::getPhysicalAddress
Addr getPhysicalAddress() const
Definition: RubyRequest.hh:221
gem5::ruby::RubyRequest::getLineAddress
Addr getLineAddress() const
Definition: RubyRequest.hh:220
gem5::ruby::RubyRequest::m_AccessMode
RubyAccessMode m_AccessMode
Definition: RubyRequest.hh:68

Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17