From 992fa9958da913aa1a40c78dd566d6498ee7d610 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Thu, 22 Sep 2016 10:07:11 +0100 Subject: mem: Support for specifying the destination of a WriteClean Previously, WriteClean packets would always write to the first memory below unless the memory was unable to allocate in which case it would be forwarded further below. This change adds support for specifying the destination of a WriteClean packet. The cache annotates the request with the specified destination and marks the packet as write-through upon its creation. The coherent xbar checks packets for their destination and resets the write-through flag when necessary e.g., the coherent xbar that is set as the PoC will reset the write-through flag for packets to the PoC. Change-Id: I84b653f5cb6e46e97e09508649a3725d72d94606 Reviewed-by: Curtis Dunham Reviewed-by: Anouk Van Laer Reviewed-on: https://gem5-review.googlesource.com/5046 Maintainer: Nikos Nikoleris Reviewed-by: Jason Lowe-Power --- src/mem/packet.hh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/mem/packet.hh') diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 330e2ae5e..325cd3a60 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -253,7 +253,7 @@ class Packet : public Printable enum : FlagsType { // Flags to transfer across when copying a packet - COPY_FLAGS = 0x0000000F, + COPY_FLAGS = 0x0000001F, // Does this packet have sharers (which means it should not be // considered writable) or not. See setHasSharers below. @@ -272,6 +272,10 @@ class Packet : public Printable // responding to a snoop. See setCacheResponding below. CACHE_RESPONDING = 0x00000008, + // The writeback/writeclean should be propagated further + // downstream by the receiver + WRITE_THROUGH = 0x00000010, + /// Are the 'addr' and 'size' fields valid? VALID_ADDR = 0x00000100, VALID_SIZE = 0x00000200, @@ -619,6 +623,19 @@ class Packet : public Printable bool responderHadWritable() const { return flags.isSet(RESPONDER_HAD_WRITABLE); } + /** + * A writeback/writeclean cmd gets propagated further downstream + * by the receiver when the flag is set. + */ + void setWriteThrough() + { + assert(cmd.isWrite() && + (cmd.isEviction() || cmd == MemCmd::WriteClean)); + flags.set(WRITE_THROUGH); + } + void clearWriteThrough() { flags.clear(WRITE_THROUGH); } + bool writeThrough() const { return flags.isSet(WRITE_THROUGH); } + void setSuppressFuncError() { flags.set(SUPPRESS_FUNC_ERROR); } bool suppressFuncError() const { return flags.isSet(SUPPRESS_FUNC_ERROR); } void setBlockCached() { flags.set(BLOCK_CACHED); } -- cgit v1.2.3