* The external port must provide a gem5 MasterPort interface.
*/
-#ifndef __MEM_EXTERNAL_MASTER__
-#define __MEM_EXTERNAL_MASTER__
+#ifndef __MEM_EXTERNAL_MASTER_HH__
+#define __MEM_EXTERNAL_MASTER_HH__
#include "mem/mem_object.hh"
#include "params/ExternalMaster.hh"
{
public:
/** Derive from this class to create an external port interface */
- class Port : public MasterPort
+ class ExternalPort : public MasterPort
{
protected:
ExternalMaster &owner;
public:
- Port(const std::string &name_,
+ ExternalPort(const std::string &name_,
ExternalMaster &owner_) :
MasterPort(name_, &owner_), owner(owner_)
{ }
- ~Port() { }
+ ~ExternalPort() { }
/** Any or all of recv... can be overloaded to provide the port's
* functionality */
public:
/** Create or find an external port which can be bound. Returns
* NULL on failure */
- virtual Port *getExternalPort(
+ virtual ExternalPort *getExternalPort(
const std::string &name, ExternalMaster &owner,
const std::string &port_data) = 0;
};
protected:
/** The peer port for the gem5 port "port" */
- Port *externalPort;
+ ExternalPort *externalPort;
/** Name of the bound port. This will be name() + ".port" */
std::string portName;
public:
ExternalMaster(ExternalMasterParams *params);
- /** MasterPort interface. Responds only to port "port" */
- BaseMasterPort &getMasterPort(const std::string &if_name,
- PortID idx = InvalidPortID);
+ /** Port interface. Responds only to port "port" */
+ Port &getPort(const std::string &if_name,
+ PortID idx=InvalidPortID) override;
/** Register a handler which can provide ports with port_type ==
* handler_name */
static void registerHandler(const std::string &handler_name,
Handler *handler);
- void init();
+ void init() override;
const MasterID masterId;
};
-#endif // __MEM_EXTERNAL_MASTER__
+#endif //__MEM_EXTERNAL_MASTER_HH__