Replace curTick global variable with accessor functions.
authorSteve Reinhardt <steve.reinhardt@amd.com>
Sat, 8 Jan 2011 05:50:29 +0000 (21:50 -0800)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Sat, 8 Jan 2011 05:50:29 +0000 (21:50 -0800)
This step makes it easy to replace the accessor functions
(which still access a global variable) with ones that access
per-thread curTick values.

129 files changed:
src/arch/alpha/isa/decoder.isa
src/arch/alpha/kernel_stats.cc
src/arch/alpha/tru64/process.cc
src/arch/arm/table_walker.cc
src/arch/mips/isa.cc
src/arch/mips/isa/formats/mt.isa
src/arch/mips/locked_mem.hh
src/arch/mips/mt.hh
src/arch/sparc/ua2005.cc
src/arch/x86/interrupts.cc
src/base/cp_annotate.cc
src/base/cp_annotate.hh
src/base/fast_alloc.cc
src/base/misc.cc
src/base/remote_gdb.cc
src/base/statistics.hh
src/base/stats/mysql.cc
src/base/stats/output.cc
src/base/trace.hh
src/cpu/base.cc
src/cpu/base.hh
src/cpu/checker/cpu.cc
src/cpu/checker/cpu_impl.hh
src/cpu/inorder/cpu.cc
src/cpu/inorder/cpu.hh
src/cpu/inorder/inorder_dyn_inst.cc
src/cpu/inorder/pipeline_stage.cc
src/cpu/inorder/reg_dep_map.cc
src/cpu/inorder/resource.cc
src/cpu/inorder/resource_pool.9stage.cc
src/cpu/inorder/resource_pool.cc
src/cpu/inorder/resources/branch_predictor.cc
src/cpu/inorder/resources/cache_unit.cc
src/cpu/inorder/resources/execution_unit.cc
src/cpu/inorder/resources/fetch_seq_unit.cc
src/cpu/inorder/resources/graduation_unit.cc
src/cpu/inorder/resources/mult_div_unit.cc
src/cpu/o3/commit_impl.hh
src/cpu/o3/cpu.cc
src/cpu/o3/cpu.hh
src/cpu/o3/fetch_impl.hh
src/cpu/o3/inst_queue_impl.hh
src/cpu/o3/lsq_impl.hh
src/cpu/o3/lsq_unit.hh
src/cpu/o3/lsq_unit_impl.hh
src/cpu/o3/thread_context_impl.hh
src/cpu/ozone/back_end.hh
src/cpu/ozone/cpu.hh
src/cpu/ozone/cpu_impl.hh
src/cpu/ozone/front_end_impl.hh
src/cpu/ozone/inorder_back_end.hh
src/cpu/ozone/inst_queue_impl.hh
src/cpu/ozone/lsq_unit.hh
src/cpu/ozone/lsq_unit_impl.hh
src/cpu/ozone/lw_back_end_impl.hh
src/cpu/ozone/lw_lsq.hh
src/cpu/ozone/lw_lsq_impl.hh
src/cpu/pc_event.cc
src/cpu/simple/atomic.cc
src/cpu/simple/base.cc
src/cpu/simple/timing.cc
src/cpu/simple_thread.cc
src/cpu/static_inst.cc
src/cpu/testers/directedtest/RubyDirectedTester.cc
src/cpu/testers/memtest/memtest.cc
src/cpu/testers/rubytest/Check.cc
src/cpu/testers/rubytest/RubyTester.cc
src/cpu/trace/trace_cpu.cc
src/dev/alpha/backdoor.cc
src/dev/arm/pl011.cc
src/dev/arm/pl111.cc
src/dev/arm/rv_ctrl.cc
src/dev/arm/timer_sp804.cc
src/dev/etherbus.cc
src/dev/etherdump.cc
src/dev/etherlink.cc
src/dev/ethertap.cc
src/dev/i8254xGBe.cc
src/dev/ide_disk.cc
src/dev/intel_8254_timer.cc
src/dev/io_device.cc
src/dev/mc146818.cc
src/dev/mc146818.hh
src/dev/ns_gige.cc
src/dev/sinic.cc
src/dev/uart8250.cc
src/kern/kernel_stats.cc
src/mem/bridge.cc
src/mem/bus.cc
src/mem/cache/base.cc
src/mem/cache/base.hh
src/mem/cache/blk.hh
src/mem/cache/cache_impl.hh
src/mem/cache/mshr.cc
src/mem/cache/mshr.hh
src/mem/cache/mshr_queue.hh
src/mem/cache/tags/fa_lru.cc
src/mem/cache/tags/iic.cc
src/mem/cache/tags/lru.cc
src/mem/dram.cc
src/mem/mport.cc
src/mem/packet.hh
src/mem/request.hh
src/mem/ruby/eventqueue/RubyEventQueue.hh
src/mem/ruby/system/RubyPort.cc
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/system/System.cc
src/mem/tport.cc
src/mem/tport.hh
src/python/m5/simulate.py
src/python/swig/core.i
src/python/swig/stats.i
src/sim/core.cc
src/sim/core.hh
src/sim/eventq.cc
src/sim/eventq.hh
src/sim/init.cc
src/sim/pseudo_inst.cc
src/sim/serialize.cc
src/sim/serialize.hh
src/sim/sim_events.cc
src/sim/sim_exit.hh
src/sim/sim_object.hh
src/sim/simulate.cc
src/sim/stat_control.cc
src/sim/stat_control.hh
src/sim/syscall_emul.cc
src/sim/syscall_emul.hh
src/unittest/stattest.cc

index d829ad7444dec5252d45c373c477bb2a73a11666..f0aa5a3fd7938b1135ccddd689e9fb64601acc0f 100644 (file)
@@ -791,7 +791,7 @@ decode OPCODE default Unknown::unknown() {
                 Ra = xc->readMiscReg(IPR_CC) + (Rb & 0);
 
 #else
-                Ra = curTick;
+                Ra = curTick();
 #endif
             }}, IsUnverifiable);
 
index 6e9dc1611ca3b5f3721b9ccc48cbbec8ddb0b5e0..70eeadd8e90114d8b6d72bbc3f588120602b5eca 100644 (file)
@@ -143,9 +143,9 @@ Statistics::changeMode(cpu_mode newmode, ThreadContext *tc)
             Linux::ThreadInfo(tc).curTaskPID());
 
     _modeGood[newmode]++;
-    _modeTicks[themode] += curTick - lastModeTick;
+    _modeTicks[themode] += curTick() - lastModeTick;
 
-    lastModeTick = curTick;
+    lastModeTick = curTick();
     themode = newmode;
 }
 
index 9aae7e15563dc9e6b17c3f79a8870460bf3c724a..b10fea02b630a60958cbb38a107e4aaa4a1e0c14 100644 (file)
@@ -184,7 +184,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 / (SimClock::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 88f2a455f7fbc7213dfade32e792a0fa19faf136..6b2113639a9c1f8c8b2a12a9d837a7bdfc6abc02 100644 (file)
@@ -713,7 +713,7 @@ void
 TableWalker::nextWalk(ThreadContext *tc)
 {
     if (pendingQueue.size())
-        schedule(doProcessEvent, tc->getCpuPtr()->nextCycle(curTick+1));
+        schedule(doProcessEvent, tc->getCpuPtr()->nextCycle(curTick()+1));
 }
 
 
index 1cad7e4bebafb53c555345c39b518e1b90bcfd97..5cd65cfac1aa0e8796defa373c081b937513d53c 100644 (file)
@@ -528,7 +528,7 @@ ISA::scheduleCP0Update(BaseCPU *cpu, int delay)
 
         //schedule UPDATE
         CP0Event *cp0_event = new CP0Event(this, cpu, UpdateCP0);
-        cpu->schedule(cp0_event, curTick + cpu->ticks(delay));
+        cpu->schedule(cp0_event, curTick() + cpu->ticks(delay));
     }
 }
 
@@ -585,7 +585,7 @@ ISA::CP0Event::description() const
 void
 ISA::CP0Event::scheduleEvent(int delay)
 {
-    cpu->reschedule(this, curTick + cpu->ticks(delay), true);
+    cpu->reschedule(this, curTick() + cpu->ticks(delay), true);
 }
 
 void
index 9d354c46a7d7fccfdc7c969bd9df45aa219e2d82..1944d69d3c2fc0239a5441c6c6ffb3f4891cce7b 100644 (file)
@@ -201,7 +201,7 @@ def format MT_Control(code, *opt_flags) {{
 
 def format MT_MFTR(code, *flags) {{
         flags += ('IsNonSpeculative', )
-#        code = 'std::cerr << curTick << \": T\" << xc->tcBase()->threadId() << \": Executing MT INST: ' + name + '\" << endl;\n' + code
+#        code = 'std::cerr << curTick() << \": T\" << xc->tcBase()->threadId() << \": Executing MT INST: ' + name + '\" << endl;\n' + code
 
         code += 'if (MT_H == 1) {\n'
         code += 'data = bits(data, top_bit, bottom_bit);\n'
@@ -217,7 +217,7 @@ def format MT_MFTR(code, *flags) {{
 
 def format MT_MTTR(code, *flags) {{
         flags += ('IsNonSpeculative', )
-#        code = 'std::cerr << curTick << \": T\" << xc->tcBase()->threadId() << \": Executing MT INST: ' + name + '\" << endl;\n' + code
+#        code = 'std::cerr << curTick() << \": T\" << xc->tcBase()->threadId() << \": Executing MT INST: ' + name + '\" << endl;\n' + code
         iop = InstObjParams(name, Name, 'MTOp', code, flags)
         header_output = BasicDeclare.subst(iop)
         decoder_output = BasicConstructor.subst(iop)
index ddda47a0afff5f07fafca5968f011904f9b0bad5..1cc08ee3dc2059917558c72103d2110a392253ef 100644 (file)
@@ -85,7 +85,7 @@ handleLockedWrite(XC *xc, Request *req)
             if (stCondFailures % 100000 == 0) {
                 warn("%i: context %d: %d consecutive "
                      "store conditional failures\n",
-                     curTick, xc->contextId(), stCondFailures);
+                     curTick(), xc->contextId(), stCondFailures);
             }
 
             if (!lock_flag){
index 3ec6cbe7056f66c396618b4c766af3e171cab126..c63c65a7391b63b177d812cc24b674a453ebacb4 100755 (executable)
@@ -81,7 +81,7 @@ haltThread(TC *tc)
         tc->setMiscReg(MISCREG_TC_RESTART, pc.npc());
 
         warn("%i: Halting thread %i in %s @ PC %x, setting restart PC to %x",
-                curTick, tc->threadId(), tc->getCpuPtr()->name(),
+                curTick(), tc->threadId(), tc->getCpuPtr()->name(),
                 pc.pc(), pc.npc());
     }
 }
@@ -99,7 +99,7 @@ restoreThread(TC *tc)
         tc->activate(0);
 
         warn("%i: Restoring thread %i in %s @ PC %x",
-                curTick, tc->threadId(), tc->getCpuPtr()->name(), restartPC);
+                curTick(), tc->threadId(), tc->getCpuPtr()->name(), restartPC);
     }
 }
 
@@ -208,7 +208,7 @@ yieldThread(TC *tc, Fault &fault, int src_reg, uint32_t yield_mask)
             tcStatus.a = 0;
             tc->setMiscReg(MISCREG_TC_STATUS, tcStatus);
             warn("%i: Deactivating Hardware Thread Context #%i",
-                    curTick, tc->threadId());
+                    curTick(), tc->threadId());
         }
     } else if (src_reg > 0) {
         if (src_reg && !yield_mask != 0) {
index bd6497b25e60659b2283ce9a2b9ada61c85c0f51..efab8b832acc54cfbcb3cf6eda8a269e8387569e 100644 (file)
@@ -111,7 +111,7 @@ ISA::setFSReg(int miscReg, const MiscReg &val, ThreadContext *tc)
         if (!(tick_cmpr & ~mask(63)) && time > 0) {
             if (tickCompare->scheduled())
                 cpu->deschedule(tickCompare);
-            cpu->schedule(tickCompare, curTick + time * cpu->ticks(1));
+            cpu->schedule(tickCompare, curTick() + time * cpu->ticks(1));
         }
         panic("writing to TICK compare register %#X\n", val);
         break;
@@ -127,7 +127,7 @@ ISA::setFSReg(int miscReg, const MiscReg &val, ThreadContext *tc)
         if (!(stick_cmpr & ~mask(63)) && time > 0) {
             if (sTickCompare->scheduled())
                 cpu->deschedule(sTickCompare);
-            cpu->schedule(sTickCompare, curTick + time * cpu->ticks(1));
+            cpu->schedule(sTickCompare, curTick() + time * cpu->ticks(1));
         }
         DPRINTF(Timer, "writing to sTICK compare register value %#X\n", val);
         break;
@@ -197,7 +197,7 @@ ISA::setFSReg(int miscReg, const MiscReg &val, ThreadContext *tc)
         if (!(hstick_cmpr & ~mask(63)) && time > 0) {
             if (hSTickCompare->scheduled())
                 cpu->deschedule(hSTickCompare);
-            cpu->schedule(hSTickCompare, curTick + time * cpu->ticks(1));
+            cpu->schedule(hSTickCompare, curTick() + time * cpu->ticks(1));
         }
         DPRINTF(Timer, "writing to hsTICK compare register value %#X\n", val);
         break;
@@ -335,7 +335,7 @@ ISA::processSTickCompare(ThreadContext *tc)
             setMiscReg(MISCREG_SOFTINT, softint | (ULL(1) << 16), tc);
         }
     } else {
-        cpu->schedule(sTickCompare, curTick + ticks * cpu->ticks(1));
+        cpu->schedule(sTickCompare, curTick() + ticks * cpu->ticks(1));
     }
 }
 
@@ -363,7 +363,7 @@ ISA::processHSTickCompare(ThreadContext *tc)
         }
         // Need to do something to cause interrupt to happen here !!! @todo
     } else {
-        cpu->schedule(hSTickCompare, curTick + ticks * cpu->ticks(1));
+        cpu->schedule(hSTickCompare, curTick() + ticks * cpu->ticks(1));
     }
 }
 
index cc1d442feabb435a5f734087511dd09ed0ff0272..951392a158d43c192315c93d1e67c392a6432156 100644 (file)
@@ -394,7 +394,7 @@ X86ISA::Interrupts::readReg(ApicRegIndex reg)
                 uint64_t ticksPerCount = clock *
                     divideFromConf(regs[APIC_DIVIDE_CONFIGURATION]);
                 // Compute how many m5 ticks are left.
-                uint64_t val = apicTimerEvent.when() - curTick;
+                uint64_t val = apicTimerEvent.when() - curTick();
                 // Turn that into a count.
                 val = (val + ticksPerCount - 1) / ticksPerCount;
                 return val;
@@ -572,13 +572,13 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val)
             uint64_t newCount = newVal *
                 (divideFromConf(regs[APIC_DIVIDE_CONFIGURATION]));
             // Schedule on the edge of the next tick plus the new count.
-            Tick offset = curTick % clock;
+            Tick offset = curTick() % clock;
             if (offset) {
                 reschedule(apicTimerEvent,
-                        curTick + (newCount + 1) * clock - offset, true);
+                        curTick() + (newCount + 1) * clock - offset, true);
             } else {
                 reschedule(apicTimerEvent,
-                        curTick + newCount * clock, true);
+                        curTick() + newCount * clock, true);
             }
         }
         break;
index 4e138a6dd9f8d2dc82c4b1e626ab22be3d296978..69b926b29921cdb8aaac09962dead62403eeec8f 100644 (file)
@@ -161,7 +161,7 @@ CPA::swSmBegin(ThreadContext *tc)
     StringWrap name(sys->name());
 
     if (!sm[0])
-        warn("Got null SM at tick %d\n", curTick);
+        warn("Got null SM at tick %d\n", curTick());
 
     int sysi = getSys(sys);
     int smi = getSm(sysi, sm, args[1]);
@@ -273,7 +273,7 @@ CPA::doSwSmEnd(System *sys, int cpuid, string sm, uint64_t frame)
         DPRINTF(Annotate, "Ending machine: %s; end stack: %s\n", sm,
                 smMap[smib-1].second.first);
 
-        warn("State machine stack not unwinding correctly at %d\n", curTick);
+        warn("State machine stack not unwinding correctly at %d\n", curTick());
     } else {
         DPRINTF(Annotate, 
                 "State machine ending:%s sysi:%d id:%#x back:%d getSm:%d\n",
@@ -316,7 +316,7 @@ CPA::swExplictBegin(ThreadContext *tc)
     DPRINTF(Annotate, "Explict begin of state %s\n", st);
     uint32_t flags = args[0];
     if (flags & FL_BAD)
-        warn("BAD state encountered: at cycle %d: %s\n", curTick, st);
+        warn("BAD state encountered: at cycle %d: %s\n", curTick(), st);
     swBegin(tc->getSystemPtr(), tc->contextId(), st, getFrame(tc), true, args[0]);
 }
 
@@ -688,10 +688,10 @@ CPA::swAq(ThreadContext *tc)
 
         warn("%d: Queue Assert: SW said there should be %d byte(s) in %s," 
                 "however there are %d byte(s)\n",
-            curTick, size, q, qBytes[qi-1]);
+            curTick(), size, q, qBytes[qi-1]);
         DPRINTF(AnnotateQ, "%d: Queue Assert: SW said there should be %d"
                 " byte(s) in %s, however there are %d byte(s)\n",
-            curTick, size, q, qBytes[qi-1]);
+            curTick(), size, q, qBytes[qi-1]);
     }
 }
 
@@ -813,7 +813,7 @@ CPA::AnnDataPtr
 CPA::add(int t, int f, int c, int sm, int stq, int32_t d)
 {
     AnnDataPtr an = new AnnotateData;
-    an->time = curTick;
+    an->time = curTick();
     an->data = d;
     an->orig_data = d;
     an->op = t;
index 8ce9995a8574539b028c0509b33e3f7d30a95c0f..fb955a38000e3f5a2ae59bb0e426fa009bd04cc9 100644 (file)
@@ -408,7 +408,7 @@ class CPA : SimObject
         int smi = getSm(sysi, sm, frame);
         add(OP_BEGIN, FL_HW | f, 0, smi, getSt(sm, st));
         if (f & FL_BAD)
-            warn("BAD state encountered: at cycle %d: %s\n", curTick, st);
+            warn("BAD state encountered: at cycle %d: %s\n", curTick(), st);
     }
 
     inline void hwQ(flags f, System *sys, uint64_t frame, std::string sm, 
index 0238f03cbc7eef9a0f4cdbb4a4a13432699dec94..649f94be39d457ac7e908544d0f5da3cab1e4052 100644 (file)
@@ -80,7 +80,7 @@ FastAlloc::moreStructs(int bucket)
 #include <typeinfo>
 
 #include "base/cprintf.hh"
-#include "sim/core.hh"   // for curTick
+#include "sim/core.hh"   // for curTick()
 
 using namespace std;
 
@@ -104,7 +104,7 @@ FastAlloc::FastAlloc()
 {
     // mark this object in use
     inUse = true;
-    whenAllocated = curTick;
+    whenAllocated = curTick();
 
     // update count
     ++numInUse;
index 65cb133568b521ceedd80c50869f5297d1790ae0..94336c647ab03a05f71aed6f4a4aa42cb57f3bda 100644 (file)
@@ -76,7 +76,7 @@ __exit_message(const char *prefix, int code,
     format += "Memory Usage: %ld KBytes\n";
     format += "For more information see: http://www.m5sim.org/%s/%x\n";
 
-    args.push_back(curTick);
+    args.push_back(curTick());
     args.push_back(func);
     args.push_back(file);
     args.push_back(line);
@@ -114,7 +114,7 @@ __base_message(std::ostream &stream, const char *prefix, bool verbose,
 
     if (verbose) {
         format += " @ cycle %d\n[%s:%s, line %d]\n";
-        args.push_back(curTick);
+        args.push_back(curTick());
         args.push_back(func);
         args.push_back(file);
         args.push_back(line);
index b7c34859b02e6d4b3e57d7e25d453b96f5190a72..abc5f4ec01e9108dd3b8f6960ad200368b7006ee 100644 (file)
@@ -217,10 +217,10 @@ GDBListener::listen()
 
 #ifndef NDEBUG
     ccprintf(cerr, "%d: %s: listening for remote gdb #%d on port %d\n",
-             curTick, name(), gdb->number, port);
+             curTick(), name(), gdb->number, port);
 #else
     ccprintf(cerr, "%d: %s: listening for remote gdb on port %d\n",
-             curTick, name(), port);
+             curTick(), name(), port);
 #endif
 }
 
index 3bb74282a71ff30e9ee752c25b3893b22f1743f2..9c10164a9c228b32247556661202e349c95812b1 100644 (file)
@@ -72,7 +72,7 @@
 class Callback;
 
 /** The current simulated tick. */
-extern Tick curTick;
+extern Tick curTick();
 
 /* A namespace for all of the Statistics */
 namespace Stats {
@@ -530,8 +530,8 @@ class AvgStor
     void
     set(Counter val)
     {
-        total += current * (curTick - last);
-        last = curTick;
+        total += current * (curTick() - last);
+        last = curTick();
         current = val;
     }
 
@@ -560,8 +560,8 @@ class AvgStor
     Result
     result() const
     {
-        assert(last == curTick);
-        return (Result)(total + current) / (Result)(curTick - lastReset + 1);
+        assert(last == curTick());
+        return (Result)(total + current) / (Result)(curTick() - lastReset + 1);
     }
 
     /**
@@ -575,8 +575,8 @@ class AvgStor
     void
     prepare(Info *info)
     {
-        total += current * (curTick - last);
-        last = curTick;
+        total += current * (curTick() - last);
+        last = curTick();
     }
 
     /**
@@ -586,8 +586,8 @@ class AvgStor
     reset(Info *info)
     {
         total = 0.0;
-        last = curTick;
-        lastReset = curTick;
+        last = curTick();
+        lastReset = curTick();
     }
 
 };
@@ -1576,7 +1576,7 @@ class AvgSampleStor
         data.type = params->type;
         data.sum = sum;
         data.squares = squares;
-        data.samples = curTick;
+        data.samples = curTick();
     }
 
     /**
index d947122da18fc07c267742ce6e7c253c46339fa3..d257de7434aba62a13584824a67016ac2d1d274b 100644 (file)
@@ -613,7 +613,7 @@ MySql::output()
         configure();
 
     // store sample #
-    newdata.tick = curTick;
+    newdata.tick = curTick();
 
     MySQL::Connection &mysql = run->conn();
 
index 9d110e4eee9254822055c31d6e313de6770f70c9..d3cb9da614744fc212b71e6ef9bee0d0067e35c9 100644 (file)
@@ -45,10 +45,10 @@ list<Output *> OutputList;
 void
 dump()
 {
-    assert(lastDump <= curTick);
-    if (lastDump == curTick)
+    assert(lastDump <= curTick());
+    if (lastDump == curTick())
         return;
-    lastDump = curTick;
+    lastDump = curTick();
 
     prepare();
 
index f793abff9597af5ef425fddf1131d929e0fa3228..a03a34018467f407f3ddff8df0d71890a3cb9288 100644 (file)
@@ -89,17 +89,17 @@ inline const std::string &name() { return Trace::DefaultName; }
 
 #define DDUMP(x, data, count) do {                              \
     if (DTRACE(x))                                              \
-        Trace::dump(curTick, name(), data, count);              \
+        Trace::dump(curTick(), name(), data, count);              \
 } while (0)
 
 #define DPRINTF(x, ...) do {                                    \
     if (DTRACE(x))                                              \
-        Trace::dprintf(curTick, name(), __VA_ARGS__);           \
+        Trace::dprintf(curTick(), name(), __VA_ARGS__);           \
 } while (0)
 
 #define DPRINTFS(x,s, ...) do {                                    \
     if (DTRACE(x))                                              \
-        Trace::dprintf(curTick, s->name(), __VA_ARGS__);           \
+        Trace::dprintf(curTick(), s->name(), __VA_ARGS__);           \
 } while (0)
 
 
@@ -109,11 +109,11 @@ inline const std::string &name() { return Trace::DefaultName; }
 } while (0)
 
 #define DDUMPN(data, count) do {                                \
-    Trace::dump(curTick, name(), data, count);                  \
+    Trace::dump(curTick(), name(), data, count);                  \
 } while (0)
 
 #define DPRINTFN(...) do {                                      \
-    Trace::dprintf(curTick, name(), __VA_ARGS__);               \
+    Trace::dprintf(curTick(), name(), __VA_ARGS__);               \
 } while (0)
 
 #define DPRINTFNR(...) do {                                     \
index e0d29577d1755769a75aa9602ea9f0485d204736..1816568ce523a899d18d788d6335f51a7e076821 100644 (file)
@@ -66,7 +66,7 @@ CPUProgressEvent::CPUProgressEvent(BaseCPU *_cpu, Tick ival)
       cpu(_cpu), _repeatEvent(true)
 {
     if (_interval)
-        cpu->schedule(this, curTick + _interval);
+        cpu->schedule(this, curTick() + _interval);
 }
 
 void
@@ -82,13 +82,13 @@ CPUProgressEvent::process()
     ipc = 0.0;
 #else
     cprintf("%lli: %s progress event, total committed:%i, progress insts "
-            "committed: %lli\n", curTick, cpu->name(), temp,
+            "committed: %lli\n", curTick(), cpu->name(), temp,
             temp - lastNumInst);
 #endif
     lastNumInst = temp;
 
     if (_repeatEvent)
-        cpu->schedule(this, curTick + _interval);
+        cpu->schedule(this, curTick() + _interval);
 }
 
 const char *
@@ -110,7 +110,7 @@ BaseCPU::BaseCPU(Params *p)
       phase(p->phase)
 #endif
 {
-//    currentTick = curTick;
+//    currentTick = curTick();
 
     // if Python did not provide a valid ID, do it here
     if (_cpuId == -1 ) {
@@ -231,7 +231,7 @@ BaseCPU::startup()
 {
 #if FULL_SYSTEM
     if (!params()->defer_registration && profileEvent)
-        schedule(profileEvent, curTick);
+        schedule(profileEvent, curTick());
 #endif
 
     if (params()->progress_interval) {
@@ -270,7 +270,7 @@ BaseCPU::regStats()
 Tick
 BaseCPU::nextCycle()
 {
-    Tick next_tick = curTick - phase + clock - 1;
+    Tick next_tick = curTick() - phase + clock - 1;
     next_tick -= (next_tick % clock);
     next_tick += phase;
     return next_tick;
@@ -284,7 +284,7 @@ BaseCPU::nextCycle(Tick begin_tick)
         next_tick = next_tick - (next_tick % clock) + clock;
     next_tick += phase;
 
-    assert(next_tick >= curTick);
+    assert(next_tick >= curTick());
     return next_tick;
 }
 
@@ -390,7 +390,7 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU, Port *ic, Port *dc)
         threadContexts[i]->profileClear();
 
     if (profileEvent)
-        schedule(profileEvent, curTick);
+        schedule(profileEvent, curTick());
 #endif
 
     // Connect new CPU to old CPU's memory only if new CPU isn't
@@ -424,7 +424,7 @@ BaseCPU::ProfileEvent::process()
         tc->profileSample();
     }
 
-    cpu->schedule(this, curTick + interval);
+    cpu->schedule(this, curTick() + interval);
 }
 
 void
@@ -465,7 +465,7 @@ BaseCPU::traceFunctionsInternal(Addr pc)
         }
 
         ccprintf(*functionTraceStream, " (%d)\n%d: %s",
-                 curTick - functionEntryTick, curTick, sym_str);
-        functionEntryTick = curTick;
+                 curTick() - functionEntryTick, curTick(), sym_str);
+        functionEntryTick = curTick();
     }
 }
index 5b03d904f88d55403cd1899985d8da7f4fcf6411..e0491a84aae198d13d5260f02c835b58662506f3 100644 (file)
@@ -100,20 +100,20 @@ class BaseCPU : public MemObject
 //    Tick currentTick;
     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 curCycle() const { return curTick() / clock; }
     inline Tick tickToCycles(Tick val) const { return val / clock; }
     // @todo remove me after debugging with legion done
     Tick instCount() { return instCnt; }
 
     /** The next cycle the CPU should be scheduled, given a cache
      * access or quiesce event returning on this cycle.  This function
-     * may return curTick if the CPU should run on the current cycle.
+     * may return curTick() if the CPU should run on the current cycle.
      */
     Tick nextCycle();
 
     /** The next cycle the CPU should be scheduled, given a cache
      * access or quiesce event returning on the given Tick.  This
-     * function may return curTick if the CPU should run on the
+     * function may return curTick() if the CPU should run on the
      * current cycle.
      * @param begin_tick The tick that the event is completing on.
      */
index 10dd77899e82425679625c999bc129efe4944066..0790577656623c287d14d7a7f6dc96e59beed6d5 100644 (file)
@@ -245,7 +245,7 @@ CheckerCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
         if (data != inst_data) {
             warn("%lli: Store value does not match value in memory! "
                  "Instruction: %#x, memory: %#x",
-                 curTick, inst_data, data);
+                 curTick(), inst_data, data);
             handleError();
         }
     }
@@ -327,6 +327,6 @@ void
 CheckerCPU::dumpAndExit()
 {
     warn("%lli: Checker PC:%#x, next PC:%#x",
-         curTick, thread->readPC(), thread->readNextPC());
+         curTick(), thread->readPC(), thread->readNextPC());
     panic("Checker found an error!");
 }
index 10a9d117764725b11c30c5faf1d9593ff3202e31..8197d560d4230732076208b8cdfb842ca24a9d00 100644 (file)
@@ -126,7 +126,7 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
                 } else {
                     warn("%lli: Changed PC does not match expected PC, "
                          "changed: %#x, expected: %#x",
-                         curTick, thread->readPC(), newPC);
+                         curTick(), thread->readPC(), newPC);
                     CheckerCPU::handleError();
                 }
                 willChangePC = false;
@@ -166,7 +166,7 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
                 // translate this instruction; in the SMT case it's
                 // possible that its ITB entry was kicked out.
                 warn("%lli: Instruction PC %#x was not found in the ITB!",
-                     curTick, thread->readPC());
+                     curTick(), thread->readPC());
                 handleError(inst);
 
                 // go to the next instruction
@@ -315,10 +315,10 @@ Checker<DynInstPtr>::validateInst(DynInstPtr &inst)
 {
     if (inst->readPC() != thread->readPC()) {
         warn("%lli: PCs do not match! Inst: %#x, checker: %#x",
-             curTick, inst->readPC(), thread->readPC());
+             curTick(), inst->readPC(), thread->readPC());
         if (changedPC) {
             warn("%lli: Changed PCs recently, may not be an error",
-                 curTick);
+                 curTick());
         } else {
             handleError(inst);
         }
@@ -329,7 +329,7 @@ Checker<DynInstPtr>::validateInst(DynInstPtr &inst)
     if (mi != machInst) {
         warn("%lli: Binary instructions do not match! Inst: %#x, "
              "checker: %#x",
-             curTick, mi, machInst);
+             curTick(), mi, machInst);
         handleError(inst);
     }
 }
@@ -354,7 +354,7 @@ Checker<DynInstPtr>::validateExecution(DynInstPtr &inst)
     if (result_mismatch) {
         warn("%lli: Instruction results do not match! (Values may not "
              "actually be integers) Inst: %#x, checker: %#x",
-             curTick, inst->readIntResult(), result.integer);
+             curTick(), inst->readIntResult(), result.integer);
 
         // It's useful to verify load values from memory, but in MP
         // systems the value obtained at execute may be different than
@@ -371,7 +371,7 @@ Checker<DynInstPtr>::validateExecution(DynInstPtr &inst)
     if (inst->readNextPC() != thread->readNextPC()) {
         warn("%lli: Instruction next PCs do not match! Inst: %#x, "
              "checker: %#x",
-             curTick, inst->readNextPC(), thread->readNextPC());
+             curTick(), inst->readNextPC(), thread->readNextPC());
         handleError(inst);
     }
 
@@ -388,7 +388,7 @@ Checker<DynInstPtr>::validateExecution(DynInstPtr &inst)
             thread->readMiscRegNoEffect(misc_reg_idx)) {
             warn("%lli: Misc reg idx %i (side effect) does not match! "
                  "Inst: %#x, checker: %#x",
-                 curTick, misc_reg_idx,
+                 curTick(), misc_reg_idx,
                  inst->tcBase()->readMiscRegNoEffect(misc_reg_idx),
                  thread->readMiscRegNoEffect(misc_reg_idx));
             handleError(inst);
@@ -402,7 +402,7 @@ Checker<DynInstPtr>::validateState()
 {
     if (updateThisCycle) {
         warn("%lli: Instruction PC %#x results didn't match up, copying all "
-             "registers from main CPU", curTick, unverifiedInst->readPC());
+             "registers from main CPU", curTick(), unverifiedInst->readPC());
         // Heavy-weight copying of all registers
         thread->copyArchRegs(unverifiedInst->tcBase());
         // Also advance the PC.  Hopefully no PC-based events happened.
index 5b5f524f2fc677a4389182b0d203e3d60634a0a3..fe2c8e708ecdc0f8d0854d297ea19f07e7132dee 100644 (file)
@@ -158,7 +158,7 @@ void
 InOrderCPU::CPUEvent::scheduleEvent(int delay)
 {
     assert(!scheduled() || squashed());
-    cpu->reschedule(this, cpu->nextCycle(curTick + cpu->ticks(delay)), true);
+    cpu->reschedule(this, cpu->nextCycle(curTick() + cpu->ticks(delay)), true);
 }
 
 void
@@ -337,7 +337,7 @@ InOrderCPU::InOrderCPU(Params *params)
     dummyBufferInst = new InOrderDynInst(this, NULL, 0, 0, 0);
     dummyBufferInst->setSquashed();
     
-    lastRunningCycle = curTick;
+    lastRunningCycle = curTick();
 
     // Reset CPU to reset state.
 #if FULL_SYSTEM
@@ -528,17 +528,17 @@ InOrderCPU::tick()
     if (!tickEvent.scheduled()) {
         if (_status == SwitchedOut) {
             // increment stat
-            lastRunningCycle = curTick;
+            lastRunningCycle = curTick();
         } else if (!activityRec.active()) {
             DPRINTF(InOrderCPU, "sleeping CPU.\n");
-            lastRunningCycle = curTick;
+            lastRunningCycle = curTick();
             timesIdled++;
         } else {
-            //Tick next_tick = curTick + cycles(1);
+            //Tick next_tick = curTick() + cycles(1);
             //tickEvent.schedule(next_tick);
-            schedule(&tickEvent, nextCycle(curTick + 1));
+            schedule(&tickEvent, nextCycle(curTick() + 1));
             DPRINTF(InOrderCPU, "Scheduled CPU for next tick @ %i.\n", 
-                    nextCycle(curTick + 1));
+                    nextCycle(curTick() + 1));
         }
     }
 
@@ -693,10 +693,10 @@ InOrderCPU::scheduleCpuEvent(CPUEventType c_event, Fault fault,
     CPUEvent *cpu_event = new CPUEvent(this, c_event, fault, tid, inst,
                                        event_pri_offset);
 
-    Tick sked_tick = nextCycle(curTick + ticks(delay));
+    Tick sked_tick = nextCycle(curTick() + ticks(delay));
     if (delay >= 0) {
         DPRINTF(InOrderCPU, "Scheduling CPU Event (%s) for cycle %i, [tid:%i].\n",
-                eventNames[c_event], curTick + delay, tid);
+                eventNames[c_event], curTick() + delay, tid);
         schedule(cpu_event, sked_tick);
     } else {
         cpu_event->process();
@@ -791,7 +791,7 @@ InOrderCPU::activateThread(ThreadID tid)
         
         activateThreadInPipeline(tid);
 
-        thread[tid]->lastActivate = curTick;            
+        thread[tid]->lastActivate = curTick();            
 
         tcBase(tid)->setStatus(ThreadContext::Active);    
 
@@ -963,7 +963,7 @@ InOrderCPU::suspendThread(ThreadID tid)
             tid);
     deactivateThread(tid);
     suspendedThreads.push_back(tid);    
-    thread[tid]->lastSuspend = curTick;    
+    thread[tid]->lastSuspend = curTick();    
 
     tcBase(tid)->setStatus(ThreadContext::Suspended);    
 }
@@ -1124,7 +1124,7 @@ InOrderCPU::instDone(DynInstPtr inst, ThreadID tid)
 
     // Finalize Trace Data For Instruction
     if (inst->traceData) {
-        //inst->traceData->setCycle(curTick);
+        //inst->traceData->setCycle(curTick());
         inst->traceData->setFetchSeq(inst->seqNum);
         //inst->traceData->setCPSeq(cpu->tcBase(tid)->numInst);
         inst->traceData->dump();
@@ -1390,7 +1390,7 @@ InOrderCPU::wakeCPU()
 
     DPRINTF(Activity, "Waking up CPU\n");
 
-    Tick extra_cycles = tickToCycles((curTick - 1) - lastRunningCycle);
+    Tick extra_cycles = tickToCycles((curTick() - 1) - lastRunningCycle);
 
     idleCycles += extra_cycles;    
     for (int stage_num = 0; stage_num < NumStages; stage_num++) {
@@ -1399,7 +1399,7 @@ InOrderCPU::wakeCPU()
 
     numCycles += extra_cycles;
 
-    schedule(&tickEvent, nextCycle(curTick));
+    schedule(&tickEvent, nextCycle(curTick()));
 }
 
 #if FULL_SYSTEM
index 38978dbd7040e3bc775d44955543814e7efd3943..c3658373a2d65954b9be88c100ccdc1cc77e6553 100644 (file)
@@ -157,7 +157,7 @@ class InOrderCPU : public BaseCPU
     void scheduleTickEvent(int delay)
     {
         assert(!tickEvent.scheduled() || tickEvent.squashed());
-        reschedule(&tickEvent, nextCycle(curTick + ticks(delay)), true);
+        reschedule(&tickEvent, nextCycle(curTick() + ticks(delay)), true);
     }
 
     /** Unschedule tick event, regardless of its current state. */
index 70fd59418a8cf77a790942083cac806fdd97c3cd..6afe35862fc2f1eb49d0b6998fde21c925bd40a6 100644 (file)
@@ -442,7 +442,7 @@ InOrderDynInst::setMiscRegOperand(const StaticInst *si, int idx,
 {
     instResult[idx].type = Integer;
     instResult[idx].val.integer = val;
-    instResult[idx].tick = curTick;
+    instResult[idx].tick = curTick();
 
     DPRINTF(InOrderDynInst, "[tid:%i]: [sn:%i] Setting Misc Reg. Operand %i "
             "being set to %#x.\n", threadNumber, seqNum, idx, val);
@@ -472,7 +472,7 @@ InOrderDynInst::setIntRegOperand(const StaticInst *si, int idx, IntReg val)
 {
     instResult[idx].type = Integer;
     instResult[idx].val.integer = val;
-    instResult[idx].tick = curTick;
+    instResult[idx].tick = curTick();
 
     DPRINTF(InOrderDynInst, "[tid:%i]: [sn:%i] Setting Result Int Reg. %i "
             "being set to %#x (result-tick:%i).\n",
@@ -485,7 +485,7 @@ InOrderDynInst::setFloatRegOperand(const StaticInst *si, int idx, FloatReg val)
 {
     instResult[idx].val.dbl = val;
     instResult[idx].type = Float;
-    instResult[idx].tick = curTick;
+    instResult[idx].tick = curTick();
 
     DPRINTF(InOrderDynInst, "[tid:%i]: [sn:%i] Setting Result Float Reg. %i "
             "being set to %#x (result-tick:%i).\n",
@@ -499,7 +499,7 @@ InOrderDynInst::setFloatRegOperandBits(const StaticInst *si, int idx,
 {
     instResult[idx].type = Integer;
     instResult[idx].val.integer = val;
-    instResult[idx].tick = curTick;
+    instResult[idx].tick = curTick();
 
     DPRINTF(InOrderDynInst, "[tid:%i]: [sn:%i] Setting Result Float Reg. %i "
             "being set to %#x (result-tick:%i).\n",
index dc36965b07e683b5a36f8d3c06e688ad023cec11..2ac402faefb3a3c538acb54b44c2dd078263a60d 100644 (file)
@@ -338,7 +338,7 @@ void
 PipelineStage::squashDueToBranch(DynInstPtr &inst, ThreadID tid)
 {
     if (cpu->squashSeqNum[tid] < inst->seqNum &&
-        cpu->lastSquashCycle[tid] == curTick){
+        cpu->lastSquashCycle[tid] == curTick()){
         DPRINTF(Resource, "Ignoring [sn:%i] branch squash signal due to "
                 "another stage's squash signal for after [sn:%i].\n", 
                 inst->seqNum, cpu->squashSeqNum[tid]);
@@ -371,7 +371,7 @@ PipelineStage::squashDueToBranch(DynInstPtr &inst, ThreadID tid)
 
         // Save squash num for later stage use
         cpu->squashSeqNum[tid] = squash_seq_num;
-        cpu->lastSquashCycle[tid] = curTick;
+        cpu->lastSquashCycle[tid] = curTick();
     }
 }
 
@@ -969,7 +969,7 @@ PipelineStage::processInstSchedule(DynInstPtr inst,int &reqs_processed)
                     inst->popSchedEntry();
                 } else {
                     panic("%i: encountered %s fault!\n",
-                          curTick, req->fault->name());
+                          curTick(), req->fault->name());
                 }
 
                 reqs_processed++;                
@@ -1075,7 +1075,7 @@ PipelineStage::sendInstToNextStage(DynInstPtr inst)
 
     if (nextStageQueueValid(inst->nextStage - 1)) {
         if (inst->seqNum > cpu->squashSeqNum[tid] &&
-            curTick == cpu->lastSquashCycle[tid]) {
+            curTick() == cpu->lastSquashCycle[tid]) {
             DPRINTF(InOrderStage, "[tid:%u]: [sn:%i]: squashed, skipping "
                     "insertion into stage %i queue.\n", tid, inst->seqNum, 
                     inst->nextStage);
@@ -1107,7 +1107,7 @@ PipelineStage::sendInstToNextStage(DynInstPtr inst)
 
             // Take note of trace data for this inst & stage
             if (inst->traceData) {
-                inst->traceData->setStageCycle(stageNum, curTick);
+                inst->traceData->setStageCycle(stageNum, curTick());
             }
 
         }
index 50636cb81d0f43d63564bf63a8b0c36df208ac90..98a0727a9af2d197d63e500a27c3d7fe1ef10225 100644 (file)
@@ -181,14 +181,14 @@ RegDepMap::canForward(unsigned reg_idx, DynInstPtr inst)
         assert(dest_reg_idx != -1);
 
         if (forward_inst->isExecuted() &&
-            forward_inst->readResultTime(dest_reg_idx) < curTick) {
+            forward_inst->readResultTime(dest_reg_idx) < curTick()) {
             return forward_inst;
         } else {
             if (!forward_inst->isExecuted()) {
                 DPRINTF(RegDepMap, "[sn:%i] Can't get value through "
                         "forwarding, [sn:%i] has not been executed yet.\n",
                         inst->seqNum, forward_inst->seqNum);
-            } else if (forward_inst->readResultTime(dest_reg_idx) >= curTick) {
+            } else if (forward_inst->readResultTime(dest_reg_idx) >= curTick()) {
                 DPRINTF(RegDepMap, "[sn:%i] Can't get value through "
                         "forwarding, [sn:%i] executed on tick:%i.\n",
                         inst->seqNum, forward_inst->seqNum,
index 0d8dbb3e4184263a17098654fcf291c9494a58f6..8c5f86c73e6f6fed7f2876b54a3e8a59d35665a5 100644 (file)
@@ -366,7 +366,7 @@ Resource::scheduleEvent(int slot_idx, int delay)
     DPRINTF(Resource, "[tid:%i]: Scheduling event for [sn:%i] on tick %i.\n",
             reqMap[slot_idx]->inst->readTid(),
             reqMap[slot_idx]->inst->seqNum,
-            cpu->ticks(delay) + curTick);
+            cpu->ticks(delay) + curTick());
     resourceEvent[slot_idx].scheduleEvent(delay);
 }
 
@@ -504,5 +504,5 @@ ResourceEvent::scheduleEvent(int delay)
 {
     assert(!scheduled() || squashed());
     resource->cpu->reschedule(this,
-                              curTick + resource->ticks(delay), true);
+                              curTick() + resource->ticks(delay), true);
 }
index 05ce91faa8e4a67142e6dc8446e58faa728feddf..746d3f33bffea67827d8e6cad75ed9e39d40621c 100644 (file)
@@ -177,13 +177,13 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
       case InOrderCPU::ActivateThread:
         {
             DPRINTF(Resource, "Scheduling Activate Thread Resource Pool Event for tick %i.\n",
-                    curTick + delay);
+                    curTick() + delay);
             res_pool_event->setEvent(e_type,
                                      inst,
                                      inst->squashingStage,
                                      inst->bdelaySeqNum,
                                      inst->readTid());
-            res_pool_event->schedule(curTick + cpu->cycles(delay));
+            res_pool_event->schedule(curTick() + cpu->cycles(delay));
 
         }
         break;
@@ -192,7 +192,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
       case InOrderCPU::DeallocateThread:
         {
             DPRINTF(Resource, "Scheduling Deactivate Thread Resource Pool Event for tick %i.\n",
-                    curTick + delay);
+                    curTick() + delay);
 
             res_pool_event->setEvent(e_type,
                                      inst,
@@ -200,7 +200,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
                                      inst->bdelaySeqNum,
                                      tid);
 
-            res_pool_event->schedule(curTick + cpu->cycles(delay));
+            res_pool_event->schedule(curTick() + cpu->cycles(delay));
 
         }
         break;
@@ -208,14 +208,14 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
       case ResourcePool::InstGraduated:
         {
             DPRINTF(Resource, "Scheduling Inst-Graduated Resource Pool Event for tick %i.\n",
-                    curTick + delay);
+                    curTick() + delay);
 
             res_pool_event->setEvent(e_type,
                                      inst,
                                      inst->squashingStage,
                                      inst->seqNum,
                                      inst->readTid());
-            res_pool_event->schedule(curTick + cpu->cycles(delay));
+            res_pool_event->schedule(curTick() + cpu->cycles(delay));
 
         }
         break;
@@ -223,13 +223,13 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
       case ResourcePool::SquashAll:
         {
             DPRINTF(Resource, "Scheduling Squash Resource Pool Event for tick %i.\n",
-                    curTick + delay);
+                    curTick() + delay);
             res_pool_event->setEvent(e_type,
                                      inst,
                                      inst->squashingStage,
                                      inst->bdelaySeqNum,
                                      inst->readTid());
-            res_pool_event->schedule(curTick + cpu->cycles(delay));
+            res_pool_event->schedule(curTick() + cpu->cycles(delay));
 
         }
         break;
@@ -345,9 +345,9 @@ void
 ResourcePool::ResPoolEvent::scheduleEvent(int delay)
 {
     if (squashed())
-        reschedule(curTick + resPool->cpu->cycles(delay));
+        reschedule(curTick() + resPool->cpu->cycles(delay));
     else if (!scheduled())
-        schedule(curTick + resPool->cpu->cycles(delay));
+        schedule(curTick() + resPool->cpu->cycles(delay));
 }
 
 /** Unschedule resource event, regardless of its current state. */
index e199d2bc2a589ebe15e8a1cbed12cc97a598815d..e8400405aedeedaf47937eee57e5aa7585e8f203 100644 (file)
@@ -244,14 +244,14 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
 {
     assert(delay >= 0);
 
-    Tick when = cpu->nextCycle(curTick + cpu->ticks(delay));
+    Tick when = cpu->nextCycle(curTick() + cpu->ticks(delay));
 
     switch (e_type)
     {
       case InOrderCPU::ActivateThread:
         {
             DPRINTF(Resource, "Scheduling Activate Thread Resource Pool Event "
-                    "for tick %i, [tid:%i].\n", curTick + delay, 
+                    "for tick %i, [tid:%i].\n", curTick() + delay, 
                     inst->readTid());
             ResPoolEvent *res_pool_event = 
                 new ResPoolEvent(this,
@@ -269,7 +269,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
         {
 
             DPRINTF(Resource, "Scheduling Deactivate Thread Resource Pool "
-                    "Event for tick %i.\n", curTick + delay);
+                    "Event for tick %i.\n", curTick() + delay);
             ResPoolEvent *res_pool_event = 
                 new ResPoolEvent(this,
                                  e_type,
@@ -304,7 +304,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
       case ResourcePool::InstGraduated:
         {
             DPRINTF(Resource, "Scheduling Inst-Graduated Resource Pool "
-                    "Event for tick %i.\n", curTick + delay);
+                    "Event for tick %i.\n", curTick() + delay);
             ResPoolEvent *res_pool_event = 
                 new ResPoolEvent(this,e_type,
                                  inst,
@@ -318,7 +318,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
       case ResourcePool::SquashAll:
         {
             DPRINTF(Resource, "Scheduling Squash Resource Pool Event for "
-                    "tick %i.\n", curTick + delay);
+                    "tick %i.\n", curTick() + delay);
             ResPoolEvent *res_pool_event = 
                 new ResPoolEvent(this,e_type,
                                  inst,
@@ -333,7 +333,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
         {
             DPRINTF(Resource, "Scheduling Squash Due to Memory Stall Resource "
                     "Pool Event for tick %i.\n",
-                    curTick + delay);
+                    curTick() + delay);
             ResPoolEvent *res_pool_event = 
                 new ResPoolEvent(this,e_type,
                                  inst,
@@ -348,7 +348,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
         {
             DPRINTF(Resource, "Scheduling UpdatePC Resource Pool Event "
                     "for tick %i.\n",
-                    curTick + delay);
+                    curTick() + delay);
             ResPoolEvent *res_pool_event = new ResPoolEvent(this,e_type,
                                                             inst,
                                                             inst->squashingStage,
@@ -542,7 +542,7 @@ ResourcePool::ResPoolEvent::scheduleEvent(int delay)
 {
     InOrderCPU *cpu = resPool->cpu;
     assert(!scheduled() || squashed());
-    cpu->reschedule(this, cpu->nextCycle(curTick + cpu->ticks(delay)), true);
+    cpu->reschedule(this, cpu->nextCycle(curTick() + cpu->ticks(delay)), true);
 }
 
 /** Unschedule resource event, regardless of its current state. */
index 33b67ce4aec7c23bbceb18c847768cd5b7acbb26..dc036df64f3b54f39ee150544e4441d4c09620ab 100644 (file)
@@ -80,7 +80,7 @@ BranchPredictor::execute(int slot_num)
       case PredictBranch:
         {
             if (inst->seqNum > cpu->squashSeqNum[tid] &&
-                curTick == cpu->lastSquashCycle[tid]) {
+                curTick() == cpu->lastSquashCycle[tid]) {
                 DPRINTF(InOrderStage, "[tid:%u]: [sn:%i]: squashed, "
                         "skipping prediction \n", tid, inst->seqNum);
             } else {
@@ -125,7 +125,7 @@ BranchPredictor::execute(int slot_num)
       case UpdatePredictor:
         {
             if (inst->seqNum > cpu->squashSeqNum[tid] &&
-                curTick == cpu->lastSquashCycle[tid]) {
+                curTick() == cpu->lastSquashCycle[tid]) {
                 DPRINTF(InOrderStage, "[tid:%u]: [sn:%i]: squashed, "
                         "skipping branch predictor update \n",
                         tid, inst->seqNum);
index 5f9ddd372c6313bc4a91117e4291236597a6a364..bb4caf48aae2acb54392dc4522081add50e13cf0 100644 (file)
@@ -63,7 +63,7 @@ Tick
 CacheUnit::CachePort::recvAtomic(PacketPtr pkt)
 {
     panic("CacheUnit::CachePort doesn't expect recvAtomic callback!");
-    return curTick;
+    return curTick();
 }
 
 void
@@ -167,7 +167,7 @@ CacheUnit::getSlot(DynInstPtr inst)
         if (new_slot == -1)
             return -1;
 
-        inst->memTime = curTick;
+        inst->memTime = curTick();
         setAddrDependency(inst);            
         return new_slot;
     } else {
@@ -343,7 +343,7 @@ CacheUnit::getRequest(DynInstPtr inst, int stage_num, int res_idx,
         break;
 
       default:
-        panic("%i: Unexpected request type (%i) to %s", curTick,
+        panic("%i: Unexpected request type (%i) to %s", curTick(),
               sched_entry->cmd, name());
     }
 
@@ -482,7 +482,7 @@ CacheUnit::read(DynInstPtr inst, Addr addr,
     
     if (secondAddr > addr && !inst->split2ndAccess) {
         DPRINTF(InOrderCachePort, "%i: sn[%i] Split Read Access (1 of 2) for "
-                "(%#x, %#x).\n", curTick, inst->seqNum, addr, secondAddr);
+                "(%#x, %#x).\n", curTick(), inst->seqNum, addr, secondAddr);
         
         // Save All "Total" Split Information
         // ==============================
index 4342042e9f896d8a00957747b3cc93d35f2999ef..9ba7a64c7bfaf2f7b15f859ceba10b63f24e8260 100644 (file)
@@ -55,7 +55,7 @@ ExecutionUnit::regStats()
         .name(name() + ".predictedNotTakenIncorrect")
         .desc("Number of Branches Incorrectly Predicted As Not Taken).");
 
-    lastExecuteCycle = curTick;
+    lastExecuteCycle = curTick();
 
     executions
         .name(name() + ".executions")
@@ -98,8 +98,8 @@ ExecutionUnit::execute(int slot_num)
     {
       case ExecuteInst:
         {
-            if (curTick != lastExecuteCycle) {
-                lastExecuteCycle = curTick;
+            if (curTick() != lastExecuteCycle) {
+                lastExecuteCycle = curTick();
             }
 
 
index 3bfe912e78392198f6c362afd5fa2fc0780eaa43..7fd57cc759bddb1e2aa51e327922fe0fe7b3d1ff 100644 (file)
@@ -210,13 +210,13 @@ FetchSeqUnit::squash(DynInstPtr inst, int squash_stage,
     }
 
     if (squashSeqNum[tid] <= done_seq_num &&
-        lastSquashCycle[tid] == curTick) {
+        lastSquashCycle[tid] == curTick()) {
         DPRINTF(InOrderFetchSeq, "[tid:%i]: Ignoring squash from stage %i, "
                 "since there is an outstanding squash that is older.\n",
                 tid, squash_stage);
     } else {
         squashSeqNum[tid] = done_seq_num;
-        lastSquashCycle[tid] = curTick;
+        lastSquashCycle[tid] = curTick();
 
         // If The very next instruction number is the done seq. num,
         // then we haven't seen the delay slot yet ... if it isn't
index a9b96a49f423418d029f734d39cd99edfbd886ca..9d19c2eefea5abd618766b9be827ed81ff379545 100644 (file)
@@ -64,8 +64,8 @@ GraduationUnit::execute(int slot_num)
             // @TODO: Instructions should never really get to this point since
             // this should be handled through the request interface. Check to
             // make sure this happens and delete this code.
-            if (lastCycleGrad != curTick) {
-                lastCycleGrad = curTick;
+            if (lastCycleGrad != curTick()) {
+                lastCycleGrad = curTick();
                 numCycleGrad = 0;
             } else if (numCycleGrad > width) {
                 DPRINTF(InOrderGraduation,
@@ -91,7 +91,7 @@ GraduationUnit::execute(int slot_num)
             }
 
             if (inst->traceData) {
-                inst->traceData->setStageCycle(stage_num, curTick);
+                inst->traceData->setStageCycle(stage_num, curTick());
             }
 
             // Tell CPU that instruction is finished processing
index d9a887571192d3c5ba2bf2827126b074afc9d92f..55df1cc43c3e434f73e44e6e75f5f51d3f773fcc 100644 (file)
@@ -163,7 +163,7 @@ MultDivUnit::getSlot(DynInstPtr inst)
         }
     }
 
-    if (lastMDUCycle + repeat_rate > curTick) {
+    if (lastMDUCycle + repeat_rate > curTick()) {
         DPRINTF(InOrderMDU, "MDU not ready to process another inst. until %i, "
                 "denying request.\n", lastMDUCycle + repeat_rate);
         return -1;
@@ -173,7 +173,7 @@ MultDivUnit::getSlot(DynInstPtr inst)
                 rval);
 
         if (rval != -1) {            
-            lastMDUCycle = curTick;
+            lastMDUCycle = curTick();
             lastOpType = inst->opClass();
             lastInstName = inst->staticInst->getName();
         }
index e8681f6e3a6a699cd6c16bccbbe16f1d35802297..2912cbb037ca54a533cabfa5337c1fdbb1a761f0 100644 (file)
@@ -475,7 +475,7 @@ DefaultCommit<Impl>::generateTrapEvent(ThreadID tid)
 
     TrapEvent *trap = new TrapEvent(this, tid);
 
-    cpu->schedule(trap, curTick + trapLatency);
+    cpu->schedule(trap, curTick() + trapLatency);
     trapInFlight[tid] = true;
 }
 
index 21c5cc706f7af3d6359a26ea46f5f68164b0ead2..9becc66010faf86ad828abd4f5537996a74f14a5 100644 (file)
@@ -334,7 +334,7 @@ FullO3CPU<Impl>::FullO3CPU(DerivO3CPUParams *params)
     // Setup the ROB for whichever stages need it.
     commit.setROB(&rob);
 
-    lastRunningCycle = curTick;
+    lastRunningCycle = curTick();
 
     lastActivatedCycle = -1;
 #if 0
@@ -538,13 +538,13 @@ FullO3CPU<Impl>::tick()
             getState() == SimObject::Drained) {
             DPRINTF(O3CPU, "Switched out!\n");
             // increment stat
-            lastRunningCycle = curTick;
+            lastRunningCycle = curTick();
         } else if (!activityRec.active() || _status == Idle) {
             DPRINTF(O3CPU, "Idle!\n");
-            lastRunningCycle = curTick;
+            lastRunningCycle = curTick();
             timesIdled++;
         } else {
-            schedule(tickEvent, nextCycle(curTick + ticks(1)));
+            schedule(tickEvent, nextCycle(curTick() + ticks(1)));
             DPRINTF(O3CPU, "Scheduling next tick!\n");
         }
     }
@@ -639,13 +639,13 @@ FullO3CPU<Impl>::activateContext(ThreadID tid, int delay)
     // Needs to set each stage to running as well.
     if (delay){
         DPRINTF(O3CPU, "[tid:%i]: Scheduling thread context to activate "
-                "on cycle %d\n", tid, curTick + ticks(delay));
+                "on cycle %d\n", tid, curTick() + ticks(delay));
         scheduleActivateThreadEvent(tid, delay);
     } else {
         activateThread(tid);
     }
 
-    if (lastActivatedCycle < curTick) {
+    if (lastActivatedCycle < curTick()) {
         scheduleTickEvent(delay);
 
         // Be sure to signal that there's some activity so the CPU doesn't
@@ -653,7 +653,7 @@ FullO3CPU<Impl>::activateContext(ThreadID tid, int delay)
         activityRec.activity();
         fetch.wakeFromQuiesce();
 
-        lastActivatedCycle = curTick;
+        lastActivatedCycle = curTick();
 
         _status = Running;
     }
@@ -666,7 +666,7 @@ FullO3CPU<Impl>::deallocateContext(ThreadID tid, bool remove, int delay)
     // Schedule removal of thread data from CPU
     if (delay){
         DPRINTF(O3CPU, "[tid:%i]: Scheduling thread context to deallocate "
-                "on cycle %d\n", tid, curTick + ticks(delay));
+                "on cycle %d\n", tid, curTick() + ticks(delay));
         scheduleDeallocateContextEvent(tid, remove, delay);
         return false;
     } else {
@@ -1552,8 +1552,8 @@ FullO3CPU<Impl>::wakeCPU()
 
     DPRINTF(Activity, "Waking up CPU\n");
 
-    idleCycles += tickToCycles((curTick - 1) - lastRunningCycle);
-    numCycles += tickToCycles((curTick - 1) - lastRunningCycle);
+    idleCycles += tickToCycles((curTick() - 1) - lastRunningCycle);
+    numCycles += tickToCycles((curTick() - 1) - lastRunningCycle);
 
     schedule(tickEvent, nextCycle());
 }
index 832d98f55026334fd315f5f57a9399ed527d1ae0..e3d13c8403a20d13334b67880ab4ca2874d422fe 100644 (file)
@@ -140,9 +140,9 @@ class FullO3CPU : public BaseO3CPU
     void scheduleTickEvent(int delay)
     {
         if (tickEvent.squashed())
-            reschedule(tickEvent, nextCycle(curTick + ticks(delay)));
+            reschedule(tickEvent, nextCycle(curTick() + ticks(delay)));
         else if (!tickEvent.scheduled())
-            schedule(tickEvent, nextCycle(curTick + ticks(delay)));
+            schedule(tickEvent, nextCycle(curTick() + ticks(delay)));
     }
 
     /** Unschedule tick event, regardless of its current state. */
@@ -182,10 +182,10 @@ class FullO3CPU : public BaseO3CPU
         // Schedule thread to activate, regardless of its current state.
         if (activateThreadEvent[tid].squashed())
             reschedule(activateThreadEvent[tid],
-                nextCycle(curTick + ticks(delay)));
+                nextCycle(curTick() + ticks(delay)));
         else if (!activateThreadEvent[tid].scheduled())
             schedule(activateThreadEvent[tid],
-                nextCycle(curTick + ticks(delay)));
+                nextCycle(curTick() + ticks(delay)));
     }
 
     /** Unschedule actiavte thread event, regardless of its current state. */
@@ -235,10 +235,10 @@ class FullO3CPU : public BaseO3CPU
         // Schedule thread to activate, regardless of its current state.
         if (deallocateContextEvent[tid].squashed())
             reschedule(deallocateContextEvent[tid],
-                nextCycle(curTick + ticks(delay)));
+                nextCycle(curTick() + ticks(delay)));
         else if (!deallocateContextEvent[tid].scheduled())
             schedule(deallocateContextEvent[tid],
-                nextCycle(curTick + ticks(delay)));
+                nextCycle(curTick() + ticks(delay)));
     }
 
     /** Unschedule thread deallocation in CPU */
index cca6b7a5729a4a771ce8f72b8faf73062c9c555c..28ef423c444ee3dea59510054063837583d11a7b 100644 (file)
@@ -68,7 +68,7 @@ Tick
 DefaultFetch<Impl>::IcachePort::recvAtomic(PacketPtr pkt)
 {
     panic("DefaultFetch doesn't expect recvAtomic callback!");
-    return curTick;
+    return curTick();
 }
 
 template<class Impl>
@@ -625,7 +625,7 @@ DefaultFetch<Impl>::fetchCacheLine(Addr vaddr, Fault &ret_fault, ThreadID tid,
 
         DPRINTF(Fetch, "[tid:%i]: Doing cache access.\n", tid);
 
-        lastIcacheStall[tid] = curTick;
+        lastIcacheStall[tid] = curTick();
 
         DPRINTF(Activity, "[tid:%i]: Activity: Waiting on I-cache "
                 "response.\n", tid);
@@ -992,7 +992,7 @@ DefaultFetch<Impl>::buildInst(ThreadID tid, StaticInstPtr staticInst,
 #if TRACING_ON
     if (trace) {
         instruction->traceData =
-            cpu->getTracer()->getInstRecord(curTick, cpu->tcBase(tid),
+            cpu->getTracer()->getInstRecord(curTick(), cpu->tcBase(tid),
                     instruction->staticInst, thisPC, curMacroop);
     }
 #else
index b944979f2f47aaefb1f5aa962c35936482c85451..ce408dfd01b79be72ba6751e7c82d81778ae0dfd 100644 (file)
@@ -754,7 +754,7 @@ InstructionQueue<Impl>::scheduleReadyInsts()
                 FUCompletion *execution = new FUCompletion(issuing_inst,
                                                            idx, this);
 
-                cpu->schedule(execution, curTick + cpu->ticks(op_latency - 1));
+                cpu->schedule(execution, curTick() + cpu->ticks(op_latency - 1));
 
                 // @todo: Enforce that issue_latency == 1 or op_latency
                 if (issue_latency > 1) {
index e780b14e4d682df3a7f208e34bcdeddc40b5b48e..ddfc637540dbadbeb315179b607749d57f9caab3 100644 (file)
@@ -55,7 +55,7 @@ Tick
 LSQ<Impl>::DcachePort::recvAtomic(PacketPtr pkt)
 {
     panic("O3CPU model does not work with atomic mode!");
-    return curTick;
+    return curTick();
 }
 
 template <class Impl>
index e9e3fea968e0651a4b7af67d7dedc1877bd5907a..2bb42cadca467fc893edd07d4e7d26d0a16aca0b 100644 (file)
@@ -624,7 +624,7 @@ LSQUnit<Impl>::read(Request *req, Request *sreqLow, Request *sreqHigh,
             // We'll say this has a 1 cycle load-store forwarding latency
             // for now.
             // @todo: Need to make this a parameter.
-            cpu->schedule(wb, curTick);
+            cpu->schedule(wb, curTick());
 
             // Don't need to do anything special for split loads.
             if (TheISA::HasUnalignedMemAcc && sreqLow) {
index 807c0b527fa3576a98df5e3a91bf9f1bf1b38f99..64d6746668910da95959f25ef83ba9d69147572d 100644 (file)
@@ -783,7 +783,7 @@ LSQUnit<Impl>::writebackStores()
                         "Instantly completing it.\n",
                         inst->seqNum);
                 WritebackEvent *wb = new WritebackEvent(inst, data_pkt, this);
-                cpu->schedule(wb, curTick + 1);
+                cpu->schedule(wb, curTick() + 1);
                 completeStore(storeWBIdx);
                 incrStIdx(storeWBIdx);
                 continue;
index 060baed3232a397f5e25f97d673272a4c2fb3a2a..e7b0540d1c671f5f92598be6050b8daae72dea9c 100755 (executable)
@@ -115,7 +115,7 @@ O3ThreadContext<Impl>::activate(int delay)
         return;
 
 #if FULL_SYSTEM
-    thread->lastActivate = curTick;
+    thread->lastActivate = curTick();
 #endif
 
     thread->setStatus(ThreadContext::Active);
@@ -135,8 +135,8 @@ O3ThreadContext<Impl>::suspend(int delay)
         return;
 
 #if FULL_SYSTEM
-    thread->lastActivate = curTick;
-    thread->lastSuspend = curTick;
+    thread->lastActivate = curTick();
+    thread->lastSuspend = curTick();
 #endif
 /*
 #if FULL_SYSTEM
index 7a2da3239c08d6f05b7cbb1ffc3b71ad15fd5f08..95e079d0d15737741f530f7e757d5c447a19d5ee 100644 (file)
@@ -468,7 +468,7 @@ BackEnd<Impl>::read(RequestPtr req, T &data, int load_idx)
     if (fault == NoFault && dcacheInterface) {
         memReq->cmd = Read;
         memReq->completionEvent = NULL;
-        memReq->time = curTick;
+        memReq->time = curTick();
         memReq->flags &= ~INST_READ;
         MemAccessResult result = dcacheInterface->access(memReq);
 
@@ -481,7 +481,7 @@ BackEnd<Impl>::read(RequestPtr req, T &data, int load_idx)
             --funcExeInst;
 
             memReq->completionEvent = &cacheCompletionEvent;
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 //          unscheduleTickEvent();
 //          status = DcacheMissStall;
             DPRINTF(OzoneCPU, "Dcache miss stall!\n");
@@ -510,7 +510,7 @@ BackEnd<Impl>::write(RequestPtr req, T &data, int store_idx)
         memReq->cmd = Write;
         memcpy(memReq->data,(uint8_t *)&data,memReq->size);
         memReq->completionEvent = NULL;
-        memReq->time = curTick;
+        memReq->time = curTick();
         memReq->flags &= ~INST_READ;
         MemAccessResult result = dcacheInterface->access(memReq);
 
@@ -519,7 +519,7 @@ BackEnd<Impl>::write(RequestPtr req, T &data, int store_idx)
         // at some point.
         if (result != MA_HIT && dcacheInterface->doEvents()) {
             memReq->completionEvent = &cacheCompletionEvent;
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 //          unscheduleTickEvent();
 //          status = DcacheMissStall;
             DPRINTF(OzoneCPU, "Dcache miss stall!\n");
index fcc5602eb8b8ff5ff98c9b213c03b3faabb9b7c2..1b196feb435d4fc170eb7c0674f80094e2e18041 100644 (file)
@@ -277,9 +277,9 @@ class OzoneCPU : public BaseCPU
     void scheduleTickEvent(int delay)
     {
         if (tickEvent.squashed())
-            tickEvent.reschedule(curTick + ticks(delay));
+            tickEvent.reschedule(curTick() + ticks(delay));
         else if (!tickEvent.scheduled())
-            tickEvent.schedule(curTick + ticks(delay));
+            tickEvent.schedule(curTick() + ticks(delay));
     }
 
     /// Unschedule tick event, regardless of its current state.
index a22ada5d0523e72d5506b95dd50c25274b2deb02..dd6c3dcf1b8efbc17d6e3eb2254f14dbad3abcc8 100644 (file)
@@ -301,7 +301,7 @@ OzoneCPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
         if (tc->status() == ThreadContext::Active &&
             _status != Running) {
             _status = Running;
-            tickEvent.schedule(curTick);
+            tickEvent.schedule(curTick());
         }
     }
     // Nothing running, change status to reflect that we're no longer
@@ -525,7 +525,7 @@ OzoneCPU<Impl>::tick()
     comInstEventQueue[0]->serviceEvents(numInst);
 
     if (!tickEvent.scheduled() && _status == Running)
-        tickEvent.schedule(curTick + ticks(1));
+        tickEvent.schedule(curTick() + ticks(1));
 }
 
 template <class Impl>
index 88413692761484b4dcf82403c931f4a75139530a..d7ed0b77aee05cbac6c3153a33ad08a913dc15c2 100644 (file)
@@ -52,7 +52,7 @@ Tick
 FrontEnd<Impl>::IcachePort::recvAtomic(PacketPtr pkt)
 {
     panic("FrontEnd doesn't expect recvAtomic callback!");
-    return curTick;
+    return curTick();
 }
 
 template<class Impl>
@@ -432,7 +432,7 @@ FrontEnd<Impl>::tick()
 
 #if FULL_SYSTEM
         if (inst->isQuiesce()) {
-//            warn("%lli: Quiesce instruction encountered, halting fetch!", curTick);
+//            warn("%lli: Quiesce instruction encountered, halting fetch!", curTick());
             status = QuiescePending;
             break;
         }
@@ -894,7 +894,7 @@ FrontEnd<Impl>::getInstFromCacheline()
             instruction->staticInst->disassemble(PC));
 
     instruction->traceData =
-        Trace::getInstRecord(curTick, tc,
+        Trace::getInstRecord(curTick(), tc,
                              instruction->staticInst,
                              instruction->readPC());
 
index 9c26996105213be5693e760f91887fa927551fa4..fcdc2a38a051a0fc5b0af76a44f1644061eae261 100644 (file)
@@ -210,7 +210,7 @@ InorderBackEnd<Impl>::read(Addr addr, T &data, unsigned flags)
     if (fault == NoFault && dcacheInterface) {
         memReq->cmd = Read;
         memReq->completionEvent = NULL;
-        memReq->time = curTick;
+        memReq->time = curTick();
         MemAccessResult result = dcacheInterface->access(memReq);
 
         // Ugly hack to get an event scheduled *only* if the access is
@@ -220,7 +220,7 @@ InorderBackEnd<Impl>::read(Addr addr, T &data, unsigned flags)
             // Fix this hack for keeping funcExeInst correct with loads that
             // are executed twice.
             memReq->completionEvent = &cacheCompletionEvent;
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 //          unscheduleTickEvent();
             status = DcacheMissLoadStall;
             DPRINTF(IBE, "Dcache miss stall!\n");
@@ -246,7 +246,7 @@ InorderBackEnd<Impl>::write(T data, Addr addr, unsigned flags, uint64_t *res)
         memReq->cmd = Write;
 //      memcpy(memReq->data,(uint8_t *)&data,memReq->size);
         memReq->completionEvent = NULL;
-        memReq->time = curTick;
+        memReq->time = curTick();
         MemAccessResult result = dcacheInterface->access(memReq);
 
         // Ugly hack to get an event scheduled *only* if the access is
@@ -254,7 +254,7 @@ InorderBackEnd<Impl>::write(T data, Addr addr, unsigned flags, uint64_t *res)
         // at some point.
         if (result != MA_HIT) {
             memReq->completionEvent = &cacheCompletionEvent;
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 //          unscheduleTickEvent();
             status = DcacheMissStoreStall;
             DPRINTF(IBE, "Dcache miss stall!\n");
@@ -280,7 +280,7 @@ InorderBackEnd<Impl>::read(MemReqPtr &req, T &data, int load_idx)
 //    Fault fault = cpu->translateDataReadReq(req);
     req->cmd = Read;
     req->completionEvent = NULL;
-    req->time = curTick;
+    req->time = curTick();
     assert(!req->data);
     req->data = new uint8_t[64];
     Fault fault = cpu->read(req, data);
@@ -295,7 +295,7 @@ InorderBackEnd<Impl>::read(MemReqPtr &req, T &data, int load_idx)
         // at some point.
         if (result != MA_HIT) {
             req->completionEvent = &cacheCompletionEvent;
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 //          unscheduleTickEvent();
             status = DcacheMissLoadStall;
             DPRINTF(IBE, "Dcache miss load stall!\n");
@@ -320,7 +320,7 @@ InorderBackEnd<Impl>::write(MemReqPtr &req, T &data, int store_idx)
 
     req->cmd = Write;
     req->completionEvent = NULL;
-    req->time = curTick;
+    req->time = curTick();
     assert(!req->data);
     req->data = new uint8_t[64];
     memcpy(req->data, (uint8_t *)&data, req->size);
@@ -347,7 +347,7 @@ InorderBackEnd<Impl>::write(MemReqPtr &req, T &data, int store_idx)
         req->data = new uint8_t[64];
         memcpy(req->data,(uint8_t *)&data,req->size);
         req->completionEvent = NULL;
-        req->time = curTick;
+        req->time = curTick();
         MemAccessResult result = dcacheInterface->access(req);
 
         // Ugly hack to get an event scheduled *only* if the access is
@@ -355,7 +355,7 @@ InorderBackEnd<Impl>::write(MemReqPtr &req, T &data, int store_idx)
         // at some point.
         if (result != MA_HIT) {
             req->completionEvent = &cacheCompletionEvent;
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 //          unscheduleTickEvent();
             status = DcacheMissStoreStall;
             DPRINTF(IBE, "Dcache miss store stall!\n");
index ae2e3b09bb53125ecfe933340270434b6e8e3b64..0068f29775e8c4b8cfecac966ae8c582130bd1d8 100644 (file)
@@ -673,7 +673,7 @@ InstQueue<Impl>::scheduleReadyInsts()
                     FUCompletion *execution = new FUCompletion(issuing_inst,
                                                                idx, this);
 
-                    execution->schedule(curTick + issue_latency - 1);
+                    execution->schedule(curTick() + issue_latency - 1);
                 } else {
                     i2e_info->insts[exec_queue_slot++] = issuing_inst;
                     i2e_info->size++;
index d8e402b652dbdb519ae7d2f3bb5abd1baec43e21..0216c501301e731bff6ff9e6b4fb5eaadce6b84c 100644 (file)
@@ -485,7 +485,7 @@ OzoneLSQ<Impl>::read(MemReqPtr &req, T &data, int load_idx)
             req->cmd = Read;
             assert(!req->completionEvent);
             req->completionEvent = NULL;
-            req->time = curTick;
+            req->time = curTick();
             assert(!req->data);
             req->data = new uint8_t[64];
 
@@ -502,7 +502,7 @@ OzoneLSQ<Impl>::read(MemReqPtr &req, T &data, int load_idx)
             // We'll say this has a 1 cycle load-store forwarding latency
             // for now.
             // FIXME - Need to make this a parameter.
-            wb->schedule(curTick);
+            wb->schedule(curTick());
 
             // Should keep track of stat for forwarded data
             return NoFault;
@@ -562,7 +562,7 @@ OzoneLSQ<Impl>::read(MemReqPtr &req, T &data, int load_idx)
         // Setup MemReq pointer
         req->cmd = Read;
         req->completionEvent = NULL;
-        req->time = curTick;
+        req->time = curTick();
         assert(!req->data);
         req->data = new uint8_t[64];
 
@@ -585,7 +585,7 @@ OzoneLSQ<Impl>::read(MemReqPtr &req, T &data, int load_idx)
             DPRINTF(Activity, "Activity: ld accessing mem miss [sn:%lli]\n",
                     inst->seqNum);
 
-            lastDcacheStall = curTick;
+            lastDcacheStall = curTick();
 
             _status = DcacheMissStall;
 
index dd44adf6edad8e6fff635bddc0b14c00b1f70d3e..f36b870d8255632c37439dbe41882c191dda85e3 100644 (file)
@@ -557,7 +557,7 @@ OzoneLSQ<Impl>::writebackStores()
 //      Fault fault = cpu->translateDataReadReq(req);
         req->cmd = Write;
         req->completionEvent = NULL;
-        req->time = curTick;
+        req->time = curTick();
         assert(!req->data);
         req->data = new uint8_t[64];
         memcpy(req->data, (uint8_t *)&storeQueue[storeWBIdx].data, req->size);
@@ -615,7 +615,7 @@ OzoneLSQ<Impl>::writebackStores()
                 req->completionEvent = new
                     StoreCompletionEvent(storeWBIdx, wb, this);
 
-                lastDcacheStall = curTick;
+                lastDcacheStall = curTick();
 
                 _status = DcacheMissStall;
 
@@ -637,7 +637,7 @@ OzoneLSQ<Impl>::writebackStores()
                     typename BackEnd::LdWritebackEvent *wb =
                         new typename BackEnd::LdWritebackEvent(storeQueue[storeWBIdx].inst,
                                                                be);
-                    wb->schedule(curTick);
+                    wb->schedule(curTick());
                 }
 
                 completeStore(storeWBIdx);
index 465fccbdbd5d895b4355ebbe97a123abcb9a27a4..8000c142e44fca17ff31b7fcca149ad5a0241fb6 100644 (file)
@@ -45,7 +45,7 @@ LWBackEnd<Impl>::generateTrapEvent(Tick latency)
 
     TrapEvent *trap = new TrapEvent(this);
 
-    trap->schedule(curTick + cpu->ticks(latency));
+    trap->schedule(curTick() + cpu->ticks(latency));
 
     thread->trapPending = true;
 }
@@ -1226,7 +1226,7 @@ LWBackEnd<Impl>::commitInst(int inst_num)
 
     // Write the done sequence number here.
     toIEW->doneSeqNum = inst->seqNum;
-    lastCommitCycle = curTick;
+    lastCommitCycle = curTick();
 
 #if FULL_SYSTEM
     int count = 0;
index ee03129694e0b095ae753ee4b3d7185e255df8dd..9605f175e56e12b7cdaef835d88e8dd04f8094b6 100644 (file)
@@ -581,7 +581,7 @@ OzoneLWLSQ<Impl>::read(RequestPtr req, T &data, int load_idx)
             // We'll say this has a 1 cycle load-store forwarding latency
             // for now.
             // @todo: Need to make this a parameter.
-            wb->schedule(curTick);
+            wb->schedule(curTick());
 
             // Should keep track of stat for forwarded data
             return NoFault;
index c714c5d382c32c6caeeeefa9acde40902a510a35..0c4e4b9c748a7522ac1c6a73e401909facdd26d1 100644 (file)
@@ -65,7 +65,7 @@ Tick
 OzoneLWLSQ<Impl>::DcachePort::recvAtomic(PacketPtr pkt)
 {
     panic("O3CPU model does not work with atomic mode!");
-    return curTick;
+    return curTick();
 }
 
 template <class Impl>
@@ -677,7 +677,7 @@ OzoneLWLSQ<Impl>::writebackStores()
 
                 be->addDcacheMiss(inst);
 
-                lastDcacheStall = curTick;
+                lastDcacheStall = curTick();
 
                 _status = DcacheMissStall;
 
index 533d6149892a0dae00590e95d2c88040c753182c..09bd6681915106d6055c2b0167cfe9561c5a3d6a 100644 (file)
@@ -111,7 +111,7 @@ PCEventQueue::dump() const
     const_iterator e = pc_map.end();
 
     for (; i != e; ++i)
-        cprintf("%d: event at %#x: %s\n", curTick, (*i)->pc(),
+        cprintf("%d: event at %#x: %s\n", curTick(), (*i)->pc(),
                 (*i)->descr());
 }
 
index de26ca2f8d0f1b5dc9d682097d29937659214b11..35ad461589277cf93235b9ba4b26eb53d39b694f 100644 (file)
@@ -267,7 +267,7 @@ AtomicSimpleCPU::activateContext(int thread_num, int delay)
     numCycles += tickToCycles(thread->lastActivate - thread->lastSuspend);
 
     //Make sure ticks are still on multiples of cycles
-    schedule(tickEvent, nextCycle(curTick + ticks(delay)));
+    schedule(tickEvent, nextCycle(curTick() + ticks(delay)));
     _status = Running;
 }
 
@@ -731,7 +731,7 @@ AtomicSimpleCPU::tick()
         latency = ticks(1);
 
     if (_status != Idle)
-        schedule(tickEvent, curTick + latency);
+        schedule(tickEvent, curTick() + latency);
 }
 
 
index c993110e1e5a0ea183f2f33600ff1b91fa8556ad..13ef0648ca2c1336cc685cd0e152e9d30bd664d5 100644 (file)
@@ -330,7 +330,7 @@ BaseSimpleCPU::preExecute()
     if(curStaticInst)
     {
 #if TRACING_ON
-        traceData = tracer->getInstRecord(curTick, tc,
+        traceData = tracer->getInstRecord(curTick(), tc,
                 curStaticInst, thread->pcState(), curMacroStaticInst);
 
         DPRINTF(Decode,"Decode: Decoded %s instruction: 0x%x\n",
index 7307f2fc9e0de179691353c729f695836530ef7c..9192c080892db39c2fc56d8fbd65b728f08499ad 100644 (file)
@@ -85,7 +85,7 @@ Tick
 TimingSimpleCPU::CpuPort::recvAtomic(PacketPtr pkt)
 {
     panic("TimingSimpleCPU doesn't expect recvAtomic callback!");
-    return curTick;
+    return curTick();
 }
 
 void
@@ -189,7 +189,7 @@ TimingSimpleCPU::switchOut()
 {
     assert(_status == Running || _status == Idle);
     _status = SwitchedOut;
-    numCycles += tickToCycles(curTick - previousTick);
+    numCycles += tickToCycles(curTick() - previousTick);
 
     // If we've been scheduled to resume but are then told to switch out,
     // we'll need to cancel it.
@@ -217,7 +217,7 @@ TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
         _status = Idle;
     }
     assert(threadContexts.size() == 1);
-    previousTick = curTick;
+    previousTick = curTick();
 }
 
 
@@ -235,7 +235,7 @@ TimingSimpleCPU::activateContext(int thread_num, int delay)
     _status = Running;
 
     // kick things off by initiating the fetch of the next instruction
-    schedule(fetchEvent, nextCycle(curTick + ticks(delay)));
+    schedule(fetchEvent, nextCycle(curTick() + ticks(delay)));
 }
 
 
@@ -266,7 +266,7 @@ TimingSimpleCPU::handleReadPacket(PacketPtr pkt)
     if (req->isMmapedIpr()) {
         Tick delay;
         delay = TheISA::handleIprRead(thread->getTC(), pkt);
-        new IprEvent(pkt, this, nextCycle(curTick + delay));
+        new IprEvent(pkt, this, nextCycle(curTick() + delay));
         _status = DcacheWaitResponse;
         dcache_pkt = NULL;
     } else if (!dcachePort.sendTiming(pkt)) {
@@ -355,8 +355,8 @@ TimingSimpleCPU::translationFault(Fault fault)
 {
     // fault may be NoFault in cases where a fault is suppressed,
     // for instance prefetches.
-    numCycles += tickToCycles(curTick - previousTick);
-    previousTick = curTick;
+    numCycles += tickToCycles(curTick() - previousTick);
+    previousTick = curTick();
 
     if (traceData) {
         // Since there was a fault, we shouldn't trace this instruction.
@@ -538,7 +538,7 @@ TimingSimpleCPU::handleWritePacket()
     if (req->isMmapedIpr()) {
         Tick delay;
         delay = TheISA::handleIprWrite(thread->getTC(), dcache_pkt);
-        new IprEvent(dcache_pkt, this, nextCycle(curTick + delay));
+        new IprEvent(dcache_pkt, this, nextCycle(curTick() + delay));
         _status = DcacheWaitResponse;
         dcache_pkt = NULL;
     } else if (!dcachePort.sendTiming(dcache_pkt)) {
@@ -726,8 +726,8 @@ TimingSimpleCPU::fetch()
         _status = IcacheWaitResponse;
         completeIfetch(NULL);
 
-        numCycles += tickToCycles(curTick - previousTick);
-        previousTick = curTick;
+        numCycles += tickToCycles(curTick() - previousTick);
+        previousTick = curTick();
     }
 }
 
@@ -754,8 +754,8 @@ TimingSimpleCPU::sendFetch(Fault fault, RequestPtr req, ThreadContext *tc)
         advanceInst(fault);
     }
 
-    numCycles += tickToCycles(curTick - previousTick);
-    previousTick = curTick;
+    numCycles += tickToCycles(curTick() - previousTick);
+    previousTick = curTick();
 }
 
 
@@ -787,8 +787,8 @@ TimingSimpleCPU::completeIfetch(PacketPtr pkt)
 
     _status = Running;
 
-    numCycles += tickToCycles(curTick - previousTick);
-    previousTick = curTick;
+    numCycles += tickToCycles(curTick() - previousTick);
+    previousTick = curTick();
 
     if (getState() == SimObject::Draining) {
         if (pkt) {
@@ -862,9 +862,9 @@ TimingSimpleCPU::IcachePort::recvTiming(PacketPtr pkt)
 {
     if (pkt->isResponse() && !pkt->wasNacked()) {
         // delay processing of returned data until next CPU clock edge
-        Tick next_tick = cpu->nextCycle(curTick);
+        Tick next_tick = cpu->nextCycle(curTick());
 
-        if (next_tick == curTick)
+        if (next_tick == curTick())
             cpu->completeIfetch(pkt);
         else
             tickEvent.schedule(pkt, next_tick);
@@ -906,8 +906,8 @@ TimingSimpleCPU::completeDataAccess(PacketPtr pkt)
     assert(_status == DcacheWaitResponse || _status == DTBWaitResponse ||
            pkt->req->getFlags().isSet(Request::NO_ACCESS));
 
-    numCycles += tickToCycles(curTick - previousTick);
-    previousTick = curTick;
+    numCycles += tickToCycles(curTick() - previousTick);
+    previousTick = curTick();
 
     if (pkt->senderState) {
         SplitFragmentSenderState * send_state =
@@ -994,9 +994,9 @@ TimingSimpleCPU::DcachePort::recvTiming(PacketPtr pkt)
 {
     if (pkt->isResponse() && !pkt->wasNacked()) {
         // delay processing of returned data until next CPU clock edge
-        Tick next_tick = cpu->nextCycle(curTick);
+        Tick next_tick = cpu->nextCycle(curTick());
 
-        if (next_tick == curTick) {
+        if (next_tick == curTick()) {
             cpu->completeDataAccess(pkt);
         } else {
             if (!tickEvent.scheduled()) {
index 51e27188cd64dd6e55f46ee73da63ef14cde47a8..61174dd4e6cc1224d4a64fbf709ddebd7669349c 100644 (file)
@@ -234,7 +234,7 @@ SimpleThread::activate(int delay)
     if (status() == ThreadContext::Active)
         return;
 
-    lastActivate = curTick;
+    lastActivate = curTick();
 
 //    if (status() == ThreadContext::Unallocated) {
 //      cpu->activateWhenReady(_threadId);
@@ -253,8 +253,8 @@ SimpleThread::suspend()
     if (status() == ThreadContext::Suspended)
         return;
 
-    lastActivate = curTick;
-    lastSuspend = curTick;
+    lastActivate = curTick();
+    lastSuspend = curTick();
 /*
 #if FULL_SYSTEM
     // Don't change the status from active if there are pending interrupts
index f2a72c96af26bddd73af857aa19bea00e9a1230f..f1ec05802e87c54c72fc6aa1d915cc38d5deedd9 100644 (file)
@@ -51,7 +51,7 @@ StaticInst::~StaticInst()
 void
 StaticInst::dumpDecodeCacheStats()
 {
-    cerr << "Decode hash table stats @ " << curTick << ":" << endl;
+    cerr << "Decode hash table stats @ " << curTick() << ":" << endl;
     cerr << "\tnum entries = " << decodeCache.size() << endl;
     cerr << "\tnum buckets = " << decodeCache.bucket_count() << endl;
     vector<int> hist(100, 0);
index 56352d14a460b73a1c873acc852775600fa5c88a..cc7c84dd36df9e6c72bc4838e8fae07281f695c6 100644 (file)
@@ -114,7 +114,7 @@ RubyDirectedTester::hitCallback(NodeID proc, Addr addr)
             addr);
 
     generator->performCallback(proc, addr);    
-    schedule(directedStartEvent, curTick);
+    schedule(directedStartEvent, curTick());
 }
 
 void
@@ -122,7 +122,7 @@ RubyDirectedTester::wakeup()
 {
     if (m_requests_completed < m_requests_to_complete) {
         if (!generator->initiate()) {
-            schedule(directedStartEvent, curTick + 1);
+            schedule(directedStartEvent, curTick() + 1);
         }
     } else {
         exitSimLoop("Ruby DirectedTester completed");
index 6f3bbd77e8ff70771f8818f78e81d5a899c95fef..9440bfec20f2037886c7dfbe3f897455731f0f67 100644 (file)
@@ -69,14 +69,14 @@ MemTest::CpuPort::recvAtomic(PacketPtr pkt)
     // must be snoop upcall
     assert(pkt->isRequest());
     assert(pkt->getDest() == Packet::Broadcast);
-    return curTick;
+    return curTick();
 }
 
 void
 MemTest::CpuPort::recvFunctional(PacketPtr pkt)
 {
     //Do nothing if we see one come through
-//    if (curTick != 0)//Supress warning durring initialization
+//    if (curTick() != 0)//Supress warning durring initialization
 //        warn("Functional Writes not implemented in MemTester\n");
     //Need to find any response values that intersect and update
     return;
@@ -220,7 +220,7 @@ MemTest::completeRequest(PacketPtr pkt)
         if (memcmp(pkt_data, data, pkt->getSize()) != 0) {
             panic("%s: read of %x (blk %x) @ cycle %d "
                   "returns %x, expected %x\n", name(),
-                  req->getPaddr(), blockAddr(req->getPaddr()), curTick,
+                  req->getPaddr(), blockAddr(req->getPaddr()), curTick(),
                   *pkt_data, *data);
         }
 
@@ -229,7 +229,7 @@ MemTest::completeRequest(PacketPtr pkt)
 
         if (numReads == (uint64_t)nextProgressMessage) {
             ccprintf(cerr, "%s: completed %d read accesses @%d\n",
-                     name(), numReads, curTick);
+                     name(), numReads, curTick());
             nextProgressMessage += progressInterval;
         }
 
@@ -272,13 +272,13 @@ void
 MemTest::tick()
 {
     if (!tickEvent.scheduled())
-        schedule(tickEvent, curTick + ticks(1));
+        schedule(tickEvent, curTick() + ticks(1));
 
     if (++noResponseCycles >= 500000) {
         if (issueDmas) {
             cerr << "DMA tester ";
         }
-        cerr << name() << ": deadlocked at cycle " << curTick << endl;
+        cerr << name() << ": deadlocked at cycle " << curTick() << endl;
         fatal("");
     }
 
index 0d384b08a176ca8e3da8d7501d3bcbf4909cf627..a33351312819c486239fe0580a4a8631a58f5e49 100644 (file)
@@ -98,7 +98,7 @@ Check::initiatePrefetch()
     }
 
     // Prefetches are assumed to be 0 sized
-    Request *req = new Request(m_address.getAddress(), 0, flags, curTick,
+    Request *req = new Request(m_address.getAddress(), 0, flags, curTick(),
                                m_pc.getAddress());
 
     PacketPtr pkt = new Packet(req, cmd, port->idx);
@@ -139,7 +139,7 @@ Check::initiateAction()
     Address writeAddr(m_address.getAddress() + m_store_count);
 
     // Stores are assumed to be 1 byte-sized
-    Request *req = new Request(writeAddr.getAddress(), 1, flags, curTick,
+    Request *req = new Request(writeAddr.getAddress(), 1, flags, curTick(),
                                m_pc.getAddress());
 
     Packet::Command cmd;
@@ -205,7 +205,7 @@ Check::initiateCheck()
 
     // Checks are sized depending on the number of bytes written
     Request *req = new Request(m_address.getAddress(), CHECK_SIZE, flags,
-                               curTick, m_pc.getAddress());
+                               curTick(), m_pc.getAddress());
 
     PacketPtr pkt = new Packet(req, MemCmd::ReadReq, port->idx);
     uint8_t* dataArray = new uint8_t[CHECK_SIZE];
index 8c5aafd8980f38e59c82ad1cb2c021f96019ab75..1d477dad24071c0c2519bb48e00b687e1cc24795 100644 (file)
@@ -160,7 +160,7 @@ RubyTester::wakeup()
 
         checkForDeadlock();
 
-        schedule(checkStartEvent, curTick + m_wakeup_frequency);
+        schedule(checkStartEvent, curTick() + m_wakeup_frequency);
     } else {
         exitSimLoop("Ruby Tester completed");
     }
index b286f1e40905e325167aa556112d8ec1151dd508..70aa1f042a3afd322b018c5dfc036f07a9f5f46e 100644 (file)
@@ -66,13 +66,13 @@ TraceCPU::tick()
     int instReqs = 0;
     int dataReqs = 0;
 
-    while (nextReq && curTick >= nextCycle) {
+    while (nextReq && curTick() >= nextCycle) {
         assert(nextReq->thread_num < 4 && "Not enough threads");
         if (nextReq->isInstFetch() && icacheInterface) {
             if (icacheInterface->isBlocked())
                 break;
 
-            nextReq->time = curTick;
+            nextReq->time = curTick();
             if (nextReq->cmd == Squash) {
                 icacheInterface->squash(nextReq->asid);
             } else {
@@ -91,7 +91,7 @@ TraceCPU::tick()
                 break;
 
             ++dataReqs;
-            nextReq->time = curTick;
+            nextReq->time = curTick();
             if (dcacheInterface->doEvents()) {
                 nextReq->completionEvent =
                     new TraceCompleteEvent(nextReq, this);
@@ -113,7 +113,7 @@ TraceCPU::tick()
             tickEvent.schedule(mainEventQueue.nextEventTime() + ticks(1));
         }
     } else {
-        tickEvent.schedule(max(curTick + ticks(1), nextCycle));
+        tickEvent.schedule(max(curTick() + ticks(1), nextCycle));
     }
 }
 
index 660ef00c57e925dc0cce4f7dc5846f92c53914f2..960832f8c1385a23bc76b9cfba9d839886251073 100644 (file)
@@ -234,7 +234,7 @@ AlphaBackdoor::write(PacketPtr pkt)
       default:
         int cpunum = (daddr - offsetof(AlphaAccess, cpuStack)) /
                      sizeof(alphaAccess->cpuStack[0]);
-        inform("Launching CPU %d @ %d", cpunum, curTick);
+        inform("Launching CPU %d @ %d", cpunum, curTick());
         assert(val > 0 && "Must not access primary cpu");
         if (cpunum >= 0 && cpunum < 64)
             alphaAccess->cpuStack[cpunum] = val;
index d8ea9409bc4069e08f1d11be6ca8fe7820a8bcce..dd1c8863e3b82fd09c4880f36758f8c06b42535c 100644 (file)
@@ -187,7 +187,7 @@ Pl011::write(PacketPtr pkt)
             DPRINTF(Uart, "TX int enabled, scheduling interruptt\n");
             rawInt.txim = 1;
             if (!intEvent.scheduled())
-                schedule(intEvent, curTick + intDelay);
+                schedule(intEvent, curTick() + intDelay);
         }
 
         break;
@@ -217,7 +217,7 @@ Pl011::write(PacketPtr pkt)
             DPRINTF(Uart, "Writing to IMSC: TX int enabled, scheduling interruptt\n");
             rawInt.txim = 1;
             if (!intEvent.scheduled())
-                schedule(intEvent, curTick + intDelay);
+                schedule(intEvent, curTick() + intDelay);
         }
 
         break;
@@ -252,7 +252,7 @@ Pl011::dataAvailable()
     DPRINTF(Uart, "Data available, scheduling interrupt\n");
 
     if (!intEvent.scheduled())
-        schedule(intEvent, curTick + intDelay);
+        schedule(intEvent, curTick() + intDelay);
 }
 
 void
index e78d2814144a1f4ba7baaa878ac5f5a16cd91c1d..e597bf27242de2bf40c49a93c77e530d8f09d526 100644 (file)
@@ -355,7 +355,7 @@ Pl111::readFramebuffer()
         startAddr = lcdUpbase;
     }
     curAddr = 0;
-    startTime = curTick;
+    startTime = curTick();
     maxAddr = static_cast<Addr>(length*sizeof(uint32_t));
     dmaPendingNum =0 ;
 
@@ -388,9 +388,9 @@ Pl111::dmaDone()
     DPRINTF(PL111, " -- DMA pending number %d\n", dmaPendingNum);
 
     if (maxAddr == curAddr && !dmaPendingNum) {
-        if ((curTick - startTime) > maxFrameTime)
+        if ((curTick() - startTime) > maxFrameTime)
             warn("CLCD controller buffer underrun, took %d cycles when should"
-                 " have taken %d\n", curTick - startTime, maxFrameTime);
+                 " have taken %d\n", curTick() - startTime, maxFrameTime);
 
         // double buffering so the vnc server doesn't see a tear in the screen
         memcpy(frameBuffer, dmaBuffer, maxAddr);
@@ -400,7 +400,7 @@ Pl111::dmaDone()
         writeBMP(frameBuffer);
 
         DPRINTF(PL111, "-- schedule next dma read event at %d tick \n",
-                maxFrameTime + curTick);
+                maxFrameTime + curTick());
         schedule(readEvent, nextCycle(startTime + maxFrameTime));
     }
 
@@ -415,7 +415,7 @@ Pl111::dmaDone()
 Tick
 Pl111::nextCycle()
 {
-    Tick nextTick = curTick + clock - 1;
+    Tick nextTick = curTick() + clock - 1;
     nextTick -= nextTick%clock;
     return nextTick;
 }
@@ -427,7 +427,7 @@ Pl111::nextCycle(Tick beginTick)
     if (nextTick%clock!=0)
         nextTick = nextTick - (nextTick%clock) + clock;
 
-    assert(nextTick >= curTick);
+    assert(nextTick >= curTick());
     return nextTick;
 }
 
index 08ac0723350c1afb1eaee82371bc92350aafddc4..c0ba4c7aa13b7681bf296276b112739ff3982f3a 100644 (file)
@@ -62,7 +62,7 @@ RealViewCtrl::read(PacketPtr pkt)
         break;
       case Clock24:
         Tick clk;
-        clk = (Tick)(curTick / (24 * SimClock::Float::MHz));
+        clk = (Tick)(curTick() / (24 * SimClock::Float::MHz));
         pkt->set((uint32_t)(clk));
         break;
       case Flash:
index f6bbfb515b736044257769376115e3a633b618a3..04668d26857f6300b9340690e42caa9c9bd28b85 100644 (file)
@@ -93,7 +93,7 @@ Sp804::Timer::read(PacketPtr pkt, Addr daddr)
         DPRINTF(Timer, "Event schedule for %d, clock=%d, prescale=%d\n",
                 zeroEvent.when(), clock, control.timerPrescale);
         Tick time;
-        time = zeroEvent.when() - curTick;
+        time = zeroEvent.when() - curTick();
         time = time / clock / power(16, control.timerPrescale);
         DPRINTF(Timer, "-- returning counter at %d\n", time);
         pkt->set<uint32_t>(time);
@@ -188,8 +188,8 @@ Sp804::Timer::restartCounter(uint32_t val)
         DPRINTF(Timer, "-- Event was already schedule, de-scheduling\n");
         parent->deschedule(zeroEvent);
     }
-    parent->schedule(zeroEvent, curTick + time);
-    DPRINTF(Timer, "-- Scheduling new event for: %d\n", curTick + time);
+    parent->schedule(zeroEvent, curTick() + time);
+    DPRINTF(Timer, "-- Scheduling new event for: %d\n", curTick() + time);
 }
 
 void
index 063a594e76997ef658587c189a600c6507365b02..b072e16f8e9c05859b6a6b2e9a538fb26e13ddd8 100644 (file)
@@ -87,7 +87,7 @@ bool
 EtherBus::send(EtherInt *sndr, EthPacketPtr &pkt)
 {
     if (busy()) {
-        DPRINTF(Ethernet, "ethernet packet not sent, bus busy\n", curTick);
+        DPRINTF(Ethernet, "ethernet packet not sent, bus busy\n", curTick());
         return false;
     }
 
@@ -99,7 +99,7 @@ EtherBus::send(EtherInt *sndr, EthPacketPtr &pkt)
     int delay = (int)ceil(((double)pkt->length * ticksPerByte) + 1.0);
     DPRINTF(Ethernet, "scheduling packet: delay=%d, (rate=%f)\n",
             delay, ticksPerByte);
-    schedule(event, curTick + delay);
+    schedule(event, curTick() + delay);
 
     return true;
 }
index 9cb15c4e870e928219f05f92767747d9118d3661..21532bd59115aeaf46aa70a04e946d6bce9b3db5 100644 (file)
@@ -94,8 +94,8 @@ void
 EtherDump::dumpPacket(EthPacketPtr &packet)
 {
     pcap_pkthdr pkthdr;
-    pkthdr.seconds = curTick / SimClock::Int::s;
-    pkthdr.microseconds = (curTick / SimClock::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 f3f38fc20fb04f08eba5fc097c566f822dfcd329..9d8d8cfa881e5d70be827e426e9de24640c89d37 100644 (file)
@@ -154,7 +154,7 @@ EtherLink::Link::txDone()
     if (linkDelay > 0) {
         DPRINTF(Ethernet, "packet delayed: delay=%d\n", linkDelay);
         Event *event = new LinkDelayEvent(this, packet);
-        parent->schedule(event, curTick + linkDelay);
+        parent->schedule(event, curTick() + linkDelay);
     } else {
         txComplete(packet);
     }
@@ -183,7 +183,7 @@ EtherLink::Link::transmit(EthPacketPtr pkt)
 
     DPRINTF(Ethernet, "scheduling packet: delay=%d, (rate=%f)\n",
             delay, ticksPerByte);
-    parent->schedule(doneEvent, curTick + delay);
+    parent->schedule(doneEvent, curTick() + delay);
 
     return true;
 }
index 85d6370beefd8c0f43359176bcf5766efa533055..76952e5c012df9cb6a76110d162538e000eb2797 100644 (file)
@@ -246,7 +246,7 @@ EtherTap::process(int revent)
             DPRINTF(Ethernet, "bus busy...buffer for retransmission\n");
             packetBuffer.push(packet);
             if (!txEvent.scheduled())
-                schedule(txEvent, curTick + retryTime);
+                schedule(txEvent, curTick() + retryTime);
         } else if (dump) {
             dump->dump(packet);
         }
@@ -269,7 +269,7 @@ EtherTap::retransmit()
     }
 
     if (!packetBuffer.empty() && !txEvent.scheduled())
-        schedule(txEvent, curTick + retryTime);
+        schedule(txEvent, curTick() + retryTime);
 }
 
 EtherInt*
index 2a044ebbe6ec03728ed88e0a751ad8a94013ae1f..78a89781501f147a1b732653295a6e25c28bca7b 100644 (file)
@@ -695,11 +695,11 @@ IGbE::postInterrupt(IntTypes t, bool now)
 
     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);
+            "EINT: postInterrupt() curTick(): %d itr: %d interval: %d\n",
+            curTick(), regs.itr.interval(), itr_interval);
 
     if (regs.itr.interval() == 0 || now ||
-        lastInterrupt + itr_interval <= curTick) {
+        lastInterrupt + itr_interval <= curTick()) {
         if (interEvent.scheduled()) {
             deschedule(interEvent);
         }
@@ -763,7 +763,7 @@ IGbE::cpuPostInt()
 
     intrPost();
 
-    lastInterrupt = curTick;
+    lastInterrupt = curTick();
 }
 
 void
@@ -801,7 +801,7 @@ IGbE::chkInterrupt()
             DPRINTF(Ethernet,
                     "Possibly scheduling interrupt because of imr write\n");
             if (!interEvent.scheduled()) {
-                Tick t = curTick + SimClock::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);
             }
@@ -888,7 +888,7 @@ IGbE::DescCache<T>::writeback(Addr aMask)
     wbOut = max_to_wb;
 
     assert(!wbDelayEvent.scheduled()); 
-    igbe->schedule(wbDelayEvent, curTick + igbe->wbDelay);
+    igbe->schedule(wbDelayEvent, curTick() + igbe->wbDelay);
     igbe->anBegin(annSmWb, "Prepare Writeback Desc");
 }
             
@@ -898,7 +898,7 @@ IGbE::DescCache<T>::writeback1()
 {
     // If we're draining delay issuing this DMA
     if (igbe->getState() != SimObject::Running) {
-        igbe->schedule(wbDelayEvent, curTick + igbe->wbDelay);
+        igbe->schedule(wbDelayEvent, curTick() + igbe->wbDelay);
         return;
     }
 
@@ -969,7 +969,7 @@ IGbE::DescCache<T>::fetchDescriptors()
     curFetching = max_to_fetch;
 
     assert(!fetchDelayEvent.scheduled());
-    igbe->schedule(fetchDelayEvent, curTick + igbe->fetchDelay);
+    igbe->schedule(fetchDelayEvent, curTick() + igbe->fetchDelay);
     igbe->anBegin(annSmFetch, "Prepare Fetch Desc");
 }
 
@@ -979,7 +979,7 @@ IGbE::DescCache<T>::fetchDescriptors1()
 {
     // If we're draining delay issuing this DMA
     if (igbe->getState() != SimObject::Running) {
-        igbe->schedule(fetchDelayEvent, curTick + igbe->fetchDelay);
+        igbe->schedule(fetchDelayEvent, curTick() + igbe->fetchDelay);
         return;
     }
 
@@ -1440,14 +1440,14 @@ IGbE::RxDescCache::pktComplete()
         if (igbe->regs.rdtr.delay()) {
             Tick delay = igbe->regs.rdtr.delay() * igbe->intClock();
             DPRINTF(EthernetSM, "RXS: Scheduling DTR for %d\n", delay);
-            igbe->reschedule(igbe->rdtrEvent, curTick + delay);
+            igbe->reschedule(igbe->rdtrEvent, curTick() + delay);
         }
 
         if (igbe->regs.radv.idv()) {
             Tick delay = igbe->regs.radv.idv() * igbe->intClock();
             DPRINTF(EthernetSM, "RXS: Scheduling ADV for %d\n", delay);
             if (!igbe->radvEvent.scheduled()) {
-                igbe->schedule(igbe->radvEvent, curTick + delay);
+                igbe->schedule(igbe->radvEvent, curTick() + delay);
             }
         }
 
@@ -1880,14 +1880,14 @@ IGbE::TxDescCache::pktComplete()
         if (igbe->regs.tidv.idv()) {
             Tick delay = igbe->regs.tidv.idv() * igbe->intClock();
             DPRINTF(EthernetDesc, "setting tidv\n");
-            igbe->reschedule(igbe->tidvEvent, curTick + delay, true);
+            igbe->reschedule(igbe->tidvEvent, curTick() + delay, true);
         }
 
         if (igbe->regs.tadv.idv() && igbe->regs.tidv.idv()) {
             Tick delay = igbe->regs.tadv.idv() * igbe->intClock();
             DPRINTF(EthernetDesc, "setting tadv\n");
             if (!igbe->tadvEvent.scheduled()) {
-                igbe->schedule(igbe->tadvEvent, curTick + delay);
+                igbe->schedule(igbe->tadvEvent, curTick() + delay);
             }
         }
     }
@@ -2039,7 +2039,7 @@ IGbE::restartClock()
 {
     if (!tickEvent.scheduled() && (rxTick || txTick || txFifoTick) &&
         getState() == SimObject::Running)
-        schedule(tickEvent, (curTick / ticks(1)) * ticks(1) + ticks(1));
+        schedule(tickEvent, (curTick() / ticks(1)) * ticks(1) + ticks(1));
 }
 
 unsigned int
@@ -2420,7 +2420,7 @@ IGbE::tick()
 
 
     if (rxTick || txTick || txFifoTick)
-        schedule(tickEvent, curTick + ticks(1));
+        schedule(tickEvent, curTick() + ticks(1));
 }
 
 void
index fe93924f97587373b48e2d01339cea11e9805f61..a30811d4ec7e18961ca1eb7cd38ee02c382e3144 100644 (file)
@@ -323,7 +323,7 @@ IdeDisk::doDmaTransfer()
               dmaState, devState);
 
     if (ctrl->dmaPending() || ctrl->getState() != SimObject::Running) {
-        schedule(dmaTransferEvent, curTick + DMA_BACKOFF_PERIOD);
+        schedule(dmaTransferEvent, curTick() + DMA_BACKOFF_PERIOD);
         return;
     } else
         ctrl->dmaRead(curPrdAddr, sizeof(PrdEntry_t), &dmaPrdReadEvent,
@@ -357,7 +357,7 @@ IdeDisk::doDmaDataRead()
     DPRINTF(IdeDisk, "doDmaRead, diskDelay: %d totalDiskDelay: %d\n",
             diskDelay, totalDiskDelay);
 
-    schedule(dmaReadWaitEvent, curTick + totalDiskDelay);
+    schedule(dmaReadWaitEvent, curTick() + totalDiskDelay);
 }
 
 void
@@ -403,7 +403,7 @@ IdeDisk::doDmaRead()
 
     }
     if (ctrl->dmaPending() || ctrl->getState() != SimObject::Running) {
-        schedule(dmaReadWaitEvent, curTick + DMA_BACKOFF_PERIOD);
+        schedule(dmaReadWaitEvent, curTick() + DMA_BACKOFF_PERIOD);
         return;
     } else if (!dmaReadCG->done()) {
         assert(dmaReadCG->complete() < MAX_DMA_SIZE);
@@ -465,7 +465,7 @@ IdeDisk::doDmaDataWrite()
         cmdBytesLeft -= SectorSize;
     }
 
-    schedule(dmaWriteWaitEvent, curTick + totalDiskDelay);
+    schedule(dmaWriteWaitEvent, curTick() + totalDiskDelay);
 }
 
 void
@@ -478,7 +478,7 @@ IdeDisk::doDmaWrite()
                 curPrd.getByteCount(), TheISA::PageBytes);
     }
     if (ctrl->dmaPending() || ctrl->getState() != SimObject::Running) {
-        schedule(dmaWriteWaitEvent, curTick + DMA_BACKOFF_PERIOD);
+        schedule(dmaWriteWaitEvent, curTick() + DMA_BACKOFF_PERIOD);
         return;
     } else if (!dmaWriteCG->done()) {
         assert(dmaWriteCG->complete() < MAX_DMA_SIZE);
@@ -553,7 +553,7 @@ IdeDisk::startDma(const uint32_t &prdTableBase)
     dmaState = Dma_Transfer;
 
     // schedule dma transfer (doDmaTransfer)
-    schedule(dmaTransferEvent, curTick + 1);
+    schedule(dmaTransferEvent, curTick() + 1);
 }
 
 void
index 9e507b9681a6a4c5b619ed8a9026a624350167d5..aee716c010d05d41bd017c6759911fcd017368e9 100644 (file)
@@ -281,9 +281,9 @@ Intel8254Timer::Counter::CounterEvent::setTo(int clocks)
 {
     if (clocks == 0)
         panic("Timer can't be set to go off instantly.\n");
-    DPRINTF(Intel8254Timer, "Timer set to curTick + %d\n",
+    DPRINTF(Intel8254Timer, "Timer set to curTick() + %d\n",
             clocks * interval);
-    counter->parent->schedule(this, curTick + clocks * interval);
+    counter->parent->schedule(this, curTick() + clocks * interval);
 }
 
 int
@@ -291,7 +291,7 @@ Intel8254Timer::Counter::CounterEvent::clocksLeft()
 {
     if (!scheduled())
         return -1;
-    return (when() - curTick + interval - 1) / interval;
+    return (when() - curTick() + interval - 1) / interval;
 }
 
 const char *
index 08269bf51bdd7cf427ab5e17cb6b20b368a59576..be97bc4ad49ae65161afca5688c09d9646170ce2 100644 (file)
@@ -121,7 +121,7 @@ DmaPort::recvTiming(PacketPtr pkt)
         else if (backoffTime < maxBackoffDelay)
             backoffTime <<= 1;
 
-        reschedule(backoffEvent, curTick + backoffTime, true);
+        reschedule(backoffEvent, curTick() + backoffTime, true);
 
         DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime);
 
@@ -144,7 +144,7 @@ DmaPort::recvTiming(PacketPtr pkt)
         if (state->totBytes == state->numBytes) {
             if (state->completionEvent) {
                 if (state->delay)
-                    schedule(state->completionEvent, curTick + state->delay);
+                    schedule(state->completionEvent, curTick() + state->delay);
                 else
                     state->completionEvent->process();
             }
@@ -212,9 +212,9 @@ DmaPort::recvRetry()
     } while (!backoffTime &&  result && transmitList.size());
 
     if (transmitList.size() && backoffTime && !inRetry) {
-        DPRINTF(DMA, "Scheduling backoff for %d\n", curTick+backoffTime);
+        DPRINTF(DMA, "Scheduling backoff for %d\n", curTick()+backoffTime);
         if (!backoffEvent.scheduled())
-            schedule(backoffEvent, backoffTime + curTick);
+            schedule(backoffEvent, backoffTime + curTick());
     }
     DPRINTF(DMA, "TransmitList: %d, backoffTime: %d inRetry: %d es: %d\n",
             transmitList.size(), backoffTime, inRetry,
@@ -299,8 +299,8 @@ DmaPort::sendDma()
         if (transmitList.size() && backoffTime && !inRetry &&
                 !backoffEvent.scheduled()) {
             DPRINTF(DMA, "-- Scheduling backoff timer for %d\n",
-                    backoffTime+curTick);
-            schedule(backoffEvent, backoffTime + curTick);
+                    backoffTime+curTick());
+            schedule(backoffEvent, backoffTime + curTick());
         }
     } else if (state == Enums::atomic) {
         transmitList.pop_front();
@@ -322,7 +322,7 @@ DmaPort::sendDma()
         if (state->totBytes == state->numBytes) {
             if (state->completionEvent) {
                 assert(!state->completionEvent->scheduled());
-                schedule(state->completionEvent, curTick + lat + state->delay);
+                schedule(state->completionEvent, curTick() + lat + state->delay);
             }
             delete state;
             delete pkt->req;
index 16ed58e463bb635bf8bf790be4856eb9e0033e83..987b1bcd338680d009d31bb2c57a9f2b42a13963 100644 (file)
@@ -214,9 +214,9 @@ MC146818::serialize(const string &base, ostream &os)
     // save the timer tick and rtc clock tick values to correctly reschedule 
     // them during unserialize
     //
-    Tick rtcTimerInterruptTickOffset = event.when() - curTick;
+    Tick rtcTimerInterruptTickOffset = event.when() - curTick();
     SERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
-    Tick rtcClockTickOffset = event.when() - curTick;
+    Tick rtcClockTickOffset = event.when() - curTick();
     SERIALIZE_SCALAR(rtcClockTickOffset);
 }
 
@@ -234,30 +234,30 @@ MC146818::unserialize(const string &base, Checkpoint *cp,
     //
     Tick rtcTimerInterruptTickOffset;
     UNSERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
-    reschedule(event, curTick + rtcTimerInterruptTickOffset);
+    reschedule(event, curTick() + rtcTimerInterruptTickOffset);
     Tick rtcClockTickOffset;
     UNSERIALIZE_SCALAR(rtcClockTickOffset);
-    reschedule(tickEvent, curTick + rtcClockTickOffset);
+    reschedule(tickEvent, curTick() + rtcClockTickOffset);
 }
 
 MC146818::RTCEvent::RTCEvent(MC146818 * _parent, Tick i)
     : parent(_parent), interval(i)
 {
     DPRINTF(MC146818, "RTC Event Initilizing\n");
-    parent->schedule(this, curTick + interval);
+    parent->schedule(this, curTick() + interval);
 }
 
 void
 MC146818::RTCEvent::scheduleIntr()
 {
-    parent->schedule(this, curTick + interval);
+    parent->schedule(this, curTick() + interval);
 }
 
 void
 MC146818::RTCEvent::process()
 {
     DPRINTF(MC146818, "RTC Timer Interrupt\n");
-    parent->schedule(this, curTick + interval);
+    parent->schedule(this, curTick() + interval);
     parent->handleEvent();
 }
 
@@ -271,7 +271,7 @@ void
 MC146818::RTCTickEvent::process()
 {
     DPRINTF(MC146818, "RTC clock tick\n");
-    parent->schedule(this, curTick + SimClock::Int::s);
+    parent->schedule(this, curTick() + SimClock::Int::s);
     parent->tickClock();
 }
 
index 699785199a3ad9618875d3fce1fbe0ee0e85fc3a..576c4ab9fedb5042f7775989a9d7bafa685d0981 100644 (file)
@@ -71,7 +71,7 @@ class MC146818 : public EventManager
 
         RTCTickEvent(MC146818 * _parent) : parent(_parent)
         {
-            parent->schedule(this, curTick + SimClock::Int::s);
+            parent->schedule(this, curTick() + SimClock::Int::s);
         }
 
         /** Event process to occur at interrupt*/
index 86f081ec5855c8992b2ae75f47e8833f3d7ab7f6..794fd53551b89a2bbda8600a59dfa55c1efecee2 100644 (file)
@@ -848,7 +848,7 @@ NSGigE::devIntrPost(uint32_t interrupts)
             interrupts, regs.isr, regs.imr);
 
     if ((regs.isr & regs.imr)) {
-        Tick when = curTick;
+        Tick when = curTick();
         if ((regs.isr & regs.imr & ISR_NODELAY) == 0)
             when += intrDelay;
         postedInterrupts++;
@@ -910,7 +910,7 @@ NSGigE::devIntrChangeMask()
             regs.isr, regs.imr, regs.isr & regs.imr);
 
     if (regs.isr & regs.imr)
-        cpuIntrPost(curTick);
+        cpuIntrPost(curTick());
     else
         cpuIntrClear();
 }
@@ -927,8 +927,8 @@ NSGigE::cpuIntrPost(Tick when)
      * @todo this warning should be removed and the intrTick code should
      * be fixed.
      */
-    assert(when >= curTick);
-    assert(intrTick >= curTick || intrTick == 0);
+    assert(when >= curTick());
+    assert(intrTick >= curTick() || intrTick == 0);
     if (when > intrTick && intrTick != 0) {
         DPRINTF(EthernetIntr, "don't need to schedule event...intrTick=%d\n",
                 intrTick);
@@ -936,9 +936,9 @@ NSGigE::cpuIntrPost(Tick when)
     }
 
     intrTick = when;
-    if (intrTick < curTick) {
+    if (intrTick < curTick()) {
         debug_break();
-        intrTick = curTick;
+        intrTick = curTick();
     }
 
     DPRINTF(EthernetIntr, "going to schedule an interrupt for intrTick=%d\n",
@@ -953,7 +953,7 @@ NSGigE::cpuIntrPost(Tick when)
 void
 NSGigE::cpuInterrupt()
 {
-    assert(intrTick == curTick);
+    assert(intrTick == curTick());
 
     // Whether or not there's a pending interrupt, we don't care about
     // it anymore
@@ -1125,7 +1125,7 @@ NSGigE::rxKick()
 
   next:
     if (clock) {
-        if (rxKickTick > curTick) {
+        if (rxKickTick > curTick()) {
             DPRINTF(EthernetSM, "receive kick exiting, can't run till %d\n",
                     rxKickTick);
 
@@ -1133,7 +1133,7 @@ NSGigE::rxKick()
         }
 
         // Go to the next state machine clock tick.
-        rxKickTick = curTick + ticks(1);
+        rxKickTick = curTick() + ticks(1);
     }
 
     switch(rxDmaState) {
@@ -1494,7 +1494,7 @@ NSGigE::transmit()
 
    if (!txFifo.empty() && !txEvent.scheduled()) {
        DPRINTF(Ethernet, "reschedule transmit\n");
-       schedule(txEvent, curTick + retryTime);
+       schedule(txEvent, curTick() + retryTime);
    }
 }
 
@@ -1573,14 +1573,14 @@ NSGigE::txKick()
 
   next:
     if (clock) {
-        if (txKickTick > curTick) {
+        if (txKickTick > curTick()) {
             DPRINTF(EthernetSM, "transmit kick exiting, can't run till %d\n",
                     txKickTick);
             goto exit;
         }
 
         // Go to the next state machine clock tick.
-        txKickTick = curTick + ticks(1);
+        txKickTick = curTick() + ticks(1);
     }
 
     switch(txDmaState) {
@@ -2001,7 +2001,7 @@ NSGigE::transferDone()
 
     DPRINTF(Ethernet, "transfer complete: data in txFifo...schedule xmit\n");
 
-    reschedule(txEvent, curTick + ticks(1), true);
+    reschedule(txEvent, curTick() + ticks(1), true);
 }
 
 bool
@@ -2259,7 +2259,7 @@ NSGigE::serialize(ostream &os)
      * If there's a pending transmit, store the time so we can
      * reschedule it later
      */
-    Tick transmitTick = txEvent.scheduled() ? txEvent.when() - curTick : 0;
+    Tick transmitTick = txEvent.scheduled() ? txEvent.when() - curTick() : 0;
     SERIALIZE_SCALAR(transmitTick);
 
     /*
@@ -2440,7 +2440,7 @@ NSGigE::unserialize(Checkpoint *cp, const std::string &section)
     Tick transmitTick;
     UNSERIALIZE_SCALAR(transmitTick);
     if (transmitTick)
-        schedule(txEvent, curTick + transmitTick);
+        schedule(txEvent, curTick() + transmitTick);
 
     /*
      * unserialize receive address filter settings
index 2183d9d998f29b44bbf134838d32993ae377a1ec..98a2426f59aad62840e06964cadaeaf4aadaef87 100644 (file)
@@ -618,7 +618,7 @@ Device::devIntrPost(uint32_t interrupts)
         interrupts &= ~Regs::Intr_TxLow;
 
     if (interrupts) {
-        Tick when = curTick;
+        Tick when = curTick();
         if ((interrupts & Regs::Intr_NoDelay) == 0)
             when += intrDelay;
         cpuIntrPost(when);
@@ -654,7 +654,7 @@ Device::devIntrChangeMask(uint32_t newmask)
             regs.IntrStatus, regs.IntrMask, regs.IntrStatus & regs.IntrMask);
 
     if (regs.IntrStatus & regs.IntrMask)
-        cpuIntrPost(curTick);
+        cpuIntrPost(curTick());
     else
         cpuIntrClear();
 }
@@ -671,8 +671,8 @@ Base::cpuIntrPost(Tick when)
      * @todo this warning should be removed and the intrTick code should
      * be fixed.
      */
-    assert(when >= curTick);
-    assert(intrTick >= curTick || intrTick == 0);
+    assert(when >= curTick());
+    assert(intrTick >= curTick() || intrTick == 0);
     if (!cpuIntrEnable) {
         DPRINTF(EthernetIntr, "interrupts not enabled.\n",
                 intrTick);
@@ -686,9 +686,9 @@ Base::cpuIntrPost(Tick when)
     }
 
     intrTick = when;
-    if (intrTick < curTick) {
+    if (intrTick < curTick()) {
         debug_break();
-        intrTick = curTick;
+        intrTick = curTick();
     }
 
     DPRINTF(EthernetIntr, "going to schedule an interrupt for intrTick=%d\n",
@@ -703,7 +703,7 @@ Base::cpuIntrPost(Tick when)
 void
 Base::cpuInterrupt()
 {
-    assert(intrTick == curTick);
+    assert(intrTick == curTick());
 
     // Whether or not there's a pending interrupt, we don't care about
     // it anymore
@@ -759,7 +759,7 @@ Device::changeConfig(uint32_t newconf)
         cpuIntrEnable = regs.Config & Regs::Config_IntEn;
         if (cpuIntrEnable) {
             if (regs.IntrStatus & regs.IntrMask)
-                cpuIntrPost(curTick);
+                cpuIntrPost(curTick());
         } else {
             cpuIntrClear();
         }
@@ -882,7 +882,7 @@ Device::rxKick()
     DPRINTF(EthernetSM, "rxKick: rxState=%s (rxFifo.size=%d)\n",
             RxStateStrings[rxState], rxFifo.size());
 
-    if (rxKickTick > curTick) {
+    if (rxKickTick > curTick()) {
         DPRINTF(EthernetSM, "rxKick: exiting, can't run till %d\n",
                 rxKickTick);
         return;
@@ -1196,7 +1196,7 @@ Device::txKick()
     DPRINTF(EthernetSM, "txKick: txState=%s (txFifo.size=%d)\n",
             TxStateStrings[txState], txFifo.size());
 
-    if (txKickTick > curTick) {
+    if (txKickTick > curTick()) {
         DPRINTF(EthernetSM, "txKick: exiting, can't run till %d\n",
                 txKickTick);
         return;
@@ -1317,7 +1317,7 @@ Device::transferDone()
 
     DPRINTF(Ethernet, "transfer complete: data in txFifo...schedule xmit\n");
 
-    reschedule(txEvent, curTick + ticks(1), true);
+    reschedule(txEvent, curTick() + ticks(1), true);
 }
 
 bool
@@ -1573,7 +1573,7 @@ Device::serialize(std::ostream &os)
      * If there's a pending transmit, store the time so we can
      * reschedule it later
      */
-    Tick transmitTick = txEvent.scheduled() ? txEvent.when() - curTick : 0;
+    Tick transmitTick = txEvent.scheduled() ? txEvent.when() - curTick() : 0;
     SERIALIZE_SCALAR(transmitTick);
 }
 
@@ -1708,7 +1708,7 @@ Device::unserialize(Checkpoint *cp, const std::string &section)
     Tick transmitTick;
     UNSERIALIZE_SCALAR(transmitTick);
     if (transmitTick)
-        schedule(txEvent, curTick + transmitTick);
+        schedule(txEvent, curTick() + transmitTick);
 
     pioPort->sendStatusChange(Port::RangeChange);
 
index f8bd233117448cbd239761c9df15540d502ceb8d..f33a428f760bff2ca9a8a00002436b8ac9cb1cde 100644 (file)
@@ -68,7 +68,7 @@ Uart8250::IntrEvent::process()
        DPRINTF(Uart, "UART InterEvent, interrupting\n");
        uart->platform->postConsoleInt();
        uart->status |= intrBit;
-       uart->lastTxInt = curTick;
+       uart->lastTxInt = curTick();
     }
     else
        DPRINTF(Uart, "UART InterEvent, not interrupting\n");
@@ -92,11 +92,11 @@ Uart8250::IntrEvent::scheduleIntr()
 {
     static const Tick interval = 225 * SimClock::Int::ns;
     DPRINTF(Uart, "Scheduling IER interrupt for %#x, at cycle %lld\n", intrBit,
-            curTick + interval);
+            curTick() + interval);
     if (!scheduled())
-        uart->schedule(this, curTick + interval);
+        uart->schedule(this, curTick() + interval);
     else
-        uart->reschedule(this, curTick + interval);
+        uart->reschedule(this, curTick() + interval);
 }
 
 
@@ -218,13 +218,13 @@ Uart8250::write(PacketPtr pkt)
                 if (UART_IER_THRI & IER)
                 {
                     DPRINTF(Uart, "IER: IER_THRI set, scheduling TX intrrupt\n");
-                    if (curTick - lastTxInt > 225 * SimClock::Int::ns) {
+                    if (curTick() - lastTxInt > 225 * SimClock::Int::ns) {
                         DPRINTF(Uart, "-- Interrupting Immediately... %d,%d\n",
-                                curTick, lastTxInt);
+                                curTick(), lastTxInt);
                         txIntrEvent.process();
                     } else {
                         DPRINTF(Uart, "-- Delaying interrupt... %d,%d\n",
-                                curTick, lastTxInt);
+                                curTick(), lastTxInt);
                         txIntrEvent.scheduleIntr();
                     }
                 }
index aa9342a1311bc15799ee1d3cd9f7609f547b72fc..d1de00fcdc4f1d53c7b5fab0a9132de79e8354e6 100644 (file)
@@ -120,8 +120,8 @@ Statistics::swpipl(int ipl)
         return;
 
     _iplGood[ipl]++;
-    _iplTicks[iplLast] += curTick - iplLastTick;
-    iplLastTick = curTick;
+    _iplTicks[iplLast] += curTick() - iplLastTick;
+    iplLastTick = curTick();
     iplLast = ipl;
 }
 
index 668b492e8583357078366bba3e560c9f533b2804..4b83250883b46bdd052563de2a5c38218a0d1847 100644 (file)
@@ -158,7 +158,7 @@ Bridge::BridgePort::nackRequest(PacketPtr pkt)
     pkt->setNacked();
 
     //put it on the list to send
-    Tick readyTime = curTick + nackDelay;
+    Tick readyTime = curTick() + nackDelay;
     PacketBuffer *buf = new PacketBuffer(pkt, readyTime, true);
 
     // nothing on the list, add it and we're done
@@ -221,7 +221,7 @@ Bridge::BridgePort::queueForSendTiming(PacketPtr pkt)
 
 
 
-    Tick readyTime = curTick + delay;
+    Tick readyTime = curTick() + delay;
     PacketBuffer *buf = new PacketBuffer(pkt, readyTime);
 
     // If we're about to put this packet at the head of the queue, we
@@ -241,7 +241,7 @@ Bridge::BridgePort::trySend()
 
     PacketBuffer *buf = sendQueue.front();
 
-    assert(buf->ready <= curTick);
+    assert(buf->ready <= curTick());
 
     PacketPtr pkt = buf->pkt;
 
@@ -283,7 +283,7 @@ Bridge::BridgePort::trySend()
         if (!sendQueue.empty()) {
             buf = sendQueue.front();
             DPRINTF(BusBridge, "Scheduling next send\n");
-            schedule(sendEvent, std::max(buf->ready, curTick + 1));
+            schedule(sendEvent, std::max(buf->ready, curTick() + 1));
         }
     } else {
         DPRINTF(BusBridge, "  unsuccessful\n");
@@ -301,7 +301,7 @@ Bridge::BridgePort::recvRetry()
 {
     inRetry = false;
     Tick nextReady = sendQueue.front()->ready;
-    if (nextReady <= curTick)
+    if (nextReady <= curTick())
         trySend();
     else
         schedule(sendEvent, nextReady);
index 39399017cef5bf22e93d2736a9c95a09612ea38e..c84d9fc5e18fdcf373e69cfe41a624c47207b4eb 100644 (file)
@@ -142,10 +142,10 @@ Bus::calcPacketTiming(PacketPtr pkt)
     // a cycle boundary to take up only the following cycle. Anything
     // that happens later will have to "wait" for the end of that
     // cycle, and then start using the bus after that.
-    if (tickNextIdle < curTick) {
-        tickNextIdle = curTick;
+    if (tickNextIdle < curTick()) {
+        tickNextIdle = curTick();
         if (tickNextIdle % clock != 0)
-            tickNextIdle = curTick - (curTick % clock) + clock;
+            tickNextIdle = curTick() - (curTick() % clock) + clock;
     }
 
     Tick headerTime = tickNextIdle + headerCycles * clock;
@@ -181,7 +181,7 @@ void Bus::occupyBus(Tick until)
     reschedule(busIdle, tickNextIdle, true);
 
     DPRINTF(Bus, "The bus is now occupied from tick %d to %d\n",
-            curTick, tickNextIdle);
+            curTick(), tickNextIdle);
 }
 
 /** Function called by the port when the bus is receiving a Timing
@@ -205,7 +205,7 @@ Bus::recvTiming(PacketPtr pkt)
     // If the bus is busy, or other devices are in line ahead of the current
     // one, put this device on the retry list.
     if (!pkt->isExpressSnoop() &&
-        (tickNextIdle > curTick ||
+        (tickNextIdle > curTick() ||
          (retryList.size() && (!inRetry || src_port != retryList.front()))))
     {
         addToRetryList(src_port);
@@ -295,7 +295,7 @@ void
 Bus::recvRetry(int id)
 {
     // If there's anything waiting, and the bus isn't busy...
-    if (retryList.size() && curTick >= tickNextIdle) {
+    if (retryList.size() && curTick() >= tickNextIdle) {
         //retryingPort = retryList.front();
         inRetry = true;
         DPRINTF(Bus, "Sending a retry to %s\n", retryList.front()->getPeer()->name());
@@ -308,7 +308,7 @@ Bus::recvRetry(int id)
             inRetry = false;
 
             //Bring tickNextIdle up to the present
-            while (tickNextIdle < curTick)
+            while (tickNextIdle < curTick())
                 tickNextIdle += clock;
 
             //Burn a cycle for the missed grant.
@@ -318,7 +318,7 @@ Bus::recvRetry(int id)
         }
     }
     //If we weren't able to drain before, we might be able to now.
-    if (drainEvent && retryList.size() == 0 && curTick >= tickNextIdle) {
+    if (drainEvent && retryList.size() == 0 && curTick() >= tickNextIdle) {
         drainEvent->process();
         // Clear the drain event once we're done with it.
         drainEvent = NULL;
@@ -435,7 +435,7 @@ Bus::recvAtomic(PacketPtr pkt)
     }
 
     // why do we have this packet field and the return value both???
-    pkt->finishTime = curTick + response_latency;
+    pkt->finishTime = curTick() + response_latency;
     return response_latency;
 }
 
@@ -649,7 +649,7 @@ Bus::drain(Event * de)
     //We should check that we're not "doing" anything, and that noone is
     //waiting. We might be idle but have someone waiting if the device we
     //contacted for a retry didn't actually retry.
-    if (retryList.size() || (curTick < tickNextIdle && busIdle.scheduled())) {
+    if (retryList.size() || (curTick() < tickNextIdle && busIdle.scheduled())) {
         drainEvent = de;
         return 1;
     }
@@ -659,8 +659,8 @@ Bus::drain(Event * de)
 void
 Bus::startup()
 {
-    if (tickNextIdle < curTick)
-        tickNextIdle = (curTick / clock) * clock + clock;
+    if (tickNextIdle < curTick())
+        tickNextIdle = (curTick() / clock) * clock + clock;
 }
 
 Bus *
index 70bc51cda400b04a93c065e573ff0958c08561aa..9166e1a0993829f85112afab61e47fcb58f95881 100644 (file)
@@ -124,7 +124,7 @@ BaseCache::CachePort::clearBlocked()
         mustSendRetry = false;
         SendRetryEvent *ev = new SendRetryEvent(this, true);
         // @TODO: need to find a better time (next bus cycle?)
-        schedule(ev, curTick + 1);
+        schedule(ev, curTick() + 1);
     }
 }
 
index 867d771210ad9a87c51ad8d315dfd2ffeadcf43c..e8a6442966e8a8007a347f0946ec590108c00bea 100644 (file)
@@ -434,7 +434,7 @@ class BaseCache : public MemObject
         uint8_t flag = 1 << cause;
         if (blocked == 0) {
             blocked_causes[cause]++;
-            blockedCycle = curTick;
+            blockedCycle = curTick();
             cpuSidePort->setBlocked();
         }
         blocked |= flag;
@@ -454,7 +454,7 @@ class BaseCache : public MemObject
         blocked &= ~flag;
         DPRINTF(Cache,"Unblocking for cause %d, mask=%d\n", cause, blocked);
         if (blocked == 0) {
-            blocked_cycles[cause] += curTick - blockedCycle;
+            blocked_cycles[cause] += curTick() - blockedCycle;
             cpuSidePort->clearBlocked();
         }
     }
index bf78a226876628dbe99cfff2261b710a2ff585e7..6be09597c628e1ec7aa1becd551cf3edb175a528 100644 (file)
@@ -89,7 +89,7 @@ class CacheBlk
     /** The current status of this block. @sa CacheBlockStatusBits */
     State status;
 
-    /** Which curTick will this block be accessable */
+    /** Which curTick() will this block be accessable */
     Tick whenReady;
 
     /**
index c5b7ca065751e9acd20c084694ec9d7e0c656d4f..e4e4a3c9231a19f86cf41450f47f4d2543d2f410 100644 (file)
@@ -412,7 +412,7 @@ Cache<TagStore>::timingAccess(PacketPtr pkt)
 //    MemDebug::cacheAccess(pkt);
 
     // we charge hitLatency for doing just about anything here
-    Tick time =  curTick + hitLatency;
+    Tick time =  curTick() + hitLatency;
 
     if (pkt->isResponse()) {
         // must be cache-to-cache response from upper to lower level
@@ -504,7 +504,7 @@ Cache<TagStore>::timingAccess(PacketPtr pkt)
     if (satisfied) {
         if (needsResponse) {
             pkt->makeTimingResponse();
-            cpuSidePort->respond(pkt, curTick+lat);
+            cpuSidePort->respond(pkt, curTick()+lat);
         } else {
             delete pkt;
         }
@@ -532,7 +532,7 @@ Cache<TagStore>::timingAccess(PacketPtr pkt)
                 noTargetMSHR = mshr;
                 setBlocked(Blocked_NoTargets);
                 // need to be careful with this... if this mshr isn't
-                // ready yet (i.e. time > curTick_, we don't want to
+                // ready yet (i.e. time > curTick()_, we don't want to
                 // move it ahead of mshrs that are ready
                 // mshrQueue.moveToFront(mshr);
             }
@@ -816,7 +816,7 @@ template<class TagStore>
 void
 Cache<TagStore>::handleResponse(PacketPtr pkt)
 {
-    Tick time = curTick + hitLatency;
+    Tick time = curTick() + hitLatency;
     MSHR *mshr = dynamic_cast<MSHR*>(pkt->senderState);
     bool is_error = pkt->isError();
 
@@ -848,7 +848,7 @@ Cache<TagStore>::handleResponse(PacketPtr pkt)
     MSHR::Target *initial_tgt = mshr->getTarget();
     BlkType *blk = tags->findBlock(pkt->getAddr());
     int stats_cmd_idx = initial_tgt->pkt->cmdToIndex();
-    Tick miss_latency = curTick - initial_tgt->recvTime;
+    Tick miss_latency = curTick() - initial_tgt->recvTime;
     PacketList writebacks;
 
     if (pkt->req->isUncacheable()) {
@@ -1159,7 +1159,7 @@ doTimingSupplyResponse(PacketPtr req_pkt, uint8_t *blk_data,
         // invalidate it.
         pkt->cmd = MemCmd::ReadRespWithInvalidate;
     }
-    memSidePort->respond(pkt, curTick + hitLatency);
+    memSidePort->respond(pkt, curTick() + hitLatency);
 }
 
 template<class TagStore>
@@ -1430,7 +1430,7 @@ Cache<TagStore>::getNextMSHR()
                 // (hwpf_mshr_misses)
                 mshr_misses[pkt->cmdToIndex()][0/*pkt->req->threadId()*/]++;
                 // Don't request bus, since we already have it
-                return allocateMissBuffer(pkt, curTick, false);
+                return allocateMissBuffer(pkt, curTick(), false);
             }
         }
     }
@@ -1461,7 +1461,7 @@ Cache<TagStore>::getTimingPacket()
         pkt = new Packet(tgt_pkt);
         pkt->cmd = MemCmd::UpgradeFailResp;
         pkt->senderState = mshr;
-        pkt->firstWordTime = pkt->finishTime = curTick;
+        pkt->firstWordTime = pkt->finishTime = curTick();
         handleResponse(pkt);
         return NULL;
     } else if (mshr->isForwardNoResponse()) {
@@ -1679,7 +1679,7 @@ Cache<TagStore>::MemSidePort::sendPacket()
         // @TODO: need to facotr in prefetch requests here somehow
         if (nextReady != MaxTick) {
             DPRINTF(CachePort, "more packets to send @ %d\n", nextReady);
-            schedule(sendEvent, std::max(nextReady, curTick + 1));
+            schedule(sendEvent, std::max(nextReady, curTick() + 1));
         } else {
             // no more to send right now: if we're draining, we may be done
             if (drainEvent && !sendEvent->scheduled()) {
index 54977346f51c7ec60dc7d0bacb3ced3f5abb698b..292c11c6b3472ab240e4f88377f4d50f25d6e44e 100644 (file)
@@ -333,7 +333,7 @@ MSHR::handleSnoop(PacketPtr pkt, Counter _order)
         // Actual target device (typ. PhysicalMemory) will delete the
         // packet on reception, so we need to save a copy here.
         PacketPtr cp_pkt = new Packet(pkt, true);
-        targets->add(cp_pkt, curTick, _order, Target::FromSnoop,
+        targets->add(cp_pkt, curTick(), _order, Target::FromSnoop,
                      downstreamPending && targets->needsExclusive);
         ++ntargets;
 
@@ -378,7 +378,7 @@ MSHR::promoteDeferredTargets()
     deferredTargets->resetFlags();
 
     order = targets->front().order;
-    readyTime = std::max(curTick, targets->front().readyTime);
+    readyTime = std::max(curTick(), targets->front().readyTime);
 
     return true;
 }
index 9b55e70effd2c00d856d68610339ffc0d9b10526..7920ad717f12130dd228db0c133402b481a90363 100644 (file)
@@ -72,7 +72,7 @@ class MSHR : public Packet::SenderState, public Printable
 
         Target(PacketPtr _pkt, Tick _readyTime, Counter _order,
                Source _source, bool _markedPending)
-            : recvTime(curTick), readyTime(_readyTime), order(_order),
+            : recvTime(curTick()), readyTime(_readyTime), order(_order),
               pkt(_pkt), source(_source), markedPending(_markedPending)
         {}
     };
index d8c495679e2084b8b73a38211fd1f3ba35a6eaef..5a8739fc7d1203f736c292f1a0a9ce884dbc2361 100644 (file)
@@ -199,7 +199,7 @@ class MSHRQueue
      */
     MSHR *getNextMSHR() const
     {
-        if (readyList.empty() || readyList.front()->readyTime > curTick) {
+        if (readyList.empty() || readyList.front()->readyTime > curTick()) {
             return NULL;
         }
         return readyList.front();
index 4d1c2175f8cea4269d9a5d89618885768760731f..873883c1b3e3a57053dab8e1d90c02c3abb76946 100644 (file)
@@ -220,7 +220,7 @@ FALRU::findVictim(Addr addr, PacketList &writebacks)
         blk->isTouched = true;
         if (!warmedUp && tagsInUse.value() >= warmupBound) {
             warmedUp = true;
-            warmupCycle = curTick;
+            warmupCycle = curTick();
         }
     }
     //assert(check());
index 1315a17eebdb3ec20aafee8e85e78a259670ef04..743c6894f4708a821af2e03c7ec29321f4514b68 100644 (file)
@@ -257,8 +257,8 @@ IIC::accessBlock(Addr addr, int &lat, int context_src)
         hitDepthTotal += sets[set].depth;
         tag_ptr->status |= BlkReferenced;
         lat = set_lat;
-        if (tag_ptr->whenReady > curTick && tag_ptr->whenReady - curTick > set_lat) {
-            lat = tag_ptr->whenReady - curTick;
+        if (tag_ptr->whenReady > curTick() && tag_ptr->whenReady - curTick() > set_lat) {
+            lat = tag_ptr->whenReady - curTick();
         }
 
         tag_ptr->refCount += 1;
@@ -437,7 +437,7 @@ IIC::getFreeTag(int set, PacketList & writebacks)
     tagsInUse++;
     if (!warmedUp && tagsInUse.value() >= warmupBound) {
         warmedUp = true;
-        warmupCycle = curTick;
+        warmupCycle = curTick();
     }
 
     return tag_ptr;
index 8a8b0d0d650c714a23eadb7d62cddb8578ec568b..25e98d2938207f6d643488cdce9195f7bbbc9b74 100644 (file)
@@ -126,9 +126,9 @@ LRU::accessBlock(Addr addr, int &lat, int context_src)
         sets[set].moveToHead(blk);
         DPRINTF(CacheRepl, "set %x: moving blk %x to MRU\n",
                 set, regenerateBlkAddr(tag, set));
-        if (blk->whenReady > curTick
-            && blk->whenReady - curTick > hitLatency) {
-            lat = blk->whenReady - curTick;
+        if (blk->whenReady > curTick()
+            && blk->whenReady - curTick() > hitLatency) {
+            lat = blk->whenReady - curTick();
         }
         blk->refCount += 1;
     }
@@ -180,7 +180,7 @@ LRU::insertBlock(Addr addr, BlkType *blk, int context_src)
         blk->isTouched = true;
         if (!warmedUp && tagsInUse.value() >= warmupBound) {
             warmedUp = true;
-            warmupCycle = curTick;
+            warmupCycle = curTick();
         }
     }
 
index ff01ab1dc0fc1508f6d30423ce78d6e154cf1f8f..6253f982857fdbbf626f17872d49965bca49ea81 100644 (file)
@@ -414,14 +414,14 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
         int SD_BEST_T_WRITE_READ_OBANK = (war_lat -1); /* WAR, row miss/hit, another bank */
         int SD_BEST_T_WRITE_WRITE_OBANK = 0; /* WAW, row miss/hit, another bank */
 
-    Tick time_since_last_access = curTick-time_last_access;
+    Tick time_since_last_access = curTick()-time_last_access;
     Tick time_last_miss = 0;    // used for keeping track of times between activations (page misses)
-    //int was_idle = (curTick > busy_until);
+    //int was_idle = (curTick() > busy_until);
         bool srow_flag = false;
         int timing_correction = 0;
 
-    int was_idle = (curTick > busy_until[current_bank]);
-    cycles_nCKE[0] += was_idle ? MIN(curTick-busy_until[current_bank], time_since_last_access) : 0;
+    int was_idle = (curTick() > busy_until[current_bank]);
+    cycles_nCKE[0] += was_idle ? MIN(curTick()-busy_until[current_bank], time_since_last_access) : 0;
 
     // bank is precharged
     //active_row[current_bank] == DR_NUM_ROWS
@@ -441,7 +441,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
     if(all_precharged) {
         if(was_idle) {
-                cycles_all_precharge_nCKE[0] += MIN(curTick-busy_until[current_bank], time_since_last_access);
+                cycles_all_precharge_nCKE[0] += MIN(curTick()-busy_until[current_bank], time_since_last_access);
                 cycles_all_precharge_CKE[0] += MIN(0, busy_until[current_bank]-time_last_access);
         }
         else {
@@ -449,7 +449,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
         }
     } else { // some bank is active
         if(was_idle) {
-                cycles_bank_active_nCKE[0] += MIN(curTick-busy_until[current_bank], time_since_last_access);
+                cycles_bank_active_nCKE[0] += MIN(curTick()-busy_until[current_bank], time_since_last_access);
         }
         else {
         }
@@ -462,7 +462,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
     }
 
 
-    time_last_access = curTick;
+    time_last_access = curTick();
     ////////////////////////////////////////////////////////////////////////////
 
     if ((mem_type == "SDRAM") && (mem_actpolicy == "open"))
@@ -516,7 +516,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
         if (memctrlpipe_enable == true)
           {
-            overlap=(int)(busy_until[current_bank] - curTick);
+            overlap=(int)(busy_until[current_bank] - curTick());
           }
         else overlap = 0;
 
@@ -529,7 +529,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
             corrected_overlap = (int) (overlap/cpu_ratio);
           }
 
-        /*fprintf(stderr,"%10.0f %10.0f %4d %4d ",(double)busy_until, (double)curTick, overlap, corrected_overlap); debugging*/
+        /*fprintf(stderr,"%10.0f %10.0f %4d %4d ",(double)busy_until, (double)curTick(), overlap, corrected_overlap); debugging*/
 
         if (cmdIsRead == lastCmdIsRead)/*same command*/
           {
@@ -889,25 +889,25 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
           {
             if (memctrlpipe_enable == true)
               {
-              busy_until[current_bank]=curTick+lat+
+              busy_until[current_bank]=curTick()+lat+
                         timing_correction;
               }
             else
               {
-                if (busy_until[current_bank] >= curTick)
+                if (busy_until[current_bank] >= curTick())
                   {
                     busy_until[current_bank]+=(lat+
                                 timing_correction);
                         total_arb_latency += (busy_until[current_bank]
-                                - curTick - lat
+                                - curTick() - lat
                                 - timing_correction);
-                    lat=busy_until[current_bank] - curTick;
+                    lat=busy_until[current_bank] - curTick();
                   }
-                else busy_until[current_bank]=curTick+lat+
+                else busy_until[current_bank]=curTick()+lat+
                         timing_correction;
               }
           }
-        else/*the memory request will be satisfied temp cycles after curTick*/
+        else/*the memory request will be satisfied temp cycles after curTick()*/
           {
             busy_until[current_bank] +=(lat+
                         timing_correction);
@@ -1001,7 +1001,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
         if (memctrlpipe_enable == true)
           {
-            overlap=(int)(busy_until[current_bank] - curTick);
+            overlap=(int)(busy_until[current_bank] - curTick());
           }
         else overlap=0;
 
@@ -1014,7 +1014,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
             corrected_overlap = (int) (overlap/cpu_ratio);
           }
 
-        /*fprintf(stderr,"%10.0f %10.0f %6d %6d %2d %2d ",(double)busy_until, (double)curTick, overlap, corrected_overlap,precharge,adjacent);debugging*/
+        /*fprintf(stderr,"%10.0f %10.0f %6d %6d %2d %2d ",(double)busy_until, (double)curTick(), overlap, corrected_overlap,precharge,adjacent);debugging*/
 
         if (cmdIsRead == lastCmdIsRead)/*same command*/
           {
@@ -2013,19 +2013,19 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
           {
             if (memctrlpipe_enable == true)
               {
-                busy_until[current_bank] =curTick+lat;
+                busy_until[current_bank] =curTick()+lat;
               }
             else
               {
-                if (busy_until[current_bank] >= curTick)
+                if (busy_until[current_bank] >= curTick())
                   {
                     busy_until[current_bank] +=lat;
-                    lat=busy_until[current_bank] - curTick;
+                    lat=busy_until[current_bank] - curTick();
                   }
-                else busy_until[current_bank] = curTick+lat;
+                else busy_until[current_bank] = curTick()+lat;
               }
           }
-        else/*the memory request will be satisfied temp cycles after curTick*/
+        else/*the memory request will be satisfied temp cycles after curTick()*/
           {
             busy_until[current_bank] +=lat;
             command_overlapping++;
@@ -2073,7 +2073,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
           }
         total_access++;
 
-        overlap=(int)(busy_until[current_bank] - curTick);
+        overlap=(int)(busy_until[current_bank] - curTick());
 
         if (current_bank == last_bank)/*same bank*/
           {
@@ -2206,9 +2206,9 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
         if (overlap <= 0) /*memory interface is not busy*/
           {
-            busy_until[current_bank] = curTick+lat;
+            busy_until[current_bank] = curTick()+lat;
           }
-        else /*the memory request will be satisfied temp cycles after curTick*/
+        else /*the memory request will be satisfied temp cycles after curTick()*/
           {
             busy_until[current_bank] +=lat;
             command_overlapping++;
@@ -2223,7 +2223,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
 
 
-        /*fprintf(stderr,"%10.0f %10.0f %4d %4d \n",(double)busy_until, (double)curTick, overlap, lat);debug*/
+        /*fprintf(stderr,"%10.0f %10.0f %4d %4d \n",(double)busy_until, (double)curTick(), overlap, lat);debug*/
         // if((_cpu_num < num_cpus) && (_cpu_num >= 0))
                 // cout <<"cpu id = " << _cpu_num << "current_bank = " << current_bank << endl;
     //  bank_access_profile[_cpu_num][current_bank]++;
@@ -2269,7 +2269,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
           }
         total_access++;
 
-        overlap=(int)(busy_until[current_bank] - curTick);
+        overlap=(int)(busy_until[current_bank] - curTick());
 
         if (cpu_ratio < 1.0)
           {
@@ -2432,16 +2432,16 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
         if (overlap <= 0) /*memory interface is not busy*/
           {
-            busy_until[current_bank] = curTick+lat;
+            busy_until[current_bank] = curTick()+lat;
           }
-        else/*the memory request will be satisfied temp cycles after curTick*/
+        else/*the memory request will be satisfied temp cycles after curTick()*/
           {
             busy_until[current_bank] +=lat;
             command_overlapping++;
             lat+=overlap;
           }
 
-        /*fprintf(stderr,"%10.0f %10.0f %4d %4d \n",(double)busy_until, (double)curTick, overlap, lat);*/
+        /*fprintf(stderr,"%10.0f %10.0f %4d %4d \n",(double)busy_until, (double)curTick(), overlap, lat);*/
 
         if (cmdIsRead)
           {
@@ -2494,7 +2494,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
         total_access++;
         lat += chunks;
 
-        overlap=(int)(busy_until[current_bank] - curTick);
+        overlap=(int)(busy_until[current_bank] - curTick());
         lastCmdIsRead=cmdIsRead;
 
         if (cpu_ratio < 1.0)
@@ -2509,9 +2509,9 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
         if (overlap <= 0) /*memory interface is not busy*/
           {
-            busy_until[current_bank] = curTick+lat;
+            busy_until[current_bank] = curTick()+lat;
           }
-        else/*the memory request will be satisfied temp cycles after curTick*/
+        else/*the memory request will be satisfied temp cycles after curTick()*/
           {
             busy_until[current_bank] +=lat;
             command_overlapping++;
@@ -2543,7 +2543,7 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
             lat = DR_T_RCD + DR_T_CWD + DR_T_PACKET; /* DR_T_RP + */
           }
         total_access++;
-        overlap=(int)(busy_until[current_bank] - curTick);
+        overlap=(int)(busy_until[current_bank] - curTick());
         lat += chunks * DR_T_PACKET; /*every 128 bit need DR_NUM_CYCLES*/
 
         if (cpu_ratio < 1.0)
@@ -2560,9 +2560,9 @@ DRAMMemory::calculateLatency(PacketPtr pkt)
 
         if (overlap <= 0) /*memory interface is not busy*/
           {
-            busy_until[current_bank] = curTick+lat;
+            busy_until[current_bank] = curTick()+lat;
           }
-        else/*the memory request will be satisfied temp cycles after curTick*/
+        else/*the memory request will be satisfied temp cycles after curTick()*/
           {
             busy_until[current_bank] += lat;
             command_overlapping++;
index 564c560c62b9019a58db9631cb31079855a68812..80393c81e96fa654f8cb7137a9ca30f107e55ca5 100644 (file)
@@ -50,7 +50,7 @@ MessagePort::recvAtomic(PacketPtr pkt)
 void
 MessagePort::sendMessageTiming(PacketPtr pkt, Tick latency)
 {
-    schedSendTiming(pkt, curTick + latency);
+    schedSendTiming(pkt, curTick() + latency);
 }
 
 Tick
index 41edef8a78a161f09a12a45d9618de51ecdeed25..19fff7e3ad17afe68cc41c0f5577062e4aabb41c 100644 (file)
@@ -496,7 +496,7 @@ class Packet : public FastAlloc, public Printable
      */
     Packet(Request *_req, MemCmd _cmd, NodeID _dest)
         :  flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
-           dest(_dest), time(curTick), senderState(NULL)
+           dest(_dest), time(curTick()), senderState(NULL)
     {
         if (req->hasPaddr()) {
             addr = req->getPaddr();
@@ -515,7 +515,7 @@ class Packet : public FastAlloc, public Printable
      */
     Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
         :  flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
-           dest(_dest), time(curTick), senderState(NULL)
+           dest(_dest), time(curTick()), senderState(NULL)
     {
         if (req->hasPaddr()) {
             addr = req->getPaddr() & ~(_blkSize - 1);
@@ -536,7 +536,7 @@ class Packet : public FastAlloc, public Printable
         :  cmd(pkt->cmd), req(pkt->req),
            data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
            addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
-           time(curTick), senderState(pkt->senderState)
+           time(curTick()), senderState(pkt->senderState)
     {
         if (!clearFlags)
             flags.set(pkt->flags & COPY_FLAGS);
index 38daea266476cf811a81c8313a1ab208d76471c5..ec1b8ba29daa3417501e5c62edc467b3d7f19f5f 100644 (file)
@@ -145,7 +145,7 @@ class Request : public FastAlloc
 
     /**
      * The time this request was started. Used to calculate
-     * latencies. This field is set to curTick any time paddr or vaddr
+     * latencies. This field is set to curTick() any time paddr or vaddr
      * is written.
      */
     Tick _time;
@@ -179,7 +179,7 @@ class Request : public FastAlloc
 
     /**
      * Constructor for physical (e.g. device) requests.  Initializes
-     * just physical address, size, flags, and timestamp (to curTick).
+     * just physical address, size, flags, and timestamp (to curTick()).
      * These fields are adequate to perform a request. 
      */
     Request(Addr paddr, int size, Flags flags)
@@ -240,7 +240,7 @@ class Request : public FastAlloc
     void
     setPhys(Addr paddr, int size, Flags flags)
     {
-        setPhys(paddr, size, flags, curTick);
+        setPhys(paddr, size, flags, curTick());
     }
 
     /**
@@ -255,7 +255,7 @@ class Request : public FastAlloc
         _vaddr = vaddr;
         _size = size;
         _pc = pc;
-        _time = curTick;
+        _time = curTick();
 
         _flags.clear(~STICKY_FLAGS);
         _flags.set(flags);
index 6fa8b0ac39a298d31ecd6406b3411b38c07b7143..3e2bc3f899dba3e95f3ba26b7484b47bf64cbec4 100644 (file)
@@ -71,7 +71,7 @@ class RubyEventQueue : public EventManager
     RubyEventQueue(EventQueue* eventq, Tick _clock);
     ~RubyEventQueue();
 
-    Time getTime() const { return curTick/m_clock; }
+    Time getTime() const { return curTick()/m_clock; }
     Tick getClock() const { return m_clock; }
     void scheduleEvent(Consumer* consumer, Time timeDelta);
     void scheduleEventAbsolute(Consumer* consumer, Time timeAbs);
index f707af36fb86a9845b2505b00151240d616d30c3..ea1ff04f0d62740f3881ce678270a1e09907af6c 100644 (file)
@@ -318,7 +318,7 @@ bool
 RubyPort::M5Port::sendTiming(PacketPtr pkt)
 {
     //minimum latency, must be > 0
-    schedSendTiming(pkt, curTick + (1 * g_eventQueue_ptr->getClock()));
+    schedSendTiming(pkt, curTick() + (1 * g_eventQueue_ptr->getClock()));
     return true;
 }
 
@@ -326,7 +326,7 @@ bool
 RubyPort::PioPort::sendTiming(PacketPtr pkt)
 {
     //minimum latency, must be > 0
-    schedSendTiming(pkt, curTick + (1 * g_eventQueue_ptr->getClock()));
+    schedSendTiming(pkt, curTick() + (1 * g_eventQueue_ptr->getClock()));
     return true;
 }
 
index 1a0f8a66a93afae3c0ae4b3a877f3c559fdbf649..6357980f26d422c4830f56e69c76a98f5d0d7793 100644 (file)
@@ -132,7 +132,7 @@ Sequencer::wakeup()
         // If there are still outstanding requests, keep checking
         schedule(deadlockCheckEvent,
                  m_deadlock_threshold * g_eventQueue_ptr->getClock() +
-                 curTick);
+                 curTick());
     }
 }
 
@@ -223,7 +223,7 @@ Sequencer::insertRequest(SequencerRequest* request)
 
     // See if we should schedule a deadlock check
     if (deadlockCheckEvent.scheduled() == false) {
-        schedule(deadlockCheckEvent, m_deadlock_threshold + curTick);
+        schedule(deadlockCheckEvent, m_deadlock_threshold + curTick());
     }
 
     Address line_addr(request->ruby_request.paddr);
index a6d0d87d6ec9686f55c55ddf1036f48e5035bd06..a704724ac361a33b0b80b0aeba92759b6282a254 100644 (file)
@@ -159,7 +159,7 @@ RubySystem::unserialize(Checkpoint *cp, const string &section)
     //
     // The main purpose for clearing stats in the unserialize process is so
     // that the profiler can correctly set its start time to the unserialized
-    // value of curTick
+    // value of curTick()
     //
     clearStats();
 }
index 4e89544e3b94e698be03f3dd4edb2c6cb0e00b84..61f9e143ccc8e2b06f748d98537b899854641eed 100644 (file)
@@ -95,7 +95,7 @@ SimpleTimingPort::recvTiming(PacketPtr pkt)
         // recvAtomic() should already have turned packet into
         // atomic response
         assert(pkt->isResponse());
-        schedSendTiming(pkt, curTick + latency);
+        schedSendTiming(pkt, curTick() + latency);
     } else {
         delete pkt;
     }
@@ -107,8 +107,8 @@ SimpleTimingPort::recvTiming(PacketPtr pkt)
 void
 SimpleTimingPort::schedSendTiming(PacketPtr pkt, Tick when)
 {
-    assert(when > curTick);
-    assert(when < curTick + SimClock::Int::ms);
+    assert(when > curTick());
+    assert(when < curTick() + SimClock::Int::ms);
 
     // Nothing is on the list: add it and schedule an event
     if (transmitList.empty() || when < transmitList.front().tick) {
@@ -152,7 +152,7 @@ SimpleTimingPort::sendDeferredPacket()
     if (success) {
         if (!transmitList.empty() && !sendEvent->scheduled()) {
             Tick time = transmitList.front().tick;
-            schedule(sendEvent, time <= curTick ? curTick+1 : time);
+            schedule(sendEvent, time <= curTick() ? curTick()+1 : time);
         }
 
         if (transmitList.empty() && drainEvent && !sendEvent->scheduled()) {
index 7dfe60b72385378233a8df9734dd77318fce487b..91a8ab9a55d639a84052dba2a88755d30336c41f 100644 (file)
@@ -100,7 +100,7 @@ class SimpleTimingPort : public Port
 
     /** Check whether we have a packet ready to go on the transmit list. */
     bool deferredPacketReady()
-    { return !transmitList.empty() && transmitList.front().tick <= curTick; }
+    { return !transmitList.empty() && transmitList.front().tick <= curTick(); }
 
     Tick deferredPacketReadyTime()
     { return transmitList.empty() ? MaxTick : transmitList.front().tick; }
@@ -129,7 +129,7 @@ class SimpleTimingPort : public Port
 
     /** Attempt to send the packet at the head of the deferred packet
      * list.  Caller must guarantee that the deferred packet list is
-     * non-empty and that the head packet is scheduled for curTick (or
+     * non-empty and that the head packet is scheduled for curTick() (or
      * earlier).
      */
     void sendDeferredPacket();
index 196f3b6b438dac8f49bee95a682441cd4796156b..cbcc0049797f51e14682efaff96ce21cd4d6b276 100644 (file)
@@ -127,7 +127,7 @@ def simulate(*args, **kwargs):
 
 # Export curTick to user script.
 def curTick():
-    return internal.core.cvar.curTick
+    return internal.core.curTick()
 
 # Python exit handlers happen in reverse order.  We want to dump stats last.
 atexit.register(internal.stats.dump)
index 7201b03d83666ca7310244d1f4f7902e599dc8a8..b8f70039d5002f82fb2a6ea28663af7879ece148 100644 (file)
@@ -73,8 +73,7 @@ const bool flag_TRACING_ON;
 
 void setClockFrequency(Tick ticksPerSecond);
 
-%immutable curTick;
-Tick curTick;
+Tick curTick();
 
 class Checkpoint;
 
index 67ce72173281aa8d7a934c0c9a431f62a42f052b..1f113093779ee9eb634f2ece0a90168a05426db1 100644 (file)
@@ -37,6 +37,7 @@
 #include "base/statistics.hh"
 #include "base/stats/mysql.hh"
 #include "base/stats/text.hh"
+#include "sim/core.hh"
 #include "sim/stat_control.hh"
 %}
 
@@ -51,7 +52,7 @@ void initMySQL(std::string host, std::string database, std::string user,
     std::string sample);
 
 void schedStatEvent(bool dump, bool reset,
-                    Tick when = curTick, Tick repeat = 0);
+                    Tick when = curTick(), Tick repeat = 0);
 
 void enable();
 void prepare();
index 1b7a034f0c11202d23590ecada1f86df91b6a50c..ab75e1d9a1783de9d14f197bb53200f3a648b854 100644 (file)
 
 using namespace std;
 
-Tick curTick = 0;
+Tick _curTick = 0;
 
 namespace SimClock {
-/// The simulated frequency of curTick. (In ticks per second)
+/// The simulated frequency of curTick(). (In ticks per second)
 Tick Frequency;
 
 namespace Float {
index 074ce32b6c394f7c435eeab7920eb33cfa108fc5..64640957e995241d157275872e9d4a08e1837181 100644 (file)
 #include "base/types.hh"
 
 /// The universal simulation clock.
-extern Tick curTick;
+extern Tick _curTick;
+
+inline Tick curTick() { return _curTick; }
+inline void curTick(Tick newVal) { _curTick = newVal; }
+
 const Tick retryTime = 1000;
 
 namespace SimClock {
-/// The simulated frequency of curTick.
+/// The simulated frequency of curTick().
 extern Tick Frequency;
 
 namespace Float {
index d460610642ecaada059896f7535109052a9297db..71036fe7e486e3dea9b374ce2d7fa7c5164bef9e 100644 (file)
@@ -309,7 +309,7 @@ void
 EventQueue::dump() const
 {
     cprintf("============================================================\n");
-    cprintf("EventQueue Dump  (cycle %d)\n", curTick);
+    cprintf("EventQueue Dump  (cycle %d)\n", curTick());
     cprintf("------------------------------------------------------------\n");
 
     if (empty())
index 3869ca287163fd1f8b8d78adea1c85cd50c3e4e6..e28c43bb774b8630bb68d470f0dbbe6dc13d7300 100644 (file)
@@ -136,7 +136,7 @@ class Event : public Serializable, public FastAlloc
         queue = q;
 #endif
 #ifdef EVENTQ_DEBUG
-        whenScheduled = curTick;
+        whenScheduled = curTick();
 #endif
     }
 
@@ -254,7 +254,7 @@ class Event : public Serializable, public FastAlloc
         queue = NULL;
 #endif
 #ifdef EVENTQ_DEBUG
-        whenCreated = curTick;
+        whenCreated = curTick();
         whenScheduled = 0;
 #endif
     }
@@ -405,15 +405,15 @@ class EventQueue : public Serializable
         }
     }
 
-    // default: process all events up to 'now' (curTick)
-    void serviceEvents() { serviceEvents(curTick); }
+    // default: process all events up to 'now' (curTick())
+    void serviceEvents() { serviceEvents(curTick()); }
 
     // return true if no events are queued
     bool empty() const { return head == NULL; }
 
     void dump() const;
 
-    Tick nextEventTime() { return empty() ? curTick : head->when(); }
+    Tick nextEventTime() { return empty() ? curTick() : head->when(); }
 
     bool debugVerify() const;
 
@@ -486,7 +486,7 @@ class EventManager
 inline void
 EventQueue::schedule(Event *event, Tick when)
 {
-    assert((UTick)when >= (UTick)curTick);
+    assert((UTick)when >= (UTick)curTick());
     assert(!event->scheduled());
     assert(event->initialized());
 
@@ -523,7 +523,7 @@ EventQueue::deschedule(Event *event)
 inline void
 EventQueue::reschedule(Event *event, Tick when, bool always)
 {
-    assert(when >= curTick);
+    assert(when >= curTick());
     assert(always || event->scheduled());
     assert(event->initialized());
 
index bd835917ec76cc849751057f6c014242d6a83202..a9aa905ee9332094ae141e7811f8f44b1ad13077 100644 (file)
@@ -75,7 +75,7 @@ exitNowHandler(int sigtype)
 void
 abortHandler(int sigtype)
 {
-    ccprintf(cerr, "Program aborted at cycle %d\n", curTick);
+    ccprintf(cerr, "Program aborted at cycle %d\n", curTick());
 }
 
 /*
index df6ba1781278619a05fc7851954c1fc78362d3ce..9ee473014bc17fcfd445de18b32df80593f3e21a 100644 (file)
@@ -95,7 +95,7 @@ quiesceNs(ThreadContext *tc, uint64_t ns)
 
     EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
 
-    Tick resume = curTick + SimClock::Int::ns * ns;
+    Tick resume = curTick() + SimClock::Int::ns * ns;
 
     cpu->reschedule(quiesceEvent, resume, true);
 
@@ -117,7 +117,7 @@ quiesceCycles(ThreadContext *tc, uint64_t cycles)
 
     EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
 
-    Tick resume = curTick + cpu->ticks(cycles);
+    Tick resume = curTick() + cpu->ticks(cycles);
 
     cpu->reschedule(quiesceEvent, resume, true);
 
@@ -141,7 +141,7 @@ quiesceTime(ThreadContext *tc)
 uint64_t
 rpns(ThreadContext *tc)
 {
-    return curTick / SimClock::Int::ns;
+    return curTick() / SimClock::Int::ns;
 }
 
 void
@@ -156,7 +156,7 @@ wakeCPU(ThreadContext *tc, uint64_t cpuid)
 void
 m5exit(ThreadContext *tc, Tick delay)
 {
-    Tick when = curTick + delay * SimClock::Int::ns;
+    Tick when = curTick() + delay * SimClock::Int::ns;
     exitSimLoop("m5_exit instruction encountered", 0, when);
 }
 
@@ -233,7 +233,7 @@ resetstats(ThreadContext *tc, Tick delay, Tick period)
         return;
 
 
-    Tick when = curTick + delay * SimClock::Int::ns;
+    Tick when = curTick() + delay * SimClock::Int::ns;
     Tick repeat = period * SimClock::Int::ns;
 
     Stats::schedStatEvent(false, true, when, repeat);
@@ -246,7 +246,7 @@ dumpstats(ThreadContext *tc, Tick delay, Tick period)
         return;
 
 
-    Tick when = curTick + delay * SimClock::Int::ns;
+    Tick when = curTick() + delay * SimClock::Int::ns;
     Tick repeat = period * SimClock::Int::ns;
 
     Stats::schedStatEvent(true, false, when, repeat);
@@ -259,7 +259,7 @@ dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
         return;
 
 
-    Tick when = curTick + delay * SimClock::Int::ns;
+    Tick when = curTick() + delay * SimClock::Int::ns;
     Tick repeat = period * SimClock::Int::ns;
 
     Stats::schedStatEvent(true, true, when, repeat);
@@ -271,7 +271,7 @@ m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
     if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
         return;
 
-    Tick when = curTick + delay * SimClock::Int::ns;
+    Tick when = curTick() + delay * SimClock::Int::ns;
     Tick repeat = period * SimClock::Int::ns;
 
     exitSimLoop("checkpoint", 0, when, repeat);
index aa343d0e9c2ed7569574ad866f0fbef44d414754..b050027e2b7b1cbb2012f4e9fb737ef097f09e6a 100644 (file)
@@ -400,7 +400,7 @@ void
 Globals::serialize(ostream &os)
 {
     nameOut(os);
-    SERIALIZE_SCALAR(curTick);
+    SERIALIZE_SCALAR(curTick());
 
     nameOut(os, "MainEventQueue");
     mainEventQueue.serialize(os);
@@ -410,7 +410,9 @@ void
 Globals::unserialize(Checkpoint *cp)
 {
     const string &section = name();
-    UNSERIALIZE_SCALAR(curTick);
+    Tick tick;
+    paramIn(cp, section, "curTick", tick);
+    curTick(tick);
 
     mainEventQueue.unserialize(cp, "MainEventQueue");
 }
@@ -533,10 +535,10 @@ string Checkpoint::currentDirectory;
 string
 Checkpoint::setDir(const string &name)
 {
-    // use csprintf to insert curTick into directory name if it
+    // use csprintf to insert curTick() into directory name if it
     // appears to have a format placeholder in it.
     currentDirectory = (name.find("%") != string::npos) ?
-        csprintf(name, curTick) : name;
+        csprintf(name, curTick()) : name;
     if (currentDirectory[currentDirectory.size() - 1] != '/')
         currentDirectory += "/";
     return currentDirectory;
index d785605f3cda6dd8f41b834d997c5a6bdf84811a..5ea632ea4b5bdeee7138103b9437dc4f3b967e57 100644 (file)
@@ -250,7 +250,7 @@ class Checkpoint
 
   public:
     // Set the current directory.  This function takes care of
-    // inserting curTick if there's a '%d' in the argument, and
+    // inserting curTick() if there's a '%d' in the argument, and
     // appends a '/' if necessary.  The final name is returned.
     static std::string setDir(const std::string &base_name);
 
index 6d743cac6b7ba6eeed7e5822eb4d0cc992e5199c..aac844429767ccc18e30e102baf3350cd6ad96a4 100644 (file)
@@ -66,7 +66,7 @@ SimLoopExitEvent::process()
     // but if you are doing this on intervals, don't forget to make another
     if (repeat) {
         assert(getFlags(IsMainQueue));
-        mainEventQueue.schedule(this, curTick + repeat);
+        mainEventQueue.schedule(this, curTick() + repeat);
     }
 }
 
index 589f6993e28e061dc9a613c7d47172d2f36b959e..da71cc912cb33a4ae9ee0ab1c18cf3b4f9d5ba66 100644 (file)
@@ -47,10 +47,10 @@ class SimLoopExitEvent;
 void registerExitCallback(Callback *);
 
 /// Schedule an event to exit the simulation loop (returning to
-/// Python) at the end of the current cycle (curTick).  The message
+/// Python) at the end of the current cycle (curTick()).  The message
 /// and exit_code parameters are saved in the SimLoopExitEvent to
 /// indicate why the exit occurred.
 void exitSimLoop(const std::string &message, int exit_code = 0,
-                 Tick when = curTick, Tick repeat = 0);
+                 Tick when = curTick(), Tick repeat = 0);
 
 #endif // __SIM_EXIT_HH__
index 567288e963e84a24e375efed1468031aafad81d0..d57a56ab85e6039bb23848c61e3e284c89774ec6 100644 (file)
@@ -131,7 +131,7 @@ class SimObject : public EventManager, public Serializable
     /**
      * startup() is the final initialization call before simulation.
      * All state is initialized (including unserialized state, if any,
-     * such as the curTick value), so this is the appropriate place to
+     * such as the curTick() value), so this is the appropriate place to
      * schedule initial event(s) for objects that need them.
      */
     virtual void startup();
index de33cce1cbf9fb2e6e188b1dd5e7c1fb4a4cd21b..5e69f0ff45590f3e93fa34a33167b3d47f99a2e2 100644 (file)
 SimLoopExitEvent *
 simulate(Tick num_cycles)
 {
-    inform("Entering event queue @ %d.  Starting simulation...\n", curTick);
+    inform("Entering event queue @ %d.  Starting simulation...\n", curTick());
 
     if (num_cycles < 0)
         fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles);
-    else if (curTick + num_cycles < 0)  //Overflow
+    else if (curTick() + num_cycles < 0)  //Overflow
         num_cycles = MaxTick;
     else
-        num_cycles = curTick + num_cycles;
+        num_cycles = curTick() + num_cycles;
 
     Event *limit_event =
         new SimLoopExitEvent("simulate() limit reached", 0);
@@ -64,12 +64,12 @@ simulate(Tick num_cycles)
         // there should always be at least one event (the SimLoopExitEvent
         // we just scheduled) in the queue
         assert(!mainEventQueue.empty());
-        assert(curTick <= mainEventQueue.nextTick() &&
+        assert(curTick() <= mainEventQueue.nextTick() &&
                "event scheduled in the past");
 
         // forward current cycle to the time of the first event on the
         // queue
-        curTick = mainEventQueue.nextTick();
+        curTick(mainEventQueue.nextTick());
         Event *exit_event = mainEventQueue.serviceOne();
         if (exit_event != NULL) {
             // hit some kind of exit event; return to Python
index 5985eb0a45b7e5c66dd0957d5b9f29d36308bc84..f2c7c8a2e37f384030ab93431db48937f7d5a916 100644 (file)
@@ -66,7 +66,7 @@ struct SimTicksReset : public Callback
     void process()
     {
         statTime.set();
-        startTick = curTick;
+        startTick = curTick();
     }
 };
 
@@ -81,7 +81,7 @@ statElapsedTime()
 Tick
 statElapsedTicks()
 {
-    return curTick - startTick;
+    return curTick() - startTick;
 }
 
 SimTicksReset simTicksReset;
@@ -189,7 +189,7 @@ class StatEvent : public Event
             Stats::reset();
 
         if (repeat) {
-            Stats::schedStatEvent(dump, reset, curTick + repeat, repeat);
+            Stats::schedStatEvent(dump, reset, curTick() + repeat, repeat);
         }
     }
 };
index ac3c4496061654be9883446f112246dce99f92ba..c41a9482a4675759ea1fa084cccf9945d62330a3 100644 (file)
@@ -34,7 +34,7 @@
 namespace Stats {
 
 void initSimStats();
-void schedStatEvent(bool dump, bool reset, Tick when = curTick,
+void schedStatEvent(bool dump, bool reset, Tick when = curTick(),
                     Tick repeat = 0);
 
 } // namespace Stats
index 60bb59790f533864df95c71d45eb338249a8c37a..e0469744e51e48f7a9568e36c84ceb2ffff772c4 100644 (file)
@@ -59,7 +59,7 @@ SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc)
 #endif
     DPRINTFR(SyscallVerbose,
              "%d: %s: syscall %s called w/arguments %d,%d,%d,%d\n",
-             curTick, tc->getCpuPtr()->name(), name,
+             curTick(), tc->getCpuPtr()->name(), name,
              process->getSyscallArg(tc, index),
              process->getSyscallArg(tc, index),
              process->getSyscallArg(tc, index),
@@ -68,7 +68,7 @@ SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc)
     SyscallReturn retval = (*funcPtr)(this, callnum, process, tc);
 
     DPRINTFR(SyscallVerbose, "%d: %s: syscall %s returns %d\n",
-             curTick,tc->getCpuPtr()->name(), name, retval.value());
+             curTick(),tc->getCpuPtr()->name(), name, retval.value());
 
     if (!(flags & SyscallDesc::SuppressReturnValue))
         process->setSyscallReturn(tc, retval);
index f2847b2e503f2fd619399a688781564eb39041b3..1dc51ad5686944d01ebe586e3fd0bff5ac55acbf 100644 (file)
@@ -363,7 +363,7 @@ template <class T1, class T2>
 void
 getElapsedTime(T1 &sec, T2 &usec)
 {
-    int elapsed_usecs = curTick / SimClock::Int::us;
+    int elapsed_usecs = curTick() / SimClock::Int::us;
     sec = elapsed_usecs / one_million;
     usec = elapsed_usecs % one_million;
 }
@@ -1190,7 +1190,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 / SimClock::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;
index 7c7b116a8e51d97d6f993f720e320ddd03dbaacc..0c9a07c00a7916ba7b7a946ca5b0425ba9b2c5f1 100644 (file)
@@ -332,7 +332,7 @@ main(int argc, char *argv[])
     s15[9].sample(1234);
 
     s10.sample(1000000000);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s10.sample(100000);
     s10.sample(100000);
     s10.sample(100000);
@@ -407,59 +407,59 @@ main(int argc, char *argv[])
 
     s15[0].sample(1234);
     s15[1].sample(4134);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[4].sample(1213);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[3].sample(1124);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[2].sample(1243);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[7].sample(1244);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[4].sample(7234);
     s15[2].sample(9234);
     s15[3].sample(1764);
     s15[7].sample(1564);
     s15[3].sample(3234);
     s15[1].sample(2234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[5].sample(1234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[9].sample(4334);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[2].sample(1234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[4].sample(4334);
     s15[6].sample(1234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[8].sample(8734);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[1].sample(5234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[3].sample(8234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[7].sample(5234);
     s15[4].sample(4434);
     s15[3].sample(7234);
     s15[2].sample(1934);
     s15[1].sample(9234);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[5].sample(5634);
     s15[3].sample(1264);
     s15[7].sample(5223);
     s15[0].sample(1234);
     s15[0].sample(5434);
     s15[3].sample(8634);
-    curTick += ULL(1000000);
+    curTick() += ULL(1000000);
     s15[1].sample(1234);
 
-    s4 = curTick;
+    s4 = curTick();
 
     s8[3] = 99999;
 
     s3 = 12;
     s3++;
-    curTick += 9;
+    curTick() += 9;
 
     s1 = 9;
     s1 += 9;
@@ -534,8 +534,8 @@ main(int argc, char *argv[])
     s9.sample(10);
     s9.sample(10);
 
-    curTick += 9;
-    s4 = curTick;
+    curTick() += 9;
+    s4 = curTick();
     s6.sample(100);
     s6.sample(100);
     s6.sample(100);