gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mem_checker_monitor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2014 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  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * Authors: Thomas Grass
38  * Andreas Hansson
39  * Marco Elver
40  */
41 
42 #ifndef __MEM_MEM_CHECKER_MONITOR_HH__
43 #define __MEM_MEM_CHECKER_MONITOR_HH__
44 
45 #include "base/statistics.hh"
46 #include "mem/mem_checker.hh"
47 #include "mem/mem_object.hh"
48 #include "params/MemCheckerMonitor.hh"
49 #include "sim/system.hh"
50 
55 {
56  public:
57 
59  typedef MemCheckerMonitorParams Params;
60  const Params* params() const
61  { return reinterpret_cast<const Params*>(_params); }
62 
69 
72 
73  virtual BaseMasterPort& getMasterPort(const std::string& if_name,
74  PortID idx = InvalidPortID);
75 
76  virtual BaseSlavePort& getSlavePort(const std::string& if_name,
77  PortID idx = InvalidPortID);
78 
79  virtual void init();
80 
81  private:
82 
84  {
86  : serial(_serial)
87  {}
88 
90  };
91 
99  {
100 
101  public:
102 
103  MonitorMasterPort(const std::string& _name, MemCheckerMonitor& _mon)
104  : MasterPort(_name, &_mon), mon(_mon)
105  { }
106 
107  protected:
108 
110  {
112  }
113 
115  {
116  return mon.recvAtomicSnoop(pkt);
117  }
118 
120  {
121  return mon.recvTimingResp(pkt);
122  }
123 
125  {
126  mon.recvTimingSnoopReq(pkt);
127  }
128 
130  {
132  }
133 
134  bool isSnooping() const
135  {
136  return mon.isSnooping();
137  }
138 
140  {
141  mon.recvReqRetry();
142  }
143 
144  private:
145 
147 
148  };
149 
152 
160  {
161 
162  public:
163 
164  MonitorSlavePort(const std::string& _name, MemCheckerMonitor& _mon)
165  : SlavePort(_name, &_mon), mon(_mon)
166  { }
167 
168  protected:
169 
171  {
172  mon.recvFunctional(pkt);
173  }
174 
176  {
177  return mon.recvAtomic(pkt);
178  }
179 
181  {
182  return mon.recvTimingReq(pkt);
183  }
184 
186  {
187  return mon.recvTimingSnoopResp(pkt);
188  }
189 
191  {
192  return mon.getAddrRanges();
193  }
194 
196  {
197  mon.recvRespRetry();
198  }
199 
200  private:
201 
203 
204  };
205 
208 
209  void recvFunctional(PacketPtr pkt);
210 
211  void recvFunctionalSnoop(PacketPtr pkt);
212 
214 
216 
217  bool recvTimingReq(PacketPtr pkt);
218 
219  bool recvTimingResp(PacketPtr pkt);
220 
221  void recvTimingSnoopReq(PacketPtr pkt);
222 
223  bool recvTimingSnoopResp(PacketPtr pkt);
224 
226 
227  bool isSnooping() const;
228 
229  void recvReqRetry();
230 
231  void recvRespRetry();
232 
233  void recvRangeChange();
234 
235  bool warnOnly;
236 
238 };
239 
240 #endif //__MEM_MEM_CHECKER_MONITOR_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
Definition: port.hh:167
~MemCheckerMonitor()
Destructor.
AddrRangeList getAddrRanges() const
Tick recvAtomicSnoop(PacketPtr pkt)
bool recvTimingReq(PacketPtr pkt)
MonitorSlavePort(const std::string &_name, MemCheckerMonitor &_mon)
const PortID InvalidPortID
Definition: types.hh:182
MemCheckerMonitorSenderState(MemChecker::Serial _serial)
MemObject declaration.
Tick recvAtomic(PacketPtr pkt)
bool recvTimingReq(PacketPtr pkt)
Receive a timing request from the master port.
A SlavePort is a specialisation of a port.
Definition: port.hh:331
This is the master port of the communication monitor.
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
Definition: port.hh:139
Declaration of Statistics objects.
uint64_t Serial
The Serial type is used to be able to uniquely identify a transaction as it passes through the system...
Definition: mem_checker.hh:80
MemCheckerMonitor(Params *params)
Constructor based on the Python params.
const Params * params() const
MonitorMasterPort masterPort
Instance of master port, facing the memory side.
MemChecker.
Definition: mem_checker.hh:72
uint64_t Tick
Tick count type.
Definition: types.hh:63
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the slave port.
MemCheckerMonitorParams Params
Parameters of memchecker monitor.
void recvTimingSnoopReq(PacketPtr pkt)
Receive a timing snoop request from the slave port.
Tick recvAtomicSnoop(PacketPtr pkt)
Receive an atomic snoop request packet from the slave port.
AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
void recvFunctionalSnoop(PacketPtr pkt)
void recvRespRetry()
Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to ...
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the master port.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
void recvRangeChange()
Called to receive an address range change from the peer slave port.
Implements a MemChecker monitor, to be inserted between two ports.
MonitorSlavePort slavePort
Instance of slave port, i.e.
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
bool recvTimingSnoopResp(PacketPtr pkt)
Receive a timing snoop response from the master port.
A virtual base opaque structure used to hold state associated with the packet (e.g., an MSHR), specific to a MemObject that sees the packet.
Definition: packet.hh:377
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
bool isSnooping() const
Determine if this master port is snooping or not.
virtual BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
void recvReqRetry()
Called by the slave port if sendTimingReq was called on this master port (causing recvTimingReq to be...
void recvFunctionalSnoop(PacketPtr pkt)
Receive a functional snoop request packet from the slave port.
void recvTimingSnoopReq(PacketPtr pkt)
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
Definition: mem_object.hh:60
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
Definition: port.hh:115
MonitorMasterPort(const std::string &_name, MemCheckerMonitor &_mon)
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
bool recvTimingSnoopResp(PacketPtr pkt)
void recvFunctional(PacketPtr pkt)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:181
bool recvTimingResp(PacketPtr pkt)
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the master port.
This is the slave port of the communication monitor.

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