Gabe Black has submitted this change and it was merged. (
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, falling back to a
binary dump if the size isn't supported. If not, then we just dump the
data without interpretation regardless of size.
Change-Id: Ib050c4c876ee41f17cfd14ad657150bf6ab1de39
Reviewed-on: https://gem5-review.googlesource.com/c/13464
Reviewed-by: Andreas Sandberg <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/mem/abstract_mem.cc
1 file changed, 20 insertions(+), 29 deletions(-)
Approvals:
Andreas Sandberg: Looks good to me, approved
Gabe Black: Looks good to me, approved
diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc
index 01817bb..084ee26 100644
--- a/src/mem/abstract_mem.cc
+++ b/src/mem/abstract_mem.cc
@@ -289,38 +289,29 @@
return allowStore;
}
+static inline void
+tracePacket(System *sys, const char *label, PacketPtr pkt)
+{
+ int size = pkt->getSize();
+#if THE_ISA != NULL_ISA
+ if (size == 1 || size == 2 || size == 4 || size == 8) {
+ DPRINTF(MemoryAccess,"%s from %s of size %i on address %#x data "
+ "%#x %c\n", label,
sys->getMasterName(pkt->req->masterId()),
+ size, pkt->getAddr(),
pkt->getUintX(TheISA::GuestByteOrder),
+ pkt->req->isUncacheable() ? 'U' : 'C');
+ return;
+ }
+#endif
+ DPRINTF(MemoryAccess, "%s from %s of size %i on address %#x %c\n",
+ label, sys->getMasterName(pkt->req->masterId()),
+ size, pkt->getAddr(), pkt->req->isUncacheable() ? 'U' : 'C');
+ DDUMP(MemoryAccess, pkt->getConstPtr<uint8_t>(), pkt->getSize());
+}
#if TRACING_ON
-
-#define CASE(A, T) \
- case sizeof(T): \
- 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->req->isUncacheable() ? 'U' : 'C'); \
- break
-
-
-#define TRACE_PACKET(A) \
- do { \
- switch (pkt->getSize()) { \
- 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()), \
- pkt->getSize(),
pkt->getAddr(), \
-
pkt->req->isUncacheable() ? 'U' : 'C'); \
- DDUMP(MemoryAccess, pkt->getConstPtr<uint8_t>(),
pkt->getSize()); \
-
} \
- } while (0)
-
+# define TRACE_PACKET(A) tracePacket(system(), A, pkt)
#else
-
-#define TRACE_PACKET(A)
-
+# define TRACE_PACKET(A)
#endif
void
--
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: 5
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Alec Roelke <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev