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 <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2019-10-13 23:56:30 -07:00
parent 272a43175f
commit 54b9d49ec7
2 changed files with 10 additions and 1 deletions

View File

@@ -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
{

View File

@@ -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()