summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorGeoffrey Blake <geoffrey.blake@arm.com>2012-01-09 18:10:05 -0600
committerGeoffrey Blake <geoffrey.blake@arm.com>2012-01-09 18:10:05 -0600
commite826d23a2eae6136f20f74d8d48601ff49349e58 (patch)
tree65ddaabb4931a5a40961424615bc3c5629fd0dc9 /src/mem/packet.hh
parentbda1125e882eaf8c127ebdae0d847bf2148832ad (diff)
downloadgem5-e826d23a2eae6136f20f74d8d48601ff49349e58.tar.xz
Packet: Add derived class FunctionalPacket to enable partial functional reads
This adds the derived class FunctionalPacket to fix a long standing deficiency in the Packet class where it was unable to handle finding data to partially satisfy a functional access. Made this a derived class as functional accesses are used only in certain contexts and to not add any additional overhead to the existing Packet class.
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index be0c20d42..6347c21ea 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -299,6 +299,13 @@ class Packet : public FastAlloc, public Printable
*/
MemCmd origCmd;
+ /**
+ * These values specify the range of bytes found that satisfy a
+ * functional read.
+ */
+ uint16_t bytesValidStart;
+ uint16_t bytesValidEnd;
+
public:
/// Used to calculate latencies for each packet.
Tick time;
@@ -507,7 +514,8 @@ class Packet : public FastAlloc, public Printable
*/
Packet(Request *_req, MemCmd _cmd, NodeID _dest)
: flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
- dest(_dest), time(curTick()), senderState(NULL)
+ dest(_dest), bytesValidStart(0), bytesValidEnd(0),
+ time(curTick()), senderState(NULL)
{
if (req->hasPaddr()) {
addr = req->getPaddr();
@@ -526,7 +534,8 @@ class Packet : public FastAlloc, public Printable
*/
Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
: flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
- dest(_dest), time(curTick()), senderState(NULL)
+ dest(_dest), bytesValidStart(0), bytesValidEnd(0),
+ time(curTick()), senderState(NULL)
{
if (req->hasPaddr()) {
addr = req->getPaddr() & ~(_blkSize - 1);
@@ -547,6 +556,7 @@ class Packet : public FastAlloc, 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),
time(curTick()), senderState(pkt->senderState)
{
if (!clearFlags)
@@ -554,6 +564,7 @@ class Packet : public FastAlloc, public Printable
flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE|VALID_SRC|VALID_DST));
flags.set(pkt->flags & STATIC_DATA);
+
}
/**