dev-arm: Add a VExpress_GEM5_V2 platform with GICv3 support
[gem5.git] / src / dev / io_device.cc
index 74ab8c3b3adc3033824da8a2ec11653d895f196e..28ea52aad6b5b729d3d092dbac56db2447038107 100644 (file)
@@ -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
  *          Nathan Binkert
  */
 
+#include "dev/io_device.hh"
+
 #include "base/trace.hh"
 #include "debug/AddrRanges.hh"
-#include "dev/io_device.hh"
 #include "sim/system.hh"
 
 PioPort::PioPort(PioDevice *dev)
@@ -54,12 +55,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