mem: Plumb backdoor requests through the xbar classes.
authorGabe Black <gabeblack@google.com>
Fri, 22 Mar 2019 22:46:57 +0000 (15:46 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 10 Apr 2019 10:39:43 +0000 (10:39 +0000)
Change-Id: Ic8f49339ab95c31d2f00edfdf23a46f1271ec3aa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17593
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>

src/mem/coherent_xbar.cc
src/mem/coherent_xbar.hh
src/mem/noncoherent_xbar.cc
src/mem/noncoherent_xbar.hh

index 3e994dd71f086b29683bbdab67fb2db3f8de8379..96e855f7598ffee19b9c41ffa104f898b9cffba7 100644 (file)
@@ -721,7 +721,8 @@ CoherentXBar::recvReqRetry(PortID master_port_id)
 }
 
 Tick
-CoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
+CoherentXBar::recvAtomicBackdoor(PacketPtr pkt, PortID slave_port_id,
+                                 MemBackdoorPtr *backdoor)
 {
     DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__,
             slavePorts[slave_port_id]->name(), pkt->print());
@@ -800,7 +801,10 @@ CoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
             }
 
             // forward the request to the appropriate destination
-            response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
+            auto master = masterPorts[master_port_id];
+            response_latency = backdoor ?
+                master->sendAtomicBackdoor(pkt, *backdoor) :
+                master->sendAtomic(pkt);
         } else {
             // if it does not need a response we sink the packet above
             assert(pkt->needsResponse());
index 2bb5db2811b1d502cd387d9b8310b4e9a82e362a..ff28cb74341b648addc67f30af07d017cdedcf8c 100644 (file)
@@ -123,7 +123,13 @@ class CoherentXBar : public BaseXBar
         Tick
         recvAtomic(PacketPtr pkt) override
         {
-            return xbar.recvAtomic(pkt, id);
+            return xbar.recvAtomicBackdoor(pkt, id);
+        }
+
+        Tick
+        recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor) override
+        {
+            return xbar.recvAtomicBackdoor(pkt, id, &backdoor);
         }
 
         void
@@ -314,7 +320,8 @@ class CoherentXBar : public BaseXBar
     void forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id,
                        const std::vector<QueuedSlavePort*>& dests);
 
-    Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
+    Tick recvAtomicBackdoor(PacketPtr pkt, PortID slave_port_id,
+                            MemBackdoorPtr *backdoor=nullptr);
     Tick recvAtomicSnoop(PacketPtr pkt, PortID master_port_id);
 
     /**
index b0fe205c10a4ee3ebfeee1fdb18c8ae9fcf09495..a7b6b0fdc20745a054b4c568046c090fd6b4afa2 100644 (file)
@@ -244,7 +244,8 @@ NoncoherentXBar::recvReqRetry(PortID master_port_id)
 }
 
 Tick
-NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
+NoncoherentXBar::recvAtomicBackdoor(PacketPtr pkt, PortID slave_port_id,
+                                    MemBackdoorPtr *backdoor)
 {
     DPRINTF(NoncoherentXBar, "recvAtomic: packet src %s addr 0x%x cmd %s\n",
             slavePorts[slave_port_id]->name(), pkt->getAddr(),
@@ -263,7 +264,9 @@ NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
     transDist[pkt_cmd]++;
 
     // forward the request to the appropriate destination
-    Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
+    auto master = masterPorts[master_port_id];
+    Tick response_latency = backdoor ?
+        master->sendAtomicBackdoor(pkt, *backdoor) : master->sendAtomic(pkt);
 
     // add the response data
     if (pkt->isResponse()) {
index 9d4efbee27be275cab081739025ca579b4095e9f..4f72cef4d6f89360e29f9f17bff56adf62764545 100644 (file)
@@ -113,7 +113,13 @@ class NoncoherentXBar : public BaseXBar
         Tick
         recvAtomic(PacketPtr pkt) override
         {
-            return xbar.recvAtomic(pkt, id);
+            return xbar.recvAtomicBackdoor(pkt, id);
+        }
+
+        Tick
+        recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor) override
+        {
+            return xbar.recvAtomicBackdoor(pkt, id, &backdoor);
         }
 
         void
@@ -172,7 +178,8 @@ class NoncoherentXBar : public BaseXBar
     virtual bool recvTimingReq(PacketPtr pkt, PortID slave_port_id);
     virtual bool recvTimingResp(PacketPtr pkt, PortID master_port_id);
     void recvReqRetry(PortID master_port_id);
-    Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
+    Tick recvAtomicBackdoor(PacketPtr pkt, PortID slave_port_id,
+                            MemBackdoorPtr *backdoor=nullptr);
     void recvFunctional(PacketPtr pkt, PortID slave_port_id);
 
   public: