From 462c288a757bc4fd50324ebe2f1fd697d53838ab Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 25 Sep 2015 07:13:54 -0400 Subject: mem: Make the coherent crossbar account for timing snoops This patch introduces the concept of a snoop latency. Given the requirement to snoop and forward packets in zero time (due to the coherency mechanism), the latency is accounted for later. On a snoop, we establish the latency, and later add it to the header delay of the packet. To allow multiple caches to contribute to the snoop latency, we use a separate variable in the packet, and then take the maximum before adding it to the header delay. --- src/mem/packet.hh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mem/packet.hh') diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 2b667d26d..f33ee120d 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -323,6 +323,14 @@ class Packet : public Printable */ uint32_t headerDelay; + /** + * Keep track of the extra delay incurred by snooping upwards + * before sending a request down the memory system. This is used + * by the coherent crossbar to account for the additional request + * delay. + */ + uint32_t snoopDelay; + /** * The extra pipelining delay from seeing the packet until the end of * payload is transmitted by the component that provided it (if @@ -582,7 +590,7 @@ class Packet : public Printable */ Packet(const RequestPtr _req, MemCmd _cmd) : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false), - size(0), headerDelay(0), payloadDelay(0), + size(0), headerDelay(0), snoopDelay(0), payloadDelay(0), senderState(NULL) { if (req->hasPaddr()) { @@ -603,7 +611,7 @@ class Packet : public Printable */ Packet(const RequestPtr _req, MemCmd _cmd, int _blkSize) : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false), - headerDelay(0), payloadDelay(0), + headerDelay(0), snoopDelay(0), payloadDelay(0), senderState(NULL) { if (req->hasPaddr()) { @@ -628,6 +636,7 @@ class Packet : public Printable addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size), bytesValid(pkt->bytesValid), headerDelay(pkt->headerDelay), + snoopDelay(0), payloadDelay(pkt->payloadDelay), senderState(pkt->senderState) { -- cgit v1.2.3