From a0104b6ff6e7a39b068e104504aa1c7c33f1ec23 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 29 May 2009 15:30:16 -0700 Subject: request: add accessor and constructor for setting time other than curTick --- src/mem/request.hh | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'src/mem/request.hh') 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. */ -- cgit v1.2.3