summaryrefslogtreecommitdiff
path: root/src/cpu/base.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-16 14:41:56 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-16 14:41:56 -0500
commit14ebaa1eccff4032d59147783e98e07b81b5f1ae (patch)
tree4c738d02f4876cb394d0f9510d08380a6f5384c1 /src/cpu/base.cc
parentac2c7967f69e3ffd29a1ed04a15838073dc060de (diff)
parentdbdf2f14ae6b586efd31b73aa4548a38ecee263f (diff)
downloadgem5-14ebaa1eccff4032d59147783e98e07b81b5f1ae.tar.xz
Merge zizzer.eecs.umich.edu:/bk/newmem/
into zower.eecs.umich.edu:/home/gblack/m5/newmemmemops --HG-- extra : convert_revision : c49b760eac758dbde30867cb638fcb3b790f4721
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r--src/cpu/base.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index 4c243a2e9..7cbbb0b96 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -97,11 +97,13 @@ CPUProgressEvent::description()
#if FULL_SYSTEM
BaseCPU::BaseCPU(Params *p)
: MemObject(p->name), clock(p->clock), checkInterrupts(true),
- params(p), number_of_threads(p->numberOfThreads), system(p->system)
+ params(p), number_of_threads(p->numberOfThreads), system(p->system),
+ phase(p->phase)
#else
BaseCPU::BaseCPU(Params *p)
: MemObject(p->name), clock(p->clock), params(p),
- number_of_threads(p->numberOfThreads), system(p->system)
+ number_of_threads(p->numberOfThreads), system(p->system),
+ phase(p->phase)
#endif
{
// currentTick = curTick;
@@ -257,8 +259,9 @@ BaseCPU::regStats()
Tick
BaseCPU::nextCycle()
{
- Tick next_tick = curTick + clock - 1;
+ Tick next_tick = curTick - phase + clock - 1;
next_tick -= (next_tick % clock);
+ next_tick += phase;
return next_tick;
}
@@ -266,11 +269,12 @@ Tick
BaseCPU::nextCycle(Tick begin_tick)
{
Tick next_tick = begin_tick;
+ next_tick -= (next_tick % clock);
+ next_tick += phase;
while (next_tick < curTick)
next_tick += clock;
- next_tick -= (next_tick % clock);
assert(next_tick >= curTick);
return next_tick;
}