diff options
author | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2016-09-22 10:18:24 +0100 |
---|---|---|
committer | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2017-12-05 11:47:01 +0000 |
commit | e67c97ee4cd61dda4378f27e0baa329b020a2fee (patch) | |
tree | 66f6f944084fa06a5b780ae2e07a3b2ffd77d225 /src/mem/packet.hh | |
parent | 992fa9958da913aa1a40c78dd566d6498ee7d610 (diff) | |
download | gem5-e67c97ee4cd61dda4378f27e0baa329b020a2fee.tar.xz |
mem: Add support for cache maintenance operation requests
This change adds new packet cmds and request flags for cache
maintenance operations.
1) A cache clean operation writes dirty data in the first memory below
the specified xbar and updates any old copies in the memories above
it.
2) A cache invalidate operation invalidates all copies of the
specified block in the memories above the specified xbar
3) A clean and invalidate operation is a combination of the two
operations above
Change-Id: If45702848bdd568de532cd57cba58499e5e4354c
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Anouk Van Laer <anouk.vanlaer@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5047
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r-- | src/mem/packet.hh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 325cd3a60..fcdd73a03 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -114,6 +114,10 @@ class MemCmd MessageResp, MemFenceReq, MemFenceResp, + CleanSharedReq, + CleanSharedResp, + CleanInvalidReq, + CleanInvalidResp, // Error responses // @TODO these should be classified as responses rather than // requests; coding them as requests initially for backwards @@ -140,6 +144,7 @@ class MemCmd IsWrite, //!< Data flows from requester to responder IsUpgrade, IsInvalidate, + IsClean, //!< Cleans any existing dirty blocks NeedsWritable, //!< Requires writable copy to complete in-cache IsRequest, //!< Issued by requester IsResponse, //!< Issue by responder @@ -195,6 +200,7 @@ class MemCmd bool needsResponse() const { return testCmdAttrib(NeedsResponse); } bool isInvalidate() const { return testCmdAttrib(IsInvalidate); } bool isEviction() const { return testCmdAttrib(IsEviction); } + bool isClean() const { return testCmdAttrib(IsClean); } bool fromCache() const { return testCmdAttrib(FromCache); } /** @@ -521,6 +527,7 @@ class Packet : public Printable bool needsResponse() const { return cmd.needsResponse(); } bool isInvalidate() const { return cmd.isInvalidate(); } bool isEviction() const { return cmd.isEviction(); } + bool isClean() const { return cmd.isClean(); } bool fromCache() const { return cmd.fromCache(); } bool isWriteback() const { return cmd.isWriteback(); } bool hasData() const { return cmd.hasData(); } @@ -815,7 +822,12 @@ class Packet : public Printable return MemCmd::StoreCondReq; else if (req->isSwap()) return MemCmd::SwapReq; - else + else if (req->isCacheInvalidate()) { + return req->isCacheClean() ? MemCmd::CleanInvalidReq : + MemCmd::InvalidateReq; + } else if (req->isCacheClean()) { + return MemCmd::CleanSharedReq; + } else return MemCmd::WriteReq; } |