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 <jason@lowepower.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
}
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;
}
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;
}
for (auto tid : priority_list) {
- if (getInput(tid)) {
+ if (cpu.getContext(tid)->status() == ThreadContext::Active &&
+ getInput(tid)) {
issuePriority = tid;
return tid;
}
}
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;
}