Revert "cpu: fix branching when thread is suspended in MinorCPU"
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 1 Mar 2019 13:56:15 +0000 (13:56 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 14 May 2019 08:44:37 +0000 (08:44 +0000)
This reverts commit e437086341712f1435db655b3527ea29b3311f4e.
The commit was part of a patchset which broke MinorCPU regressions
(switcheroo)

Change-Id: Ib8482034c2402008ccfa552325a8eb31e731b619
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18602
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/minor/execute.cc

index 527eb2bc036fe79e0b5c26f5ccef2c4a7874fde6..6d751badebbb59b66d6fa5c8752323df4215ff61 100644 (file)
@@ -248,14 +248,7 @@ Execute::tryToBranch(MinorDynInstPtr inst, Fault fault, BranchData &branch)
             pc_before, target);
     }
 
-    if (thread->status() == ThreadContext::Suspended) {
-        /* Thread got suspended */
-        DPRINTF(Branch, "Thread got suspended: branch from 0x%x to 0x%x "
-            "inst: %s\n",
-            inst->pc.instAddr(), target.instAddr(), *inst);
-
-        reason = BranchData::SuspendThread;
-    } else if (inst->predictedTaken && !force_branch) {
+    if (inst->predictedTaken && !force_branch) {
         /* Predicted to branch */
         if (!must_branch) {
             /* No branch was taken, change stream to get us back to the
@@ -1068,7 +1061,8 @@ Execute::commit(ThreadID thread_id, bool only_commit_microops, bool discard,
         !branch.isStreamChange() && /* No real branch */
         fault == NoFault && /* No faults */
         completed_inst && /* Still finding instructions to execute */
-        num_insts_committed != commitLimit /* Not reached commit limit */
+        num_insts_committed != commitLimit && /* Not reached commit limit */
+        cpu.getContext(thread_id)->status() != ThreadContext::Suspended
         )
     {
         if (only_commit_microops) {