cpu: Only iterate over possible threads on the o3 cpu
authorMitch Hayenga <mitch.hayenga@arm.com>
Tue, 9 Sep 2014 08:36:34 +0000 (04:36 -0400)
committerMitch Hayenga <mitch.hayenga@arm.com>
Tue, 9 Sep 2014 08:36:34 +0000 (04:36 -0400)
Some places in O3 always iterated over "Impl::MaxThreads" even if a CPU had
fewer threads.  This removes a few of those instances.

src/cpu/o3/fetch_impl.hh

index e20d2970a8b896acd7a41a8e87ffc75b180fe065..fb933b8cab6dedfac750136c87d293f67de4382b 100644 (file)
@@ -419,7 +419,7 @@ template <class Impl>
 void
 DefaultFetch<Impl>::drainResume()
 {
-    for (ThreadID i = 0; i < Impl::MaxThreads; ++i)
+    for (ThreadID i = 0; i < numThreads; ++i)
         stalls[i].drain = false;
 }
 
@@ -887,7 +887,7 @@ DefaultFetch<Impl>::tick()
 
     wroteToTimeBuffer = false;
 
-    for (ThreadID i = 0; i < Impl::MaxThreads; ++i) {
+    for (ThreadID i = 0; i < numThreads; ++i) {
         issuePipelinedIfetch[i] = false;
     }
 
@@ -927,7 +927,7 @@ DefaultFetch<Impl>::tick()
     }
 
     // Issue the next I-cache request if possible.
-    for (ThreadID i = 0; i < Impl::MaxThreads; ++i) {
+    for (ThreadID i = 0; i < numThreads; ++i) {
         if (issuePipelinedIfetch[i]) {
             pipelineIcacheAccesses(i);
         }