smtLSQPolicy = Param.SMTQueuePolicy('Partitioned',
"SMT LSQ Sharing Policy")
smtLSQThreshold = Param.Int(100, "SMT LSQ Threshold Sharing Parameter")
- smtIQPolicy = Param.String('Partitioned', "SMT IQ Sharing Policy")
+ smtIQPolicy = Param.SMTQueuePolicy('Partitioned',
+ "SMT IQ Sharing Policy")
smtIQThreshold = Param.Int(100, "SMT IQ Threshold Sharing Parameter")
smtROBPolicy = Param.String('Partitioned', "SMT ROB Sharing Policy")
smtROBThreshold = Param.Int(100, "SMT ROB Threshold Sharing Parameter")
: cpu(cpu_ptr),
iewStage(iew_ptr),
fuPool(params->fuPool),
+ iqPolicy(params->smtIQPolicy),
numEntries(params->numIQEntries),
totalWidth(params->issueWidth),
commitToIEWDelay(params->commitToIEWDelay)
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;
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);
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;
int
InstructionQueue<Impl>::entryAmount(ThreadID num_threads)
{
- if (iqPolicy == Partitioned) {
+ if (iqPolicy == SMTQueuePolicy::Partitioned) {
return numEntries / num_threads;
} else {
return 0;
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();
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;
}
}