diff --git a/src/mem/packet.cc b/src/mem/packet.cc index 3cd1bb9a29..31dc330cab 100644 --- a/src/mem/packet.cc +++ b/src/mem/packet.cc @@ -214,6 +214,10 @@ MemCmd::commandInfo[] = { {IsResponse, IsError}, InvalidCmd, "InvalidDestError" }, /* BadAddressError -- memory address invalid */ { {IsResponse, IsError}, InvalidCmd, "BadAddressError" }, + /* ReadError -- packet dest unable to fulfill read command */ + { {IsRead, IsResponse, IsError}, InvalidCmd, "ReadError" }, + /* WriteError -- packet dest unable to fulfill write command */ + { {IsWrite, IsResponse, IsError}, InvalidCmd, "WriteError" }, /* FunctionalReadError */ { {IsRead, IsResponse, IsError}, InvalidCmd, "FunctionalReadError" }, /* FunctionalWriteError */ diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 7d3263412c..9238dbec00 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -133,6 +133,8 @@ class MemCmd // compatibility InvalidDestError, // packet dest field invalid BadAddressError, // memory address invalid + ReadError, // packet dest unable to fulfill read command + WriteError, // packet dest unable to fulfill write command FunctionalReadError, // unable to fulfill functional read FunctionalWriteError, // unable to fulfill functional write // Fake simulator-only commands @@ -785,6 +787,19 @@ class Packet : public Printable cmd = MemCmd::BadAddressError; } + // Command error conditions. The request is sent to target but the target + // cannot make it. + void + setBadCommand() + { + assert(isResponse()); + if (isWrite()) { + cmd = MemCmd::WriteError; + } else { + cmd = MemCmd::ReadError; + } + } + void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; } Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }