summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2010-08-25 21:55:44 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2010-08-25 21:55:44 -0700
commitee6a92863afa3c8cea4dda6b8f6c16e227e25349 (patch)
tree3dca60fd68a91216d6a7ccd2a0a1d5fd8815c642
parent6d9fc4175e84eaddf68907191aba88b8fc9617de (diff)
downloadgem5-ee6a92863afa3c8cea4dda6b8f6c16e227e25349.tar.xz
memtest: fix/cleanup functional access testing
Don't assert that the response packet is marked as a response since it won't always be so for functional accesses. Also cleanup code to refer to functional accesses rather than "probes" (old terminology), and mention in the DPRINTF which type of access we're doing.
-rw-r--r--src/cpu/testers/memtest/memtest.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cpu/testers/memtest/memtest.cc b/src/cpu/testers/memtest/memtest.cc
index 7a8e4cc52..5649f7a8e 100644
--- a/src/cpu/testers/memtest/memtest.cc
+++ b/src/cpu/testers/memtest/memtest.cc
@@ -223,8 +223,6 @@ MemTest::completeRequest(PacketPtr pkt)
assert(removeAddr != outstandingAddrs.end());
outstandingAddrs.erase(removeAddr);
- assert(pkt->isResponse());
-
if (pkt->isRead()) {
if (memcmp(pkt_data, data, pkt->getSize()) != 0) {
panic("%s: read of %x (blk %x) @ cycle %d "
@@ -325,7 +323,7 @@ MemTest::tick()
} else {
paddr = ((base) ? baseAddr1 : baseAddr2) + offset;
}
- bool probe = (random() % 100 < percentFunctional) && !uncacheable;
+ bool do_functional = (random() % 100 < percentFunctional) && !uncacheable;
if (issueDmas) {
paddr &= ~((1 << dma_access_size) - 1);
@@ -358,8 +356,9 @@ MemTest::tick()
funcPort.readBlob(req->getPaddr(), result, req->getSize());
DPRINTF(MemTest,
- "id %d initiating read at address %x (blk %x) expecting %x\n",
- id, req->getPaddr(), blockAddr(req->getPaddr()), *result);
+ "id %d initiating %sread at addr %x (blk %x) expecting %x\n",
+ id, do_functional ? "functional " : "", req->getPaddr(),
+ blockAddr(req->getPaddr()), *result);
PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
pkt->setSrc(0);
@@ -367,7 +366,7 @@ MemTest::tick()
MemTestSenderState *state = new MemTestSenderState(result);
pkt->senderState = state;
- if (probe) {
+ if (do_functional) {
cachePort.sendFunctional(pkt);
completeRequest(pkt);
} else {
@@ -387,8 +386,9 @@ MemTest::tick()
outstandingAddrs.insert(paddr);
- DPRINTF(MemTest, "initiating write at address %x (blk %x) value %x\n",
- req->getPaddr(), blockAddr(req->getPaddr()), data & 0xff);
+ DPRINTF(MemTest, "initiating %swrite at addr %x (blk %x) value %x\n",
+ do_functional ? "functional " : "", req->getPaddr(),
+ blockAddr(req->getPaddr()), data & 0xff);
PacketPtr pkt = new Packet(req, MemCmd::WriteReq, Packet::Broadcast);
pkt->setSrc(0);
@@ -400,7 +400,7 @@ MemTest::tick()
funcPort.writeBlob(req->getPaddr(), pkt_data, req->getSize());
- if (probe) {
+ if (do_functional) {
cachePort.sendFunctional(pkt);
completeRequest(pkt);
} else {