summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2019-11-27 19:16:26 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2019-12-09 13:18:48 +0000
commitbc26c0dd355f2bbaf2274dd4f549f11efcf84bba (patch)
treee08ed9b91265e36634ff91d4e0c95a9e80603303
parent8a1f195c2b6bcd3b73c00336af9a58517ebccd4c (diff)
downloadgem5-bc26c0dd355f2bbaf2274dd4f549f11efcf84bba.tar.xz
mem: Add Request::isMasked to check for byte strobing
This is trying to overcome the following problem: At the moment a memory request with a non empty byteEnable mask will be considered masking even if all elements in the vector are true. Change-Id: I16ae2c0ea8c3f3370e397bab9d79d6d60c3784bd Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23284 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r--src/mem/packet.hh2
-rw-r--r--src/mem/request.hh16
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 4aee81f9b..cf31fa53d 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -1305,7 +1305,7 @@ class Packet : public Printable
bool
isMaskedWrite() const
{
- return (cmd == MemCmd::WriteReq && !req->getByteEnable().empty());
+ return (cmd == MemCmd::WriteReq && req->isMasked());
}
/**
diff --git a/src/mem/request.hh b/src/mem/request.hh
index 90d1ee3dd..b3268e02e 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013,2017-2018 ARM Limited
+ * Copyright (c) 2012-2013,2017-2019 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -650,6 +650,20 @@ class Request
_byteEnable = be;
}
+ /**
+ * Returns true if the memory request is masked, which means
+ * there is at least one byteEnable element which is false
+ * (byte is masked)
+ */
+ bool
+ isMasked() const
+ {
+ return std::find(
+ _byteEnable.begin(),
+ _byteEnable.end(),
+ false) != _byteEnable.end();
+ }
+
/** Accessor for time. */
Tick
time() const