summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-12-08 04:49:52 -0500
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-12-08 04:49:52 -0500
commit6a9fbd295d18d96b39f9d8ba6093bee17d318c1d (patch)
tree9b4379f4f75a4f19e43a26ebebae7483253e2ae0
parent1ccc4e0e21e5a47640b2a8bd6864988c3dfb5926 (diff)
downloadgem5-6a9fbd295d18d96b39f9d8ba6093bee17d318c1d.tar.xz
dev: Add response sanity checks in PioPort
Add an assert in the PioPort that checks if a response packet from a device has the right flags set before passing it to them rest of the memory system.
-rw-r--r--src/dev/io_device.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc
index b118294f7..a536e2973 100644
--- a/src/dev/io_device.cc
+++ b/src/dev/io_device.cc
@@ -57,7 +57,9 @@ PioPort::recvAtomic(PacketPtr pkt)
// @todo: We need to pay for this and not just zero it out
pkt->firstWordDelay = pkt->lastWordDelay = 0;
- return pkt->isRead() ? device->read(pkt) : device->write(pkt);
+ const Tick delay(pkt->isRead() ? device->read(pkt) : device->write(pkt));
+ assert(pkt->isResponse() || pkt->isError());
+ return delay;
}
AddrRangeList