gem5  v20.1.0.0
RubyRequest.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 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 class RubyRequest : public Message
56 {
57  public:
60  RubyRequestType m_Type;
62  RubyAccessMode m_AccessMode;
63  int m_Size;
64  PrefetchBit m_Prefetch;
65  uint8_t* data;
70  int m_wfid;
71  uint64_t m_instSeqNum;
74 
75  RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
76  uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
77  PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
78  ContextID _proc_id = 100, ContextID _core_id = 99)
79  : Message(curTime),
80  m_PhysicalAddress(_paddr),
81  m_Type(_type),
82  m_ProgramCounter(_pc),
83  m_AccessMode(_access_mode),
84  m_Size(_len),
85  m_Prefetch(_pb),
86  data(_data),
87  m_pkt(_pkt),
88  m_contextId(_core_id),
89  m_htmFromTransaction(false),
91  {
93  }
94 
95  RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
96  uint64_t _pc, RubyRequestType _type,
97  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
98  unsigned _proc_id, unsigned _core_id,
99  int _wm_size, std::vector<bool> & _wm_mask,
100  DataBlock & _Data,
101  uint64_t _instSeqNum = 0)
102  : Message(curTime),
103  m_PhysicalAddress(_paddr),
104  m_Type(_type),
105  m_ProgramCounter(_pc),
106  m_AccessMode(_access_mode),
107  m_Size(_len),
108  m_Prefetch(_pb),
109  data(_data),
110  m_pkt(_pkt),
111  m_contextId(_core_id),
112  m_writeMask(_wm_size,_wm_mask),
113  m_WTData(_Data),
114  m_wfid(_proc_id),
115  m_instSeqNum(_instSeqNum),
116  m_htmFromTransaction(false),
118  {
120  }
121 
122  RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
123  uint64_t _pc, RubyRequestType _type,
124  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
125  unsigned _proc_id, unsigned _core_id,
126  int _wm_size, std::vector<bool> & _wm_mask,
127  DataBlock & _Data,
129  uint64_t _instSeqNum = 0)
130  : Message(curTime),
131  m_PhysicalAddress(_paddr),
132  m_Type(_type),
133  m_ProgramCounter(_pc),
134  m_AccessMode(_access_mode),
135  m_Size(_len),
136  m_Prefetch(_pb),
137  data(_data),
138  m_pkt(_pkt),
139  m_contextId(_core_id),
140  m_writeMask(_wm_size,_wm_mask,_atomicOps),
141  m_WTData(_Data),
142  m_wfid(_proc_id),
143  m_instSeqNum(_instSeqNum),
144  m_htmFromTransaction(false),
146  {
148  }
149 
150  RubyRequest(Tick curTime) : Message(curTime) {}
151  MsgPtr clone() const
152  { return std::shared_ptr<Message>(new RubyRequest(*this)); }
153 
154  Addr getLineAddress() const { return m_LineAddress; }
156  const RubyRequestType& getType() const { return m_Type; }
158  const RubyAccessMode& getAccessMode() const { return m_AccessMode; }
159  const int& getSize() const { return m_Size; }
160  const PrefetchBit& getPrefetch() const { return m_Prefetch; }
161 
162  void print(std::ostream& out) const;
163  bool functionalRead(Packet *pkt);
164  bool functionalWrite(Packet *pkt);
165 };
166 
167 inline std::ostream&
168 operator<<(std::ostream& out, const RubyRequest& obj)
169 {
170  obj.print(out);
171  out << std::flush;
172  return out;
173 }
174 
175 #endif //__MEM_RUBY_SLICC_INTERFACE_RUBYREQUEST_HH__
RubyRequest::m_pkt
PacketPtr m_pkt
Definition: RubyRequest.hh:66
RubyRequest::functionalWrite
bool functionalWrite(Packet *pkt)
Definition: RubyRequest.cc:75
operator<<
std::ostream & operator<<(std::ostream &out, const RubyRequest &obj)
Definition: RubyRequest.hh:168
RubyRequest::m_htmTransactionUid
uint64_t m_htmTransactionUid
Definition: RubyRequest.hh:73
RubyRequest::m_Prefetch
PrefetchBit m_Prefetch
Definition: RubyRequest.hh:64
RubyRequest::m_wfid
int m_wfid
Definition: RubyRequest.hh:70
makeLineAddress
Addr makeLineAddress(Addr addr)
Definition: Address.cc:54
RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _paddr, uint8_t *_data, 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:95
RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _paddr, uint8_t *_data, 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:75
RubyRequest::m_ProgramCounter
Addr m_ProgramCounter
Definition: RubyRequest.hh:61
RubyRequest::m_AccessMode
RubyAccessMode m_AccessMode
Definition: RubyRequest.hh:62
ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:231
RubyRequest::m_LineAddress
Addr m_LineAddress
Definition: RubyRequest.hh:59
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
RubyRequest::print
void print(std::ostream &out) const
Definition: RubyRequest.cc:50
std::vector< bool >
RubyRequest::data
uint8_t * data
Definition: RubyRequest.hh:65
DataBlock
Definition: DataBlock.hh:40
RubyRequest::RubyRequest
RubyRequest(Tick curTime, uint64_t _paddr, uint8_t *_data, 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:122
RubyRequest::m_PhysicalAddress
Addr m_PhysicalAddress
Definition: RubyRequest.hh:58
RubyRequest::getType
const RubyRequestType & getType() const
Definition: RubyRequest.hh:156
RubyRequest::functionalRead
bool functionalRead(Packet *pkt)
The two functions below are used for reading / writing the message functionally.
Definition: RubyRequest.cc:65
RubyRequest::getLineAddress
Addr getLineAddress() const
Definition: RubyRequest.hh:154
DataBlock.hh
WriteMask.hh
RubyRequest::m_contextId
ContextID m_contextId
Definition: RubyRequest.hh:67
RubyRequest
Definition: RubyRequest.hh:55
RubyRequest::getPrefetch
const PrefetchBit & getPrefetch() const
Definition: RubyRequest.hh:160
RubyRequest::getSize
const int & getSize() const
Definition: RubyRequest.hh:159
RubyRequest::RubyRequest
RubyRequest(Tick curTime)
Definition: RubyRequest.hh:150
std::pair< int, AtomicOpFunctor * >
RubyRequest::m_Type
RubyRequestType m_Type
Definition: RubyRequest.hh:60
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
RubyRequest::m_Size
int m_Size
Definition: RubyRequest.hh:63
RubyRequest::m_WTData
DataBlock m_WTData
Definition: RubyRequest.hh:69
MsgPtr
std::shared_ptr< Message > MsgPtr
Definition: Message.hh:40
RubyRequest::m_writeMask
WriteMask m_writeMask
Definition: RubyRequest.hh:68
RubyRequest::getAccessMode
const RubyAccessMode & getAccessMode() const
Definition: RubyRequest.hh:158
RubyRequest::clone
MsgPtr clone() const
Definition: RubyRequest.hh:151
RubyRequest::m_htmFromTransaction
bool m_htmFromTransaction
Definition: RubyRequest.hh:72
Address.hh
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
Message
Definition: Message.hh:43
RubyRequest::getProgramCounter
Addr getProgramCounter() const
Definition: RubyRequest.hh:157
RubyRequest::getPhysicalAddress
Addr getPhysicalAddress() const
Definition: RubyRequest.hh:155
RubyRequest::m_instSeqNum
uint64_t m_instSeqNum
Definition: RubyRequest.hh:71
WriteMask
Definition: WriteMask.hh:40

Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17