Only issue responses if we aren;t already blocked
[gem5.git] / src / mem / bridge.hh
index 8a5cbf92a5bb7cc5f0e63e853a1d4aad8e3c4457..2ab9799c71fd3f649adf0ea3a7d25bf0549181e2 100644 (file)
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Ali Saidi
+ *          Steve Reinhardt
  */
 
 /**
- * @file Decleration of a simple bus bridge object with no buffering
+ * @file
+ * Declaration of a simple bus bridge object with no buffering
  */
 
 #ifndef __MEM_BRIDGE_HH__
@@ -38,7 +42,6 @@
 #include <inttypes.h>
 #include <queue>
 
-
 #include "mem/mem_object.hh"
 #include "mem/packet.hh"
 #include "mem/port.hh"
@@ -47,7 +50,7 @@
 class Bridge : public MemObject
 {
   protected:
-    /** Decleration of the buses port type, one will be instantiated for each
+    /** Declaration of the buses port type, one will be instantiated for each
         of the interfaces connecting to the bus. */
     class BridgePort : public Port
     {
@@ -77,7 +80,8 @@ class Bridge : public MemObject
                   origSenderState(_pkt->senderState), origSrc(_pkt->getSrc()),
                   expectResponse(_pkt->needsResponse())
             {
-                pkt->senderState = this;
+                if (!pkt->isResponse())
+                    pkt->senderState = this;
             }
 
             void fixResponse(Packet *pkt)
@@ -146,7 +150,7 @@ class Bridge : public MemObject
 
         /** When receiving a retry request from the peer port,
             pass it to the bridge. */
-        virtual Packet* recvRetry();
+        virtual void recvRetry();
 
         /** When receiving a Atomic requestfrom the peer port,
             pass it to the bridge. */
@@ -174,7 +178,7 @@ class Bridge : public MemObject
   public:
 
     /** A function used to return the port associated with this bus object. */
-    virtual Port *getPort(const std::string &if_name);
+    virtual Port *getPort(const std::string &if_name, int idx = -1);
 
     virtual void init();