summaryrefslogtreecommitdiff
path: root/src/mem/request.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-05-29 15:30:16 -0700
committerNathan Binkert <nate@binkert.org>2009-05-29 15:30:16 -0700
commita0104b6ff6e7a39b068e104504aa1c7c33f1ec23 (patch)
tree4a5e87529bca730d31751e28ba681b80a487173b /src/mem/request.hh
parent7f50ea05ac848e22a70c9a9471904637aea2f907 (diff)
downloadgem5-a0104b6ff6e7a39b068e104504aa1c7c33f1ec23.tar.xz
request: add accessor and constructor for setting time other than curTick
Diffstat (limited to 'src/mem/request.hh')
-rw-r--r--src/mem/request.hh30
1 files changed, 24 insertions, 6 deletions
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. */