summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-09-25 11:49:40 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-09-25 11:49:40 -0500
commit396600de107220db8c2c8f3951eeb7062ac0e81c (patch)
treec5c1d81488c543d02a3d1547213c21ddd906edc3 /src/mem/packet.hh
parent0c99d21ad748371e801508a8c3652e07e2e56f93 (diff)
downloadgem5-396600de107220db8c2c8f3951eeb7062ac0e81c.tar.xz
mem: Add a gasket that allows memory ranges to be re-mapped.
For example if DRAM is at two locations and mirrored this patch allows the mirroring to occur.
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 7396048d6..fbcf185cc 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -491,6 +491,15 @@ class Packet : public Printable
void clearDest() { dest = InvalidPortID; }
Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
+ /**
+ * Update the address of this packet mid-transaction. This is used
+ * by the address mapper to change an already set address to a new
+ * one based on the system configuration. It is intended to remap
+ * an existing address, so it asserts that the current address is
+ * valid.
+ */
+ void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
+
unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
Addr getOffset(int blkSize) const { return getAddr() & (Addr)(blkSize - 1); }