cpu: Remove the "SingleThreaded" fetch policy from the O3 CPU.

The fetch policy is only meaningful for SMT simulations. The
"SingleThreaded" value is a placeholder which is the default, and is
only supposed to be used in non-SMT simulations.

Rather than have this enum value and have special checks for it in
various places in O3, we can just eliminate it and set the default,
which is still only meaningful in SMT simulations, be an SMT fetch
policy.

The DerivO3CPUParams::create() function would forcefully change the
the fetch policy from "SingleThreaded" to "RoundRobin" anyway if there
were more than one thread, so that can be the actual default instead of
the shadow effective default.

Change-Id: I458fda00b5bcc246b0957e6c937eab0c5b4563c3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35935
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-10-11 17:03:50 -07:00
parent 7681fd2edd
commit 539247a4c7
4 changed files with 9 additions and 16 deletions

View File

@@ -47,8 +47,8 @@ from m5.objects.FUPool import *
from m5.objects.O3Checker import O3Checker
from m5.objects.BranchPredictor import *
class FetchPolicy(ScopedEnum):
vals = [ 'SingleThread', 'RoundRobin', 'Branch', 'IQCount', 'LSQCount' ]
class SMTFetchPolicy(ScopedEnum):
vals = [ 'RoundRobin', 'Branch', 'IQCount', 'LSQCount' ]
class SMTQueuePolicy(ScopedEnum):
vals = [ 'Dynamic', 'Partitioned', 'Threshold' ]
@@ -159,7 +159,7 @@ class DerivO3CPU(BaseCPU):
numROBEntries = Param.Unsigned(192, "Number of reorder buffer entries")
smtNumFetchingThreads = Param.Unsigned(1, "SMT Number of Fetching Threads")
smtFetchPolicy = Param.FetchPolicy('SingleThread', "SMT Fetch policy")
smtFetchPolicy = Param.SMTFetchPolicy('RoundRobin', "SMT Fetch policy")
smtLSQPolicy = Param.SMTQueuePolicy('Partitioned',
"SMT LSQ Sharing Policy")
smtLSQThreshold = Param.Int(100, "SMT LSQ Threshold Sharing Parameter")

View File

@@ -55,8 +55,5 @@ DerivO3CPUParams::create()
numThreads = actual_num_threads;
if (actual_num_threads > 1 && smtFetchPolicy == FetchPolicy::SingleThread)
smtFetchPolicy = FetchPolicy::RoundRobin;
return new DerivO3CPU(this);
}

View File

@@ -49,7 +49,7 @@
#include "cpu/pred/bpred_unit.hh"
#include "cpu/timebuf.hh"
#include "cpu/translation.hh"
#include "enums/FetchPolicy.hh"
#include "enums/SMTFetchPolicy.hh"
#include "mem/packet.hh"
#include "mem/port.hh"
#include "sim/eventq.hh"
@@ -205,7 +205,7 @@ class DefaultFetch
ThreadStatus fetchStatus[Impl::MaxThreads];
/** Fetch policy. */
FetchPolicy fetchPolicy;
SMTFetchPolicy fetchPolicy;
/** List that has the threads organized by priority. */
std::list<ThreadID> priorityList;

View File

@@ -111,10 +111,6 @@ DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params)
fatal("cache block (%u bytes) is not a multiple of the "
"fetch buffer (%u bytes)\n", cacheBlkSize, fetchBufferSize);
// Figure out fetch policy
panic_if(fetchPolicy == FetchPolicy::SingleThread && numThreads > 1,
"Invalid Fetch Policy for a SMT workload.");
// Get the size of an instruction.
instSize = sizeof(TheISA::MachInst);
@@ -1415,13 +1411,13 @@ DefaultFetch<Impl>::getFetchingThread()
{
if (numThreads > 1) {
switch (fetchPolicy) {
case FetchPolicy::RoundRobin:
case SMTFetchPolicy::RoundRobin:
return roundRobin();
case FetchPolicy::IQCount:
case SMTFetchPolicy::IQCount:
return iqCount();
case FetchPolicy::LSQCount:
case SMTFetchPolicy::LSQCount:
return lsqCount();
case FetchPolicy::Branch:
case SMTFetchPolicy::Branch:
return branchCount();
default:
return InvalidThreadID;