request: add accessor and constructor for setting time other than curTick

This commit is contained in:
Nathan Binkert 2009-05-29 15:30:16 -07:00
parent 7f50ea05ac
commit a0104b6ff6
2 changed files with 25 additions and 7 deletions

View file

@ -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();

View file

@ -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;
return _time;
}
void
time(Tick time)
{
assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
_time = time;
}
/** Accessor for flags. */