Go to the documentation of this file.
45 #include "debug/MemCheckerMonitor.hh"
52 memSidePort(
name() +
"-memSidePort", *this),
53 cpuSidePort(
name() +
"-cpuSidePort", *this),
54 warnOnly(params.warn_only),
55 memchecker(params.memchecker)
66 fatal(
"Communication monitor is not connected on both sides.\n");
72 if (if_name ==
"request" || if_name ==
"mem_side_port") {
74 }
else if (if_name ==
"response" || if_name ==
"cpu_side_port") {
95 "Forwarded functional access: addr = %#llx, size = %d\n",
103 unsigned size = pkt->
getSize();
111 "Received functional snoop: addr = %#llx, size = %d\n",
118 panic(
"Atomic not supported");
124 panic(
"Atomic not supported");
138 bool is_read = pkt->
isRead() && !pkt->
req->isPrefetch();
139 bool is_write = pkt->
isWrite();
140 unsigned size = pkt->
getSize();
143 std::unique_ptr<uint8_t[]> pkt_data;
146 if (expects_response && is_write) {
150 pkt_data.reset(
new uint8_t[size]);
158 if (expects_response && (is_read || is_write)) {
167 if (!successful && expects_response && (is_read || is_write)) {
171 if (successful && expects_response) {
191 "Forwarded read request: serial = %d, addr = %#llx, "
194 }
else if (is_write) {
203 "Forwarded write request: serial = %d, addr = %#llx, "
208 "Forwarded non read/write request: addr = %#llx\n",
addr);
210 }
else if (successful) {
212 "Forwarded request marked for cache response: addr = %#llx\n",
227 bool is_read = pkt->
isRead() && !pkt->
req->isPrefetch();
228 bool is_write = pkt->
isWrite();
229 bool is_failed_LLSC = pkt->
isLLSC() && pkt->
req->getExtraData() == 0;
230 unsigned size = pkt->
getSize();
232 std::unique_ptr<uint8_t[]> pkt_data;
239 pkt_data.reset(
new uint8_t[size]);
243 if (is_read || is_write) {
249 "Monitor got a response without monitor sender state\n");
263 "Received read response: serial = %d, addr = %#llx, "
274 warn(
"%s: read of %#llx @ cycle %d failed:\n%s\n",
282 delete received_state;
283 }
else if (is_write) {
285 "Received write response: serial = %d, addr = %#llx, "
289 if (is_failed_LLSC) {
301 delete received_state;
304 "Received non read/write response: addr = %#llx\n",
addr);
306 }
else if (is_read || is_write) {
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
MemChecker::Serial serial
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
MonitorRequestPort memSidePort
Instance of request port, facing the memory side.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
AddrRangeList getAddrRanges() const
bool recvTimingSnoopResp(PacketPtr pkt)
void sendFunctionalSnoop(PacketPtr pkt) const
Send a functional snoop request packet, where the data is instantly updated everywhere in the memory ...
void sendRetryReq()
Send a retry to the request port that previously attempted a sendTimingReq to this response port and ...
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
RequestPtr req
A pointer to the original request.
Implements a MemChecker monitor, to be inserted between two ports.
bool cacheResponding() const
void abortWrite(Serial serial, Addr addr, size_t size)
Aborts a previously started write transaction.
MonitorResponsePort cpuSidePort
Instance of response port, i.e.
SenderState * predecessor
void recvFunctionalSnoop(PacketPtr pkt)
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
MemCheckerMonitorParams Params
Parameters of memchecker monitor.
bool completeRead(Serial serial, Tick complete, Addr addr, size_t size, uint8_t *data)
Completes a previously started read transaction.
virtual std::string name() const
bool recvTimingReq(PacketPtr pkt)
Serial startWrite(Tick start, Addr addr, size_t size, const uint8_t *data)
Starts a write transaction.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void completeWrite(Serial serial, Tick complete, Addr addr, size_t size)
Completes a previously started write transaction.
const std::string & getErrorMessage() const
In completeRead, if an error is encountered, this does not print nor cause an error,...
uint64_t Tick
Tick count type.
bool isSnooping() const
Find out if the peer request port is snooping or not.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual void sendRetryResp()
Send a retry to the response port that previously attempted a sendTimingResp to this request port and...
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
void sendTimingSnoopReq(PacketPtr pkt)
Attempt to send a timing snoop request packet to the request port by calling its corresponding receiv...
bool isConnected() const
Is this port currently connected to a peer?
Tick recvAtomicSnoop(PacketPtr pkt)
AddrRangeList getAddrRanges() const
Get the address ranges of the connected responder port.
Abstract superclass for simulation objects.
~MemCheckerMonitor()
Destructor.
void recvTimingSnoopReq(PacketPtr pkt)
Serial startRead(Tick start, Addr addr, size_t size)
Starts a read transaction.
bool needsResponse() const
void writeData(uint8_t *p) const
Copy data from the packet to the memory at the provided pointer.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
SenderState * senderState
This packet's sender state.
const std::string & name()
void recvFunctional(PacketPtr pkt)
void sendRangeChange() const
Called by the owner to send a range change.
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
MemCheckerMonitor(const Params ¶ms)
Constructor based on the Python params.
Ports are used to interface objects to each other.
void reset()
Resets the entire checker.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
bool recvTimingResp(PacketPtr pkt)
Tick recvAtomic(PacketPtr pkt)
bool sendTimingSnoopResp(PacketPtr pkt)
Attempt to send a timing snoop response packet to the response port by calling its corresponding rece...
uint64_t Serial
The Serial type is used to be able to uniquely identify a transaction as it passes through the system...
#define panic(...)
This implements a cprintf based panic() function.
Generated on Tue Sep 21 2021 12:25:32 for gem5 by doxygen 1.8.17