summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2019-02-11 14:19:57 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2019-04-19 16:34:00 +0000
commitd4cee4dc66e175dd6cea7e9bcbe815a7d2d35462 (patch)
tree1a752ebda1a8a5c85dc9bd8471050f48a2e7ed8a /src/mem/packet.hh
parent9f32d74db86c8977ab16f2671830f6cdfe3c068b (diff)
downloadgem5-d4cee4dc66e175dd6cea7e9bcbe815a7d2d35462.tar.xz
mem: Add packet matching functions
Add both block and non-block-aligned packet matching functions, so that both address and secure bits are checked when checking whether a packet matches a request. Change-Id: Id0069befb925d112e06f250741cb47d9dfa249cc Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17533 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 4e3ea15e1..f942e8ddd 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -980,6 +980,45 @@ class Packet : public Printable
flags.set(VALID_SIZE);
}
+ /**
+ * Check if packet corresponds to a given block-aligned address and
+ * address space.
+ *
+ * @param addr The address to compare against.
+ * @param is_secure Whether addr belongs to the secure address space.
+ * @param blk_size Block size in bytes.
+ * @return Whether packet matches description.
+ */
+ bool matchBlockAddr(const Addr addr, const bool is_secure,
+ const int blk_size) const;
+
+ /**
+ * Check if this packet refers to the same block-aligned address and
+ * address space as another packet.
+ *
+ * @param pkt The packet to compare against.
+ * @param blk_size Block size in bytes.
+ * @return Whether packet matches description.
+ */
+ bool matchBlockAddr(const PacketPtr pkt, const int blk_size) const;
+
+ /**
+ * Check if packet corresponds to a given address and address space.
+ *
+ * @param addr The address to compare against.
+ * @param is_secure Whether addr belongs to the secure address space.
+ * @return Whether packet matches description.
+ */
+ bool matchAddr(const Addr addr, const bool is_secure) const;
+
+ /**
+ * Check if this packet refers to the same address and address space as
+ * another packet.
+ *
+ * @param pkt The packet to compare against.
+ * @return Whether packet matches description.
+ */
+ bool matchAddr(const PacketPtr pkt) const;
public:
/**