Go to the documentation of this file.
32 #include "debug/SimpleMemobj.hh"
36 instPort(params->
name +
".inst_port", this),
37 dataPort(params->
name +
".data_port", this),
38 memPort(params->
name +
".mem_side", this),
49 if (if_name ==
"mem_side") {
51 }
else if (if_name ==
"inst_port") {
53 }
else if (if_name ==
"data_port") {
77 return owner->getAddrRanges();
83 if (needRetry && blockedPacket ==
nullptr) {
95 return owner->handleFunctional(pkt);
102 if (!owner->handleRequest(pkt)) {
114 assert(blockedPacket !=
nullptr);
118 blockedPacket =
nullptr;
129 panic_if(blockedPacket !=
nullptr,
"Should never try to send if blocked!");
132 if (!sendTimingReq(pkt)) {
141 return owner->handleResponse(pkt);
148 assert(blockedPacket !=
nullptr);
152 blockedPacket =
nullptr;
161 owner->sendRangeChange();
196 if (pkt->
req->isInstFetch()) {
235 SimpleMemobjParams::create()
MemSidePort memPort
Instantiation of the memory-side port.
void recvRangeChange() override
Called to receive an address range change from the peer responder port.
bool handleRequest(PacketPtr pkt)
Handle the request from the CPU side.
AddrRangeList getAddrRanges() const
Return the address ranges this memobj is responsible for.
SimpleMemobj(SimpleMemobjParams *params)
constructor
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
const PortID InvalidPortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
AddrRangeList getAddrRanges() const
Get the address ranges of the connected responder port.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the response port.
RequestPtr req
A pointer to the original request.
CPUSidePort instPort
Instantiation of the CPU-side ports.
void trySendRetry()
Send a retry to the peer port only if it is needed.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
void recvRespRetry() override
Called by the request port if sendTimingResp was called on this response port (causing recvTimingResp...
AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
void recvReqRetry() override
Called by the response port if sendTimingReq was called on this request port (causing recvTimingReq t...
A very simple memory object.
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the request port.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Ports are used to interface objects to each other.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
const std::string & name()
void handleFunctional(PacketPtr pkt)
Handle a packet functionally.
void sendRangeChange()
Tell the CPU side to ask for our memory ranges.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool handleResponse(PacketPtr pkt)
Handle the respone from the memory side.
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
void sendRangeChange() const
Called by the owner to send a range change.
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the request port.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
bool blocked
True if this is currently blocked waiting for a response.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17