Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/35935 )

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

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.nikole...@arm.com>
Maintainer: Gabe Black <gabebl...@google.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/cpu/o3/O3CPU.py
M src/cpu/o3/deriv.cc
M src/cpu/o3/fetch.hh
M src/cpu/o3/fetch_impl.hh
4 files changed, 9 insertions(+), 16 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/cpu/o3/O3CPU.py b/src/cpu/o3/O3CPU.py
index 51d9121..9f3685d 100644
--- a/src/cpu/o3/O3CPU.py
+++ b/src/cpu/o3/O3CPU.py
@@ -47,8 +47,8 @@
 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 @@
     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")
diff --git a/src/cpu/o3/deriv.cc b/src/cpu/o3/deriv.cc
index fe1b76b..757af6f 100644
--- a/src/cpu/o3/deriv.cc
+++ b/src/cpu/o3/deriv.cc
@@ -55,8 +55,5 @@

     numThreads = actual_num_threads;

- if (actual_num_threads > 1 && smtFetchPolicy == FetchPolicy::SingleThread)
-        smtFetchPolicy = FetchPolicy::RoundRobin;
-
     return new DerivO3CPU(this);
 }
diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh
index 16f0c5e..e47059a 100644
--- a/src/cpu/o3/fetch.hh
+++ b/src/cpu/o3/fetch.hh
@@ -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 @@
     ThreadStatus fetchStatus[Impl::MaxThreads];

     /** Fetch policy. */
-    FetchPolicy fetchPolicy;
+    SMTFetchPolicy fetchPolicy;

     /** List that has the threads organized by priority. */
     std::list<ThreadID> priorityList;
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index d38420b..28b1357 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -111,10 +111,6 @@
         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 @@
 {
     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;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35935
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I458fda00b5bcc246b0957e6c937eab0c5b4563c3
Gerrit-Change-Number: 35935
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to