cpu: Fix a bug in getCurrentInstCount in the checker CPU.
authorGabe Black <gabeblack@google.com>
Wed, 6 Nov 2019 22:17:45 +0000 (14:17 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 7 Nov 2019 11:03:46 +0000 (11:03 +0000)
An earlier change accidentally left out the actualTC-> prefix in the
getCurrentInstCount method which was supposed to delegate the call to
another thread context. Without that, it just called itself and would
infinitely recurse.

This bug was pointed out in email by Robert Henry.

Change-Id: Ibf1fee6b48ff87790309c6d435bd76fa95c6cab9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22623
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/checker/thread_context.hh

index 347c4bab6d9fcb7f546f6df9cb149b6d183a236b..dbdfa80cdd96ba56bc2f6b2eecfeb9096ead0df4 100644 (file)
@@ -102,7 +102,11 @@ class CheckerThreadContext : public ThreadContext
     {
         actualTC->descheduleInstCountEvent(event);
     }
-    Tick getCurrentInstCount() override { return getCurrentInstCount(); }
+    Tick
+    getCurrentInstCount() override
+    {
+        return actualTC->getCurrentInstCount();
+    }
 
     BaseCPU *getCpuPtr() override { return actualTC->getCpuPtr(); }