summaryrefslogtreecommitdiff
path: root/src/cpu/base.cc
diff options
context:
space:
mode:
authorGeoffrey Blake <Geoffrey.Blake@arm.com>2016-04-05 05:29:02 -0500
committerGeoffrey Blake <Geoffrey.Blake@arm.com>2016-04-05 05:29:02 -0500
commitf948f9fca987b25ef0716e87fdc4e874fb607c14 (patch)
treee00e191ba53d4e26f84197453a7361d381a33207 /src/cpu/base.cc
parentdf36764e91bc96d731cbd403c3a4527248eb403c (diff)
downloadgem5-f948f9fca987b25ef0716e87fdc4e874fb607c14.tar.xz
cpu: Query CPU for inst executed from Python
This patch adds the ability for the simulator to query the number of instructions a CPU has executed so far per hw-thread. This can be used to enable more flexible periodic events such as taking checkpoints starting 1s into simulation and X instructions thereafter.
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r--src/cpu/base.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index 22fca4dc5..624843f42 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -691,6 +691,12 @@ BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
comInstEventQueue[tid]->schedule(event, now + insts);
}
+uint64_t
+BaseCPU::getCurrentInstCount(ThreadID tid)
+{
+ return Tick(comInstEventQueue[tid]->getCurTick());
+}
+
AddressMonitor::AddressMonitor() {
armed = false;
waiting = false;