diff -r cc47e11ccec1 -r 0b530c924765 src/cpu/simple/timing.hh --- a/src/cpu/simple/timing.hh Tue Jun 05 14:20:13 2012 -0400 +++ b/src/cpu/simple/timing.hh Wed Jun 06 17:40:59 2012 +0100 @@ -171,7 +171,7 @@ void schedule(PacketPtr _pkt, Tick t); }; - EventWrapper retryEvent; + EventWrapper retryEvent; }; class IcachePort : public TimingCPUPort diff -r cc47e11ccec1 -r 0b530c924765 src/mem/bus.cc --- a/src/mem/bus.cc Tue Jun 05 14:20:13 2012 -0400 +++ b/src/mem/bus.cc Wed Jun 06 17:40:59 2012 +0100 @@ -218,7 +218,10 @@ // note that we might have blocked on the receiving port being // busy (rather than the bus itself) and now call retry before the // destination called retry on the bus - retryList.front()->sendRetry(); + if (dynamic_cast(retryList.front()) != NULL) + (dynamic_cast(retryList.front()))->sendRetry(); + else + (dynamic_cast(retryList.front()))->sendRetry(); // If inRetry is still true, sendTiming wasn't called in zero time // (e.g. the cache does this) diff -r cc47e11ccec1 -r 0b530c924765 src/mem/cache/base.hh --- a/src/mem/cache/base.hh Tue Jun 05 14:20:13 2012 -0400 +++ b/src/mem/cache/base.hh Wed Jun 06 17:40:59 2012 +0100 @@ -204,7 +204,7 @@ private: - EventWrapper sendRetryEvent; + EventWrapper sendRetryEvent; }; diff -r cc47e11ccec1 -r 0b530c924765 src/mem/port.hh --- a/src/mem/port.hh Tue Jun 05 14:20:13 2012 -0400 +++ b/src/mem/port.hh Wed Jun 06 17:40:59 2012 +0100 @@ -70,10 +70,7 @@ /** * Ports are used to interface memory objects to each other. A port is * either a master or a slave and the connected peer is always of the - * opposite role. - * - * Each port has a name and an owner, and enables three basic types of - * accesses to the peer port: functional, atomic and timing. + * opposite role. Each port has a name, an owner, and an identifier. */ class Port { @@ -91,9 +88,6 @@ */ const PortID id; - /** A pointer to the peer port. */ - Port* peer; - /** A reference to the MemObject that owns this port. */ MemObject& owner; @@ -119,23 +113,6 @@ /** Get the port id. */ PortID getId() const { return id; } - protected: - - /** - * Called by a peer port if sendTimingReq, sendTimingResp or - * sendTimingSnoopResp was unsuccesful, and had to wait. - */ - virtual void recvRetry() = 0; - - public: - - /** - * Send a retry to a peer port that previously attempted a - * sendTimingReq, sendTimingResp or sendTimingSnoopResp which was - * unsuccessful. - */ - void sendRetry() { return peer->recvRetry(); } - }; /** Forward declaration */ @@ -211,6 +188,12 @@ bool sendTimingSnoopResp(PacketPtr pkt); /** + * Send a retry to the slave port that previously attempted a + * sendTimingResp to this master port and failed. + */ + void sendRetry(); + + /** * Determine if this master port is snooping or not. The default * implementation returns false and thus tells the neighbour we * are not snooping. Any master port that wants to receive snoop @@ -270,6 +253,14 @@ } /** + * Called by the slave port if sendTimingReq or + * sendTimingSnoopResp was called on this master port (causing + * recvTimingReq and recvTimingSnoopResp to be called on the + * slave port) and was unsuccesful. + */ + virtual void recvRetry() = 0; + + /** * Called to receive an address range change from the peer slave * port. the default implementation ignored the change and does * nothing. Override this function in a derived class if the owner @@ -347,6 +338,13 @@ void sendTimingSnoopReq(PacketPtr pkt); /** + * Send a retry to the master port that previously attempted a + * sendTimingReq or sendTimingSnoopResp to this slave port and + * failed. + */ + void sendRetry(); + + /** * Called by a peer port in order to determine the block size of * the owner of this port. */ @@ -396,6 +394,13 @@ panic("%s was not expecting a timing snoop response\n", name()); } + /** + * Called by the master port if sendTimingResp was called on this + * slave port (causing recvTimingResp to be called on the master + * port) and was unsuccesful. + */ + virtual void recvRetry() = 0; + }; #endif //__MEM_PORT_HH__ diff -r cc47e11ccec1 -r 0b530c924765 src/mem/port.cc --- a/src/mem/port.cc Tue Jun 05 14:20:13 2012 -0400 +++ b/src/mem/port.cc Wed Jun 06 17:40:59 2012 +0100 @@ -51,7 +51,7 @@ #include "mem/port.hh" Port::Port(const std::string &_name, MemObject& _owner, PortID _id) - : portName(_name), id(_id), peer(NULL), owner(_owner) + : portName(_name), id(_id), owner(_owner) { } @@ -86,7 +86,6 @@ { // master port keeps track of the slave port _slavePort = &slave_port; - peer = &slave_port; // slave port also keeps track of master port _slavePort->bind(*this); @@ -133,6 +132,12 @@ } void +MasterPort::sendRetry() +{ + _slavePort->recvRetry(); +} + +void MasterPort::printAddr(Addr a) { Request req(a, 1, 0, Request::funcMasterId); @@ -159,7 +164,6 @@ SlavePort::bind(MasterPort& master_port) { _masterPort = &master_port; - peer = &master_port; } MasterPort& @@ -211,3 +215,9 @@ assert(pkt->isRequest()); _masterPort->recvTimingSnoopReq(pkt); } + +void +SlavePort::sendRetry() +{ + _masterPort->recvRetry(); +}