summaryrefslogtreecommitdiff
path: root/src/mem/port.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/port.cc')
-rw-r--r--src/mem/port.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/mem/port.cc b/src/mem/port.cc
index ce3f6c74b..0e03194c9 100644
--- a/src/mem/port.cc
+++ b/src/mem/port.cc
@@ -39,17 +39,18 @@
#include "mem/mem_object.hh"
#include "mem/port.hh"
-class defaultPeerPortClass: public Port
+class DefaultPeerPort : public Port
{
protected:
void blowUp()
{
- fatal("Unconnected port!");
+ fatal("%s: Unconnected port!", peer->name());
}
public:
- defaultPeerPortClass() : Port("default_port")
- {}
+ DefaultPeerPort()
+ : Port("default_port")
+ { }
bool recvTiming(PacketPtr)
{
@@ -84,16 +85,22 @@ class defaultPeerPortClass: public Port
blowUp();
}
- bool isDefaultPort() { return true; }
+ bool isDefaultPort() const { return true; }
+};
-} defaultPeerPort;
+DefaultPeerPort defaultPeerPort;
-Port::Port() : peer(&defaultPeerPort), owner(NULL)
+Port::Port()
+ : peer(&defaultPeerPort), owner(NULL)
{
}
-Port::Port(const std::string &_name, MemObject *_owner) :
- portName(_name), peer(&defaultPeerPort), owner(_owner)
+Port::Port(const std::string &_name, MemObject *_owner)
+ : portName(_name), peer(&defaultPeerPort), owner(_owner)
+{
+}
+
+Port::~Port()
{
}
@@ -101,6 +108,7 @@ void
Port::setPeer(Port *port)
{
DPRINTF(Config, "setting peer to %s\n", port->name());
+
peer = port;
}