gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RubyRequest.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Mark D. Hill and David A. Wood
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __MEM_RUBY_SLICC_INTERFACE_RUBY_REQUEST_HH__
30 #define __MEM_RUBY_SLICC_INTERFACE_RUBY_REQUEST_HH__
31 
32 #include <ostream>
33 #include <vector>
34 
35 #include "mem/protocol/HSAScope.hh"
36 #include "mem/protocol/HSASegment.hh"
37 #include "mem/protocol/Message.hh"
38 #include "mem/protocol/PrefetchBit.hh"
39 #include "mem/protocol/RubyAccessMode.hh"
40 #include "mem/protocol/RubyRequestType.hh"
44 
45 class RubyRequest : public Message
46 {
47  public:
50  RubyRequestType m_Type;
52  RubyAccessMode m_AccessMode;
53  int m_Size;
54  PrefetchBit m_Prefetch;
55  uint8_t* data;
60  int m_wfid;
61  HSAScope m_scope;
62  HSASegment m_segment;
63 
64 
65  RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
66  uint64_t _pc, RubyRequestType _type, RubyAccessMode _access_mode,
67  PacketPtr _pkt, PrefetchBit _pb = PrefetchBit_No,
68  ContextID _proc_id = 100, ContextID _core_id = 99,
69  HSAScope _scope = HSAScope_UNSPECIFIED,
70  HSASegment _segment = HSASegment_GLOBAL)
71  : Message(curTime),
72  m_PhysicalAddress(_paddr),
73  m_Type(_type),
74  m_ProgramCounter(_pc),
75  m_AccessMode(_access_mode),
76  m_Size(_len),
77  m_Prefetch(_pb),
78  data(_data),
79  m_pkt(_pkt),
80  m_contextId(_core_id),
81  m_scope(_scope),
82  m_segment(_segment)
83  {
85  }
86 
87  RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
88  uint64_t _pc, RubyRequestType _type,
89  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
90  unsigned _proc_id, unsigned _core_id,
91  int _wm_size, std::vector<bool> & _wm_mask,
92  DataBlock & _Data,
93  HSAScope _scope = HSAScope_UNSPECIFIED,
94  HSASegment _segment = HSASegment_GLOBAL)
95  : Message(curTime),
96  m_PhysicalAddress(_paddr),
97  m_Type(_type),
98  m_ProgramCounter(_pc),
99  m_AccessMode(_access_mode),
100  m_Size(_len),
101  m_Prefetch(_pb),
102  data(_data),
103  m_pkt(_pkt),
104  m_contextId(_core_id),
105  m_writeMask(_wm_size,_wm_mask),
106  m_WTData(_Data),
107  m_wfid(_proc_id),
108  m_scope(_scope),
109  m_segment(_segment)
110  {
112  }
113 
114  RubyRequest(Tick curTime, uint64_t _paddr, uint8_t* _data, int _len,
115  uint64_t _pc, RubyRequestType _type,
116  RubyAccessMode _access_mode, PacketPtr _pkt, PrefetchBit _pb,
117  unsigned _proc_id, unsigned _core_id,
118  int _wm_size, std::vector<bool> & _wm_mask,
119  DataBlock & _Data,
121  HSAScope _scope = HSAScope_UNSPECIFIED,
122  HSASegment _segment = HSASegment_GLOBAL)
123  : Message(curTime),
124  m_PhysicalAddress(_paddr),
125  m_Type(_type),
126  m_ProgramCounter(_pc),
127  m_AccessMode(_access_mode),
128  m_Size(_len),
129  m_Prefetch(_pb),
130  data(_data),
131  m_pkt(_pkt),
132  m_contextId(_core_id),
133  m_writeMask(_wm_size,_wm_mask,_atomicOps),
134  m_WTData(_Data),
135  m_wfid(_proc_id),
136  m_scope(_scope),
137  m_segment(_segment)
138  {
140  }
141 
142 
143  RubyRequest(Tick curTime) : Message(curTime) {}
144  MsgPtr clone() const
145  { return std::shared_ptr<Message>(new RubyRequest(*this)); }
146 
147  Addr getLineAddress() const { return m_LineAddress; }
149  const RubyRequestType& getType() const { return m_Type; }
151  const RubyAccessMode& getAccessMode() const { return m_AccessMode; }
152  const int& getSize() const { return m_Size; }
153  const PrefetchBit& getPrefetch() const { return m_Prefetch; }
154 
155  void print(std::ostream& out) const;
156  bool functionalRead(Packet *pkt);
157  bool functionalWrite(Packet *pkt);
158 };
159 
160 inline std::ostream&
161 operator<<(std::ostream& out, const RubyRequest& obj)
162 {
163  obj.print(out);
164  out << std::flush;
165  return out;
166 }
167 
168 #endif // __MEM_RUBY_SLICC_INTERFACE_RUBY_REQUEST_HH__
PacketPtr m_pkt
Definition: RubyRequest.hh:56
std::shared_ptr< Message > MsgPtr
Definition: Message.hh:40
Addr m_LineAddress
Definition: RubyRequest.hh:49
bool functionalWrite(Packet *pkt)
Definition: RubyRequest.cc:61
uint8_t * data
Definition: RubyRequest.hh:55
const RubyRequestType & getType() const
Definition: RubyRequest.hh:149
Addr m_PhysicalAddress
Definition: RubyRequest.hh:48
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, HSAScope _scope=HSAScope_UNSPECIFIED, HSASegment _segment=HSASegment_GLOBAL)
Definition: RubyRequest.hh:65
const PrefetchBit & getPrefetch() const
Definition: RubyRequest.hh:153
Addr m_ProgramCounter
Definition: RubyRequest.hh:51
RubyAccessMode m_AccessMode
Definition: RubyRequest.hh:52
ContextID m_contextId
Definition: RubyRequest.hh:57
const int & getSize() const
Definition: RubyRequest.hh:152
Addr getLineAddress() const
Definition: RubyRequest.hh:147
RubyRequestType m_Type
Definition: RubyRequest.hh:50
std::ostream & operator<<(std::ostream &out, const RubyRequest &obj)
Definition: RubyRequest.hh:161
uint64_t Tick
Tick count type.
Definition: types.hh:63
bool functionalRead(Packet *pkt)
The two functions below are used for reading / writing the message functionally.
Definition: RubyRequest.cc:51
Addr getPhysicalAddress() const
Definition: RubyRequest.hh:148
const RubyAccessMode & getAccessMode() const
Definition: RubyRequest.hh:151
MsgPtr clone() const
Definition: RubyRequest.hh:144
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
WriteMask m_writeMask
Definition: RubyRequest.hh:58
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
HSASegment m_segment
Definition: RubyRequest.hh:62
Addr makeLineAddress(Addr addr)
Definition: Address.cc:112
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, HSAScope _scope=HSAScope_UNSPECIFIED, HSASegment _segment=HSASegment_GLOBAL)
Definition: RubyRequest.hh:87
RubyRequest(Tick curTime)
Definition: RubyRequest.hh:143
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, HSAScope _scope=HSAScope_UNSPECIFIED, HSASegment _segment=HSASegment_GLOBAL)
Definition: RubyRequest.hh:114
DataBlock m_WTData
Definition: RubyRequest.hh:59
HSAScope m_scope
Definition: RubyRequest.hh:61
void print(std::ostream &out) const
Definition: RubyRequest.cc:36
Addr getProgramCounter() const
Definition: RubyRequest.hh:150
PrefetchBit m_Prefetch
Definition: RubyRequest.hh:54
int ContextID
Globally unique thread context ID.
Definition: types.hh:175

Generated on Fri Jun 9 2017 13:03:50 for gem5 by doxygen 1.8.6