summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-09-25 07:13:54 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2015-09-25 07:13:54 -0400
commit462c288a757bc4fd50324ebe2f1fd697d53838ab (patch)
tree02cc70a4d0682136b458ee59d5c9dad0dfdec00a /src/mem/packet.hh
parent3bd78a141ec60ae65d910286c3d99ae7030ba703 (diff)
downloadgem5-462c288a757bc4fd50324ebe2f1fd697d53838ab.tar.xz
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.
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh13
1 files changed, 11 insertions, 2 deletions
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
@@ -324,6 +324,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
* any). This includes the header delay. Similar to the header
@@ -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)
{