diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2015-11-06 03:26:36 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2015-11-06 03:26:36 -0500 |
commit | 6b70afd0d4ec8821105e506d7a20f9af01b8eafb (patch) | |
tree | 401326ebed801c86355d7b97644feb5fce0bc134 /src/dev | |
parent | 8bc925e36d0e5de7e70a6d5bf2b1824649932599 (diff) | |
download | gem5-6b70afd0d4ec8821105e506d7a20f9af01b8eafb.tar.xz |
mem: Use the packet delays and do not just zero them out
This patch updates the I/O devices, bridge and simple memory to take
the packet header and payload delay into account in their latency
calculations. In all cases we add the header delay, i.e. the
accumulated pipeline delay of any crossbars, and the payload delay
needed for deserialisation of any payload.
Due to the additional unknown latency contribution, the packet queue
of the simple memory is changed to use insertion sorting based on the
time stamp. Moreover, since the memory hands out exclusive (non
shared) responses, we also need to ensure ordering for reads to the
same address.
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/io_device.cc | 8 | ||||
-rw-r--r-- | src/dev/pcidev.cc | 12 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 74ab8c3b3..daa939d8f 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 ARM Limited + * Copyright (c) 2012, 2015 ARM Limited * All rights reserved. * * The license below extends only to copyright in the software and shall @@ -54,12 +54,14 @@ PioPort::PioPort(PioDevice *dev) Tick PioPort::recvAtomic(PacketPtr pkt) { - // @todo: We need to pay for this and not just zero it out + // technically the packet only reaches us after the header delay, + // and typically we also need to deserialise any payload + Tick receive_delay = pkt->headerDelay + pkt->payloadDelay; pkt->headerDelay = pkt->payloadDelay = 0; const Tick delay(pkt->isRead() ? device->read(pkt) : device->write(pkt)); assert(pkt->isResponse() || pkt->isError()); - return delay; + return delay + receive_delay; } AddrRangeList diff --git a/src/dev/pcidev.cc b/src/dev/pcidev.cc index 4126141b9..7b542ab1c 100644 --- a/src/dev/pcidev.cc +++ b/src/dev/pcidev.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 ARM Limited + * Copyright (c) 2013, 2015 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -79,9 +79,15 @@ PciDevice::PciConfigPort::recvAtomic(PacketPtr pkt) { assert(pkt->getAddr() >= configAddr && pkt->getAddr() < configAddr + PCI_CONFIG_SIZE); - // @todo someone should pay for this + + // technically the packet only reaches us after the header delay, + // and typically we also need to deserialise any payload + Tick receive_delay = pkt->headerDelay + pkt->payloadDelay; pkt->headerDelay = pkt->payloadDelay = 0; - return pkt->isRead() ? device->readConfig(pkt) : device->writeConfig(pkt); + + const Tick delay(pkt->isRead() ? device->readConfig(pkt) : + device->writeConfig(pkt)); + return delay + receive_delay; } AddrRangeList |