Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/22111 )
Change subject: fastmodel: Implement getCurrentInstCount.
......................................................................
fastmodel: Implement getCurrentInstCount.
This uses the step counter the iris API provides.
Change-Id: Ic916888fa256d0aa65042d3e6695d9bf4ba32c86
---
M src/arch/arm/fastmodel/iris/thread_context.cc
M src/arch/arm/fastmodel/iris/thread_context.hh
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/arch/arm/fastmodel/iris/thread_context.cc
b/src/arch/arm/fastmodel/iris/thread_context.cc
index 79c9062..43be171 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.cc
+++ b/src/arch/arm/fastmodel/iris/thread_context.cc
@@ -163,6 +163,15 @@
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 c07c642..da96661 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.hh
+++ b/src/arch/arm/fastmodel/iris/thread_context.hh
@@ -100,7 +100,7 @@
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()
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22111
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ic916888fa256d0aa65042d3e6695d9bf4ba32c86
Gerrit-Change-Number: 22111
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev