gem5 v24.0.0.0
Loading...
Searching...
No Matches
RubyRequest.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2021, 2024 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
55namespace gem5
56{
57
58namespace ruby
59{
60
61class 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;
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
88
89 RubyRequest(Tick curTime, uint64_t _paddr, int _len,
90 uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
91 PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
92 ContextID _proc_id = 100, ContextID _core_id = 99)
93 : Message(curTime),
94 m_PhysicalAddress(_paddr),
95 m_Type(_type),
97 m_AccessMode(_access_mode),
98 m_Size(_len),
99 m_Prefetch(_pb),
100 m_pkt(_pkt),
101 m_contextId(_core_id),
104 m_isTlbi(false),
106 m_isSecure(m_pkt ? m_pkt->req->isSecure() : false)
107 {
109 if (_pkt) {
110 m_isGLCSet = m_pkt->req->isGLCSet();
111 m_isSLCSet = m_pkt->req->isSLCSet();
112 } else {
113 m_isGLCSet = 0;
114 m_isSLCSet = 0;
115 }
116 }
117
120 uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
121 PacketPtr _pkt, ContextID _proc_id, ContextID _core_id)
122 : Message(curTime),
124 m_Type(_type),
125 m_ProgramCounter(_pc),
126 m_AccessMode(_access_mode),
127 m_Size(0),
128 m_Prefetch(PrefetchBit_No),
129 m_pkt(_pkt),
130 m_contextId(_core_id),
133 m_isTlbi(false),
135 m_isSecure(m_pkt->req->isSecure())
136 {
137 assert(m_pkt->req->isMemMgmt());
138 if (_pkt) {
139 m_isGLCSet = m_pkt->req->isGLCSet();
140 m_isSLCSet = m_pkt->req->isSLCSet();
141 } else {
142 m_isGLCSet = 0;
143 m_isSLCSet = 0;
144 }
145 }
146
147 RubyRequest(Tick curTime, uint64_t _paddr, int _len,
148 uint64_t _pc, RubyRequestType _type,
149 RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
150 unsigned _proc_id, unsigned _core_id,
151 int _wm_size, std::vector<bool> & _wm_mask,
152 DataBlock & _Data,
153 uint64_t _instSeqNum = 0)
154 : Message(curTime),
155 m_PhysicalAddress(_paddr),
156 m_Type(_type),
157 m_ProgramCounter(_pc),
158 m_AccessMode(_access_mode),
159 m_Size(_len),
160 m_Prefetch(_pb),
161 m_pkt(_pkt),
162 m_contextId(_core_id),
163 m_writeMask(_wm_size,_wm_mask),
164 m_WTData(_Data),
165 m_wfid(_proc_id),
166 m_instSeqNum(_instSeqNum),
169 m_isTlbi(false),
171 m_isSecure(m_pkt->req->isSecure())
172 {
174 if (_pkt) {
175 m_isGLCSet = m_pkt->req->isGLCSet();
176 m_isSLCSet = m_pkt->req->isSLCSet();
177 } else {
178 m_isGLCSet = 0;
179 m_isSLCSet = 0;
180 }
181 }
182
183 RubyRequest(Tick curTime, uint64_t _paddr, int _len,
184 uint64_t _pc, RubyRequestType _type,
185 RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
186 unsigned _proc_id, unsigned _core_id,
187 int _wm_size, std::vector<bool> & _wm_mask,
188 DataBlock & _Data,
190 uint64_t _instSeqNum = 0)
191 : Message(curTime),
192 m_PhysicalAddress(_paddr),
193 m_Type(_type),
194 m_ProgramCounter(_pc),
195 m_AccessMode(_access_mode),
196 m_Size(_len),
197 m_Prefetch(_pb),
198 m_pkt(_pkt),
199 m_contextId(_core_id),
200 m_writeMask(_wm_size,_wm_mask,_atomicOps),
201 m_WTData(_Data),
202 m_wfid(_proc_id),
203 m_instSeqNum(_instSeqNum),
206 m_isTlbi(false),
208 m_isSecure(m_pkt->req->isSecure())
209 {
211 if (_pkt) {
212 m_isGLCSet = m_pkt->req->isGLCSet();
213 m_isSLCSet = m_pkt->req->isSLCSet();
214
215 } else {
216 m_isGLCSet = 0;
217 m_isSLCSet = 0;
218 }
219 }
220
221 RubyRequest(Tick curTime) : Message(curTime) {}
222 MsgPtr clone() const
223 { return std::shared_ptr<Message>(new RubyRequest(*this)); }
224
227 const RubyRequestType& getType() const { return m_Type; }
229 const RubyAccessMode& getAccessMode() const { return m_AccessMode; }
230 const int& getSize() const { return m_Size; }
231 const PrefetchBit& getPrefetch() const { return m_Prefetch; }
232 RequestPtr getRequestPtr() const { return m_pkt->req; }
233
234 void setWriteMask(uint32_t offset, uint32_t len,
236 void print(std::ostream& out) const;
237 bool functionalRead(Packet *pkt);
238 bool functionalRead(Packet *pkt, WriteMask &mask);
239 bool functionalWrite(Packet *pkt);
240};
241
242inline std::ostream&
243operator<<(std::ostream& out, const RubyRequest& obj)
244{
245 obj.print(out);
246 out << std::flush;
247 return out;
248}
249
250} // namespace ruby
251} // namespace gem5
252
253#endif //__MEM_RUBY_SLICC_INTERFACE_RUBYREQUEST_HH__
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
RequestPtr req
A pointer to the original request.
Definition packet.hh:377
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)
const int & getSize() const
Addr getPhysicalAddress() const
void setWriteMask(uint32_t offset, uint32_t len, std::vector< std::pair< int, AtomicOpFunctor * > > atomicOps)
Addr getLineAddress() const
RubyRequest(Tick curTime)
const RubyRequestType & getType() const
const PrefetchBit & getPrefetch() const
RubyRequestType m_Type
const RubyAccessMode & getAccessMode() const
RubyRequest(Tick curTime, uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode, PacketPtr _pkt, ContextID _proc_id, ContextID _core_id)
RubyRequest for memory management commands.
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)
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)
bool functionalWrite(Packet *pkt)
void print(std::ostream &out) const
RequestPtr getRequestPtr() const
bool functionalRead(Packet *pkt)
The two functions below are used for reading / writing the message functionally.
RubyAccessMode m_AccessMode
Addr getProgramCounter() const
STL pair class.
Definition stl.hh:58
STL vector class.
Definition stl.hh:37
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 18, 16 > len
bool isSecure(ThreadContext *tc)
Definition utility.cc:74
Bitfield< 23, 0 > offset
Definition types.hh:144
std::shared_ptr< Message > MsgPtr
Definition Message.hh:60
Addr makeLineAddress(Addr addr)
Definition Address.cc:60
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition BoolVec.cc:49
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< Request > RequestPtr
Definition request.hh:94
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint64_t Tick
Tick count type.
Definition types.hh:58
int ContextID
Globally unique thread context ID.
Definition types.hh:239

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