Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/13464

Change subject: mem: Explicitly specify the endianness in the abstract memory.
......................................................................

mem: Explicitly specify the endianness in the abstract memory.

The accessors are used for debugging output. If we're using an ISA
where there's an endianness, we use that explicitly. If not, then we
just dump the data without interpretation like if the data isn't a
typical size.

Change-Id: Ib050c4c876ee41f17cfd14ad657150bf6ab1de39
---
M src/mem/abstract_mem.cc
1 file changed, 12 insertions(+), 7 deletions(-)



diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc
index 01817bb..cd085e0 100644
--- a/src/mem/abstract_mem.cc
+++ b/src/mem/abstract_mem.cc
@@ -292,22 +292,27 @@

 #if TRACING_ON

+#if THE_ISA != NULL_ISA
 #define CASE(A, T)                                                        \
   case sizeof(T):                                                         \
-    DPRINTF(MemoryAccess,"%s from %s of size %i on address 0x%x data " \
+    DPRINTF(MemoryAccess,"%s from %s of size %i on address 0x%x data "    \
             "0x%x %c\n", A, system()->getMasterName(pkt->req->masterId()),\
-            pkt->getSize(), pkt->getAddr(), pkt->get<T>(),                \
+            pkt->getSize(), pkt->getAddr(),                               \
+            pkt->get<T>(TheISA::GuestByteOrder),                          \
             pkt->req->isUncacheable() ? 'U' : 'C');                       \
-  break
+  break;
+#else
+#define CASE(A, T)
+#endif


 #define TRACE_PACKET(A)                                                 \
     do {                                                                \
         switch (pkt->getSize()) {                                       \
-          CASE(A, uint64_t);                                            \
-          CASE(A, uint32_t);                                            \
-          CASE(A, uint16_t);                                            \
-          CASE(A, uint8_t);                                             \
+          CASE(A, uint64_t)                                             \
+          CASE(A, uint32_t)                                             \
+          CASE(A, uint16_t)                                             \
+          CASE(A, uint8_t)                                              \
           default:                                                      \
DPRINTF(MemoryAccess, "%s from %s of size %i on address 0x%x %c\n",\ A, system()->getMasterName(pkt->req->masterId()), \

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib050c4c876ee41f17cfd14ad657150bf6ab1de39
Gerrit-Change-Number: 13464
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to