summaryrefslogtreecommitdiff
path: root/src/mem/port.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-03-21 17:23:03 -0700
committerGabe Black <gabeblack@google.com>2019-04-10 10:37:27 +0000
commit64f415f9bf5bb70376859055ec2d96fbb8c998ce (patch)
treecaa8de425655fa20f717d6a796a31da3d98704ca /src/mem/port.hh
parenta8d5dd1c136529e9605066368877d3b8e24dcdba (diff)
downloadgem5-64f415f9bf5bb70376859055ec2d96fbb8c998ce.tar.xz
mem: Add sendAtomicBackdoor/recvAtomicBackdoor port methods.
These both perform atomic accesses like their non-backdoor equivalents, and also request a backdoor corresponding to the access. The default implementation for recvAtomicBackdoor prints a warning (once per port instance), calls recvAtomic to do the actual access, and leaves the backdoor pointer as nullptr. That way if an object doesn't know how to handle or transfer requests for a back door, it automatically replies in a safe way that ignores the back door request. Change-Id: Ia9fbbe9996eb4b71ea62214d203aa039a05f1618 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17590 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/mem/port.hh')
-rw-r--r--src/mem/port.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mem/port.hh b/src/mem/port.hh
index 2154da007..72a02711c 100644
--- a/src/mem/port.hh
+++ b/src/mem/port.hh
@@ -51,6 +51,7 @@
#define __MEM_PORT_HH__
#include "base/addr_range.hh"
+#include "mem/backdoor.hh"
#include "mem/packet.hh"
#include "sim/port.hh"
@@ -153,6 +154,18 @@ class MasterPort : public BaseMasterPort
Tick sendAtomic(PacketPtr pkt);
/**
+ * Send an atomic request packet like above, but also request a backdoor
+ * to the data being accessed.
+ *
+ * @param pkt Packet to send.
+ * @param backdoor Can be set to a back door pointer by the target to let
+ * caller have direct access to the requested data.
+ *
+ * @return Estimated latency of access.
+ */
+ Tick sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor);
+
+ /**
* Send a functional request packet, where the data is instantly
* updated everywhere in the memory system, without affecting the
* current state of any block or moving the block.
@@ -300,6 +313,7 @@ class SlavePort : public BaseSlavePort
private:
MasterPort* _masterPort;
+ bool defaultBackdoorWarned;
protected:
@@ -416,6 +430,12 @@ class SlavePort : public BaseSlavePort
virtual Tick recvAtomic(PacketPtr pkt) = 0;
/**
+ * Receive an atomic request packet from the master port, and optionally
+ * provide a backdoor to the data being accessed.
+ */
+ virtual Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor);
+
+ /**
* Receive a functional request packet from the master port.
*/
virtual void recvFunctional(PacketPtr pkt) = 0;