summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:06 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:06 -0500
commitb3fc8839c4727da575ed916cbd6a76d8ad5fc644 (patch)
tree4a200b41d9d2c2222ca88d85af82dd17c330ea7f /src/mem/packet.hh
parent362160c8aeeb5b655158061ad57404124b4618f3 (diff)
downloadgem5-b3fc8839c4727da575ed916cbd6a76d8ad5fc644.tar.xz
mem: Make packet bus-related time accounting relative
This patch changes the bus-related time accounting done in the packet to be relative. Besides making it easier to align the cache timing to cache clock cycles, it also makes it possible to create a Last-Level Cache (LLC) directly to a memory controller without a bus inbetween. The bus is unique in that it does not ever make the packets wait to reflect the time spent forwarding them. Instead, the cache is currently responsible for making the packets wait. Thus, the bus annotates the packets with the time needed for the first word to appear, and also the last word. The cache then delays the packets in its queues before passing them on. It is worth noting that every object attached to a bus (devices, memories, bridges, etc) should be doing this if we opt for keeping this way of accounting for the bus timing.
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 181320850..92fb2a31c 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -330,11 +330,23 @@ class Packet : public Printable
public:
- /// The time at which the packet will be fully transmitted
- Tick finishTime;
+ /**
+ * The extra delay from seeing the packet until the first word is
+ * transmitted by the bus that provided it (if any). This delay is
+ * used to communicate the bus waiting time to the neighbouring
+ * object (e.g. a cache) that actually makes the packet wait. As
+ * the delay is relative, a 32-bit unsigned should be sufficient.
+ */
+ uint32_t busFirstWordDelay;
- /// The time at which the first chunk of the packet will be transmitted
- Tick firstWordTime;
+ /**
+ * The extra delay from seeing the packet until the last word is
+ * transmitted by the bus that provided it (if any). Similar to
+ * the first word time, this is used to make up for the fact that
+ * the bus does not make the packet wait. As the delay is relative,
+ * a 32-bit unsigned should be sufficient.
+ */
+ uint32_t busLastWordDelay;
/**
* A virtual base opaque structure used to hold state associated
@@ -583,6 +595,7 @@ class Packet : public Printable
: cmd(_cmd), req(_req), data(NULL),
src(InvalidPortID), dest(InvalidPortID),
bytesValidStart(0), bytesValidEnd(0),
+ busFirstWordDelay(0), busLastWordDelay(0),
senderState(NULL)
{
if (req->hasPaddr()) {
@@ -604,6 +617,7 @@ class Packet : public Printable
: cmd(_cmd), req(_req), data(NULL),
src(InvalidPortID), dest(InvalidPortID),
bytesValidStart(0), bytesValidEnd(0),
+ busFirstWordDelay(0), busLastWordDelay(0),
senderState(NULL)
{
if (req->hasPaddr()) {
@@ -625,7 +639,10 @@ class Packet : public Printable
: cmd(pkt->cmd), req(pkt->req),
data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
- bytesValidStart(pkt->bytesValidStart), bytesValidEnd(pkt->bytesValidEnd),
+ bytesValidStart(pkt->bytesValidStart),
+ bytesValidEnd(pkt->bytesValidEnd),
+ busFirstWordDelay(pkt->busFirstWordDelay),
+ busLastWordDelay(pkt->busLastWordDelay),
senderState(pkt->senderState)
{
if (!clearFlags)
@@ -664,6 +681,13 @@ class Packet : public Printable
addr = req->getPaddr();
size = req->getSize();
+ src = InvalidPortID;
+ dest = InvalidPortID;
+ bytesValidStart = 0;
+ bytesValidEnd = 0;
+ busFirstWordDelay = 0;
+ busLastWordDelay = 0;
+
flags.set(VALID_ADDR|VALID_SIZE);
deleteData();
}