Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/46625 )

Change subject: cpu: Dispatch PCEvents to the CheckerCPU SimpleThread
......................................................................

cpu: Dispatch PCEvents to the CheckerCPU SimpleThread

Moving PCEvents scheduling from the system to the Thread [1]
requires us to forward PCEvents to the CheckerCPU thread.

We will otherwise encounter a divergence with the checker when trying to
emulate a SkipFunction in the host (e.g. udelay on Arm).
While the original thread will correctly emulate it and jump to the next
instruction in the binary), the Checker's thread, with no scheduled
PCEvent, will jump straight into the function.

This is fixing realview64-o3-checker.py regression

JIRA: https://gem5.atlassian.net/browse/GEM5-364

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/22106

Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Change-Id: I8543535eac3adc366e976b1c0999aafaeca6b141
---
M src/cpu/checker/thread_context.hh
1 file changed, 18 insertions(+), 3 deletions(-)



diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh
index 9a00488..50c20e3 100644
--- a/src/cpu/checker/thread_context.hh
+++ b/src/cpu/checker/thread_context.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012, 2016-2018, 2020 ARM Limited
+ * Copyright (c) 2011-2012, 2016-2018, 2020-2021 Arm Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -84,8 +84,23 @@
     CheckerCPU *checkerCPU;

   public:
-    bool schedule(PCEvent *e) override { return actualTC->schedule(e); }
-    bool remove(PCEvent *e) override { return actualTC->remove(e); }
+    bool
+    schedule(PCEvent *e) override
+    {
+        bool check_ret = checkerTC->schedule(e);
+        bool actual_ret = actualTC->schedule(e);
+        assert(actual_ret == check_ret);
+        return actual_ret;
+    }
+
+    bool
+    remove(PCEvent *e) override
+    {
+        bool check_ret = checkerTC->remove(e);
+        bool actual_ret = actualTC->remove(e);
+        assert(actual_ret == check_ret);
+        return actual_ret;
+    }

     void
     scheduleInstCountEvent(Event *event, Tick count) override

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/46625
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8543535eac3adc366e976b1c0999aafaeca6b141
Gerrit-Change-Number: 46625
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to