44 #include "debug/ExternalPort.hh" 47 std::map<std::string, ExternalMaster::Handler *>
53 portName(params->
name +
".port"),
54 portType(params->port_type),
55 portData(params->port_data),
56 masterId(params->
system->getMasterId(this))
62 if (if_name ==
"port") {
76 fatal(
"%s: Can't find external port type: %s" 90 fatal(
"ExternalMaster %s: externalPort not set!\n",
name());
92 fatal(
"ExternalMaster %s is unconnected!\n",
name());
97 ExternalMasterParams::create()
Ports are used to interface objects to each other.
#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.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
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.