Tuan Ta has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/9625 )

Change subject: cpu: stop scheduling suspended threads in all stages of MinorCPU
......................................................................

cpu: stop scheduling suspended threads in all stages of MinorCPU

This patch makes suspended threads non-schedulable in Fetch1, Fetch2,
Decode and Execute stages in MinorCPU.

Change-Id: Ie79857e13b7b782d9c58c32310993a132b609cf9
Reviewed-on: https://gem5-review.googlesource.com/c/9625
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrie...@gmail.com>
Maintainer: Jason Lowe-Power <ja...@lowepower.com>
---
M src/cpu/minor/decode.cc
M src/cpu/minor/execute.cc
M src/cpu/minor/fetch2.cc
3 files changed, 14 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Giacomo Gabrielli: Looks good to me, approved



diff --git a/src/cpu/minor/decode.cc b/src/cpu/minor/decode.cc
index 390ca5f..94d3dec 100644
--- a/src/cpu/minor/decode.cc
+++ b/src/cpu/minor/decode.cc
@@ -314,7 +314,9 @@
     }

     for (auto tid : priority_list) {
-        if (getInput(tid) && !decodeInfo[tid].blocked) {
+        if (cpu.getContext(tid)->status() == ThreadContext::Active &&
+            getInput(tid) &&
+            !decodeInfo[tid].blocked) {
             threadPriority = tid;
             return tid;
         }
diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc
index 93c0895..d7cb475 100644
--- a/src/cpu/minor/execute.cc
+++ b/src/cpu/minor/execute.cc
@@ -1676,7 +1676,12 @@

     for (auto tid : priority_list) {
         ExecuteThreadInfo &ex_info = executeInfo[tid];
-        bool can_commit_insts = !ex_info.inFlightInsts->empty();
+
+        bool is_thread_active =
+                cpu.getContext(tid)->status() == ThreadContext::Active;
+        bool can_commit_insts = !ex_info.inFlightInsts->empty() &&
+                                is_thread_active;
+
         if (can_commit_insts) {
QueuedInst *head_inflight_inst = &(ex_info.inFlightInsts->front());
             MinorDynInstPtr inst = head_inflight_inst->inst;
@@ -1742,7 +1747,8 @@
     }

     for (auto tid : priority_list) {
-        if (getInput(tid)) {
+        if (cpu.getContext(tid)->status() == ThreadContext::Active &&
+            getInput(tid)) {
             issuePriority = tid;
             return tid;
         }
diff --git a/src/cpu/minor/fetch2.cc b/src/cpu/minor/fetch2.cc
index 09a06fc..1808901 100644
--- a/src/cpu/minor/fetch2.cc
+++ b/src/cpu/minor/fetch2.cc
@@ -584,7 +584,9 @@
     }

     for (auto tid : priority_list) {
-        if (getInput(tid) && !fetchInfo[tid].blocked) {
+        if (cpu.getContext(tid)->status() == ThreadContext::Active &&
+            getInput(tid) &&
+            !fetchInfo[tid].blocked) {
             threadPriority = tid;
             return tid;
         }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/9625
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: Ie79857e13b7b782d9c58c32310993a132b609cf9
Gerrit-Change-Number: 9625
Gerrit-PatchSet: 10
Gerrit-Owner: Tuan Ta <q...@cornell.edu>
Gerrit-Assignee: Giacomo Gabrielli <giacomo.gabrie...@gmail.com>
Gerrit-Reviewer: Giacomo Gabrielli <giacomo.gabrie...@gmail.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Tuan Ta <q...@cornell.edu>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to