summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-10-31 14:44:23 -0500
committerKevin Lim <ktlim@umich.edu>2006-10-31 14:44:23 -0500
commit2fa535f7407ad2a7e1e2ec807b72d11a81fa25aa (patch)
tree29a33ada141edad37b9304227f411a0195520869 /src/cpu
parente912080d12666482a942eae354e783c3d666c6c9 (diff)
parent7f39644609e19ada9e94c9bbb09c3e625fa6e8ed (diff)
downloadgem5-2fa535f7407ad2a7e1e2ec807b72d11a81fa25aa.tar.xz
Merge ktlim@zizzer:/bk/newmem
into zamp.eecs.umich.edu:/z/ktlim2/clean/o3-merge/newmem --HG-- extra : convert_revision : 88fa7ae5cc32be068787ee381fae9d8de0e9bd0f
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/ozone/back_end.hh2
-rw-r--r--src/cpu/ozone/dyn_inst_impl.hh2
-rw-r--r--src/cpu/ozone/front_end_impl.hh2
-rw-r--r--src/cpu/ozone/inorder_back_end.hh2
-rw-r--r--src/cpu/ozone/inorder_back_end_impl.hh2
-rw-r--r--src/cpu/ozone/lw_back_end.hh2
-rw-r--r--src/cpu/ozone/thread_state.hh2
-rw-r--r--src/cpu/simple/atomic.cc16
-rw-r--r--src/cpu/simple/base.cc6
-rw-r--r--src/cpu/thread_state.cc4
10 files changed, 27 insertions, 13 deletions
diff --git a/src/cpu/ozone/back_end.hh b/src/cpu/ozone/back_end.hh
index 8debd277d..992f55c6e 100644
--- a/src/cpu/ozone/back_end.hh
+++ b/src/cpu/ozone/back_end.hh
@@ -35,7 +35,7 @@
#include <queue>
#include <string>
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "base/timebuf.hh"
#include "cpu/inst_seq.hh"
#include "cpu/ozone/rename_table.hh"
diff --git a/src/cpu/ozone/dyn_inst_impl.hh b/src/cpu/ozone/dyn_inst_impl.hh
index 0a1e1c139..9d42ab05b 100644
--- a/src/cpu/ozone/dyn_inst_impl.hh
+++ b/src/cpu/ozone/dyn_inst_impl.hh
@@ -28,7 +28,7 @@
* Authors: Kevin Lim
*/
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "config/full_system.hh"
#include "cpu/ozone/dyn_inst.hh"
#include "kern/kernel_stats.hh"
diff --git a/src/cpu/ozone/front_end_impl.hh b/src/cpu/ozone/front_end_impl.hh
index 36e87ec9c..60c954517 100644
--- a/src/cpu/ozone/front_end_impl.hh
+++ b/src/cpu/ozone/front_end_impl.hh
@@ -30,7 +30,7 @@
#include "config/use_checker.hh"
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/statistics.hh"
diff --git a/src/cpu/ozone/inorder_back_end.hh b/src/cpu/ozone/inorder_back_end.hh
index 76eef6fad..b2522bdc8 100644
--- a/src/cpu/ozone/inorder_back_end.hh
+++ b/src/cpu/ozone/inorder_back_end.hh
@@ -33,7 +33,7 @@
#include <list>
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "base/timebuf.hh"
#include "cpu/thread_context.hh"
#include "cpu/inst_seq.hh"
diff --git a/src/cpu/ozone/inorder_back_end_impl.hh b/src/cpu/ozone/inorder_back_end_impl.hh
index 16ebac163..8aef9c074 100644
--- a/src/cpu/ozone/inorder_back_end_impl.hh
+++ b/src/cpu/ozone/inorder_back_end_impl.hh
@@ -28,7 +28,7 @@
* Authors: Kevin Lim
*/
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "arch/types.hh"
#include "cpu/ozone/inorder_back_end.hh"
#include "cpu/ozone/thread_state.hh"
diff --git a/src/cpu/ozone/lw_back_end.hh b/src/cpu/ozone/lw_back_end.hh
index 49c6a1ae2..08a6863d0 100644
--- a/src/cpu/ozone/lw_back_end.hh
+++ b/src/cpu/ozone/lw_back_end.hh
@@ -36,7 +36,7 @@
#include <set>
#include <string>
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "base/timebuf.hh"
#include "cpu/inst_seq.hh"
#include "cpu/ozone/rename_table.hh"
diff --git a/src/cpu/ozone/thread_state.hh b/src/cpu/ozone/thread_state.hh
index c86f3552e..985e09b52 100644
--- a/src/cpu/ozone/thread_state.hh
+++ b/src/cpu/ozone/thread_state.hh
@@ -31,7 +31,7 @@
#ifndef __CPU_OZONE_THREAD_STATE_HH__
#define __CPU_OZONE_THREAD_STATE_HH__
-#include "arch/faults.hh"
+#include "sim/faults.hh"
#include "arch/types.hh"
#include "arch/regfile.hh"
#include "base/callback.hh"
diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc
index edba55b0d..11e4d2acb 100644
--- a/src/cpu/simple/atomic.cc
+++ b/src/cpu/simple/atomic.cc
@@ -188,8 +188,11 @@ AtomicSimpleCPU::resume()
changeState(SimObject::Running);
if (thread->status() == ThreadContext::Active) {
- if (!tickEvent.scheduled())
- tickEvent.schedule(curTick);
+ if (!tickEvent.scheduled()) {
+ Tick nextTick = curTick + cycles(1) - 1;
+ nextTick -= (nextTick % (cycles(1)));
+ tickEvent.schedule(nextTick);
+ }
}
}
}
@@ -217,7 +220,9 @@ AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
ThreadContext *tc = threadContexts[i];
if (tc->status() == ThreadContext::Active && _status != Running) {
_status = Running;
- tickEvent.schedule(curTick);
+ Tick nextTick = curTick + cycles(1) - 1;
+ nextTick -= (nextTick % (cycles(1)));
+ tickEvent.schedule(nextTick);
break;
}
}
@@ -234,7 +239,10 @@ AtomicSimpleCPU::activateContext(int thread_num, int delay)
assert(!tickEvent.scheduled());
notIdleFraction++;
- tickEvent.schedule(curTick + cycles(delay));
+ //Make sure ticks are still on multiples of cycles
+ Tick nextTick = curTick + cycles(delay + 1) - 1;
+ nextTick -= (nextTick % (cycles(1)));
+ tickEvent.schedule(nextTick);
_status = Running;
}
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index cbb3980cb..253d33243 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -401,13 +401,15 @@ BaseSimpleCPU::preExecute()
StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
if (instPtr->isMacroOp()) {
curMacroStaticInst = instPtr;
- curStaticInst = curMacroStaticInst->fetchMicroOp(0);
+ curStaticInst = curMacroStaticInst->
+ fetchMicroOp(thread->readMicroPC());
} else {
curStaticInst = instPtr;
}
} else {
//Read the next micro op from the macro op
- curStaticInst = curMacroStaticInst->fetchMicroOp(thread->readMicroPC());
+ curStaticInst = curMacroStaticInst->
+ fetchMicroOp(thread->readMicroPC());
}
diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc
index c644ae8d7..e6ebcc525 100644
--- a/src/cpu/thread_state.cc
+++ b/src/cpu/thread_state.cc
@@ -62,6 +62,8 @@ ThreadState::serialize(std::ostream &os)
// thread_num and cpu_id are deterministic from the config
SERIALIZE_SCALAR(funcExeInst);
SERIALIZE_SCALAR(inst);
+ SERIALIZE_SCALAR(microPC);
+ SERIALIZE_SCALAR(nextMicroPC);
#if FULL_SYSTEM
Tick quiesceEndTick = 0;
@@ -81,6 +83,8 @@ ThreadState::unserialize(Checkpoint *cp, const std::string &section)
// thread_num and cpu_id are deterministic from the config
UNSERIALIZE_SCALAR(funcExeInst);
UNSERIALIZE_SCALAR(inst);
+ UNSERIALIZE_SCALAR(microPC);
+ UNSERIALIZE_SCALAR(nextMicroPC);
#if FULL_SYSTEM
Tick quiesceEndTick;