Go to the documentation of this file.
32 #include "debug/SimpleMemobj.hh"
39 instPort(params.
name +
".inst_port", this),
40 dataPort(params.
name +
".data_port", this),
41 memPort(params.
name +
".mem_side", this),
52 if (if_name ==
"mem_side") {
54 }
else if (if_name ==
"inst_port") {
56 }
else if (if_name ==
"data_port") {
80 return owner->getAddrRanges();
86 if (needRetry && blockedPacket ==
nullptr) {
98 return owner->handleFunctional(pkt);
105 if (!owner->handleRequest(pkt)) {
117 assert(blockedPacket !=
nullptr);
121 blockedPacket =
nullptr;
132 panic_if(blockedPacket !=
nullptr,
"Should never try to send if blocked!");
135 if (!sendTimingReq(pkt)) {
144 return owner->handleResponse(pkt);
151 assert(blockedPacket !=
nullptr);
155 blockedPacket =
nullptr;
164 owner->sendRangeChange();
199 if (pkt->
req->isInstFetch()) {
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the request port.
void sendRangeChange()
Tell the CPU side to ask for our memory ranges.
RequestPtr req
A pointer to the original request.
SimpleMemobj(const SimpleMemobjParams ¶ms)
constructor
const PortID InvalidPortID
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
bool handleResponse(PacketPtr pkt)
Handle the respone from the memory side.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void recvRangeChange() override
Called to receive an address range change from the peer responder port.
MemSidePort memPort
Instantiation of the memory-side port.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
AddrRangeList getAddrRanges() const
Get the address ranges of the connected responder port.
Abstract superclass for simulation objects.
bool handleRequest(PacketPtr pkt)
Handle the request from the CPU side.
const std::string & name()
void sendRangeChange() const
Called by the owner to send a range change.
void handleFunctional(PacketPtr pkt)
Handle a packet functionally.
void recvReqRetry() override
Called by the response port if sendTimingReq was called on this request port (causing recvTimingReq t...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
AddrRangeList getAddrRanges() const
Return the address ranges this memobj is responsible for.
bool blocked
True if this is currently blocked waiting for a response.
Ports are used to interface objects to each other.
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the request port.
void trySendRetry()
Send a retry to the peer port only if it is needed.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the response port.
CPUSidePort instPort
Instantiation of the CPU-side ports.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
A very simple memory object.
void recvRespRetry() override
Called by the request port if sendTimingResp was called on this response port (causing recvTimingResp...
Generated on Tue Sep 21 2021 12:25:25 for gem5 by doxygen 1.8.17