summaryrefslogtreecommitdiff
path: root/src/cpu/memtest
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-06-23 13:24:33 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-06-23 13:24:33 -0700
commit57ff2604e59647c6afe988767186f13c80c1aa16 (patch)
treed1d91122e51d7971bba139c0b68d24d18853cd8d /src/cpu/memtest
parented1db23b414a372a012d406d5a684775f00baa11 (diff)
downloadgem5-57ff2604e59647c6afe988767186f13c80c1aa16.tar.xz
Minor fix plus new assertion to catch similar bugs.
src/cpu/memtest/memtest.cc: Need to set packet source field so that response from cache doesn't run into assertion failure when copying source to dest. src/mem/packet.hh: Copy source field when copying packets. Assert that source is valid before copying it to dest when turning packets around. --HG-- extra : convert_revision : 09e3cfda424aa89fe170e21e955b295746832bf8
Diffstat (limited to 'src/cpu/memtest')
-rw-r--r--src/cpu/memtest/memtest.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cpu/memtest/memtest.cc b/src/cpu/memtest/memtest.cc
index 6e8c5d0bf..019b4328c 100644
--- a/src/cpu/memtest/memtest.cc
+++ b/src/cpu/memtest/memtest.cc
@@ -344,6 +344,7 @@ MemTest::tick()
req->getPaddr(), blockAddr(req->getPaddr()), *result);
PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
+ pkt->setSrc(0);
pkt->dataDynamicArray(new uint8_t[req->getSize()]);
MemTestSenderState *state = new MemTestSenderState(result);
pkt->senderState = state;
@@ -373,6 +374,7 @@ MemTest::tick()
req->getPaddr(), blockAddr(req->getPaddr()), data & 0xff);
PacketPtr pkt = new Packet(req, MemCmd::WriteReq, Packet::Broadcast);
+ pkt->setSrc(0);
uint8_t *pkt_data = new uint8_t[req->getSize()];
pkt->dataDynamicArray(pkt_data);
memcpy(pkt_data, &data, req->getSize());