mem-cache: Add match functions to QueueEntry
[gem5.git] / src / mem / noncoherent_xbar.cc
index b0fe205c10a4ee3ebfeee1fdb18c8ae9fcf09495..730c2b22671ab49e63bddc85443adab2cd49a887 100644 (file)
@@ -108,8 +108,7 @@ NoncoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
     assert(!pkt->isExpressSnoop());
 
     // determine the destination based on the address
-    AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
-    PortID master_port_id = findPort(addr_range);
+    PortID master_port_id = findPort(pkt->getAddrRange());
 
     // test if the layer should be considered occupied for the current
     // port
@@ -244,7 +243,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(),
@@ -254,8 +254,7 @@ NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
     unsigned int pkt_cmd = pkt->cmdToIndex();
 
     // determine the destination port
-    AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
-    PortID master_port_id = findPort(addr_range);
+    PortID master_port_id = findPort(pkt->getAddrRange());
 
     // stats updates for the request
     pktCount[slave_port_id][master_port_id]++;
@@ -263,7 +262,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()) {
@@ -305,8 +306,7 @@ NoncoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id)
     }
 
     // determine the destination port
-    AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
-    PortID dest_id = findPort(addr_range);
+    PortID dest_id = findPort(pkt->getAddrRange());
 
     // forward the request to the appropriate destination
     masterPorts[dest_id]->sendFunctional(pkt);