diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2011-01-07 21:50:29 -0800 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2011-01-07 21:50:29 -0800 |
commit | 6f1187943cf78c2fd0334bd7e4372ae79a587fa4 (patch) | |
tree | 8d0eac2e2f4d55d48245266d3930ad4e7f92030f /src/sim/simulate.cc | |
parent | c22be9f2f016872b05d65c82055ddc936b4aa075 (diff) | |
download | gem5-6f1187943cf78c2fd0334bd7e4372ae79a587fa4.tar.xz |
Replace curTick global variable with accessor functions.
This step makes it easy to replace the accessor functions
(which still access a global variable) with ones that access
per-thread curTick values.
Diffstat (limited to 'src/sim/simulate.cc')
-rw-r--r-- | src/sim/simulate.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sim/simulate.cc b/src/sim/simulate.cc index de33cce1c..5e69f0ff4 100644 --- a/src/sim/simulate.cc +++ b/src/sim/simulate.cc @@ -47,14 +47,14 @@ 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 |