summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/arm/fastmodel/iris/thread_context.cc9
-rw-r--r--src/arch/arm/fastmodel/iris/thread_context.hh2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/arch/arm/fastmodel/iris/thread_context.cc b/src/arch/arm/fastmodel/iris/thread_context.cc
index 79c9062cb..43be17142 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.cc
+++ b/src/arch/arm/fastmodel/iris/thread_context.cc
@@ -163,6 +163,15 @@ ThreadContext::~ThreadContext()
client.unregisterEventCallback("ec_IRIS_INSTANCE_REGISTRY_CHANGED");
}
+Tick
+ThreadContext::getCurrentInstCount()
+{
+ uint64_t count;
+ auto ret = call().step_getStepCounterValue(_instId, count, "instruction");
+ panic_if(ret != iris::E_ok, "Failed to get instruction count.");
+ return count;
+}
+
ThreadContext::Status
ThreadContext::status() const
{
diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh b/src/arch/arm/fastmodel/iris/thread_context.hh
index c07c642fb..da9666161 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.hh
+++ b/src/arch/arm/fastmodel/iris/thread_context.hh
@@ -100,7 +100,7 @@ class ThreadContext : public ::ThreadContext
void serviceInstCountEvents(Tick count) override {}
void scheduleInstCountEvent(Event *event, Tick count) override {}
void descheduleInstCountEvent(Event *event) override {}
- Tick getCurrentInstCount() override { return 0; }
+ Tick getCurrentInstCount() override;
virtual Counter
totalInsts()