From: Gabe Black Date: Wed, 4 Nov 2020 09:01:04 +0000 (-0800) Subject: mem: Expose the underlyig DRAM or NVM's memory back door. X-Git-Tag: develop-gem5-snapshot~506 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=805c2956516f3c8c397003788acb4f720f6449fb;p=gem5.git mem: Expose the underlyig DRAM or NVM's memory back door. 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 Reviewed-by: Jason Lowe-Power Reviewed-by: Daniel Carvalho Reviewed-by: Nikos Nikoleris Tested-by: kokoro --- diff --git a/src/mem/mem_ctrl.cc b/src/mem/mem_ctrl.cc index 1e60ced3f..cc2768496 100644 --- a/src/mem/mem_ctrl.cc +++ b/src/mem/mem_ctrl.cc @@ -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) { diff --git a/src/mem/mem_ctrl.hh b/src/mem/mem_ctrl.hh index e6ae0abe3..dd13e3ce0 100644 --- a/src/mem/mem_ctrl.hh +++ b/src/mem/mem_ctrl.hh @@ -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);