48 #include "debug/ExternalPort.hh" 51 std::map<std::string, ExternalMaster::Handler *>
57 portName(params->
name +
".port"),
58 portType(params->port_type),
59 portData(params->port_data),
60 masterId(params->
system->getMasterId(this))
66 if (if_name ==
"port") {
80 fatal(
"%s: Can't find external port type: %s" 94 fatal(
"ExternalMaster %s: externalPort not set!\n",
name());
96 fatal(
"ExternalMaster %s is unconnected!\n",
name());
101 ExternalMasterParams::create()
Ports are used to interface objects to each other.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
#define fatal(...)
This implements a cprintf based fatal() function.
const std::string & name()
std::string portType
Key to select a port handler.
ExternalMaster is a memory object representing a binding from a gem5 slave to a master port in a syst...
bool isConnected() const
Is this port currently connected to a peer?
static void registerHandler(const std::string &handler_name, Handler *handler)
Register a handler which can provide ports with port_type == handler_name.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Port interface.
Derive from this class to create an external port interface.
std::string portName
Name of the bound port.
ExternalMaster(ExternalMasterParams *params)
ExternalPort * externalPort
The peer port for the gem5 port "port".
virtual const std::string name() const
std::string portData
Handler-specific port configuration.
static std::map< std::string, Handler * > portHandlers
Registered handlers.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Abstract superclass for simulation objects.