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