From: Gabe Black Date: Mon, 14 Oct 2019 06:56:30 +0000 (-0700) Subject: fastmodel: Implement getCurrentInstCount. X-Git-Tag: v19.0.0.0~399 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54b9d49ec79b8c93ce914d4c3600661363e829d5;p=gem5.git fastmodel: Implement getCurrentInstCount. This uses the step counter the iris API provides. Change-Id: Ic916888fa256d0aa65042d3e6695d9bf4ba32c86 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22111 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- 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()