gem5  v21.2.0.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 
80  RubyRequest(Tick curTime, uint64_t _paddr, int _len,
81  uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
82  PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
83  ContextID _proc_id = 100, ContextID _core_id = 99)
84  : Message(curTime),
85  m_PhysicalAddress(_paddr),
86  m_Type(_type),
87  m_ProgramCounter(_pc),
88  m_AccessMode(_access_mode),
89  m_Size(_len),
90  m_Prefetch(_pb),
91  m_pkt(_pkt),
92  m_contextId(_core_id),
93  m_htmFromTransaction(false),
95  {
97  }
98 
99  RubyRequest(Tick curTime, uint64_t _paddr, int _len,
100  uint64_t _pc, RubyRequestType _type,
101  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
102  unsigned _proc_id, unsigned _core_id,
103  int _wm_size, std::vector<bool> & _wm_mask,
104  DataBlock & _Data,
105  uint64_t _instSeqNum = 0)
106  : Message(curTime),
107  m_PhysicalAddress(_paddr),
108  m_Type(_type),
109  m_ProgramCounter(_pc),
110  m_AccessMode(_access_mode),
111  m_Size(_len),
112  m_Prefetch(_pb),
113  m_pkt(_pkt),
114  m_contextId(_core_id),
115  m_writeMask(_wm_size,_wm_mask),
116  m_WTData(_Data),
117  m_wfid(_proc_id),
118  m_instSeqNum(_instSeqNum),
119  m_htmFromTransaction(false),
121  {
123  }
124 
125  RubyRequest(Tick curTime, uint64_t _paddr, int _len,
126  uint64_t _pc, RubyRequestType _type,
127  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
128  unsigned _proc_id, unsigned _core_id,
129  int _wm_size, std::vector<bool> & _wm_mask,
130  DataBlock & _Data,
132  uint64_t _instSeqNum = 0)
133  : Message(curTime),
134  m_PhysicalAddress(_paddr),
135  m_Type(_type),
136  m_ProgramCounter(_pc),
137  m_AccessMode(_access_mode),
138  m_Size(_len),
139  m_Prefetch(_pb),
140  m_pkt(_pkt),
141  m_contextId(_core_id),
142  m_writeMask(_wm_size,_wm_mask,_atomicOps),
143  m_WTData(_Data),
144  m_wfid(_proc_id),
145  m_instSeqNum(_instSeqNum),
146  m_htmFromTransaction(false),
148  {
150  }
151 
152  RubyRequest(Tick curTime) : Message(curTime) {}
153  MsgPtr clone() const
154  { return std::shared_ptr<Message>(new RubyRequest(*this)); }
155 
156  Addr getLineAddress() const { return m_LineAddress; }
158  const RubyRequestType& getType() const { return m_Type; }
160  const RubyAccessMode& getAccessMode() const { return m_AccessMode; }
161  const int& getSize() const { return m_Size; }
162  const PrefetchBit& getPrefetch() const { return m_Prefetch; }
163  RequestPtr getRequestPtr() const { return m_pkt->req; }
164 
165  void print(std::ostream& out) const;
166  bool functionalRead(Packet *pkt);
167  bool functionalRead(Packet *pkt, WriteMask &mask);
168  bool functionalWrite(Packet *pkt);
169 };
170 
171 inline std::ostream&
172 operator<<(std::ostream& out, const RubyRequest& obj)
173 {
174  obj.print(out);
175  out << std::flush;
176  return out;
177 }
178 
179 } // namespace ruby
180 } // namespace gem5
181 
182 #endif //__MEM_RUBY_SLICC_INTERFACE_RUBYREQUEST_HH__
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:99
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:366
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::m_writeMask
WriteMask m_writeMask
Definition: RubyRequest.hh:73
std::vector< bool >
gem5::ruby::RubyRequest::getRequestPtr
RequestPtr getRequestPtr() const
Definition: RubyRequest.hh:163
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:162
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
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_LineAddress
Addr m_LineAddress
Definition: RubyRequest.hh:65
gem5::ruby::RubyRequest::getAccessMode
const RubyAccessMode & getAccessMode() const
Definition: RubyRequest.hh:160
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:80
gem5::ruby::RubyRequest::m_Type
RubyRequestType m_Type
Definition: RubyRequest.hh:66
gem5::ruby::RubyRequest::getSize
const int & getSize() const
Definition: RubyRequest.hh:161
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::getProgramCounter
Addr getProgramCounter() const
Definition: RubyRequest.hh:159
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:125
gem5::ruby::RubyRequest::clone
MsgPtr clone() const
Definition: RubyRequest.hh:153
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:246
gem5::ruby::RubyRequest::m_Prefetch
PrefetchBit m_Prefetch
Definition: RubyRequest.hh:70
gem5::ruby::RubyRequest::RubyRequest
RubyRequest(Tick curTime)
Definition: RubyRequest.hh:152
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:158
gem5::ruby::DataBlock
Definition: DataBlock.hh:60
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: tlb.cc:60
gem5::ruby::RubyRequest::getPhysicalAddress
Addr getPhysicalAddress() const
Definition: RubyRequest.hh:157
gem5::ruby::RubyRequest::getLineAddress
Addr getLineAddress() const
Definition: RubyRequest.hh:156
gem5::ruby::RubyRequest::m_AccessMode
RubyAccessMode m_AccessMode
Definition: RubyRequest.hh:68

Generated on Tue Dec 21 2021 11:34:33 for gem5 by doxygen 1.8.17