32#include "debug/SimpleMemobj.hh"
52 if (if_name ==
"mem_side") {
54 }
else if (if_name ==
"inst_port") {
56 }
else if (if_name ==
"data_port") {
80 return owner->getAddrRanges();
98 return owner->handleFunctional(pkt);
105 if (!
owner->handleRequest(pkt)) {
144 return owner->handleResponse(pkt);
164 owner->sendRangeChange();
199 if (pkt->
req->isInstFetch()) {
225 return memPort.getAddrRanges();
virtual std::string name() const
RequestPtr req
A pointer to the original request.
Ports are used to interface objects to each other.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
void sendRetryReq()
Send a retry to the request port that previously attempted a sendTimingReq to this response port and ...
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
SimpleMemobj * owner
The object that owns this object (SimpleMemobj)
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the request port.
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the request port.
AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
void recvRespRetry() override
Called by the request port if sendTimingResp was called on this response port (causing recvTimingResp...
void trySendRetry()
Send a retry to the peer port only if it is needed.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
bool needRetry
True if the port needs to send a retry req.
void recvRangeChange() override
Called to receive an address range change from the peer responder port.
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
SimpleMemobj * owner
The object that owns this object (SimpleMemobj)
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the response port.
void recvReqRetry() override
Called by the response port if sendTimingReq was called on this request port (causing recvTimingReq t...
void sendPacket(PacketPtr pkt)
Send a packet across this port.
bool handleResponse(PacketPtr pkt)
Handle the respone from the memory side.
MemSidePort memPort
Instantiation of the memory-side port.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
bool handleRequest(PacketPtr pkt)
Handle the request from the CPU side.
CPUSidePort instPort
Instantiation of the CPU-side ports.
AddrRangeList getAddrRanges() const
Return the address ranges this memobj is responsible for.
bool blocked
True if this is currently blocked waiting for a response.
SimpleMemobj(const SimpleMemobjParams ¶ms)
constructor
void handleFunctional(PacketPtr pkt)
Handle a packet functionally.
void sendRangeChange()
Tell the CPU side to ask for our memory ranges.
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
const Params & params() const
SimObject(const Params &p)
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Copyright (c) 2024 Arm Limited All rights reserved.
const PortID InvalidPortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.