diff options
author | Nathan Binkert <nate@binkert.org> | 2010-04-15 16:24:12 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2010-04-15 16:24:12 -0700 |
commit | e99828b06a1b694b7aca09682ae2b1be9089af88 (patch) | |
tree | e106d16b98b45695ffd993e2cd6684919723dc66 /src/sim | |
parent | f7e6f19adabd0ce7e35cea8b5c3b070e2cd26c38 (diff) | |
download | gem5-e99828b06a1b694b7aca09682ae2b1be9089af88.tar.xz |
tick: rename Clock namespace to SimClock
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/core.cc | 6 | ||||
-rw-r--r-- | src/sim/core.hh | 4 | ||||
-rw-r--r-- | src/sim/pseudo_inst.cc | 25 | ||||
-rw-r--r-- | src/sim/stat_control.cc | 2 | ||||
-rw-r--r-- | src/sim/syscall_emul.hh | 4 |
5 files changed, 21 insertions, 20 deletions
diff --git a/src/sim/core.cc b/src/sim/core.cc index 8342b6740..32642c8a4 100644 --- a/src/sim/core.cc +++ b/src/sim/core.cc @@ -40,7 +40,7 @@ using namespace std; Tick curTick = 0; -namespace Clock { +namespace SimClock { /// The simulated frequency of curTick. (In ticks per second) Tick Frequency; @@ -65,12 +65,12 @@ Tick ns; Tick ps; /* namespace Float */ } -/* namespace Clock */ } +/* namespace SimClock */ } void setClockFrequency(Tick ticksPerSecond) { - using namespace Clock; + using namespace SimClock; Frequency = ticksPerSecond; Float::s = static_cast<double>(Frequency); Float::ms = Float::s / 1.0e3; diff --git a/src/sim/core.hh b/src/sim/core.hh index c1a363689..8be1dd259 100644 --- a/src/sim/core.hh +++ b/src/sim/core.hh @@ -40,7 +40,7 @@ extern Tick curTick; const Tick retryTime = 1000; -namespace Clock { +namespace SimClock { /// The simulated frequency of curTick. extern Tick Frequency; @@ -64,7 +64,7 @@ extern Tick us; extern Tick ns; extern Tick ps; /* namespace Int */ } -/* namespace Clock */ } +/* namespace SimClock */ } void setClockFrequency(Tick ticksPerSecond); diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc index cf063818b..7a91bfbd4 100644 --- a/src/sim/pseudo_inst.cc +++ b/src/sim/pseudo_inst.cc @@ -93,7 +93,7 @@ quiesceNs(ThreadContext *tc, uint64_t ns) EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent(); - Tick resume = curTick + Clock::Int::ns * ns; + Tick resume = curTick + SimClock::Int::ns * ns; mainEventQueue.reschedule(quiesceEvent, resume, true); @@ -128,7 +128,8 @@ quiesceCycles(ThreadContext *tc, uint64_t cycles) uint64_t quiesceTime(ThreadContext *tc) { - return (tc->readLastActivate() - tc->readLastSuspend()) / Clock::Int::ns; + return (tc->readLastActivate() - tc->readLastSuspend()) / + SimClock::Int::ns; } #endif @@ -136,7 +137,7 @@ quiesceTime(ThreadContext *tc) uint64_t rpns(ThreadContext *tc) { - return curTick / Clock::Int::ns; + return curTick / SimClock::Int::ns; } void @@ -151,7 +152,7 @@ wakeCPU(ThreadContext *tc, uint64_t cpuid) void m5exit(ThreadContext *tc, Tick delay) { - Tick when = curTick + delay * Clock::Int::ns; + Tick when = curTick + delay * SimClock::Int::ns; Event *event = new SimLoopExitEvent("m5_exit instruction encountered", 0); mainEventQueue.schedule(event, when); } @@ -229,8 +230,8 @@ resetstats(ThreadContext *tc, Tick delay, Tick period) return; - Tick when = curTick + delay * Clock::Int::ns; - Tick repeat = period * Clock::Int::ns; + Tick when = curTick + delay * SimClock::Int::ns; + Tick repeat = period * SimClock::Int::ns; Stats::StatEvent(false, true, when, repeat); } @@ -242,8 +243,8 @@ dumpstats(ThreadContext *tc, Tick delay, Tick period) return; - Tick when = curTick + delay * Clock::Int::ns; - Tick repeat = period * Clock::Int::ns; + Tick when = curTick + delay * SimClock::Int::ns; + Tick repeat = period * SimClock::Int::ns; Stats::StatEvent(true, false, when, repeat); } @@ -255,8 +256,8 @@ dumpresetstats(ThreadContext *tc, Tick delay, Tick period) return; - Tick when = curTick + delay * Clock::Int::ns; - Tick repeat = period * Clock::Int::ns; + Tick when = curTick + delay * SimClock::Int::ns; + Tick repeat = period * SimClock::Int::ns; Stats::StatEvent(true, true, when, repeat); } @@ -267,8 +268,8 @@ m5checkpoint(ThreadContext *tc, Tick delay, Tick period) if (!tc->getCpuPtr()->params()->do_checkpoint_insts) return; - Tick when = curTick + delay * Clock::Int::ns; - Tick repeat = period * Clock::Int::ns; + Tick when = curTick + delay * SimClock::Int::ns; + Tick repeat = period * SimClock::Int::ns; Event *event = new SimLoopExitEvent("checkpoint", 0, repeat); mainEventQueue.schedule(event, when); diff --git a/src/sim/stat_control.cc b/src/sim/stat_control.cc index 2dcf4798d..e8c2d5814 100644 --- a/src/sim/stat_control.cc +++ b/src/sim/stat_control.cc @@ -106,7 +106,7 @@ Global::Global() ; simFreq - .scalar(Clock::Frequency) + .scalar(SimClock::Frequency) .name("sim_freq") .desc("Frequency of simulated ticks") ; diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 66e800183..6016ccfd9 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -360,7 +360,7 @@ template <class T1, class T2> void getElapsedTime(T1 &sec, T2 &usec) { - int elapsed_usecs = curTick / Clock::Int::us; + int elapsed_usecs = curTick / SimClock::Int::us; sec = elapsed_usecs / one_million; usec = elapsed_usecs % one_million; } @@ -1187,7 +1187,7 @@ timesFunc(SyscallDesc *desc, int callnum, LiveProcess *process, TypedBufferArg<typename OS::tms> bufp(process->getSyscallArg(tc, index)); // Fill in the time structure (in clocks) - int64_t clocks = curTick * OS::M5_SC_CLK_TCK / Clock::Int::s; + int64_t clocks = curTick * OS::M5_SC_CLK_TCK / SimClock::Int::s; bufp->tms_utime = clocks; bufp->tms_stime = 0; bufp->tms_cutime = 0; |