48#include "debug/ResponsePort.hh"
57class DefaultRequestPort :
public RequestPort
63 throw UnboundPortException();
67 DefaultRequestPort() : RequestPort(
"default_request_port") {}
73 bool recvTimingResp(
PacketPtr)
override { blowUp(); }
74 void recvTimingSnoopReq(
PacketPtr)
override { blowUp(); }
75 void recvReqRetry()
override { blowUp(); }
76 void recvRetrySnoopResp()
override { blowUp(); }
79 void recvFunctionalSnoop(
PacketPtr)
override { blowUp(); }
82class DefaultResponsePort :
public ResponsePort
88 throw UnboundPortException();
92 DefaultResponsePort() :
ResponsePort(
"default_response_port") {}
98 bool recvTimingReq(
PacketPtr)
override { blowUp(); }
99 bool tryTiming(
PacketPtr)
override { blowUp(); }
100 bool recvTimingSnoopResp(
PacketPtr)
override { blowUp(); }
101 void recvRespRetry()
override { blowUp(); }
104 void recvFunctional(
PacketPtr)
override { blowUp(); }
106 recvMemBackdoorReq(
const MemBackdoorReq &,
MemBackdoorPtr &)
override
115DefaultRequestPort defaultRequestPort;
116DefaultResponsePort defaultResponsePort;
127 Port(
name, _id), _responsePort(&defaultResponsePort), owner{*_owner}
138 Port(
name, _id), _responsePort(&defaultResponsePort),
150 auto *response_port =
dynamic_cast<ResponsePort *
>(&peer);
151 fatal_if(!response_port,
"Can't bind port %s to non-response port %s.",
164 "not bound.",
name());
179 auto req = std::make_shared<Request>(
198 _requestPort(&defaultRequestPort),
199 defaultBackdoorWarned(false),
213 _requestPort(&defaultRequestPort),
214 defaultBackdoorWarned(false),
242 "Port %s doesn't support requesting a back door.",
name());
254 "Port %s doesn't support requesting a back door.",
name());
virtual Tick recvAtomic(PacketPtr pkt)=0
Receive an atomic request packet from the peer.
Object used to maintain state of a PrintReq.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
SenderState * senderState
This packet's sender state.
Ports are used to interface objects to each other.
bool isConnected() const
Is this port currently connected to a peer?
const std::string name() const
Return port name (for DPRINTF).
virtual void unbind()
Dettach from a peer port.
virtual void bind(Port &peer)
Attach to a peer port.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
void unbind() override
Unbind this request port and the associated response port.
ResponsePort * _responsePort
AddrRangeList getAddrRanges() const
Get the address ranges of the connected responder port.
void bind(Port &peer) override
Bind this request port to a response port.
RequestPort(const std::string &name, SimObject *_owner, PortID id=InvalidPortID)
Request port.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
void printAddr(Addr a)
Inject a PrintReq for the given address to print the state of that address throughout the memory syst...
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
A ResponsePort is a specialization of a port.
Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor) override
Default implementations.
ResponsePort(const std::string &name, SimObject *_owner, PortID id=InvalidPortID)
Response port.
void responderUnbind()
Called by the request port to unbind.
bool defaultBackdoorWarned
void responderBind(RequestPort &request_port)
Called by the request port to bind.
virtual AddrRangeList getAddrRanges() const =0
Get a list of the non-overlapping address ranges the owner is responsible for.
void recvMemBackdoorReq(const MemBackdoorReq &req, MemBackdoorPtr &backdoor) override
Receive a request for a back door to a range of memory.
RequestPort * _requestPort
Abstract superclass for simulation objects.
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
MemBackdoor * MemBackdoorPtr
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
const std::string & name()