diff options
author | Kevin Lim <ktlim@umich.edu> | 2006-11-06 13:27:57 -0500 |
---|---|---|
committer | Kevin Lim <ktlim@umich.edu> | 2006-11-06 13:27:57 -0500 |
commit | 2506c156205bc5255e8b64d1844ddf5a3645c117 (patch) | |
tree | 47e8ca8b3e8a010bf6732527399c4f128be758e2 /src/cpu/base.cc | |
parent | 430622c173b676c7a53aa5623d5197a26f9c9190 (diff) | |
parent | 652281a61c6be7210b575e50566e7efdc82ab6ba (diff) | |
download | gem5-2506c156205bc5255e8b64d1844ddf5a3645c117.tar.xz |
Merge ktlim@zizzer:/bk/newmem
into zamp.eecs.umich.edu:/z/ktlim2/clean/newmem
--HG--
extra : convert_revision : d6bb87586cf7ee63ca32e36944c3755fae0b55d0
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r-- | src/cpu/base.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc index ea4b03bf2..55ceea8fb 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -259,6 +259,26 @@ BaseCPU::regStats() #endif } +Tick +BaseCPU::nextCycle() +{ + Tick next_tick = curTick + clock - 1; + next_tick -= (next_tick % clock); + return next_tick; +} + +Tick +BaseCPU::nextCycle(Tick begin_tick) +{ + Tick next_tick = begin_tick; + + while (next_tick < curTick) + next_tick += clock; + + next_tick -= (next_tick % clock); + assert(next_tick >= curTick); + return next_tick; +} void BaseCPU::registerThreadContexts() |