44 #include "debug/ExternalPort.hh" 85 const std::string &name_,
87 const std::string &port_data)
100 unsigned int M5_VAR_USED size = packet->
getSize();
103 " data: ...\n", packet->
getAddr(), size);
152 fatal(
"StubSlavePort: function: %s\n", __func__);
169 fatal(
"StubSlavePort: unimplemented function: %s\n", __func__);
172 std::map<std::string, ExternalSlave::Handler *>
185 portType(params->port_type),
186 portData(params->port_data),
187 addrRanges(params->addr_ranges.begin(), params->addr_ranges.end())
197 if (if_name ==
"port") {
211 fatal(
"%s: Can't find external port type: %s" 225 fatal(
"ExternalSlave %s: externalPort not set!\n",
name());
227 fatal(
"ExternalSlave %s is unconnected!\n",
name());
234 ExternalSlaveParams::create()
ExternalPort(const std::string &name_, ExternalSlave &owner_)
Ports are used to interface objects to each other.
Derive from this class to create an external port interface.
void sendRangeChange() const
Called by the owner to send a range change.
#define fatal(...)
This implements a cprintf based fatal() function.
static void registerHandler(const std::string &handler_name, Handler *handler)
Register a handler which can provide ports with port_type == handler_name.
ExternalSlave::ExternalPort * getExternalPort(const std::string &name_, ExternalSlave &owner, const std::string &port_data)
Create or find an external port which can be bound.
AddrRangeList addrRanges
The Range of addresses supported by the devices on the external side of this port.
PacketPtr responsePacket
Stub can handle a single request at a time.
EventFunctionWrapper responseEvent
bool recvTimingReq(PacketPtr packet)
Receive a timing request from the peer.
std::string portData
Handler-specific port configuration.
#define DDUMP(x, data, count)
std::string portName
Name of the bound port.
bool isConnected() const
Is this port currently connected to a peer?
Tick recvAtomic(PacketPtr packet)
Receive an atomic request packet from the peer.
void recvFunctional(PacketPtr packet)
Receive a functional request packet from the peer.
StubSlavePort(const std::string &name_, ExternalSlave &owner_)
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the master port by calling its corresponding receive function...
Tick curTick()
The current simulated tick.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
uint64_t Tick
Tick count type.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Port interface.
void schedule(Event &event, Tick when)
bool recvTimingSnoopResp(PacketPtr packet)
Receive a timing snoop response from the peer.
std::string portType
Key to select a port handler.
ExternalSlave is a memory object representing a binding from a gem5 master to a slave port in a syste...
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
static std::map< std::string, Handler * > portHandlers
Registered handlers.
ExternalPort * externalPort
The peer port for the gem5 port "port".
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
virtual const std::string name() const
void sendRetryReq()
Send a retry to the master port that previously attempted a sendTimingReq to this slave port and fail...
ExternalSlave(ExternalSlaveParams *params)
const std::string portName
Descriptive name (for DPRINTF output)
const std::string name() const
Return port name (for DPRINTF).
void processResponseEvent()
void recvFunctionalSnoop(PacketPtr packet)
const T * getConstPtr() const
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
bool mustRetry
Received a new request while processing a first.
Abstract superclass for simulation objects.
void recvRespRetry()
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
Implement a `stub' port which just responds to requests by printing a message.
AddrRangeList getAddrRanges() const
Any or all of recv...