tick: rename Clock namespace to SimClock
authorNathan Binkert <nate@binkert.org>
Thu, 15 Apr 2010 23:24:12 +0000 (16:24 -0700)
committerNathan Binkert <nate@binkert.org>
Thu, 15 Apr 2010 23:24:12 +0000 (16:24 -0700)
20 files changed:
src/arch/alpha/freebsd/system.cc
src/arch/alpha/linux/system.cc
src/arch/alpha/tru64/process.cc
src/arch/mips/linux/system.cc
src/cpu/base.hh
src/dev/alpha/tsunami_io.cc
src/dev/etherdump.cc
src/dev/i8254xGBe.cc
src/dev/i8254xGBe.hh
src/dev/intel_8254_timer.cc
src/dev/mc146818.cc
src/dev/mc146818.hh
src/dev/mips/malta_io.cc
src/dev/uart8250.cc
src/mem/tport.cc
src/sim/core.cc
src/sim/core.hh
src/sim/pseudo_inst.cc
src/sim/stat_control.cc
src/sim/syscall_emul.hh

index e541b260cb0472315b608ec94e804e647a5c4112..ac7a92ed33f3b74a9aeae83debb11a4f66bd1e20 100644 (file)
@@ -77,7 +77,7 @@ FreebsdAlphaSystem::doCalibrateClocks(ThreadContext *tc)
     ppc_vaddr = (Addr)tc->readIntReg(17);
     timer_vaddr = (Addr)tc->readIntReg(18);
 
-    virtPort.write(ppc_vaddr, (uint32_t)Clock::Frequency);
+    virtPort.write(ppc_vaddr, (uint32_t)SimClock::Frequency);
     virtPort.write(timer_vaddr, (uint32_t)TIMER_FREQUENCY);
 }
 
index 1d9332a58ac39b12d1c412d6151c22fccfc36a8f..c2af286dde573a7c31214e84b2c15cf1916fd617 100644 (file)
@@ -86,7 +86,7 @@ LinuxAlphaSystem::LinuxAlphaSystem(Params *p)
      * calculated it by using the PIT, RTC, etc.
      */
     if (kernelSymtab->findAddress("est_cycle_freq", addr))
-        virtPort.write(addr, (uint64_t)(Clock::Frequency /
+        virtPort.write(addr, (uint64_t)(SimClock::Frequency /
                     p->boot_cpu_frequency));
 
 
index b039fbe1954a3d69c02291ff694669c0065f7923..824e0413c86491a917a5457e4f09e13e0ee4c60e 100644 (file)
@@ -183,7 +183,7 @@ tableFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
           TypedBufferArg<Tru64::tbl_sysinfo> elp(bufPtr);
 
           const int clk_hz = one_million;
-          elp->si_user = htog(curTick / (Clock::Frequency / clk_hz));
+          elp->si_user = htog(curTick / (SimClock::Frequency / clk_hz));
           elp->si_nice = htog(0);
           elp->si_sys = htog(0);
           elp->si_idle = htog(0);
index 295e22a614c264d5df92760ca385686247e8fe8c..ff07f526a1b048ebe16e617df1760da46eb2c693 100644 (file)
@@ -85,7 +85,7 @@ LinuxMipsSystem::LinuxMipsSystem(Params *p)
      * calculated it by using the PIT, RTC, etc.
      */
     if (kernelSymtab->findAddress("est_cycle_freq", addr))
-        virtPort.write(addr, (uint64_t)(Clock::Frequency /
+        virtPort.write(addr, (uint64_t)(SimClock::Frequency /
                     p->boot_cpu_frequency));
 
     /**
index b229ddd38e14d0a0ac6440c402245e4fc04116b5..b96a8adb27d3f6b3fc728542ccff517bcfea97de 100644 (file)
@@ -98,7 +98,7 @@ class BaseCPU : public MemObject
     int cpuId() { return _cpuId; }
 
 //    Tick currentTick;
-    inline Tick frequency() const { return Clock::Frequency / clock; }
+    inline Tick frequency() const { return SimClock::Frequency / clock; }
     inline Tick ticks(int numCycles) const { return clock * numCycles; }
     inline Tick curCycle() const { return curTick / clock; }
     inline Tick tickToCycles(Tick val) const { return val / clock; }
index 8b06f51702089d9f407a23682a07bce686a902c7..c90f06b5a97825cf6a413a5d03090cfb8dc1ae90 100644 (file)
@@ -80,7 +80,7 @@ TsunamiIO::TsunamiIO(const Params *p)
 Tick
 TsunamiIO::frequency() const
 {
-    return Clock::Frequency / params()->frequency;
+    return SimClock::Frequency / params()->frequency;
 }
 
 Tick
index c41ce4e1f4e62697f4ac124b629ffa5169d86135..9cb15c4e870e928219f05f92767747d9118d3661 100644 (file)
@@ -94,8 +94,8 @@ void
 EtherDump::dumpPacket(EthPacketPtr &packet)
 {
     pcap_pkthdr pkthdr;
-    pkthdr.seconds = curTick / Clock::Int::s;
-    pkthdr.microseconds = (curTick / Clock::Int::us) % ULL(1000000);
+    pkthdr.seconds = curTick / SimClock::Int::s;
+    pkthdr.microseconds = (curTick / SimClock::Int::us) % ULL(1000000);
     pkthdr.caplen = std::min(packet->length, maxlen);
     pkthdr.len = packet->length;
     stream->write(reinterpret_cast<char *>(&pkthdr), sizeof(pkthdr));
index ca7e9e67a5368b28d1a05f3d7b1e2bcbf73bcfc3..2a044ebbe6ec03728ed88e0a751ad8a94013ae1f 100644 (file)
@@ -693,7 +693,7 @@ IGbE::postInterrupt(IntTypes t, bool now)
 
     regs.icr = regs.icr() | t;
 
-    Tick itr_interval = Clock::Int::ns * 256 * regs.itr.interval();
+    Tick itr_interval = SimClock::Int::ns * 256 * regs.itr.interval();
     DPRINTF(EthernetIntr,
             "EINT: postInterrupt() curTick: %d itr: %d interval: %d\n",
             curTick, regs.itr.interval(), itr_interval);
@@ -801,7 +801,7 @@ IGbE::chkInterrupt()
             DPRINTF(Ethernet,
                     "Possibly scheduling interrupt because of imr write\n");
             if (!interEvent.scheduled()) {
-                Tick t = curTick + Clock::Int::ns * 256 * regs.itr.interval();
+                Tick t = curTick + SimClock::Int::ns * 256 * regs.itr.interval();
                 DPRINTF(Ethernet, "Scheduling for %d\n", t);
                 schedule(interEvent, t);
             }
index f7f7d9a2adaa03acb9bc7e5eda60912bb0bbd53f..738b1cf439cd37c018f1ec2f4cfe091aa6576f2d 100644 (file)
@@ -171,7 +171,7 @@ class IGbE : public EtherDevice
      */
     void cpuClearInt();
 
-    Tick intClock() { return Clock::Int::ns * 1024; }
+    Tick intClock() { return SimClock::Int::ns * 1024; }
 
     /** This function is used to restart the clock so it can handle things like
      * draining and resume in one place. */
index 770df1c76dd547613c43d2e56240e4112d2f594a..9e507b9681a6a4c5b619ed8a9026a624350167d5 100644 (file)
@@ -255,7 +255,7 @@ Intel8254Timer::Counter::unserialize(const string &base, Checkpoint *cp,
 
 Intel8254Timer::Counter::CounterEvent::CounterEvent(Counter* c_ptr)
 {
-    interval = (Tick)(Clock::Float::s / 1193180.0);
+    interval = (Tick)(SimClock::Float::s / 1193180.0);
     counter = c_ptr;
 }
 
index 2e6ed2a4b9b85d59af947c22657ddf36198c54ea..16ed58e463bb635bf8bf790be4856eb9e0033e83 100644 (file)
@@ -271,7 +271,7 @@ void
 MC146818::RTCTickEvent::process()
 {
     DPRINTF(MC146818, "RTC clock tick\n");
-    parent->schedule(this, curTick + Clock::Int::s);
+    parent->schedule(this, curTick + SimClock::Int::s);
     parent->tickClock();
 }
 
index e3365890383240223f24ec039b3c9ddf687adc00..699785199a3ad9618875d3fce1fbe0ee0e85fc3a 100644 (file)
@@ -71,7 +71,7 @@ class MC146818 : public EventManager
 
         RTCTickEvent(MC146818 * _parent) : parent(_parent)
         {
-            parent->schedule(this, curTick + Clock::Int::s);
+            parent->schedule(this, curTick + SimClock::Int::s);
         }
 
         /** Event process to occur at interrupt*/
index 5a738a9b45d2f99f86c6e78f5283a55f471f03b2..a7c68a3bcb7c322b5aabb1dd4298ac9fbc6d737c 100755 (executable)
@@ -80,7 +80,7 @@ MaltaIO::MaltaIO(const Params *p)
 Tick
 MaltaIO::frequency() const
 {
-    return Clock::Frequency / params()->frequency;
+    return SimClock::Frequency / params()->frequency;
 }
 
 Tick
index f131ab69f966b6bad90782480d5e68b0f58c2ca4..2bbcf2683bb8093e0a0c5457110ed4a3e33a9dbc 100644 (file)
@@ -90,7 +90,7 @@ Uart8250::IntrEvent::process()
 void
 Uart8250::IntrEvent::scheduleIntr()
 {
-    static const Tick interval = 225 * Clock::Int::ns;
+    static const Tick interval = 225 * SimClock::Int::ns;
     DPRINTF(Uart, "Scheduling IER interrupt for %#x, at cycle %lld\n", intrBit,
             curTick + interval);
     if (!scheduled())
@@ -217,7 +217,7 @@ Uart8250::write(PacketPtr pkt)
                 if (UART_IER_THRI & IER)
                 {
                     DPRINTF(Uart, "IER: IER_THRI set, scheduling TX intrrupt\n");
-                    if (curTick - lastTxInt > 225 * Clock::Int::ns) {
+                    if (curTick - lastTxInt > 225 * SimClock::Int::ns) {
                         DPRINTF(Uart, "-- Interrupting Immediately... %d,%d\n",
                                 curTick, lastTxInt);
                         txIntrEvent.process();
index f937eeb32bdaf230f2cd96a26a164946342ee4f3..e981a74455bde7b57b772dc667b883c130e0a32d 100644 (file)
@@ -108,7 +108,7 @@ void
 SimpleTimingPort::schedSendTiming(PacketPtr pkt, Tick when)
 {
     assert(when > curTick);
-    assert(when < curTick + Clock::Int::ms);
+    assert(when < curTick + SimClock::Int::ms);
 
     // Nothing is on the list: add it and schedule an event
     if (transmitList.empty() || when < transmitList.front().tick) {
index 8342b674003d7cb407c11a149760cb083ce277e1..32642c8a4c801f3145fe5d611287b0c2e5deb0de 100644 (file)
@@ -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;
index c1a363689e7ffc5b14062887953f8af41cb7dbde..8be1dd259fa368b982c3002e0993cee36d8e600a 100644 (file)
@@ -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);
 
index cf063818b8ee77a49b9b477acb26eb3a2380627b..7a91bfbd4d2e459f52c81f6934ed58450c157254 100644 (file)
@@ -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);
index 2dcf4798d95e60f866abfc10d10726bf7b7fa34d..e8c2d581420ede8bf691db981411cf073615a950 100644 (file)
@@ -106,7 +106,7 @@ Global::Global()
         ;
 
     simFreq
-        .scalar(Clock::Frequency)
+        .scalar(SimClock::Frequency)
         .name("sim_freq")
         .desc("Frequency of simulated ticks")
         ;
index 66e8001836766ba2f942e6fedff6c3127517558c..6016ccfd93e5352940af603aa7ef3576cfc71bef 100644 (file)
@@ -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;