changeset 4dacc68fb1f3 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=4dacc68fb1f3
description:
        inorder: fetch thread bug
        dont check total # of threads but instead all
        active threads

diffstat:

2 files changed, 9 insertions(+), 7 deletions(-)
src/cpu/inorder/cpu.hh         |    2 +-
src/cpu/inorder/first_stage.cc |   14 ++++++++------

diffs (52 lines):

diff -r ac9a5e69ba31 -r 4dacc68fb1f3 src/cpu/inorder/cpu.hh
--- a/src/cpu/inorder/cpu.hh    Sun Jan 31 18:26:47 2010 -0500
+++ b/src/cpu/inorder/cpu.hh    Sun Jan 31 18:26:54 2010 -0500
@@ -611,7 +611,7 @@
         if (numActiveThreads() > 0)
             return activeThreads.front();
         else
-            return -1;
+            return InvalidThreadID;
     }
     
      
diff -r ac9a5e69ba31 -r 4dacc68fb1f3 src/cpu/inorder/first_stage.cc
--- a/src/cpu/inorder/first_stage.cc    Sun Jan 31 18:26:47 2010 -0500
+++ b/src/cpu/inorder/first_stage.cc    Sun Jan 31 18:26:54 2010 -0500
@@ -205,11 +205,12 @@
 ThreadID
 FirstStage::getFetchingThread(FetchPriority &fetch_priority)
 {
-    if (numThreads > 1) {
+    ThreadID num_active_threads = cpu->numActiveThreads();
+
+    if (num_active_threads > 1) {
         switch (fetch_priority) {
-
           case SingleThread:
-            return 0;
+            return cpu->activeThreadId();
 
           case RoundRobin:
             return roundRobin();
@@ -217,7 +218,7 @@
           default:
             return InvalidThreadID;
         }
-    } else {
+    } else if (num_active_threads == 1) {
         ThreadID tid = *activeThreads->begin();
 
         if (stageStatus[tid] == Running ||
@@ -226,8 +227,9 @@
         } else {
             return InvalidThreadID;
         }
-    }
-
+    } else {
+        return InvalidThreadID;
+    }    
 }
 
 ThreadID
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to