From: Andreas Sandberg Date: Mon, 8 Dec 2014 09:49:52 +0000 (-0500) Subject: dev: Add response sanity checks in PioPort X-Git-Tag: stable_2015_04_15~64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a9fbd295d18d96b39f9d8ba6093bee17d318c1d;p=gem5.git 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. --- 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