diff options
Diffstat (limited to 'src/cpu/o3/inst_queue_impl.hh')
-rw-r--r-- | src/cpu/o3/inst_queue_impl.hh | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/cpu/o3/inst_queue_impl.hh b/src/cpu/o3/inst_queue_impl.hh index b34e6d980..a8895f8ff 100644 --- a/src/cpu/o3/inst_queue_impl.hh +++ b/src/cpu/o3/inst_queue_impl.hh @@ -90,6 +90,7 @@ InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, : cpu(cpu_ptr), iewStage(iew_ptr), fuPool(params->fuPool), + iqPolicy(params->smtIQPolicy), numEntries(params->numIQEntries), totalWidth(params->issueWidth), commitToIEWDelay(params->commitToIEWDelay) @@ -120,24 +121,14 @@ InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, resetState(); - std::string policy = params->smtIQPolicy; - - //Convert string to lowercase - std::transform(policy.begin(), policy.end(), policy.begin(), - (int(*)(int)) tolower); - //Figure out resource sharing policy - if (policy == "dynamic") { - iqPolicy = Dynamic; - + if (iqPolicy == SMTQueuePolicy::Dynamic) { //Set Max Entries to Total ROB Capacity for (ThreadID tid = 0; tid < numThreads; tid++) { maxEntries[tid] = numEntries; } - } else if (policy == "partitioned") { - iqPolicy = Partitioned; - + } else if (iqPolicy == SMTQueuePolicy::Partitioned) { //@todo:make work if part_amt doesnt divide evenly. int part_amt = numEntries / numThreads; @@ -148,9 +139,7 @@ InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, DPRINTF(IQ, "IQ sharing policy set to Partitioned:" "%i entries per thread.\n",part_amt); - } else if (policy == "threshold") { - iqPolicy = Threshold; - + } else if (iqPolicy == SMTQueuePolicy::Threshold) { double threshold = (double)params->smtIQThreshold / 100; int thresholdIQ = (int)((double)threshold * numEntries); @@ -162,9 +151,6 @@ InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, DPRINTF(IQ, "IQ sharing policy set to Threshold:" "%i entries per thread.\n",thresholdIQ); - } else { - panic("Invalid IQ sharing policy. Options are: Dynamic, " - "Partitioned, Threshold"); } for (ThreadID tid = numThreads; tid < Impl::MaxThreads; tid++) { maxEntries[tid] = 0; @@ -502,7 +488,7 @@ template <class Impl> int InstructionQueue<Impl>::entryAmount(ThreadID num_threads) { - if (iqPolicy == Partitioned) { + if (iqPolicy == SMTQueuePolicy::Partitioned) { return numEntries / num_threads; } else { return 0; @@ -514,7 +500,7 @@ template <class Impl> void InstructionQueue<Impl>::resetEntries() { - if (iqPolicy != Dynamic || numThreads > 1) { + if (iqPolicy != SMTQueuePolicy::Dynamic || numThreads > 1) { int active_threads = activeThreads->size(); list<ThreadID>::iterator threads = activeThreads->begin(); @@ -523,9 +509,10 @@ InstructionQueue<Impl>::resetEntries() while (threads != end) { ThreadID tid = *threads++; - if (iqPolicy == Partitioned) { + if (iqPolicy == SMTQueuePolicy::Partitioned) { maxEntries[tid] = numEntries / active_threads; - } else if (iqPolicy == Threshold && active_threads == 1) { + } else if (iqPolicy == SMTQueuePolicy::Threshold && + active_threads == 1) { maxEntries[tid] = numEntries; } } |