46 #include "debug/ExternalPort.hh"
94 const std::string &name_,
96 const std::string &port_data)
100 DPRINTF(ExternalPort,
"finding stub port '%s'\n", port_data);
108 if (
DTRACE(ExternalPort)) {
111 DPRINTF(ExternalPort,
"StubSlavePort: recvAtomic a: 0x%x size: %d"
161 fatal(
"StubSlavePort: function: %s\n", __func__);
178 fatal(
"StubSlavePort: unimplemented function: %s\n", __func__);
181 std::map<std::string, ExternalSlave::Handler *>
194 portType(params->port_type),
195 portData(params->port_data),
196 addrRanges(params->addr_ranges.begin(), params->addr_ranges.end())
207 if (if_name ==
"port") {
208 DPRINTF(ExternalPort,
"Trying to bind external port: %s %s\n",
221 fatal(
"%s: Can't find external port type: %s"
235 fatal(
"ExternalSlave %s: externalPort not set!\n",
name());
237 fatal(
"ExternalSlave %s is unconnected!\n",
name());
244 ExternalSlaveParams::create()
ExternalSlave::Port * getExternalPort(const std::string &name_, ExternalSlave &owner, const std::string &port_data)
Create or find an external port which can be bound.
Ports are used to interface memory objects to each other.
const std::string & name()
static void registerHandler(const std::string &handler_name, Handler *handler)
Register a handler which can provide ports with port_type == handler_name.
ResponseEvent responseEvent
const std::string name() const
Return port name (for DPRINTF).
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.
bool recvTimingReq(PacketPtr packet)
Receive a timing request from the master port.
std::string portData
Handler-specific port configuration.
#define DDUMP(x, data, count)
AddrRangeList getAddrRanges() const
Any or all of recv...
std::string portName
Name of the bound port.
virtual BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
Tick recvAtomic(PacketPtr packet)
Receive an atomic request packet from the master port.
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
void recvFunctional(PacketPtr packet)
Receive a functional request packet from the master port.
StubSlavePort(const std::string &name_, ExternalSlave &owner_)
Port * externalPort
The peer port for the gem5 port "port".
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.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
uint64_t Tick
Tick count type.
bool recvTimingSnoopResp(PacketPtr packet)
Receive a timing snoop response from the master port.
std::string portType
Key to select a port handler.
ResponseEvent(StubSlavePort &owner_)
BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
SlavePort interface.
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...
void sendRangeChange() const
Called by the owner to send a range change.
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
std::string portName
Descriptive name (for DPRINTF output)
static const int NumArgumentRegs M5_VAR_USED
static std::map< std::string, Handler * > portHandlers
Registered handlers.
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)
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
void recvFunctionalSnoop(PacketPtr packet)
Derive from this class to create an external port interface.
void schedule(Event &event, Tick when)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const T * getConstPtr() const
bool mustRetry
Received a new request while processing a first.
void recvRespRetry()
Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to ...
Implement a `stub' port which just responds to requests by printing a message.