mem: Expose the underlyig DRAM or NVM's memory back door.
authorGabe Black <gabe.black@gmail.com>
Wed, 4 Nov 2020 09:01:04 +0000 (01:01 -0800)
committerGabe Black <gabe.black@gmail.com>
Fri, 6 Nov 2020 00:58:20 +0000 (00:58 +0000)
Use the AbstractMem's new getBackdoor call to implement the
recvAtomicBackdoor call in the memory controller's port.

Change-Id: I10a7d22edb62afc3b77a2d462f297572c04f020d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36978
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/mem_ctrl.cc
src/mem/mem_ctrl.hh

index 1e60ced3f77484a5ab76e407e8ca8d1866b88081..cc2768496147739683f5802ce9c8fb436c5cd967 100644 (file)
@@ -154,6 +154,18 @@ MemCtrl::recvAtomic(PacketPtr pkt)
     return latency;
 }
 
+Tick
+MemCtrl::recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
+{
+    Tick latency = recvAtomic(pkt);
+    if (dram) {
+        dram->getBackdoor(backdoor);
+    } else if (nvm) {
+        nvm->getBackdoor(backdoor);
+    }
+    return latency;
+}
+
 bool
 MemCtrl::readQueueFull(unsigned int neededEntries) const
 {
@@ -1461,6 +1473,13 @@ MemCtrl::MemoryPort::recvAtomic(PacketPtr pkt)
     return ctrl.recvAtomic(pkt);
 }
 
+Tick
+MemCtrl::MemoryPort::recvAtomicBackdoor(
+        PacketPtr pkt, MemBackdoorPtr &backdoor)
+{
+    return ctrl.recvAtomicBackdoor(pkt, backdoor);
+}
+
 bool
 MemCtrl::MemoryPort::recvTimingReq(PacketPtr pkt)
 {
index e6ae0abe387401ec037a2d9bb1581af650ee9b59..dd13e3ce09f06381115757a5b6bfc51bd309a7d4 100644 (file)
@@ -251,13 +251,15 @@ class MemCtrl : public QoS::MemCtrl
 
       protected:
 
-        Tick recvAtomic(PacketPtr pkt);
+        Tick recvAtomic(PacketPtr pkt) override;
+        Tick recvAtomicBackdoor(
+                PacketPtr pkt, MemBackdoorPtr &backdoor) override;
 
-        void recvFunctional(PacketPtr pkt);
+        void recvFunctional(PacketPtr pkt) override;
 
-        bool recvTimingReq(PacketPtr);
+        bool recvTimingReq(PacketPtr) override;
 
-        virtual AddrRangeList getAddrRanges() const;
+        AddrRangeList getAddrRanges() const override;
 
     };
 
@@ -701,6 +703,7 @@ class MemCtrl : public QoS::MemCtrl
   protected:
 
     Tick recvAtomic(PacketPtr pkt);
+    Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor);
     void recvFunctional(PacketPtr pkt);
     bool recvTimingReq(PacketPtr pkt);