diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2012-09-25 11:49:40 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2012-09-25 11:49:40 -0500 |
commit | 396600de107220db8c2c8f3951eeb7062ac0e81c (patch) | |
tree | c5c1d81488c543d02a3d1547213c21ddd906edc3 /src/mem/packet.hh | |
parent | 0c99d21ad748371e801508a8c3652e07e2e56f93 (diff) | |
download | gem5-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.hh | 9 |
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); } |