summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-08 16:18:10 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-08 16:18:10 -0500
commitf720029e97358b2f69ea0ecaace89d5c2ccc6bfe (patch)
tree49f739cbc78b842fc303c1a1296d293ca03ec961 /src/sim
parent5b90922ad59189f5967dc97a00bbfead062f4ba3 (diff)
parent74745cfeac4f4de4613d8faed77aa7e3c06cbca4 (diff)
downloadgem5-f720029e97358b2f69ea0ecaace89d5c2ccc6bfe.tar.xz
Merge zizzer.eecs.umich.edu:/bk/newmem/
into zeep.eecs.umich.edu:/home/gblack/m5/newmemmemops --HG-- extra : convert_revision : dc165840841bdd88e40111b98d1be493441703f0
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/host.hh2
-rw-r--r--src/sim/main.cc12
2 files changed, 5 insertions, 9 deletions
diff --git a/src/sim/host.hh b/src/sim/host.hh
index 9c79580b1..a2faa206b 100644
--- a/src/sim/host.hh
+++ b/src/sim/host.hh
@@ -56,7 +56,7 @@ typedef int64_t Counter;
*/
typedef int64_t Tick;
-const Tick MaxTick = (1LL << 62);
+const Tick MaxTick = (1LL << 63) - 1;
/**
* Address type
diff --git a/src/sim/main.cc b/src/sim/main.cc
index 133141e57..5b44102a8 100644
--- a/src/sim/main.cc
+++ b/src/sim/main.cc
@@ -309,18 +309,14 @@ finalInit()
* @return The SimLoopExitEvent that caused the loop to exit.
*/
SimLoopExitEvent *
-simulate(Tick num_cycles = -1)
+simulate(Tick num_cycles = MaxTick)
{
warn("Entering event queue @ %d. Starting simulation...\n", curTick);
- // Fix up num_cycles. Special default value -1 means simulate
- // "forever"... schedule event at MaxTick just to be safe.
- // Otherwise it's a delta for additional cycles to simulate past
- // curTick, and thus must be non-negative.
- if (num_cycles == -1)
- num_cycles = MaxTick;
- else if (num_cycles < 0)
+ if (num_cycles < 0)
fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles);
+ else if (curTick + num_cycles < 0) //Overflow
+ num_cycles = MaxTick;
else
num_cycles = curTick + num_cycles;