Yu-hsin Wang has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/64872?usp=email )

Change subject: mem: introduce bad command error to packet commands
......................................................................

mem: introduce bad command error to packet commands

The bad command is used to model a request is sent to target but the
target cannot make it. The bad command error is designed to model AXI
SLVERR.

Change-Id: I8142df36a5ed3e461493796266821a2b30a3415e
---
M src/mem/packet.cc
M src/mem/packet.hh
2 files changed, 32 insertions(+), 0 deletions(-)



diff --git a/src/mem/packet.cc b/src/mem/packet.cc
index 3cd1bb9..31dc330 100644
--- a/src/mem/packet.cc
+++ b/src/mem/packet.cc
@@ -214,6 +214,10 @@
     { {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 7d32634..9238dbe 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -133,6 +133,8 @@
         // 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 @@
         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; }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/64872?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8142df36a5ed3e461493796266821a2b30a3415e
Gerrit-Change-Number: 64872
Gerrit-PatchSet: 1
Gerrit-Owner: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to