From c86f849d5a1da1fc77f2fca43b82cb6760f68bc9 Mon Sep 17 00:00:00 2001 From: "Brad Beckmann ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E)" Date: Thu, 30 Jun 2011 19:49:26 -0500 Subject: Ruby: Add support for functional accesses This patch rpovides functional access support in Ruby. Currently only the M5Port of RubyPort supports functional accesses. The support for functional through the PioPort will be added as a separate patch. --- src/mem/packet.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/mem/packet.hh') diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 5fcd9286e..be0c20d42 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -103,6 +103,8 @@ class MemCmd NetworkNackError, // nacked at network layer (not by protocol) InvalidDestError, // packet dest field invalid BadAddressError, // memory address invalid + FunctionalReadError, // unable to fulfill functional read + FunctionalWriteError, // unable to fulfill functional write // Fake simulator-only commands PrintReq, // Print state matching address FlushReq, //request for a cache flush @@ -240,6 +242,9 @@ class Packet : public FastAlloc, public Printable /// the data pointer points to an array (thus delete []) needs to /// be called on it rather than simply delete. static const FlagsType ARRAY_DATA = 0x00004000; + /// suppress the error if this packet encounters a functional + /// access failure. + static const FlagsType SUPPRESS_FUNC_ERROR = 0x00008000; Flags flags; @@ -428,6 +433,8 @@ class Packet : public FastAlloc, public Printable void setSupplyExclusive() { flags.set(SUPPLY_EXCLUSIVE); } void clearSupplyExclusive() { flags.clear(SUPPLY_EXCLUSIVE); } bool isSupplyExclusive() { return flags.isSet(SUPPLY_EXCLUSIVE); } + void setSuppressFuncError() { flags.set(SUPPRESS_FUNC_ERROR); } + bool suppressFuncError() { return flags.isSet(SUPPRESS_FUNC_ERROR); } // Network error conditions... encapsulate them as methods since // their encoding keeps changing (from result field to command @@ -617,6 +624,18 @@ class Packet : public FastAlloc, public Printable makeResponse(); } + void + setFunctionalResponseStatus(bool success) + { + if (!success) { + if (isWrite()) { + cmd = MemCmd::FunctionalWriteError; + } else { + cmd = MemCmd::FunctionalReadError; + } + } + } + /** * Take a request packet that has been returned as NACKED and * modify it so that it can be sent out again. Only packets that -- cgit v1.2.3