summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/packet.hh2
-rw-r--r--src/mem/request.hh30
2 files changed, 25 insertions, 7 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 6e804b726..672b00e3c 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -537,7 +537,7 @@ class Packet : public FastAlloc, public Printable
flags = 0;
addr = req->getPaddr();
size = req->getSize();
- time = req->getTime();
+ time = req->time();
flags.set(VALID_ADDR|VALID_SIZE);
deleteData();
diff --git a/src/mem/request.hh b/src/mem/request.hh
index 901a24f47..870930317 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -152,7 +152,7 @@ class Request : public FastAlloc
* latencies. This field is set to curTick any time paddr or vaddr
* is written.
*/
- Tick time;
+ Tick _time;
/** The address space ID. */
int asid;
@@ -188,6 +188,11 @@ class Request : public FastAlloc
setPhys(paddr, size, flags);
}
+ Request(Addr paddr, int size, Flags flags, Tick time)
+ {
+ setPhys(paddr, size, flags, time);
+ }
+
Request(int asid, Addr vaddr, int size, Flags flags, Addr pc,
int cid, ThreadID tid)
{
@@ -213,12 +218,12 @@ class Request : public FastAlloc
* allocated Request object.
*/
void
- setPhys(Addr _paddr, int _size, Flags _flags)
+ setPhys(Addr _paddr, int _size, Flags _flags, Tick time)
{
assert(_size >= 0);
paddr = _paddr;
size = _size;
- time = curTick;
+ _time = time;
flags.clear(~STICKY_FLAGS);
flags.set(_flags);
@@ -226,6 +231,12 @@ class Request : public FastAlloc
privateFlags.set(VALID_PADDR|VALID_SIZE);
}
+ void
+ setPhys(Addr _paddr, int _size, Flags _flags)
+ {
+ setPhys(_paddr, _size, _flags, curTick);
+ }
+
/**
* Set up a virtual (e.g., CPU) request in a previously
* allocated Request object.
@@ -239,7 +250,7 @@ class Request : public FastAlloc
size = _size;
flags = _flags;
pc = _pc;
- time = curTick;
+ _time = curTick;
flags.clear(~STICKY_FLAGS);
flags.set(_flags);
@@ -313,10 +324,17 @@ class Request : public FastAlloc
/** Accessor for time. */
Tick
- getTime()
+ time() const
+ {
+ assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
+ return _time;
+ }
+
+ void
+ time(Tick time)
{
assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
- return time;
+ _time = time;
}
/** Accessor for flags. */