From 6a9fbd295d18d96b39f9d8ba6093bee17d318c1d Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 8 Dec 2014 04:49:52 -0500 Subject: [PATCH] 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. --- src/dev/io_device.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.30.2